Skip to content

Instantly share code, notes, and snippets.

View ezekielchentnik's full-sized avatar

Ezekiel Chentnik ezekielchentnik

View GitHub Profile
// see blog post: http://www.hiddentao.com/archives/2013/07/08/generate-overridable-getters-and-setters-in-javascript/
Function.prototype.generateProperty = function(name, options) {
// internal member variable name
var privateName = '__' + name;
options = options || {};
options.get = ('undefined' === typeof options.get ? true : options.get );
options.set = ('undefined' === typeof options.set ? true : options.set );
// pre-initialise the internal variable?
function attrify(config) {
var properties = {};
for (var prop in config) {
if (prop && config.hasOwnProperty(prop)) {
properties[prop] = (function(name) {
return function() {
if (!arguments.length) {
return config[name];
}
const UPDATE_LOCATION = 'UPDATE_LOCATION';
import { createLocation } from 'history';
var initialState = createLocation();
export function locationReducer(state = initialState, action) {
//needs support for Immutable.js
if (action.type === UPDATE_LOCATION) {//issues w/deep merge, query ??
return Object.assign({}, state, action.payload)
/**
* Runs an ordered set of commands within each of the build directories.
*/
import fs from 'fs'
import path from 'path'
import { spawnSync } from 'child_process'
var exampleDirs = fs.readdirSync(__dirname).filter((file) => {
return fs.statSync(path.join(__dirname, file)).isDirectory()
@ezekielchentnik
ezekielchentnik / universal-isomorphic-app.png
Last active February 1, 2016 03:25
Universal JavaScript Diagrams
universal-isomorphic-app.png
@ezekielchentnik
ezekielchentnik / react-flux.png
Last active February 1, 2016 03:29
React Diagram
react-flux.png
/*
React JS Wisconsin
_
_| `...,, Scansin
( \/|
| /
\ /
| JS |
(______|