Skip to content

Instantly share code, notes, and snippets.

View erbmicha's full-sized avatar

Michael Erb erbmicha

View GitHub Profile
#!/usr/bin/env zsh
if [[ -s "${TM_PROJECT_DIRECTORY}/.rvmrc" ]]
then
source "${TM_PROJECT_DIRECTORY}/.rvmrc"
fi
`which ruby` $*
Surround these with : e.g. :calling:
+1
-1
bulb
calling
clap
cop
email
feet
@erbmicha
erbmicha / gist:975580
Created May 16, 2011 23:19 — forked from seanlilmateus/gist:974340
Using Obj-C Blocks from MacRuby with Ruby 1.9 Syntax
# 1 # Processing enumerated arrays using two blocks
area = "Europe"
timeZoneNames = NSTimeZone.knownTimeZoneNames
areaArray = NSMutableArray.arrayWithCapacity 1
areaIndexes = timeZoneNames.indexesOfObjectsWithOptions NSEnumerationConcurrent,
passingTest: -> (obj, idx, stop) {
tmpStr = obj
tmpStr.hasPrefix area
}
tmpArray = timeZoneNames.objectsAtIndexes areaIndexes
@erbmicha
erbmicha / hack.sh
Created April 3, 2012 00:10 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@erbmicha
erbmicha / gist:2475456
Created April 24, 2012 01:48 — forked from Indamix/gist:2226290
css 3d bended shadow
.bended-shadow {position:relative}
.bended-shadow::before, .bended-shadow::after {
content: '';
position: absolute;
width: 60%;
height: 20px;
-webkit-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
-ms-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
@erbmicha
erbmicha / deployto
Created May 24, 2012 16:11
Ruby script to more easily deploy to environments with their own branches when using capistrano-multistage
#!/usr/bin/env ruby
if ARGV.size < 2
puts "Usage: deployto <environment> <branch name>"
else
begin
env = ARGV[0]
branch = ARGV[1]
system("git checkout #{env};git merge #{branch};git push origin #{env};cap #{env} deploy:migrations;")
system("cap #{env} deploy:cleanup")
rescue
@erbmicha
erbmicha / .vimrc.after
Last active October 5, 2015 10:47
My .vimrc.after file for Janus
" bind control-l to hashrocket
imap <C-l> <Space>=><Space>
" convert word into Ruby symbol
imap <C-k> <C-o>b:<Esc>Ea
nmap <C-k> lbi:<Esc>E
" folding settings
set foldmethod=indent "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
@erbmicha
erbmicha / .gvimrc.after
Created May 27, 2012 01:57
My .gvimrc.after file for Janus
" Remove the scrollbars on MacVim
set guioptions=aAce
" set the default font
set guifont=DejaVu_Sans_Mono:h12
" Turn off balloons. They drive me nuts on Ruby files
set noballooneval
" Command-T OS-X Menu mapping turned back on. I like it better this way.
@erbmicha
erbmicha / gist:2795923
Created May 27, 2012 02:02
My Janus plugins
Tomorrow-Night
bufkill.vim
tabular
vim-less
vim-pasta
vim-ragtag
vim-rvm
vim-rake
vim-bundler
vim-ruby-debugger