I hereby claim:
- I am ktec on github.
- I am globalkeith (https://keybase.io/globalkeith) on keybase.
- I have a public key whose fingerprint is 9E55 DA5C 53D6 288F 667B 04D3 420A 1F32 D5B5 C752
To claim this, I am signing this object:
Whenever you push to remote that has "production" in its name, | |
this hook will show commits and changes and then ask for confirmation. | |
Copy or symlink to: | |
.git/hooks/pre-push. | |
Make the file executable: | |
chmod +x .git/hooks/pre-push |
class Prime | |
def self.primes | |
isComposite = -> (n) {(3..Math.sqrt(n)).step(2).any?{ |i| n % i == 0 }} | |
Enumerator.new do |e| | |
e.yield 2 # start at 2 | |
(3..Float::INFINITY) # start generator from 3 | |
.step(2) # sieve all even numbers | |
.lazy # calculate on demand | |
.reject(&isComposite) # sieve all composites numbers | |
.map(&:to_i) # reduce to ints |
I hereby claim:
To claim this, I am signing this object:
defmodule Day1 do | |
defp _position(str) do | |
str | |
|> Stream.unfold(&String.next_codepoint/1) | |
|> Stream.map(&do_decode/1) | |
|> Stream.with_index | |
|> Stream.transform(0, &do_floor/2) | |
|> Stream.map(&IO.inspect(&1)) | |
|> Enum.to_list | |
|> List.last |
import Data.List | |
import qualified Data.Map as Map | |
import System.Environment (getArgs) | |
-- credit The Genuine Sieve of Eratosthenes (Melissa E. O’Neill) | |
sieve xs = sieve' xs Map.empty | |
sieve' [] table = [] | |
sieve' (x:xs) table = | |
case Map.lookup x table of |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
module FormtasticExtensions | |
module Formtastic | |
module MarkItUpEditor | |
include MarkItUp::ViewHelpers | |
def self.included(base) | |
base.class_eval do | |
@mark_it_up_dependencies_included = false | |
end | |
end |
require 'test_helper' | |
class AccountControllerTest < ActionController::TestCase | |
context 'GET to edit for existing account' do | |
setup do | |
@account = Factory(:account) | |
Account.stubs(:find).returns(@account) | |
get :edit, :id => @account.to_param | |
end |