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
aue |
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
const crypto require('crypto'); | |
const ACCESS_ID = ''; | |
const SECRET_KEY = ''; | |
const EXPIRES = Math.round((new Date()).getTime() / 1000) + 60000; // 60 minutes from now | |
const signature = crypto | |
.createHmac('sha1', accessKey) | |
.update(SECRET_KEY + '\n' + EXPIRES) | |
.digest('base64'); |
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
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
set show-all-if-ambiguous on | |
set completion-ignore-case on |
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
Google+ | |
WordPress | |
Stack Overflow | |
SlideShare | |
Quora | |
Blogger |
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
campaigns = CampaignIDEnumerator.new(scheduler_queue: ShardCreation.daily_scheduler_queue) | |
campaigns.each do |campaign_id| | |
begin | |
campaign = Campaign.find(campaign_id) | |
snapshot = campaign.to_packrat_snapshot("mtoken") | |
date = Date.new(2013, 5, 4) | |
cycle_id = "index~83" | |
puts "cycle_id #{cycle_id}; date #{date}" | |
packrat_cycle = Packrat::CollectionCycle.new(cycle_id, date, Date.today) | |
Packrat.start_collection(snapshot, packrat_cycle, 'LSAPI') |
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
campaigns = CampaignIDEnumerator.new(scheduler_queue: ShardCreation.daily_scheduler_queue) | |
campaigns.each do |campaign_id| | |
begin | |
campaign = Campaign.find(campaign_id) | |
snapshot = campaign.to_packrat_snapshot("mtoken") | |
date = Date.new(2013, 5, 4) | |
cycle_id = "index~83" | |
puts "cycle_id #{cycle_id}; date #{date}" | |
packrat_cycle = Packrat::CollectionCycle.new(cycle_id, date, Date.today) | |
Packrat.start_collection(snapshot, packrat_cycle, 'LSAPI') |
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
test2 |
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
test1 |
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
# You need to write this method | |
score = 0 | |
map = {} | |
#create map of { dice_num => times_rolled } | |
dice.each do |num| | |
if map.has_key? num | |
map[num] += 1 | |
else | |
map[num] = 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
# You need to write the triangle method | |
class TriangleError < RuntimeError | |
end | |
def triangle(x,y,z) | |
raise TriangleError if has_zero_side? x,y,z | |
raise TriangleError if has_negitive_side? x,y,z | |
raise TriangleError if side_too_long? x,y,z | |
return :equilateral if equilateral? x,y,z | |
return :isosceles if isoceles? x,y,z |