Skip to content

Instantly share code, notes, and snippets.

entry: {
app: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./app/main.js'
],
vendor: './app/vendor/vendor.js',
editor: './app/vendor/editor.js'
},
...
connectToStores() {
let view = arguments[ 0 ];
let connectedView = connectToStores.apply( null, arguments );
connectedView.willTransitionTo = view.willTransitionTo;
_.extend( connectedView.contextTypes, view.contextTypes );
return connectedView;
precision highp float;
precision highp int;
#define VERTEX_TEXTURES
#define GAMMA_FACTOR 2
#define MAX_DIR_LIGHTS 0
#define MAX_POINT_LIGHTS 0
#define MAX_SPOT_LIGHTS 0
precision highp float;
precision highp int;
#define MAX_DIR_LIGHTS 0
#define MAX_POINT_LIGHTS 0
#define MAX_SPOT_LIGHTS 0
#define MAX_HEMI_LIGHTS 0
#define MAX_SHADOWS 0
let conflicts = _.chain( shaders ).reduce( ( memo, shader ) => {
return memo.concat(
shader.runtime.metadata.fragment.variables,
shader.runtime.metadata.vertex.variables
);
}, [] ).countBy().reduce( ( memo, countGroup, name ) => {
if( countGroup > 1 ) {
memo.push( name );
}
return memo;
doSomething().then( ( id ) => {
return delete(id).then(() => {
return id;
});
}).then((id) => {
return doSomethingElseWithId(id);
});
@AndrewRayCode
AndrewRayCode / voices.sh
Created October 20, 2015 23:29
All Mac computer voices. Some are funny, some are disturbing!
COLOR_LIGHT_RED=$(tput sgr0 && tput bold && tput setaf 1)
COLOR_LIGHT_CYAN=$(tput sgr0 && tput bold && tput setaf 6)
COLOR_RESET=$(tput sgr0)
say -v ? | while read line; do
voice=`echo $line | awk '{ print $1 }'`
phrase=`echo $line | sed -E 's/^.+# //'`
echo "${COLOR_LIGHT_RED}say -v ${COLOR_LIGHT_CYAN}${voice}${COLOR_RESET} $phrase"
say -v $voice $phrase
done
/**
* Reasons to avoid comma separated lists in Javascript
* ----------------------------------------------------
* TL;DR use:
*
* var a = 1;
* var b = 2;
*
* instead of:
*
// Shader 1
uniform float a;
void main() {
float b;
gl_FragColor = a + b;
}
// Shader 2
uniform float b;
void main() {
it('variables in main child scope (like for loop) that conflict get renamed correctly ', function() {
var combined = newComposedShader(
newSubShader({
fragment: `
void main() {
vec2 position = vec2( 1.0 );
for (int p = 0; p < 20; p++) {
vec2 other = position + p;
}