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
# UTF-8, 'nuff said | |
contents = IO.read(file) | |
high_chars = [] | |
contents.scan(/./m){|x| | |
high_chars << x[0] if x[0] > 128 | |
} | |
high_chars.uniq! | |
unicode_1 = %w{Ä Å Ç É Ñ Ö Ü á à â ä ã å ç é è ê ë í ì î ï ñ ó ò ô ö õ ú ù û ü † ° ¢ £ § • ¶ ß ® © ™ ´ ¨ ≠ Æ Ø ∞ ± ≤ ≥ ¥ µ ∂ ∑ ∏ π ∫ ª º Ω æ ø ¿ ¡ ¬ √ ƒ ≈ ∆ « » …} | |
unicode_2 = %w{À Ã Õ Œ œ – — “ ” ‘ ’ ÷ ◊ ÿ Ÿ ⁄ € ‹ › fi fl ‡ · ‚ „ ‰ Â Ê Á Ë È Í Î Ï Ì Ó Ô Ò Ú Û Ù} | |
mac = high_chars.all?{|x| |
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
#!/bin/bash | |
source ~/.rvm/scripts/rvm | |
cd . | |
exec ruby "$@" |
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
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/Library/PostgreSQL/9.0/bin:/usr/local/mysql/bin:/Users/rsl/.rvm/bin:/Users/rsl/bin:$PATH | |
export MANPATH=/opt/local/share/man:$MANPATH | |
export EVENT_NOKQUEUE=yes | |
export EDITOR='mate -w' | |
export PGOPTIONS='-c client_min_messages=WARNING' | |
export TM_GIT='/opt/local/bin/git' | |
export HIDE_ENV_BADGE=true | |
export NO_TEMPLATE_INLINER=true | |
function 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
Last login: Thu Mar 3 14:24:49 on ttys001 | |
rsl@channel5 ~ $ rvm info | |
system: | |
system: | |
uname: "Darwin channel5.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386" | |
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)" | |
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)" |
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
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" |
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
ruby-1.8.7-p302 :001 > xml = Builder::XmlMarkup.new | |
=> <inspect/> | |
ruby-1.8.7-p302 :002 > xml.send :foo, "bar" | |
=> "<inspect/><send:foo>bar</send:foo>" |
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
<html> | |
<head> | |
<title>FUBAR</title> | |
</head> | |
<body> | |
<p>This is not how we indent, is it?</p> | |
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
puts File.exists?(File.join(File.dirname(__FILE__), '../init.rb')) # Returns true | |
require File.join(File.dirname(__FILE__), '../init.rb') # Raises MissingSourceFile |
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 DumbQuoter | |
def self.included(base) | |
base.class_eval do | |
before_validation :dumb_down_strings | |
end | |
base.extend ClassMethods | |
end | |
def dumb_down_strings | |
self.class.string_attribute_names.each do |name| |
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 ApplicationController | |
# Yadda | |
private | |
def static_pages(*names) | |
names.each do |name| | |
define_method name do | |
render | |
end | |
end |