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/ruby | |
# | |
# This script fixes /usr/local only. | |
# | |
# 6th January 2010: | |
# Modified the script to just fix, rather than install. - rpavlik | |
# | |
# 30th March 2010: | |
# Added a check to make sure user is in the staff group. This was a problem | |
# for me, and I think it was due to me migrating my account over several |
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 RockPaperScissors | |
HAND = { :rock => 1, :paper => 3, :scissors => 4 } | |
def play(param1, param2) | |
determinant = HAND[param1] + HAND[param2] | |
if(determinant==2) | |
puts "tie" |
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
require 'grackle' | |
require 'json' | |
require 'highline/import' | |
$client = Grackle::Client.new(:auth=>{ | |
:type => :oauth, | |
:consumer_key => 'YOUR_CONSUMER_KEY', :consumer_secret => 'YOUR_CONSUMER_SECRET', | |
:token => 'YOUR_ACCCESS_TOKEN', :token_secret => 'YOUR_ACCESS_TOKEN_SECRET' | |
}) |
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
require("./rps.rb") | |
class DoGame | |
def promptuser | |
loop do | |
$stdout.write("Player 1: ") | |
param1 = $stdin.gets.chomp | |
param1 = param1.to_sym | |
break if param1 == :quit |
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
require("./rps.rb") | |
HAND = { :rock => 1, :paper => 3, :scissors => 4 } | |
class DoAIGame | |
def promptuser | |
loop do | |
$stdout.write("Player 1: ") | |
param1 = $stdin.gets.chomp | |
param1 = param1.to_sym |
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
require './rps.rb' | |
HAND = { :rock => 1, :paper => 3, :scissors => 4 } | |
class ComputerVersusComputer | |
def doTenTimes | |
i=0 | |
10.times do | |
i += 1 |
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
require 'highline/import' | |
beastie = { | |
"1986" => "Licensed to Ill", "1989" => "Paul", "1992" => "Check Your Head", | |
"1993" => "Ill Communication", "1998" => "Hello Nasty", | |
"2004" => "To the 5 Boroughs", "2007" => "The Mix-Up", | |
"2011" => "Hot Sauce Committee Part Two", "1994" => "Some Old Bullshit", | |
"1996" => "The In Sound From Way Out!", "1999" => "Beastie Boys Anthology: The Sounds of Science", | |
"2005" => "Solid Gold Hits" | |
} |
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
require 'highline/import' | |
class Discography | |
def initialize | |
@disco = { | |
"1986" => "Licensed to Ill", "1989" => "Paul", "1992" => "Check Your Head", | |
"1993" => "Ill Communication", "1998" => "Hello Nasty", | |
"2004" => "To the 5 Boroughs", "2007" => "The Mix-Up", | |
"2011" => "Hot Sauce Committee Part Two", "1994" => "Some Old Bullshit", |
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
<!DOCTYPE html> | |
<head> | |
<title>Draggable</title> | |
<script type="text/javascript" src="jquery-1.7.2.min.js"></script> | |
<script type="text/javascript" src="jquery-ui-1.8.21.custom.min.js"></script> | |
<link href='index.css' rel='stylesheet' type='text/css'> | |
</head> | |
<h1>Draggable</h1> | |
<form id="form1"> |
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
<?php | |
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island |
OlderNewer