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
Feature: La Cosa Nostra IVR Workflow | |
In order to register a credit card I want to call the La Cosa Nostra IVR | |
and simulate a phone call. | |
Background: As part of each Scenario I want to set my defaults. | |
Given my telephone number is "(100) 000-0001" | |
And I am testing the "CCard" workflow. | |
And I call the IVR. | |
Scenario: I register my card in one step and sign up for all 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
Then /^the IVR says "([^\"]*)"$/ do |phrase| | |
@ivr_client.last_response['twml'].should include(phrase) | |
end | |
Then /^the IVR says$/ do |multiline| | |
multiline.split(/\n/).each do |phrase| | |
phrase.strip! | |
@ivr_client.last_response['twml'].should include(phrase) | |
end | |
end |
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
wooo = function () { | |
var self = {}; | |
self.interval = 1000; | |
self.iLikeIt = true; | |
self.init = function () { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "http://mbostock.github.com/d3/d3.js?1.29.1") | |
document.getElementsByTagName("head")[0].appendChild(script); |
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 'fileutils' | |
require 'net/http' | |
require 'net/https' | |
require 'json' | |
require 'pp' | |
def http_get url | |
uri = URI.parse(url) | |
http = Net::HTTP.new(uri.host, uri.port) |
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
(defmulti my-multi (fn [arg] | |
(if (.startsWith arg "a") | |
:a | |
:b))) | |
(defmethod my-multi :a [arg] | |
(format "this is :a gonka-donk: %s" arg)) | |
(defmethod my-multi :b [arg] | |
(format "b is the b is the b damn it: %s" arg)) |
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
// http://www.hackerrank.com/ | |
// open JS console in Chrome, paste into JS console | |
// run: | |
// Foo.playGames( 7, 99 ) | |
// to play 99 games starting with the opening value of 7 | |
Foo = (function () { | |
var self = {autoContinue: true}; | |
self.startGame = function (numCandies) { | |
$.ajax({ |
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
;; condition free fizz-buzz solution, based on code from [email protected] to the clojure list | |
;; uses infinite, lazy-sequences | |
(let [three (cycle [nil nil "fizz"]) | |
five (cycle [nil nil nil nil "buzz"])] | |
(defn fizz-buzz [] | |
(map vector (iterate inc 1) three five))) | |
(doseq [tuple (take 30 (fizz-buzz))] | |
(println (apply str (interpose " " (filter identity tuple))))) |
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
$meats = %w[fajita-veggie carnitas barbacoa chicken steak] | |
$rices = ['no-rice', 'white rice', 'brown rice'] | |
$salsas = ['mild salsa', 'medium salsa', 'salsa roja'] | |
$toppings = %w[sour-cream guacamole lettuce cheese] | |
def gen | |
ingredients = [] | |
base = $meats[rand($meats.size)] + ' burrito with ' | |
ingredients << $rices[rand($meats.size-1)] | |
if rand < 0.9 |
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
Philosophical: | |
* writing lines of code is one of the least valuable things I can do | |
* cultivate your impatience | |
* reject the status quo, unless we can re-derive it from first-principles | |
* engineers imprint on the first languages (techniuqes, frameworks or technology) that we find success with (unconsciously seen as caregivers, which we defend w/o always knowing why) | |
* we tend to overvalue the familiar/known; we tend to undervalue the unfamiliar/unknown, this interferes with our receptiveness to new ideas and personal growth | |
* we're 90% composed of bad habits; many of our best habits become bad as time passes; this allows us to filter for the fundamental; the great | |
* make doing the right thing easier than any other thing, or we will fail to achieve greatness, or break bad habits | |
* be conscious, be intentional | |
* "is this the highest we can aim?" (I prefer this over "is this the best we can do", the former is aspirational, the latter is judgemental) |
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
(let [chars (-> | |
"01000010 01000101 01000101 01010010" | |
(.split " ") | |
vec) | |
nums (mapv #(Integer/parseInt % 2) | |
chars)] | |
(mapv #(-> % char str) nums)) |