Skip to content

Instantly share code, notes, and snippets.

View jgable's full-sized avatar

Jacob Gable jgable

  • Making Other People Money
  • Redwood City, CA
  • X @jacob4u2
View GitHub Profile
@jgable
jgable / requiresToImports.js
Last active June 1, 2017 23:28 — forked from ide/requiresToImports.js
Converts commonJS requires to es6 imports
/**
### 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 04:36
Thoughts on React VisualStateManager

React VisualStateManager

A declarative visual state transition manager.

Wishlist

var { VisualStateComponent, VisualState, ColorAnimation } = require('vsm');
@jgable
jgable / example1.ios.js
Created March 30, 2015 01:13
TouchableHighlight Examples
/**
* Touchable Highlight example (that fires invariant as expected)
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
@jgable
jgable / store.js
Created February 27, 2015 17:35
FluxBone Store with Dispatcher helpers
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 September 15, 2014 14:53
Word Permutations
// 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 June 12, 2014 19:55
Derived Class Method not ran
// 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 15:29
Sinon Sandbox Example
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 February 12, 2014 18:50
Traceur Compiler Source Maps Examples
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 January 4, 2016 12:49
ES6 Module with export default { ... }
import { $ } from 'vendor/libraries';
var foo = {
something: true
};
export default { foo: foo, bar: true };
@jgable
jgable / webhook-wizard.md
Created December 15, 2013 20:52
Adding a webhook for Pull Requests to a GitHub Repo

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