This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo '[branch "master"] | |
remote = origin | |
merge = refs/heads/master' >> .git/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=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 |