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
/** | |
* Allows Redux action creators to use a limited form of dependency injection. | |
* | |
* To apply: | |
* | |
* import { applyMiddleware, createStore } from 'redux'; | |
* import inject from './redux-inject'; | |
* | |
* import dep1 from '.../dep1'; | |
* import dep2 from '.../dep2'; |
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
var _ = require('lodash'); | |
var Backbone = require('backbone'); | |
var Bookshelf = require('bookshelf'); | |
var Knex = require('knex'); | |
var ModelBaseMixin = { | |
initialize: function() { | |
console.log('ModelBaseMixin.initialize()'); | |
this.say(); |
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
const PWD = process.cwd(); | |
const BASEDIR = `${PWD}/spec`; | |
module.exports = config => config.set({ | |
logLevel: config.LOG_INFO, | |
frameworks: ['browserify', 'jasmine'], | |
files: [`${BASEDIR}/stuff.karma.js`], | |
// files: [`${BASEDIR}/**/+([^.]|*.karma).js`], | |
browsers: ['PhantomJS'], |
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
#include <cstdio> | |
#include <cstdlib> | |
#include <vector> | |
#include <string> | |
#include <iostream> | |
#include <regex> | |
using namespace std; | |
string toUnix(char*); |
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
/* jslint esversion: 6 */ | |
/** | |
* # Module Manager | |
* | |
* An asynchronous module dependency manager that is loosely based on the AMD | |
* api. | |
* | |
* Requires an ES6 compatible browser. | |
* | |
* ## Usage Example: |
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 fs from 'fs'; | |
let WindowXMLHttpRequest = null; | |
/** | |
* An XMLHttpRequest-compatible interface to Node's "fs" module. | |
*/ | |
class FSXHR { | |
constructor() { | |
/** |
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
/** | |
* Preprocess a file's contents represented as a string. | |
* | |
* This will look for lines containing custom preprocessor directives embedded | |
* in a string. The directives take the form of psuedo-HTML tags, which begin | |
* with <@@ COND @@> and end with </@@>, where COND is any valid JavaScript | |
* expression that is used to test whether the text between the tags | |
* should be output or not. | |
* | |
* Within the COND expressions, the variable __ (double underscore) |
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
/** | |
* Example entry point for container-less DI-based application in ES6. | |
*/ | |
// Master list of all modules used in this configuration in alphabetical order | |
import aaa_ from './aaa'; | |
import bbb_ from './bbb'; | |
import ccc_ from './ccc'; | |
import altCcc_ from './alternates/ccc'; | |
import ddd_ from './ddd'; |
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 Deps = { | |
aaa : () => number, | |
bbb : (a : number, b : number) => number | |
}; | |
export default ({ aaa, bbb } : Deps) => | |
(a : number, b : number) => { | |
const x = aaa(); | |
const y = bbb(a, b); | |
return x + y; |
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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
window.onload = () => ReactDOM.render(<App />, document.body); | |
class App extends React.Component { | |
render() { | |
const pid = 999; | |
const ProductClosure = makeProductClosure({ |
OlderNewer