Skip to content

Instantly share code, notes, and snippets.

View jtmkrueger's full-sized avatar
🎉
Working from home

John Krueger jtmkrueger

🎉
Working from home
View GitHub Profile
'use strict';
var LIVERELOAD_PORT = 35729;
var SERVER_PORT = 9000;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jtmkrueger
jtmkrueger / gist:6158238
Created August 5, 2013 18:30
fire function on esc with jqeury
var that = this;
$(document).keyup(function(e) {
if (e.keyCode == 27) { that.closePopup(e); }   // esc
});

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jtmkrueger
jtmkrueger / gist:2573837
Created May 2, 2012 04:55
devise rails-api stack trace
/Users/jtmkrueger/.rvm/gems/ruby-1.9.3-p125@cmsweb/gems/devise-2.0.4/lib/devise/controllers/helpers.rb:8:in `block in <module:Helpers>': undefi
ned method `helper_method' for ActionController::API:Class (NoMethodError)
from /Users/jtmkrueger/.rvm/gems/ruby-1.9.3-p125@cmsweb/gems/activesupport-3.2.3/lib/active_support/concern.rb:119:in `class_eval'
from /Users/jtmkrueger/.rvm/gems/ruby-1.9.3-p125@cmsweb/gems/activesupport-3.2.3/lib/active_support/concern.rb:119:in `append_features'
from /Users/jtmkrueger/.rvm/gems/ruby-1.9.3-p125@cmsweb/gems/devise-2.0.4/lib/devise.rb:424:in `include'
from /Users/jtmkrueger/.rvm/gems/ruby-1.9.3-p125@cmsweb/gems/devise-2.0.4/lib/devise.rb:424:in `block in include_helpers'
from /Users/jtmkrueger/.rvm/gems/ruby-1.9.3-p125@cmsweb/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Users/jtmkrueger/.rvm/gems/ruby-1.9.3-p125@cmsweb/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:
@jtmkrueger
jtmkrueger / Asset.coffee
Created March 15, 2012 17:23
character counter
init = 1100
notes_length = $('#notes_length')
desc = $('#description')
chars = desc.val().length
notes_length.html(init - chars)
check = ->
console.log notes_length.html()
if notes_length.html() < 0
@jtmkrueger
jtmkrueger / .gvimrc.after
Created February 20, 2012 17:44
My .gvimrc.after
color railscasts+
set guifont=Monaco:h12
" Shortcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>
" Map tab to cycle splits
nmap <Tab> <C-W>W
"Map shift + enter to esc
inoremap <S-CR> <Esc>
@jtmkrueger
jtmkrueger / .ackrc
Created February 20, 2012 17:40 — forked from myronmarston/.ackrc
I just added a few formats to the original
--type-add=js=.ejs
--type-add=ruby=.erb
--type-add=css=.sass
--type-add=ruby=.feature
--type-add=js=.coffee
--type-add=css=.less
--type-add=css=.scss
@jtmkrueger
jtmkrueger / gist:1214934
Created September 13, 2011 19:57
liveDraggable
(function ($) {
$.fn.liveDraggable = function (opts) {
this.live("mouseover", function() {
if (!$(this).data("init")) {
$(this).data("init", true).draggable(opts);
}
});
};
}(jQuery));
@jtmkrueger
jtmkrueger / promptcolor
Created September 13, 2011 16:34
color your prompt and show git branch
#color and git branch
parse_git_branch() {··
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export CLICOLOR=1
export GREP_OPTIONS="--color"
export LSCOLORS=gxfxcxdxbxegedabagacad
PS1='\n\[\e[1;36m\]\w \[\e[m\]\[\e[1;33m\]$(parse_git_branch)\[\e[m\] \n> '