Skip to content

Instantly share code, notes, and snippets.

View erbmicha's full-sized avatar

Michael Erb erbmicha

View GitHub Profile
@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 / 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 / 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: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
Surround these with : e.g. :calling:
+1
-1
bulb
calling
clap
cop
email
feet
#!/usr/bin/env zsh
if [[ -s "${TM_PROJECT_DIRECTORY}/.rvmrc" ]]
then
source "${TM_PROJECT_DIRECTORY}/.rvmrc"
fi
`which ruby` $*