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
def get_avail_info (requests) | |
avail_info = [] | |
avail_info = requests.map { | |
Thread.new { hit_api(request) }.map(&:value) | |
} | |
p avail_info | |
# requests.map(&:request).each do |request| | |
# puts "hitting API" |
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
Hello! We are searching for an awesome software engineer to join our small team in SF and help create | |
Hipcamp, the best way to discover and book campsites. | |
We are driven by our mission to get more people outside and believe connecting with nature is | |
essential to a happy and healthy human life. | |
Currently our engineering team consists of Richard (RichardLitt) who specializes in Angular, JS, SASS | |
andour CEO Alyssa (alyraz) who codes whenever she can. We're looking for a senior engineer who can lead | |
backend architecture, basic dev ops, and fill in the missing gaps in our team. Potential to transition | |
to mobile development later in the year if desired. |
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
HC.filters = function filtersCollection() { | |
var api = {}; | |
var filters = { | |
amenity: [], | |
activity: [], | |
feature: [] | |
}; | |
api.add = function(type, name) { |
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
<% title "Hipcamp | Discover the Best Camping in #{@park.full_name}" %> | |
<% description "Find yourself a campsite in #{@park.short_name}. Get realtime reservations information, recommended activities, tips and book your perfect campsite." %> | |
<% og_title "Hipcamp | Discover the Best Camping in #{@park.short_name}" %> | |
<% og_description "Find yourself a campsite in #{@park.short_name}. Get realtime reservations information, recommended activities, tips and book your perfect campsite." %> | |
<% og_url build_url_for_park(@park) %> | |
<% og_image build_park_image_url_facebook_sharing(@park) %> | |
<% content_for :style_sheet do %> | |
<style type="text/css"> |
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
res.on('end', function(){ | |
var parser = require('xml2json'); | |
var allCampgrounds = parser.toJson(data, {object: true}); | |
var availableCampgrounds = _.where(allCampgrounds.resultset.result, { availabilityStatus: "Y", contractID: 'CA' }); | |
var queryCount = availableCampgrounds.length; | |
console.log(queryCount) | |
_.each(availableCampgrounds, function(campground){ |
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 Person | |
attr_reader :id, :first_name, :last_name, :email, :phone, :created_at | |
def initialize(id, first_name, last_name, email, phone, created_at) | |
@id = id | |
@first_name = first_name | |
@last_name = last_name | |
@email = email | |
@phone = phone | |
@created_at = DateTime.parse(created_at) |
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 Die | |
def initialize(sides = 6) | |
@sides = sides | |
end | |
# Remember: rand(N) randomly returns one of N consecutive integers, starting at 0 | |
# So rand(N) returns a random integer in (0..N-1) | |
# And 1 + rand(N) returns a random integer in (1..N) | |
# See: http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-rand | |
def roll |
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
###**Enumberable Method: .each_with_index** | |
**Class:** Array of people and a horse | |
**Method:** .each_with_index | |
**Block:** do |item, index| | |
if index.even? | |
item.dance | |
else | |
item.push_up(2) | |
end |