Skip to content

Instantly share code, notes, and snippets.

View allforabit's full-sized avatar

Kevin Nolan allforabit

View GitHub Profile
@allforabit
allforabit / Change rem scale
Created February 22, 2022 14:57
change-rem-scale.js
const fs = require('fs')
const path = require('path');
const dirs = [
'assets', 'layout','sections', 'snippets', 'templates'
]
for(let dir of dirs) {
fs.readdir(dir, function (err, files) {
@allforabit
allforabit / xstate-react-router-sync.tsx
Created November 20, 2019 15:27
Xstate react router sync
const appMachine = Machine({
id: "app",
initial: "unknown",
context: {
randomMessage: "Yo",
thing: null,
anotherThing: null
},
states: {
// Wait for route info
@allforabit
allforabit / osx-style.ahk
Created October 29, 2019 22:14
Remap windows to osx keys
; Create the array, initially empty:
; Array := ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", ";", "'", "`", ",", ".", "/", "-", "="]
Array := ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", ";", "'", ",", ".", "/", "-", "=", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"]
; TODO add in `
for index, element in Array ; Enumeration is the recommended approach in most cases.
{
; Using "Loop", indices must be consecutive numbers from 1 to the number
; of elements in the array (or they must be calculated within the loop).
; MsgBox % "Element number " . A_Index . " is " . Array[A_Index]
@allforabit
allforabit / machine.js
Created September 13, 2019 20:42
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@allforabit
allforabit / machine.js
Created September 12, 2019 11:33
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions