Skip to content

Instantly share code, notes, and snippets.

View rsanheim's full-sized avatar

Rob Sanheim rsanheim

View GitHub Profile
diff --git a/app/models/git_hub/notifications.rb b/app/models/git_hub/notifications.rb
index dd1a897..4119101 100644
--- a/app/models/git_hub/notifications.rb
+++ b/app/models/git_hub/notifications.rb
@@ -14,28 +14,25 @@ module GitHub
# Public
def all(user, options = {})
- return [] unless web
key = web_finder_key(user, options)
@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 / 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
Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V (compute.clj:19)
at clojure.lang.Compiler.eval(Compiler.java:5435)
at clojure.lang.Compiler.eval(Compiler.java:5410)
at clojure.lang.Compiler.load(Compiler.java:5852)
at clojure.lang.RT.loadResourceScript(RT.java:340)
at clojure.lang.RT.loadResourceScript(RT.java:331)
at clojure.lang.RT.load(RT.java:409)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn__4505.invoke(core.clj:4905)
at clojure.core$load.doInvoke(core.clj:4904)
^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