Skip to content

Instantly share code, notes, and snippets.

View jeffschwartz's full-sized avatar

Jeff Schwartz jeffschwartz

View GitHub Profile
@jeffschwartz
jeffschwartz / Preferences.sublime-settings
Last active December 27, 2015 16:49
My Sublime Text 3 User Preferences File.
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
@jeffschwartz
jeffschwartz / typical sublime project file
Created December 4, 2013 14:47
Typical Sublime project file (projectname.sublime-project), including settings for TernJS.
{
"folders":
[
{
"follow_symlinks": true,
"path": "."
}
],
"ternjs": {
"libs": ["jquery"],
@jeffschwartz
jeffschwartz / .vimrc
Last active January 1, 2016 01:19
My latest .vimrc file. Includes setting for Syntastic.
au!
"
" pathogen settings
"
call pathogen#infect()
"
" always show the status line
@jeffschwartz
jeffschwartz / sample5.js
Created January 10, 2014 23:04
Test for embedding gist in blog
function proxy(){
var proxyFactory = function(){
var fnToCall = arguments.length === 2 ? arguments[0][arguments[1]] : arguments[0];
var fn = function(){
var args = [].slice.call(arguments);
fnToCall.apply(this, args);
};
return fn;
@jeffschwartz
jeffschwartz / ProxyJS.js
Last active June 19, 2021 14:48
ProxyJS is a small JavaScript library that provides the ability to proxy any function or object property method. It includes an API and you can extend it with additional functionality to fit your particular use case. Enjoy!
function proxy(){
var proxyFactory = function(){
//The wrapped function to call.
var fnToCall = arguments.length === 2 ? arguments[0][arguments[1]] : arguments[0];
//A counter used to note how many times proxy has been called.
var xCalled = 0;
@jeffschwartz
jeffschwartz / .jshintrc
Last active January 3, 2016 05:59
jshintrc file. Place it in ~
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@jeffschwartz
jeffschwartz / .tmux.conf
Created January 14, 2014 18:41
tmux configuration file. goes in ~.
# delay time
set -sg escape-time 1
# 256 colors
set -g default-terminal "screen-256color"
# a mouse
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@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);
@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){