Skip to content

Instantly share code, notes, and snippets.

Avatar

Jason Rudolph jasonrudolph

View GitHub Profile
View disqus_import.rb
#vim: ruby
#
# This script will import all your Mephisto comments into Disqus (http:/disqus.com)
# parts of it came from http://www.locomotivation.com/blog/2008/12/01/disqus-sinatra-importer.html
# but instead of a blog-engine independent sinatra app we needed a mephisto-specific script that
# will just do the job :)
unless defined?(RAILS_ROOT)
puts "This is a Rails 'runner' script. Please run './script/runner path/to/disqus_import' inside your Mephisto directory"
exit
View my_methods.irbrc.rb
# Put this in your .irbrc, and then type
# "some_object.my_methods" in an IRB session
# for less noisy exploration of what objects
# can do.
class Object
def my_methods
base_object = case self
when Class then Class.new
when Module then Module.new
View gist:55536
# Grab a password out of the 1Password keychain...finding it by "name"
def password_for_hostname(name)
password_info = `security 2>&1 >/dev/null find-generic-password -gs passwords.Password:#{name} 1Password.keychain`
password = password_info.match(/\"\:\"(.+)\"\}\"/)[1] rescue nil
end
View gist:47239
# Adapted from http://gist.github.com/31934
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
RED="\[\033[0;31m\]"
ORANGE="\[\033[0;33m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"