Skip to content

Instantly share code, notes, and snippets.

{
"files.exclude": {
"**/.git": true,
"**/.gitkeep": true,
"**/yarn.lock": true,
"**/.DS_Store": true,
"**/node_modules": true
}
}
@vonWolfehaus
vonWolfehaus / keybindings.json
Last active July 10, 2019 04:58
VS Code key bindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
@vonWolfehaus
vonWolfehaus / vs-code-prefs.json
Last active November 5, 2020 20:08
VS Code prefs
// Place your settings in this file to overwrite the default settings
{
"workbench.startupEditor": "newUntitledFile",
"files.associations": {
"*.js6": "javascriptreact"
},
"editor.multiCursorModifier": "ctrlCmd",
"editor.wordWrap": "on",
"editor.minimap.showSlider": "always",
"editor.minimap.renderCharacters": false,
@vonWolfehaus
vonWolfehaus / .eslintrc
Created November 19, 2015 19:57
Personal ESlint ruleset
{
"root": true,
"extends": "eslint:recommended",
"ecmaFeatures": {
"arrowFunctions": true,
},
"plugins": ["riot"],
"globals": {
"riot": true,
"moment": true
$spinner-size = 60px;
$spinner-line-size = 3px;
$spinner-duration = 1500ms;
$color-accent = #1e76e3;
.spinner {
position: relative;
min-width: $spinner-size;
min-height: $spinner-size;
}
[
{ "keys": ["ctrl+b"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+d"], "command": "duplicate_line" },
{ "keys": ["ctrl+enter"], "command": "build" },
{ "keys": ["shift+delete"], "command": "left_delete" },
{ "keys": ["ctrl+q"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+q"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["ctrl+v"], "command": "paste_and_indent" },
{ "keys": ["ctrl+shift+v"], "command": "paste" }
]
@vonWolfehaus
vonWolfehaus / basicEaseFunction.js
Last active August 29, 2015 14:07
Dampen a value to ease it to a target value
var damper = 0.5; // lower is slower
function ease(current, target) {
current += (target - current) * damper;
// fix Zeno's paradox: value is snapped if we're within fraction of a distance unit (usually a pixel)
if (Math.abs(target - current) < 1) {
current = target;
}
return current;
}
def spiral(X, Y):
x = y = 0
dx = 0
dy = -1
for i in range(max(X, Y)**2):
if (-X/2 < x <= X/2) and (-Y/2 < y <= Y/2):
print (x, y)
# DO STUFF...
if x == y or (x < 0 and x == -y) or (x > 0 and x == 1-y):
dx, dy = -dy, dx
@vonWolfehaus
vonWolfehaus / js_fail.js
Created May 23, 2013 17:48
JavaScript fail
(![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]; // "fail"
++[[]][+[]]+[+[]]; // 10
@vonWolfehaus
vonWolfehaus / canary_dev_flags
Created March 11, 2013 21:02
Chrome Canary flags for local development. UNSAFE FOR SURFING! Edit the shortcut target with these flags to allow access to the filesystem etc..
"C:\Users\--USER_NAME_HERE--\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --allow-file-access --allow-file-access-from-files --disable-web-security --allow-running-insecure-content --allow-sandbox-debugging --enable-extension-timeline-api