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
#controller method example | |
def us_map | |
@locations = LocationNode.where(:in_the_us => true).where('d_s > ?', 10) | |
end | |
#example of view | |
<h1>US Map of Startup Density</h1> |
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 SetupDayData | |
attr_reader :iterations | |
def go | |
@day = nil | |
this_day = Startup.order(:al_created_at).first.al_created_at |
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
<?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 |
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> | |
<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 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
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 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
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 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
require './rps.rb' | |
HAND = { :rock => 1, :paper => 3, :scissors => 4 } | |
class ComputerVersusComputer | |
def doTenTimes | |
i=0 | |
10.times do | |
i += 1 |
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
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 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
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 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
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' | |
}) |