Skip to content

Instantly share code, notes, and snippets.

@azabcodes
azabcodes / adaptive_form_factor.dart
Created December 21, 2024 19:59
adaptive_form_factor.dart
import 'package:flutter/material.dart';
extension AdaptiveCount on BuildContext {
T withFormFactor<T>({
required T onMobile,
required T onTablet,
required T onDesktop,
bool followDeviceOrientation = true,
}) {
final formFactor = this.formFactor(
@mattiasghodsian
mattiasghodsian / readme.md
Last active December 23, 2024 18:53
How to create a Windows application Installer with NSIS

Nullsoft Scriptable Install System is also known as NSIS open-source system to create Windows application installers. NSIS is a script-based system allowing you to create the logic behind your installer/setup file in a complex way to install tasks. NSIS offers plug-ins and other scripts, for example, to download/install 3rd-party files or communicate with Windows.

The tutorial application

This tutorial will guide you through installing and creating your first Windows installer with Nullsoft Scriptable Install System and how to compile your project. Captura Portable will be used as "our application" for the sake of this tutorial.

Installation

Head to NSIS official site and download the latest release and install it. Run NSIS and you will be welcomed with a menu like below, It's always a good practice to read the Documentation before jumping in t

@shauan1508
shauan1508 / Microscope Camera File Renamer.py
Created December 23, 2024 18:44
Microscope Camera File Renamer
import os
import shutil
from itertools import cycle
def create_folders(base_path, work_order, serial_numbers):
work_order_path = os.path.join(base_path, work_order)
if not os.path.exists(work_order_path):
os.makedirs(work_order_path)
for serial_number in serial_numbers:

A metatable can be defined like

local t = setmetatable({}, {
  __tostring = function() return 'custom tostring behavior!' end
})

Here are the metamethods that you can define, and their behavior

Operators

@ih2502mk
ih2502mk / list.md
Last active December 23, 2024 18:42
Quantopian Lectures Saved
@hatsari
hatsari / ansible_replace_the_value_of_dic_variable.yaml
Last active December 23, 2024 18:40
ansible replace the value of dictionary variable
---
### ref: https://stackoverflow.com/questions/48825583/in-ansible-how-do-you-change-a-existing-dictionary-hash-values-using-a-variable
- name: replace the value of dictionary variable
hosts: localhost
gather_facts: no
vars:
fact_process:
cmd_check: ok
cmd_name: node1
cmd_status: error
@honeyedoasis
honeyedoasis / readme.md
Last active December 23, 2024 18:39
Download Weverse DM

How to use

Video tutorial: https://www.youtube.com/watch?v=GSbwYbfVE6c

Make sure your browser's download folder is empty, downloading all these media can flood your download folder with files and it'll be annoying to move later.

  1. Login weverse
  2. Open member's DM
  3. Open development console (on chrome or firefox press F12)
  4. Navigate to the console tab
@kolyanok
kolyanok / Установка bol-van zapret на OpenWrt.md
Created April 21, 2020 03:04
Установка bol-van/zapret на OpenWrt

1. Установите OpenWrt на ваш роутер.

Для каждой модели роутера процесс установки различается. Ищите инструкции для своей модели в Google.

2. Подключитесь к роутеру по SSH

Чтобы подключиться по SSH, на роутере должен быть установлен пароль. Его можно установить в веб-интерфейсе. Для Windows используйте программу PuTTY, в macOS/Linux достаточно открыть системное приложение Терминал и ввести там следующую команду:

ssh root@IP-адрес_роутера

IP адрес роутера в стандартной конфигурации — 192.168.1.1

@dcleao
dcleao / npm-commands-scripts-life-cycle-phases.md
Last active December 23, 2024 18:34
NPM Commands, Scripts, Life-cycle Phases

NPM Commands, Scripts, Life-cycle Phases

The following describes the behaviour of several npm commands, particularly w.r.t. the scripts that are run in each, for NPM version 6.5.0.

npm build <other-package-folder>

  1. npm run preinstall
  2. link binaries (node-gyp)
  3. for each bin command in other package:
@ECHO OFF
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDPrivate
:CONFIRM
echo Are you sure to lock this folder? (Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END