Skip to content

Instantly share code, notes, and snippets.

View rsanheim's full-sized avatar

Rob Sanheim rsanheim

View GitHub Profile
@rsanheim
rsanheim / ci.sh
Created March 28, 2012 05:03
Simple continuous deployment via Jenkins and Capistrano for all branches. Wire this up with Github post receive hooks from Jenkins for best results.
#!/bin/bash -x
# This should be your "script/ci" checked into version control, and then wired as your sole build step in Jenkins.
#
# Simplifying Assumptions:
#
# * You build all branches
# * You want to deploy all branches.
# * You wired up an SSH key to your CI server appropriately so it can talk to your deployment target(s) via Cap
@rsanheim
rsanheim / flash_helper.rb
Created March 13, 2012 19:41
Simple Flash Helper to display any flashes in a class
module FlashHelper
# Output a series of divs with the class being the flash type, and the content being the flash message
def render_flashes
flash.inject(String.new.html_safe) do |html, (key, value)|
content_tag(:div, value, :class => key)
end
end
end
@rsanheim
rsanheim / gist:1871433
Created February 20, 2012 21:07
ec2_display.sh
#!/bin/bash
export DISPLAY=":$(ps -ef|grep '.*nxagent.*-[D].*' | cut -d':' -f5).0"
xhost +SI:localuser:pair
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Domain Name: CODECITE.COM
Registrar: DOTSTER, INC.
Whois Server: whois.dotster.com
Referral URL: http://www.dotster.com
@rsanheim
rsanheim / .gitignore
Created November 29, 2011 15:35
Simple way to override your rvm locally only (i.e. use Ruby 1.9.3 locally, versus 1.9.2 on CI or other places)
# make sure you ignore this file
.rvmrc_override
@rsanheim
rsanheim / id_rsa.pub
Created October 25, 2011 18:48
rsanheim public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDqWQntHW/fOBViCrIoNSp9YqEs0bUyJdLyBgTvXwwu4GaGt+7JVxxTOfLN6QWXJsVoMPpn8iR3a67H78SImmy8gfxI2BZKf+76+24TiwG/j+8ODuE/Hpl78ptU28TosUcL5FGszEn2FuBO4SS6jVUa9zr8KztU8CNBcVcX5GIumS85H2Xk9TJLiyUpVyEyILTuSfrBDgM8gvsZG60xQNVIjVzXqHRVIG+vZvEXTX9ooiDVcgXyACD7iloHCvAOliOTBlfvRQ/QbOkh/7g2mb4L4CJyFzEM7elWYt9+gsgQ1KkP1Epg9Lq8hrNqep5QOin2px9z87hghhKlonSNdoj7 rsanheim@pema.local
@rsanheim
rsanheim / xvfb
Created October 24, 2011 20:53
/etc/init.d/xvfb
root@ci:/etc/init.d# cat Xvfb
#! /bin/sh
### BEGIN INIT INFO
# Provides: Xvfb
# Required-Start: $local_fs $remote_fs
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop:
@rsanheim
rsanheim / gist:1276373
Created October 10, 2011 20:06
Turn on trace in Rake tasks at runtime
# when you can't use --trace for whatever reason...
desc "Turn on trace during the rake call chain"
task :turn_on_trace do
Rake.application.options.trace = true
end
# then in your dependency chain put that task first
task :foo => [:turn_on_trace, :one, :two, :etc]
@rsanheim
rsanheim / gist:1054078
Created June 29, 2011 15:23
Devise + Spork + Rails 3.1 RC4 hacks to keep User model from loading prefork
Spork.prefork do
require "rails/application"
# Prevent Devise from loading the User model super early with it's route hacks for Rails 3.1 rc4
# see also: https://github.com/timcharper/spork/wiki/Spork.trap_method-Jujutsu
Spork.trap_method(Rails::Application, :reload_routes!)
Spork.trap_method(Rails::Application::RoutesReloader, :reload!)
# rest of your prefork here...
end
^C^C^C[pallet (master)(-solo-)⚡] mvn install -e -U
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building pallet
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/12/maven-plugins-12.pom