Discover gists
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 Waging < ActiveRecord::Base | |
has_many :employees | |
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
class WelcomeEmail | |
include Mack::Mailer | |
end | |
mail = WelcomeEmail.new | |
mail.to = "foo@example.com" | |
mail.from = "me@example.com" | |
mail.subject = "Hello" | |
mail.body(:plain) = "This is my plain text body" | |
mail.body(:html) = "This is my <b>HTML</b> body" |
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
ナ ゝ ナ ゝ / 十_" ー;=‐ |! |! | |
cト cト /^、_ノ | 、.__ つ (.__  ̄ ̄ ̄ ̄ ・ ・ | |
ミミ:::;,! u `゙"~´ ヾ彡::l/VvVw、 ,yvヾNヽ ゞヾ ,. ,. ,. 、、ヾゝヽr=ヾ | |
ミ::::;/  ゙̄`ー-.、 u ;,,; j ヾk'! ' l / 'レ ^ヽヘ\ ,r゙ゞ゙-"、ノ / l! !ヽ 、、 | | |
ミ/ J ゙`ー、 " ;, ;;; ,;; ゙ u ヾi ,,./ , ,、ヾヾ | '-- 、..,,ヽ j ! | Nヾ| | |
'" _,,.. -─ゝ.、 ;, " ;; _,,..._ゞイ__//〃 i.! ilヾゞヽ | 、 .r. ヾ-、;;ノ,.:-一'"i | |
j / ,.- 、 ヾヽ、 ;; ;; _,-< //_,,\' "' !| :l ゙i !_,,ヽ.l `ー─-- エィ' (. 7 / | |
: ' ・丿  ̄≠Ξイ´,-、 ヽ /イ´ r. `ー-'メ ,.-´、 i u ヾ``ー' イ | |
\_ _,,......:: ´゙i、 `¨ / i ヽ.__,,... ' u ゙l´.i・j.冫,イ゙l / ``-、..- ノ :u l | |
u  ̄ ̄ 彡" 、ヾ ̄``ミ::.l u j i、`ー' .i / /、._ `'y / |
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
What is this? | |
It's cool. |
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
set :application, "clever_name" | |
set :user, "deploy" | |
set :scm_username, "you" | |
set :repository, "git@github.com:#{scm_username}/#{application}.git" | |
set :deploy_to, "/var/www/apps/#{application}" | |
set :scm, :git | |
set :django_location, "/usr/local/django/trunk" | |
set :django_admin_media, "/django/contrib/admin/media" | |
set :domain, "example.com" |
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'm working on a site that has a fixed page height and should not scroll. | |
# Because of this, the amount of text displayed on a page needs to not exceed | |
# a maximum value. I wrote the following function to break a string into | |
# lines based on either line breaks, or the amount of characters that can fit | |
# across the div. | |
# | |
# Ruby 1.9 already has a function to break a string into lines; | |
# (http://www.ruby-doc.org/core/classes/String.html#M000775) | |
# however, this does not include the option to break up a line based on | |
# characters and I am still on Ruby 1.8.6. |
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
nocompatible | |
Last set from ~/.vimrc | |
textwidth=80 | |
nopaste | |
wrapmargin=0 | |
formatoptions=croql | |
Last set from ~/.vim/ftplugin/ruby.vim | |
formatexpr= | |
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
deployer@tappit:/home/dev/apps/newzcache$ nmap home.claudenix.com -p 1480 | |
Starting Nmap 4.20 ( http://insecure.org ) at 2008-07-27 05:17 UTC | |
Warning: Hostname home.claudenix.com resolves to 8 IPs. Using 68.142.212.117. | |
Interesting ports on p10w1.geo.mud.yahoo.com (68.142.212.117): | |
PORT STATE SERVICE | |
1480/tcp filtered pacerforum | |
Nmap finished: 1 IP address (1 host up) scanned in 10.349 seconds | |
deployer@tappit:/home/dev/apps/newzcache$ nmap home.claudenix.com -p 80 |
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 | |
# | |
# delete comments for ripper in parse.y | |
# | |
str = File.read(ARGV[0]) | |
str.gsub!(%r|/\*%.*?%\*/|m, '') | |
print str |
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 Hundred | |
def initialize(difficulty) | |
@difficulty = difficulty | |
@correct = 0 | |
@error = 0 | |
end | |
def question | |
case @difficulty | |
when 1 |