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
@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 / .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 / 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 / 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:

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
~
▶ pkgin -f up
cleaning database from http://pkgsrc.joyent.com/packages/Darwin/2015Q3/x86_64/All entries...
processing remote summary (http://pkgsrc.joyent.com/packages/Darwin/trunk/x86_64/All)...
pkg_summary.xz 0% 0 0.0KB/s 0.0KB/s --:-- ETAcleaning database from http://pkgsrc.joyent.com/packages/Darwin/trunk/x86_64/All entries...
pkg_summary.xz 100% 1776KB 888.2KB/s 944.4KB/s 00:02
~
▶ pkgin
▶ cat /var/db/pkgin/pkg_install-err.log
---Jan 19 13:12:30: installing libssh2-1.6.0...
---Jan 19 13:12:30: installing curl-7.44.0...
---Jan 19 13:23:50: installing patch-2.7.5...
---Jan 19 13:32:12: installing libffi-3.2.1...
---Jan 19 13:32:12: installing python27-2.7.10...
---Jan 19 13:32:14: installing nodejs-4.1.1...
---Jan 20 14:40:40: installing libpaper-1.1.24...
---Jan 20 14:40:41: installing ghostscript-fonts-8.11nb3...
---Jan 20 14:40:41: installing giflib-5.1.1...