Skip to content

Instantly share code, notes, and snippets.

View aarongeorge's full-sized avatar
🤖

ADG aarongeorge

🤖
View GitHub Profile
@aarongeorge
aarongeorge / @moviemaking.cfg
Created December 6, 2015 01:24
CS:GO Movie Making Config
// A-Ron's CS:GO Movie Making Config
// Cheats are required
sv_cheats "1"
// Enable console
con_enable "1"
// HUD
cl_autohelp "0"

macOS Reinstall Checklist

Clean install without USB
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/startosinstall --agreetolicense --eraseinstall

Set “Key Repeat” to “Fast”
defaults write -g InitialKeyRepeat -int 15

Set “Delay Until Repeat” to “Short”
defaults write -g KeyRepeat -int 2

@aarongeorge
aarongeorge / Tween.js
Last active March 17, 2021 06:29
A minimal tweening class, utilising stepped updates with optional easing
// A minimal tweening class, utilising stepped updates with optional easing
class Tween {
constructor ({ from, to, change, steps, easeFn, duration, cb }) {
this.from = from
this.to = typeof to === 'undefined' ? from + change : to
this.change = typeof change === 'undefined' ? to - from : change
this.steps = typeof steps === 'number' ? steps : duration / 16
this.duration = duration
this.easeFn = typeof easeFn !== 'function' ? t => t : easeFn
this.cb = typeof cb === 'undefined' ? () => {} : cb
@aarongeorge
aarongeorge / remap.js
Last active November 30, 2020 07:22
Linear remapping in JavaScript. When n, a and b are equal, x will be returned instead of NaN (Due to divide by zero)
const remap = (n, a, b, x, y) => x + (y - x) * (n - a) / (b - a) || x
/*
Usage:
n = Number
a = from lower bound
b = from upper bound
x = to lower bound
y = to upper bound
@aarongeorge
aarongeorge / EventEmitter.ts
Last active October 27, 2020 22:51
Flexible Event Emitter for TypeScript
/**
* EventEmitter
*
* @desc An event emitter
*/
interface Listener {
cb: (...args: any[]) => void
count: number
name: string
@aarongeorge
aarongeorge / easings.ts
Last active October 5, 2020 07:35
A list of easing functions for use with JavaScript and TypeScript
/**
* A list of easing functions for use with JavaScript and TypeScript
*
* Usage:
*
* `Easings.linear(t)`
* Where `t` in a value between 0 and 1
*/
@aarongeorge
aarongeorge / propertyValidator.js
Last active July 1, 2020 00:28
A runtime property validator for JS objects
/**
* Property Validator
*
* @desc A runtime property validator for JS objects
* @usage:
* const model = new PropertyValidator({
* 'propName': {
* 'type': 'any'|'array'|'boolean'|'custom'|'date'|'element'|'function'|'number'|'object'|'regExp'|'string'
* 'required': true|false,
* 'validateFn': a function that takes one param and returns true or false. Only works if `type` is `custom`
@aarongeorge
aarongeorge / Draggie.ts
Last active June 24, 2020 00:26
A library for dragging DOM elements around
/**
* Draggie.ts
*
* A library for dragging elements around
*
* Github: https://gist.github.com/aarongeorge/2e1c970a4d0032e98fa2eb51bb40e00b
* Demo: https://codepen.io/AaronGeorge/full/oGZoBg/
*/
interface Constraints {

I was looking to see if there are any CSS pre-processors that handle scoped variables inside of their mixins. The goal was to be able to create a breakpoint mixin that auto-injects variables defined in a map/hash.

This is how I've been forced to do it with Sass

SCSS Input

$BREAKPOINTS: (
    default: min-width 0    6  10 10 10 10 24,
    phablet: min-width 480  6  10 10 10 10 24,
@aarongeorge
aarongeorge / cloudSettings
Last active April 30, 2020 16:47
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-30T16:47:44.301Z","extensionVersion":"v3.4.3"}