The next data structure we are going to talk about is a hash. Hashes are fundamental in Ruby, and very important when it comes to Ruby Web Programing. You will see them used a lot in frameworks like Rails and Sinatra.
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 RotationalCipher | |
def initialize(offset) | |
while offset > 26 | |
offset -= 26 | |
end | |
generate_cipher_map(offset) | |
end | |
class << self |
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
/* jshint undef: true, unused: true */ | |
(function(window) { | |
'use strict'; | |
var Promise = function () { | |
this.state = 'pending'; | |
this._successHandlers = []; | |
this.values = null; | |
}; |
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
// Karma configuration | |
// Generated on Sat Oct 05 2013 23:52:56 GMT-0700 (PDT) | |
module.exports = function(config) { | |
config.set({ | |
// base path, that will be used to resolve files and exclude | |
basePath: '', | |
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
// TravelController.show was commented out when using this controller | |
ShowTravelController = ApplicationController.extend({ | |
waitOn: function() { | |
var id = this.params._id; | |
return [Meteor.subscribe('singleTravelRequest', id)]; | |
}, | |
action: function() { | |
// tried this one too | |
// this.waitOn = Meteor.subscribe('singleTravelRequest', this.params._id); |
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
Locations = new Meteor.Collection2('Locations', { | |
schema: { | |
country: { | |
type: String, | |
label: 'Country', | |
max: 50 | |
}, | |
city: { | |
type: String, | |
label: 'City', |
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
source "https://rubygems.org" | |
gem "httparty" |
This is a short quiz to make sure you have the fundamentals in place to apply for our position. Please email your answers to [email protected] when finished. This shouldn't take you longer than 20 minutes.
Just a few guidelines:
- Take into consideration both functionality and style.
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
Ember.computed.groupByTimeRange = (dependantArrayKey, dependantChildKey, hourRange) -> | |
dependantProperty = "#{dependantArrayKey}.@each.#{dependantChildKey}" | |
Em.computed( -> | |
# hash by dates | |
activityItemsHash = {} | |
activityItems = @get(dependantArrayKey).sortBy(dependantChildKey) | |
groupedActivityItems = [] | |
activityItems.forEach (activity, index, activities) => | |
hashPosition = null |
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
import Ember from 'ember'; | |
import EmberResolver from 'ember/resolver'; | |
var Em = Ember; | |
var HybridResolver = EmberResolver.extend({ | |
resolveOther: function(parsedName) { | |
var factory = this.resolveGlobal(parsedName); | |
if(factory) { return factory; } |
OlderNewer