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 / 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 / .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 / .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 / 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> '
##
# Your previous /Users/john_t_krueger/.profile file was backed up as /Users/john_t_krueger/.profile.macports-saved_2010-02-25_at_10:01:22
##
# MacPorts Installer addition on 2010-02-25_at_10:01:22: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
for a in local $(ls /opt/ | grep -v local | grep -v gentoo); do
FULLPATH=/opt/$a
[2010-05-06 09:44:45] make
dln.c: In function ‘dln_load’:
dln.c:1463: warning: ‘NSCreateObjectFileImageFromFile’ is deprecated (declared at /usr/include/mach-o/dyld.h:145)
dln.c:1469: warning: ‘NSLinkModule’ is deprecated (declared at /usr/include/mach-o/dyld.h:161)
dln.c:1472: warning: ‘NSIsSymbolNameDefined’ is deprecated (declared at /usr/include/mach-o/dyld.h:176)
dln.c:1475: warning: ‘NSAddressOfSymbol’ is deprecated (declared at /usr/include/mach-o/dyld.h:188)
dln.c:1475: warning: ‘NSLookupAndBindSymbol’ is deprecated (declared at /usr/include/mach-o/dyld.h:179)
file.c: In function ‘lchmod_internal’:
file.c:1784: warning: cast from pointer to integer of different size
process.c: In function ‘detach_process_watcher’:
$ gem uninstall mysql; gem install mysql
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d mysql`
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/Users/john_t_krueger/.rvm/rubies/ruby-1.8.6-p114/bin/ruby extconf.rb
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... no
GREP_COLOR=1;32
MANPATH=/opt/macports/share/man:/opt/macports/man:/opt/git/share/man:
COLOR_NC=e[0m
rvm_scripts_path=/Users/john_t_krueger/.rvm/scripts
rvm_bin_path=/Users/john_t_krueger/.rvm/bin
TERM_PROGRAM=Apple_Terminal
COLOR_RED=e[0;31m
COLOR_CYAN=e[0;36m
COLOR_PURPLE=e[0;35m
TERM=xterm-color
# controller
def show
render :xlsx => 'show', :filename => 'simple.xlsx'
end
#show.xlsx.axlsx
Axlsx::Package.new do |p|
p.workbook.add_worksheet(:name => "Test") do |sheet|
# sheet.add_row [@final_report.id, @final_report.reporting_date, @final_report.created_at]