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
first_name = 'ed' | |
nick_name = 'ebot' | |
puts "Hello, my name is #{first_name}, but everyone calls me #{nick_name}." |
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
# Create the contact information. | |
contact = { | |
:name => 'John Doe', | |
:phone_numbers => [ | |
{:description => 'home', | |
:number => '555.555.6304'}, | |
{:description => 'cell', | |
:number => '555.555.6300'}, | |
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
#!/usr/bin/env ruby -wKU | |
require 'net/http' | |
require 'rexml/document' | |
server_name = 'server_name' | |
url = '/additional/html/pathing/' | |
in_file = 'input.xml' | |
user = { | |
:name => 'user_name', |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<link rel="alternate" type="application/rss+xml" title="RSS" | |
href="{RSS}"/> | |
<meta name="viewport" content="width=670"/> <!-- iPhone --> | |
<title>{Title}{block:PostSummary} | {PostSummary}{/block:PostSummary}</title> |
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
SELECT problems.id, problems.title, problems.start_date, | |
problems.uid, problems.uemail, tblUsers.uid, customers.custname | |
FROM ( | |
customers INNER JOIN | |
( | |
problems INNER JOIN status ON | |
problems.status = status.status_id | |
) ON | |
customers.customer_id = problems.customer | |
) |
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
#!/usr/bin/env ruby | |
# Creates a weekly gtd report from your backpack account | |
# Based on the sample wrapper script from | |
# David Heinemeier Hansson, 37signals and | |
# Gmail sample script from shunsuk | |
# Requires that XmlSimple, RedCloth, tlsmail, and time | |
# are installed. | |
# Assumptions: | |
# ** All personal/home pages start with a space ' ' | |
# ** All closed projects start with zzc |
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
Shoes.app(:height=>100) do | |
background "#EFC" | |
border "#BE8", :strokewidth => 6 | |
stack(:margin => 12) do | |
para "Enter your name" | |
flow do | |
name = edit_line | |
button "OK" do | |
alert "Hi #{name.text}, this was a collosal waste of your time!" | |
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
*.log | |
Manifest | |
pkg/* |
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
#!/usr/bin/env ruby -wKU | |
error_file = File.new '2003_errors.txt', 'w' | |
Dir.foreach(".") do |x| | |
error_file << File.new( x, 'r' ).read if x[x.length-3, 3] == 'txt' | |
end | |
error_file.close |
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
#!/usr/bin/env ruby -wKU | |
require 'date' | |
spring_training = Date.new 2009, 2, 14 | |
current_date = DateTime.now | |
difference = spring_training - current_date | |
puts "#{difference.to_i} days until pitchers and catchers report for the " << |
OlderNewer