Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacob Gable jgable

  • Making Other People Money
  • Redwood City, CA
  • Twitter @jacob4u2
View GitHub Profile
@jgable
jgable / requiresToImports.js
Last active Jun 1, 2017 — forked from ide/requiresToImports.js
Converts commonJS requires to es6 imports
View requiresToImports.js
/**
### Regular component require statement
```
const Token = require('v2/core/components/tokenizer/token');
-> import Token from 'v2/core/components/tokenizer/token';
```
### Destructured require statement
```
@jgable
jgable / react-visualstatemanager-notes.md
Created May 6, 2015
Thoughts on React VisualStateManager
View react-visualstatemanager-notes.md

React VisualStateManager

A declarative visual state transition manager.

Wishlist

var { VisualStateComponent, VisualState, ColorAnimation } = require('vsm');
@jgable
jgable / example1.ios.js
Created Mar 30, 2015
TouchableHighlight Examples
View example1.ios.js
/**
* Touchable Highlight example (that fires invariant as expected)
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
@jgable
jgable / store.js
Created Feb 27, 2015
FluxBone Store with Dispatcher helpers
View store.js
var dispatcher = require('./dispatcher');
/** @class Store */
var Store = Backbone.Collection.extend(/** @lends Store.prototype */ {
/**
* Instantiate a new store from the passed in models and options. Will attempt to load models
* from `getInitialData` if none are passed in.
*
* @constructor
@jgable
jgable / permutations.js
Created Sep 15, 2014
Word Permutations
View permutations.js
// To run with node: npm install lodash && node perms.js star
var _ = require('lodash'),
words = ['stars'];
function getPermutations(word) {
// Stop case for single character
if (word.length === 1) {
return [word];
}
@jgable
jgable / derived.swift
Created Jun 12, 2014
Derived Class Method not ran
View derived.swift
// Playground - noun: a place where people can play
import Cocoa
// Base class for parameters to POST to service
class APIParams {
func getData() -> Dictionary<String, AnyObject> {
return Dictionary<String, AnyObject>()
}
}
@jgable
jgable / sandbox-mocha.js
Created May 8, 2014
Sinon Sandbox Example
View sandbox-mocha.js
var sinon = require('sinon'),
Widget = require('../../widget');
describe('My widget', function () {
var sandbox;
beforeEach(function () {
// Create a sandbox for the test
sandbox = sinon.sandbox.create();
});
@jgable
jgable / source1.js
Created Feb 12, 2014
Traceur Compiler Source Maps Examples
View source1.js
import { hello } from 'test1';
export var things = {
'1': 0,
'2': 0,
'3': 0,
updateThing: function (name, val) {
this[name] = val;
@jgable
jgable / module.js
Last active Jan 4, 2016
ES6 Module with export default { ... }
View module.js
import { $ } from 'vendor/libraries';
var foo = {
something: true
};
export default { foo: foo, bar: true };
@jgable
jgable / webhook-wizard.md
Created Dec 15, 2013
Adding a webhook for Pull Requests to a GitHub Repo
View webhook-wizard.md

Download and install the git-at-me module and run the wizard function.

npm install git-at-me 
echo "require('git-at-me').wizard();" >> git-wizard.js
node git-wizard.js
  1. Generate a token by selecting the Token option
  2. Enter your GitHub username