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
Analysis of sampling ruby (pid 8228) every 1 millisecond | |
Process: ruby [8228] | |
Path: /Users/pairing/.rbenv/versions/2.4.1/bin/ruby | |
Load Address: 0x108ab2000 | |
Identifier: ruby | |
Version: 0 | |
Code Type: X86-64 | |
Parent Process: zsh [917] |
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 PigLatin | |
def initialize | |
end | |
def convert(original_string) | |
word_collection = original_string.split(" ").map(&:downcase) | |
word_collection.map! do |word| | |
word.match(/(.)(.+)/) | |
$2 + $1 + "ay" |
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
pickie [master] :> npm install | |
npm ERR! install Couldn't read dependencies | |
npm ERR! package.json ENOENT, open '/Users/ryan/Desktop/pickie/package.json' | |
npm ERR! package.json This is most likely not a problem with npm itself. | |
npm ERR! package.json npm can't find a package.json file in your current directory. | |
npm ERR! System Darwin 13.3.0 | |
npm ERR! command "node" "/usr/local/bin/npm" "install" | |
npm ERR! cwd /Users/ryan/Desktop/pickie | |
npm ERR! node -v v0.10.24 |
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 Array | |
def my_inject(*args) | |
acc = args.length >= 1 ? args[0] : self.shift | |
self.each {|el| acc = yield acc, el} | |
acc | |
end | |
end | |
def assert_equal(actual, expected) | |
puts "You expected #{expected} and got #{actual}" unless actual == expected |
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 ChangeDispenser | |
attr_reader :purse | |
MONEY_TO_VALUE = { | |
quarter: 25, | |
dime: 10, | |
nickel: 5, | |
penny: 1 | |
} |
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
# Given an array_of_ints, find the highest_product you can get from three of the integers. | |
# The input array_of_ints will always have at least three integers. | |
def highest_product(arr) | |
highest = arr[0] | |
lowest = arr[0] | |
highest_of_two = arr[0] * arr[1] | |
highest_of_three = arr[0] * arr[1] * arr[2] |
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
require 'benchmark' | |
def factorial(n) | |
if n <= 1 | |
n | |
else | |
n * factorial(n-1) | |
end | |
end |
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
$(document).ready(function(){ | |
controller = new SingleListApp.Controller(); | |
controller.bind(); | |
list = new SingleListApp.GroceryList | |
view = new SingleListApp.View('#grocery_list', '#total_cost') | |
}); | |
SingleListApp = {}; | |
//Controller |
#What is Jasmine?
My talk is about showing the basic similarities between Jasmine and Rpsec. The best way to learn a new concept is to relate to existing knowledge.
Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM.
def hello_world
NewerOlder