Skip to content

Instantly share code, notes, and snippets.

@oskardahlberg
oskardahlberg / gist:742103262d2217046a5b
Created May 4, 2015 12:03
react css injection pseudo
function styler(...args) {
var result = { className: '', style: {} };
args.forEach(arg => {
var reference = getReference(arg);
var injected = reference && isInjected(reference);
if (!injected) {
Object.assign(style, arg);
if (reference) injectStyle(reference);
}
else className += ' ' + getClassName(arg);
function asyncMap (list, doStuff, done) {
var index = -1;
var results = [];
next();
function next (error, result) {
if (error) return done(error)
if (index == list.length) return done(results);
if (index >= 0) results[index] = result;
var cursor = this.props.cursor;
var message = Immutable.fromJS({ file: true });
cursor = cursor.set('active', message);
this.dispatch('upload', cursor.cursor('active'));
@oskardahlberg
oskardahlberg / addon
Created February 28, 2015 14:41
templateMatches
Here is the implementation
https://github.com/peterbraden/node-opencv/blob/master/src/Matrix.cc#L1736
The argument preprocessing is bad, you should probably specify all.
var EmotionSchema = new mongoose.Schema({
name : String,
defaultCategory: String,
customCategory: String,
imageSrc: String,
timesUsed: Number
});
@oskardahlberg
oskardahlberg / gist:6af5e506030d669af00b
Created December 21, 2014 10:33
Webpack style error
Error: Path doesn't exists C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\build/C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\node_modules\extract-text-webpack-plugin C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\node_modules\css-loader\index.js!C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\node_modules\stylus-loader\index.js!C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\node_modules\klunga-web\lib\variables.styl
at MemoryFileSystem.writeFileSync (C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\node_modules\memory-fs\lib\MemoryFileSystem.js:167:10)
at MemoryFileSystem.writeFile (C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\node_modules\memory-fs\lib\MemoryFileSystem.js:216:8)
at Tapable.writeOut (C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\node_modules\webpack\lib\Compiler.js:256:27)
at Tapable.<anonymous> (C:\Users\Oskar\Documents\GitHub\klunga\klunga-server\node_modules\webpack\lib\Compiler.js:241:20)
at C:\Users\Oskar\Documents\Git