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 test_while_statement | |
i = 1 | |
result = 1 | |
while i <= 10 | |
result = result * i | |
i += 1 | |
end | |
assert_equal result, result | |
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
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 |
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
"THE ROOT BEER LICENSE" (Revision 3): | |
<[email protected]> 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 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
# 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}"}, |
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
[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 |
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> | |
<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. | |
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
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 |
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
[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! |
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 Die | |
def initialize | |
roll | |
end | |
def roll | |
@numberShowing = 1 + rand(6) | |
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
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) |
OlderNewer