Skip to content

Instantly share code, notes, and snippets.

View jeffschwartz's full-sized avatar

Jeff Schwartz jeffschwartz

View GitHub Profile
@jeffschwartz
jeffschwartz / .eslintrc.js
Created August 3, 2016 13:34
My default ESLint configuration
module.exports = {
"extends": "standard",
"plugins": [
"standard",
"promise",
"react"
],
"env": {
"browser": true,
"node": true,
@jeffschwartz
jeffschwartz / tsconfig.json
Created June 26, 2016 12:48
my standard tsconfig.json configuration as of typescript v1.8.10
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"isolatedModules": false,
"jsx": "react",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declaration": true,
@jeffschwartz
jeffschwartz / Preamble Atom snippets
Created July 12, 2015 21:50
Preamble snippets for the fabulous Atom editor
'.source.js':
'Preamble configure':
'prefix': 'configure'
'body': """
configure({
$1: $2,
});
"""
'Preamble describe':
'prefix': 'describe'
@jeffschwartz
jeffschwartz / createPrototype.js
Last active August 29, 2015 14:20
Create a prototype
/**
* Creates a new object that can be used as a protype for a ctor.
* @param api object The object whose own properties are to be copied to
* the new prototype object.
* @param ctr function The constructor function which will be set as the
* value of the new prototype's contructor property.
* @returns an object that can be uses as a protytpe.
*/
function createPrototype(api, ctr){
var ownProps = Object.getOwnPropertyNames(api),
@jeffschwartz
jeffschwartz / snippets.cson
Created April 18, 2015 14:35
Atom snippets for Preamble
'Preamble describe':
'prefix': 'describe'
'body': """
describe('$1', function(){
$2
});
"""
'Preamble it':
'prefix': 'it'
'body': """
@jeffschwartz
jeffschwartz / datevalidation.js
Created November 28, 2014 17:29
Date validation
/* Date Validation by Jeffrey Schwartz */
(function(w){
'use strict';
var dv;
//define the project module's name space
w.ejr = w.ejr || {};
//define this module's name space
dv = w.ejr.dateValidation = {};
dv.isYearValid = function isYearValid(y){
return typeof(y) === 'number';
@jeffschwartz
jeffschwartz / classicalinheritance.js
Last active August 29, 2015 14:03
Emulates classical inheritance and results in a prototype chain (nested prototypes) of base classes.
/*
* Emulates classical inheritance and results in a
* prototype chain (nested prototypes) of baseclasses.
*/
(function(){
/*
* Extend childObj from parentObj and apply childPrototype to the childObj.
* @param {Objectl} childObj The child object. Required.
* @param {Objectl} parentObj The parent object. Required.
@jeffschwartz
jeffschwartz / partial.js
Created February 26, 2014 18:34
A JavaScript implementation of partial.
(function(){
"use strict";
/**
* Creating a partial the hard way.
*/
(function(){
function add(x){
return function(y){
@jeffschwartz
jeffschwartz / curry.js
Last active August 29, 2015 13:56
A JavaScript implementation of curry.
(function(){
"use strict";
/**
* A factory for creating curry functions that
* are tied to the arrity of the function f.
*/
function makeArrityBasedCurry(n) {
var curry = function(f){
var args = [].slice.call(arguments, 1);

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: