Skip to content

Instantly share code, notes, and snippets.

View quinn's full-sized avatar
🐁
huh

Quinn Shanahan quinn

🐁
huh
View GitHub Profile
echo '[branch "master"]
remote = origin
merge = refs/heads/master' >> .git/config
#!/usr/bin/env ruby
require 'yaml'
require 'wordpress_app'
unless ARGV[0]
puts "you did not pass an argument\n---"
puts WordpressApp.help
exit 1
end
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
show_rip_env() {
ruby -e 'puts `rip env active`.sub("ripenv: ","")'
}
export PS1='\[\033[0;35m\]\t\[\033[0;32m\] \w\[\033[00m\] \[\033[00m\]at\[\033[0;32m\] $(show_rip_env) $(parse_git_branch)\[\033[00m\] \n:'
module Math
def self.radian num
num * PI / 180
end
end
module Sass::Script::Functions
def cos num
num = Math.cos Math.radian(num.to_i)
Sass::Script::Number.new num
#!/usr/bin/env ruby
# warning: totally breaks if you have filenames with whitespace in them.
`svn st`.split("\n").each do |status|
parts = status.split(/\s/)
case parts[0]
when "?"
`svn add #{parts.last}`
when "!"
`svn rm #{parts.last}`
class UserSession < Authlogic::Session::Base
ldap_host 'example.com'
ldap_login_format "uid=%s,cn=users,dc=example,dc=com"
ldap_search_base "dc=example,dc=com"
ldap_create_in_database true
private
def search_for_record(*args)
klass.send(*args)
end
AuthType Basic
AuthName "Private"
AuthUserFile /usr/home/safire5/usr/local/etc/httpd/vhosts/deandrazninpr/docs/.htpasswd
require valid-user
# ENABLE DIRECTORY VIEWS
Options +Indexes
# STRONG HTACCESS PROTECTION
<Files ~ "^.*\.([Hh][Tt][Aa])">
@quinn
quinn / paths.rb
Created October 15, 2009 13:06
i want this always
# i want this always
class Symbol; def / val; self.to_s / val; end; end
class String; def / val; File.join(self, val.to_s); end; end
# i forgot where this comes from so i just put it here for now.
@quinn
quinn / speak_computer_speak.rb
Created November 13, 2009 16:32
help your computer talk it's feelings
#!/usr/bin/env ruby
data = ""
ARGV[0].each_byte do |i|
str = i.to_s(2)
zeros = 8 - str.length
data << "0"*zeros + str
end
data.each_byte do |i|
=chr(!chr)
background= "url(/images/"+ !chr +"-normal.gif) no-repeat"
&.active
background-image= "url(/images/"+ !chr +"-active.gif)"
/*
puts "=insert-alpha-nav()"
x = 0
65.upto(90) do |i|
s = i.chr