blah | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
This file remaps the key bindings of a single user on Mac OS X 10.5 to more | |
closely match default behavior on Windows systems. This makes the Command key | |
behave like Windows Control key. To use Control instead of Command, either swap | |
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys... | |
or replace @ with ^ in this file. | |
Here is a rough cheatsheet for syntax. | |
Key Modifiers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createEffect, untrack} from 'solid-js'; | |
type GetterSetter = [() => string, (v: string) => void]; | |
type ObjectAndKey = [Record<string, unknown>, string]; // TODO better type | |
/** | |
* Use this to make a two-way binding from an input to a signal or a reactive | |
* object such as a store or mutable. F.e. | |
* | |
* ```js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//First attempt: O(r^2) | |
function drawCircle(cx, cy, r) { | |
var dim = 100 | |
for (let i = -r; i<=r; i+=1) { | |
for (let j = -r; j<=r; j+=1) { | |
if ( | |
Math.round(Math.sqrt(i*i + j*j)) === r |
Back in 2004 Nike SB produced an ad campaign using clear transparent skate ramps and obstacles illuminated with florescent lights in dark settings. The skaters did tricks over these obstacles while not having the best visibility of the obstacles they were skating. The difficulty of skating these obstacles added to the already awesome visual effect to create a unique and artful series of skate photos like no other. Enjoy!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Omit<T, K> = Pick<T, Exclude<keyof T, K>> | |
type ImplementationKeys = 'static' | 'private' | 'protected' | |
type FunctionToConstructor<T, TReturn> = T extends (...a: infer A) => void ? new (...a: A) => TReturn : never | |
// Note, void also works the same in place of unknown | |
type ReplaceCtorReturn<T, TReturn> = T extends new (...a: infer A) => unknown ? new (...a: A) => TReturn : never | |
type ConstructorOrDefault<T> = T extends {constructor: infer TCtor} ? TCtor : (() => void) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function multiple(...classes) { | |
// If more than one class extends from a native class, we may need to throw | |
// an error, since we can't mix native prototypes; We won't throw if the | |
// native prototypes of one class or in the same chain as the native | |
// prototypes in the others. For example, if one class extends from Array | |
// and another from Event, we'll throw an error because we can't put the | |
// Array prototype before the Event prototype or vice versa | |
// (`Array.prototype` and `Event.prototype` are `{enumerable:false, | |
// writable:false, configurable:false}`, so we can't change the __proto__ of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set ft=sh: | |
# | |
# /etc/bash.bashrc.custom | |
# | |
## BEGIN ENVIRONMENT VARS | |
# Add local ruby gems to our PATH. How to add system-wide gems? | |
export PATH=$PATH:~/.gem/ruby/1.9.1/bin | |
# proper encoding for the linux terminal (ttys) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// recursively deletes all properties within an `object` or `function` | |
// TODO option to also handle non-enumerable but configurable descriptors | |
function obliterate(obj: object) { | |
const visited = new WeakSet | |
_obliterate(obj) | |
async function _obliterate(obj) { | |
if (!obj || !(typeof obj === 'object' || typeof obj === 'function')) return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// host comments via uploading them in the comments. |
NewerOlder