Skip to content

Instantly share code, notes, and snippets.

View hamishnorton's full-sized avatar

Hamish Norton hamishnorton

View GitHub Profile
@hamishnorton
hamishnorton / main.dart
Last active August 26, 2022 03:24
Flutter Tabs Example
import 'package:flutter/material.dart';
// https://api.flutter.dev/flutter/material/DefaultTabController-class.html
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@hamishnorton
hamishnorton / main.dart
Created August 11, 2022 19:56
Flutter Generic StatefulWidget Example
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Stateful Generic Example';
@hamishnorton
hamishnorton / injector.py
Created March 24, 2022 07:22
Text Injection wtih a Adafruit MacroPad
# MACROPAD Hotkeys example: Text Injection
# https://learn.adafruit.com/macropad-hotkeys
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
# https://docs.circuitpython.org/projects/hid/en/latest/_modules/adafruit_hid/keycode.html
app = {
'name' : 'Injection', # Application name
'macros' : [ # List of button macros...
# COLOR LABEL KEY SEQUENCE
import 'dart:math';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@hamishnorton
hamishnorton / flutter_field_validation_suffix_icon.dart
Last active November 19, 2021 00:38
Flutter: Field Validation Suffix Icon
import 'package:flutter/material.dart';
// based on: https://stackoverflow.com/questions/56005180/how-to-show-error-icon-inside-textfield-in-flutter
// based on: https://codewithandrea.com/articles/flutter-text-field-form-validation/
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@hamishnorton
hamishnorton / LauchersAndExpanders.ahk
Last active December 2, 2018 04:12
Auto Hot Key Lauchers and Expanders
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetNumLockState, AlwaysOn
SetCapsLockState, AlwaysOff
SetScrollLockState, AlwaysOff
Return
@hamishnorton
hamishnorton / PowerShell-ContextMenu.reg
Created December 2, 2018 02:53
Windows 10, Explorer Context Menus for PowerShell and Command Prompt
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Cmd]
@="@shell32.dll,-8506"
"NoWorkingDirectory"=""
"ShowBasedOnVelocityId"=dword:00639bc8
"Icon"="imageres.dll,-5323"
[HKEY_CLASSES_ROOT\Directory\shell\Cmd\command]
@="cmd.exe /s /k pushd \"%V\""
@hamishnorton
hamishnorton / ParallelMaker.cs
Last active November 24, 2018 22:40
[Parallel Execution] Parallel execution in C# with .NET #parallel #NET #CSharp
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Execution
{
public class ParallelMaker
{
public List<IThingy> CreateInParallel()
{
var thingies = new List<IThingy>();
@hamishnorton
hamishnorton / ReadMe.md
Last active November 24, 2018 19:40
Singleton Pattern #CSharp #NET