heroku addons:add graphenedb --version v218
tar -cjf graph.tar.bz2 /opt/neo4j-enterprise-2.1.5/data/graph.db
git remote add heroku-staging git@heroku.com:ut-census-staging.git
describe "Bottles Song" do | |
it "the first verse" do | |
expected = "99 bottles of beer on the wall, " + | |
"99 bottles of beer.\n" + | |
"Take one down and pass it around, " + | |
"98 bottles of beer on the wall.\n" | |
expect(expected).to eq(Bottles.verse(99)) | |
end |
test "invalid when proper number of digits but letters mixed in" do | |
assert Phone.number("1a2a3a4a5a6a7a8a9a0a") == "0000000000" | |
end |
defmodule Phone do | |
@doc """ | |
Remove formatting from a phone number. | |
Returns "0000000000" if phone number is not valid | |
(10 digits or "1" followed by 10 digits) | |
## Examples | |
iex> Phone.number("123-456-7890") |
Definitions. | |
INT = [0-9] | |
SPECIAL = [\(\)\.\-] | |
WHITESPACE = [\s\t\n\r] | |
Rules. | |
{INT} : { token, {int, TokenLine, TokenChars}}. | |
{SPECIAL} : skip_token. |
@char_types [{~r/(?<number>\d)/, :digit}, {~r/(?<letter>\w)/, :letter}, {~r/(?<allowed>[\(\)\.\-])/, :allowed} ] | |
defp identify_char(char) do | |
{_, type} = Enum.find(@char_types, {nil, :unknown}, fn {reg, type} -> | |
String.match?(char, reg) | |
end) | |
{type, char} | |
end |
begin; | |
SELECT | |
id, | |
linked_study_id, | |
folder_id | |
FROM studies | |
WHERE | |
linked_study_id IS NOT NULL AND | |
folder_id IS NOT NULL; |
:ruby | |
@site = UT::SiteSucker.new(params[:url]) | |
= content_for :bottom_js do | |
:plain | |
window.launchTest = function(e){ | |
$('#utfst_start').remove() | |
$('#sucked_site').show() | |
}; |
class Strategy | |
def initialize(warrior, player) | |
@warrior = warrior | |
@player = player | |
end | |
def remember(memo) | |
player.remember memo | |
end |