This file contains hidden or 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
{ | |
"bold_folder_labels": true, | |
"caret_style": "wide", | |
"color_scheme": "Packages/User/SublimeLinter/Solarized (Light) (SL).tmTheme", | |
"detect_slow_plugins": false, | |
"dictionary": "Packages/Language - English/en_US.dic", | |
"draw_indent_guides": true, | |
"ensure_newline_at_eof_on_save": false, | |
"file_exclude_patterns": | |
[ |
This file contains hidden or 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 Email | |
def initialize | |
Pony.options = { :from => '[email protected]', :via => :smtp, :via_options => { :host => 'smtp.yourserver.com' } } | |
end | |
def self.email_admins | |
opts = { | |
:to => ['[email protected]', '[email protected]'], | |
:from => '[email protected]', | |
:subject => 'hi', |
This file contains hidden or 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
Sample 1: | |
d jrrg jodvv lq wkh elvkrsv krvwho lq wkh ghylov vhdw vwrs iruwb rqh ghjuhhv dqg wkluwhhq plqxwhv qruwkhdvw dqg eb qruwk vwrs pdlq eudqfk vhyhqwk olpe hdvw vlgh vkrrw iurp wkh ohiw hbh ri wkh ghdwkv khdg vwrs d ehh olqh iurp wkh wuhh wkurxjk wkh vkrw iliwb ihhw rxw vwrs | |
Sample 2: | |
y xqlu tufeiyjut yd jxu sekdjo ev rutveht qrekj vekh cybui vhec rkvehti yd qd unsqlqjyed eh lqkbj iyn vuuj rubem jxu ikhvqsu ev jxu whekdt jxu vebbemydw qhjysbui rubedwydw zeydjbo je jxu fqhjyui mxeiu dqcui qhu wylud yd dkcruh jxhuu xuhumyjx jxu vyhij tufeiyj sediyijut ev jud xkdthut qdt vekhjuud fekdti ev webt qdt jxyhjo uywxj xkdthut qdt jmublu fekdti ev iybluh tufeiyjut del ijef uywxjuud dydujuud ijef jxu iusedt mqi cqtu tus ijef uywxjuud jmudjo edu qdt sediyijut ev dydujuud xkdthut qdt iulud fekdti ev webt qdt jmublu xkdthut qdt uywxjo uywxj ev iybluh ijef qbie zumubi erjqydut yd ij ijef bekyi yd unsxqdwu veh iybluh je iqlu jhqdifehjqjyed qdt lqbkut qj jxyhjuud jxekiqdt tebbqhi ijef jxu qrelu yi iuskhubo fqsaut yd yhed |
This file contains hidden or 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 ScrabbleScorer | |
POINTS = { | |
/[aeiou]/ => 1, | |
/[j]/ => 8, | |
/[qx]/ => 10 | |
} | |
def self.score(word) | |
sum = 0 | |
POINTS.each do |key, value| | |
sum += word.scan(key).length * value |
This file contains hidden or 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
def factorial num | |
if num == 1 | |
return 1 | |
else | |
return num * factorial(num-1) | |
end | |
end | |
factorial(5) | |
5 * factorial(4) |
This file contains hidden or 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
require 'minitest/autorun' | |
class TestHQ9F < MiniTest::Unit::TestCase | |
def test_h | |
# assert_output takes a block. Anything that is output inside the | |
# block is captured and matched. | |
assert_output "Hello World!\n" do | |
h | |
end | |
end |
This file contains hidden or 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 Dog | |
def bark_at(cat) | |
"Curse you #{cat}!!" | |
end | |
end | |
class Cat | |
def initialize(name) | |
@name = name | |
end |
This file contains hidden or 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
Account settings / new connection: | |
http://d.pr/i/e62O | |
Joining a chat: | |
http://d.pr/i/pmGV | |
http://d.pr/i/iUm7 | |
Turning off join/leave messages once you've joined a chat: | |
http://d.pr/i/8bMG |
This file contains hidden or 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
Account settings / new connection: | |
http://d.pr/i/e62O | |
Joining a chat: | |
http://d.pr/i/pmGV | |
http://d.pr/i/iUm7 | |
Turning off join/leave messages once you've joined a chat: | |
http://d.pr/i/8bMG |
This file contains hidden or 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 DB_UN="root" | |
export DB_PW="" | |
gem install rails | |
rails new humanitywar-rails --skip-test-unit --skip-bundle --database=mysql | |
cd humanitywar-rails | |
echo "gem 'haml-rails'" >> Gemfile | |
echo "group :development, :test do | |
gem 'rspec-rails' | |
end" >> Gemfile | |
bundle |