Skip to content

Instantly share code, notes, and snippets.

@suda
suda / keybindings.json
Created December 16, 2018 11:44
VSCode Mac keybindings for Linux/Windows
// Overwrite key bindings by placing them into your key bindings file.
[
{
"key": "escape escape",
"command": "workbench.action.exitZenMode",
"when": "inZenMode"
},
{
"key": "shift+escape",
"command": "closeReferenceSearchEditor",
-- eval the functions below first, then you can do this:
midiInstrument $ (|+| note "45") $ mel m9 5 "0*8"
-- above, plays the first 5 notes of a m9 arpeggio, over a pattern of eighth notes,
-- starting at MIDI note #45
-- the "mel" function below relies on a "scramble" function which I don't
-- really like. I'm not good enough at haskell to know to how pick
-- random values out of the scale/arpeggio.
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@lennart
lennart / blinken.ino
Last active January 4, 2016 11:37
Lo-Fi Arduino Tidal binding, makes lights go on by color name.
/*
Tidal <-> Arduino
send rhythmic patterns to custom hardware
assumes three leds connected to Arduino on Digital Pins:
13 red
12 yellow
11 green
@nicholaswmin
nicholaswmin / catmullFitter.js
Created September 7, 2015 12:49
Catmull Rom Fitting Algorithm in Javascript through a series of X/Y Points
/**
* Interpolates a Catmull-Rom Spline through a series of x/y points
* Converts the CR Spline to Cubic Beziers for use with SVG items
*
* If 'alpha' is 0.5 then the 'Centripetal' variant is used
* If 'alpha' is 1 then the 'Chordal' variant is used
*
*
* @param {Array} data - Array of points, each point in object literal holding x/y values
* @return {String} d - SVG string with cubic bezier curves representing the Catmull-Rom Spline
@robertsdionne
robertsdionne / deepdream-install.md
Last active February 15, 2021 16:07
Deepdream installation
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
@nkbt
nkbt / .eslintrc.js
Last active May 1, 2024 21:15
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

function makeStyle(defaults, tagName) {
tagName = tagName || 'div';
var Style = React.createClass({
getDefaultProps: function() {
return assign({}, defaults);
},
render: function() {
var style = assign({}, this.props);
delete style.children;