Skip to content

Instantly share code, notes, and snippets.

View jrgifford's full-sized avatar
:shipit:
This is like AIM all over again, isn't it?

James Gifford jrgifford

:shipit:
This is like AIM all over again, isn't it?
View GitHub Profile
@jrgifford
jrgifford / test_while_statement.rb
Created March 28, 2011 00:39
This is a Ruby Koan.
def test_while_statement
i = 1
result = 1
while i <= 10
result = result * i
i += 1
end
assert_equal result, result
end
print "Welcome to Facepalm! How epik is the fail, on a scale of 1-5, with 1 being a small fail, and 5 being 'EFFING HUGE!'?"
STDOUT.flush
value = gets.to_i
if value == 1
puts "Dude,seriously? If you're going to fail, please faile. *facepalm*."
elsif value == 2
puts "Dude...?? *facepalm*"
elsif value == 3
"THE ROOT BEER LICENSE" (Revision 3):
<james@jamesrgifford.com> wrote this file.
As long as you retain this notice you
can do whatever you want with this stuff.
If we meet some day, and you think
this stuff is worth it, you can buy me a root beer in return.
Also, James Gifford is not responsible for anything that
might happen through use of this file
# This is a code example for the Ruby HTTP library Typhoeus
# here's an example for twitter search
# Including Typhoeus adds http methods like get, put, post, and delete.
# What's more interesting though is the stuff to build up what I call
# remote_methods.
class Twitter
include Typhoeus
remote_defaults :on_success => lambda {|response| JSON.parse(response.body)},
:on_failure => lambda {|response| puts "error code: #{response.code}"},
[Desktop Entry]
Version=1.0
Name=FileZilla FTP
Comment=FTP Access For My Servers
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=utilities-terminal
StartupNotify=true
StartupWMClass=RemoteServers
@jrgifford
jrgifford / fatc.html
Created May 26, 2011 12:46 — forked from tomger/fatc.html
a twitter client in stratified javascript ( http://fatc.onilabs.com )
<!DOCTYPE html>
<html><head>
<title>Fork-A-Twitter-Client</title>
<!--
Basic OniApollo/StratifiedJS Twitter Client application scaffold.
See http://fatc.onilabs.com/
THIS FILE IS IN THE PUBLIC DOMAIN.
print "Press enter to continue.."
STDOUT.flush
value = gets.to_i
if value == '\r'
puts "Dude,seriously? If you're going to fail, please faile. *facepalm*."
# Yes, that's an intentional typo
else
end
@jrgifford
jrgifford / SecondsAlive Output.txt
Created June 2, 2011 11:54
SecondsAlive Output
[random-ruby]$ ruby ./seconds-alive.rb
Please enter the year you were born (numeric values only):
1996
Now please enter the month you were born (numeric values only):
6
Now finally enter the day you were born (numeric values only):
18
You are 471945179.98833895 seconds old!
That's 7865752 minutes old!
That's 131095 hours old!
class Die
def initialize
roll
end
def roll
@numberShowing = 1 + rand(6)
end
This comment is going to be extremely biased, but that's just the way I am.
You didn't mention Linux.
For coding, vim is the way to go. It's the best editor out there IMHO.
GIMP/GIMPShop for slicing images. (GIMPShop has a very Photoshop-like UI, or so I've been told. I've never used PS)
Apache and WEBRick for local testing servers. (No real difference there)