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
References | |
http://railscasts.com/episodes/218-making-generators-in-rails-3 | |
http://edgeguides.rubyonrails.org/generators.html |
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
VID Dist. Name | |
47bae90ff964a520d24d1fe3 21 BJ's Restaurant & Brewhouse | |
4c2f94e9ed37a593ea886703 56 Toys Are Us | |
4aefa901f964a520cfd921e3 64 Staples - Bridgepointe | |
4b2d5755f964a520a1d424e3 81 Hallmark Creations | |
4840c7c2f964a5202d501fe3 98 Mimi's Cafe - San Mateo | |
4cadf334632b370496b26b6e 102 Fortify Software | |
4b23e8edf964a520a25c24e3 105 Marshalls - Foster City | |
4c2e69533896e21e7a39e290 117 Irol's Place | |
4a09b759f964a52049741fe3 117 Target - San Mateo Fashion 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
VID Dist Name | |
4cb90ed2bac93704d1fae17c 0 Layla's Mediterranean Cafe | |
4caf773aeb65b1f7b9f363cd 0 OneWest Bank | |
4cbf0660ca4aa1cdf5a317b4 0 Beverly Hilton | |
4cb89e6ddd41a35d0c5cdca0 0 CBEST | |
4caf362039458cfa1c7cf89f 0 West Coast ENT | |
4cbcce884495721e9a865c7a 0 Ameriprise | |
4c2bcd4577cfe21ee217b5f1 26 Lea Journo Salon | |
4ced9b6982125481491260a1 35 Gang, Tyre, Ramer & Brown | |
4bc5fc2edb8fa593948b9b37 55 USB Financial Services |
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
RSpec.configure do |config| | |
config.mock_with :mocha | |
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures | |
# config.fixture_path = "#{::Rails.root}/spec/fixtures" | |
# If you're not using ActiveRecord, or you'd prefer not to run each of your | |
# examples within a transaction, remove the following line or assign false | |
# instead of true. | |
# use_transactional_fixtures config option was removed by Mongoid |
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
# Gnu R code to generate histogram for lab | |
length_of_pinky = c(6,5.5,5.5,6.5,5.5, 5,5.5,6.5,5.5,6, 5.5,6,5.5,5,6, 5,6.5,6,5.5,5, 5.5,7.5,6,5.5,5.5, 6,5.5,6,6.5,7) | |
hist(length_of_pinky, seq(4.75, 7.75, 0.5), prob=TRUE, main="Histogram of students pinky length [cm]", xlab="Length of pinky [cm]") | |
lines(density(length_of_pinky, bw=0.25), col="blue") | |
curve(dnorm(x,mean=mean(length_of_pinky), sd=sd(length_of_pinky)), add=TRUE, col="green") |
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
#!/opt/local/bin/ruby | |
require "ruby-debug" | |
filename = 'ex_dataset.csv' | |
file = File.new(filename, 'r') | |
line_count = -1 | |
col_headers = {} | |
results = Hash.new(0) | |
file.each_line do |row| | |
line_count = line_count + 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 'rubygems' | |
gem "beeminder", "= 0.2.2" | |
require 'fitgem' | |
require 'json' | |
require 'beeminder' | |
consumer_key = 'FITBIT_KEY' | |
consumer_secret = 'FITBIT_SECRET' | |
token = 'FITBIT_TOKEN' | |
secret = '' |
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 'rubygems' | |
require 'json' | |
gem 'beeminder', "0.2.2" | |
require 'beeminder' | |
require 'open-uri' | |
require 'uri' | |
require 'ruby-debug' | |
# Pulls data from Rescuetime and sends it to Beeminder. | |
# Maybe run it in an hourly cron job. | |
# Enter your keys and tokens below. |
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
# ~/.config/pianobar/config | |
user = [email protected] | |
password = very_secret | |
event_command = /Users/username/.config/pianobar/tabname.sh | |
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
Device | kWh/year | CO2 peak hour use | CO2 low/use | Sources | |
---|---|---|---|---|---|
Electric Tumble Drier | 556kWh | 167kg | 83kg | [1] | |
Gas Tumble Drier | 15kWh | 122kg | 119kg | [2] | |
Dishwasher | 1 | 1 | 1 | ||
Tesla Model 3 50 | 1 | 1 | 1 | 50 miles/day [4] | |
Chevy Bolt | 1 | 1 | 1 | ||
Chevy Volt | 1 | 1 | 1 | ||
Toyota Plug in Prius | 1 | 1 | 1 | ||
Toyota Tundra Pickup | 1 | 1 | 1 | ||
VW Bug | 1 | 1 | 1 | 1 |
OlderNewer