Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Matthew Stokeley matthewstokeley

🎯
Focusing
View GitHub Profile
@matthewstokeley
matthewstokeley / single-threaded-processing-in-5-seconds.md
Last active Apr 16, 2020
Single-threaded-processing-in-5-seconds.md
View single-threaded-processing-in-5-seconds.md
// the thread of a processor is like a queue
- - - - -
// processes take various amounts of time to execute
--- -- - ------- -
@matthewstokeley
matthewstokeley / javascript-modules-in-5-seconds.md
Last active Apr 16, 2020
javascript-modules-in-5-seconds.md
View javascript-modules-in-5-seconds.md

wip needs editing

// Google Closure Library
google.require()
// ES6 Modules
import {export} from 'module'
// all
@matthewstokeley
matthewstokeley / javascript-native-array-methods-in-5.md
Last active Apr 16, 2020
javascript-native-array-methods-in-5.md
View javascript-native-array-methods-in-5.md

wip needs editing

// native array methods are functions attached to the prototype of the variadic constructor or object literal, and are inherited via prototypal inheritance
Array.prototype[METHOD].call, [].prototype[METHOD].call, let arr_ = [1,2,3]; arr[METHOD].call
// the common argument pattern for methods is VIA: value, index, array
[].forEach((value, index, array) => value++)
@matthewstokeley
matthewstokeley / bootloader.js
Last active Apr 8, 2020
bootloading a transpiler
View bootloader.js
#! /usr/bin/node
/* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
* Bootload a Transpiling Environment
*
* @version 0.0.2
*/
/* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
* Declare Modules
@matthewstokeley
matthewstokeley / delegation-pattern.js
Last active Apr 7, 2020
Delegation design pattern
View delegation-pattern.js
// #### Delegation
// A SOLID method is delegated via composition.
/**
*
*/
type Subtask: Function(name: String): Function
/**
@matthewstokeley
matthewstokeley / on-one-off.ts
Last active Mar 16, 2020
an on-one-off robust api with the mixin pattern
View on-one-off.ts
// dom versus publisher subscribe naming conventions
const Handler = ( function() {
return {}
} )()
type eventName: String
type eventFn: Function
View isolated-development.sh
# Isolated Development Environment Installation
# Poor man's storybook for scripts, with glitch
# https://www.lucidchart.com/invitations/accept/d77e6095-bd82-41af-a9cf-a48e056f39ee
# tl;dr
# Problem:
# `return _cache( new Symbol( key ) )` should have been `return ( typeof key === 'Symbol' ) ? _cache( key ) : _cache( new Symbol( key ) )
View gist:c1015f96ef5dbdf9eab005c72811e51a
https://docs.google.com/spreadsheets/d/1K4XK94PdH4l4NSHVMnh04ht0ZktJ70EG_4pfPpaSVbI/edit?usp=sharing
View key-lookup-strategies.js
// 0.0.2
type Key: Symbol | String
type KeyClosure: Function( str: String ): Key
// Symbol Strategy
export var symbolKeyHandler = function symbolKeyHandler(
_cache: Function
): KeyClosure {
You can’t perform that action at this time.