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
score(Rolls) -> score(Rolls, 10). | |
score(_Rolls, 0) -> 0; | |
score(Rolls, NumberOfFrame) -> | |
case Rolls of | |
[ 10, FirstOfNextFrame, SecondOfNextFrame | NextRolls ] -> | |
10 + FirstOfNextFrame + SecondOfNextFrame + | |
score([ FirstOfNextFrame, SecondOfNextFrame | NextRolls ], NumberOfFrame - 1); | |
[ FirstOfCurrentFrame, SecondOfCurrentFrame, FirstOfNextFrame | NextRolls ] |
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
score(Rolls) -> | |
NumberOfFrames = 10, | |
{ Score, _ } = lists:foldl(fun(_, { Score, FramesRolls }) -> | |
{ ScoreInFrame, RemainingFramesRolls } = score_frame(FramesRolls), | |
{ Score + ScoreInFrame, RemainingFramesRolls } | |
end, { 0, Rolls }, lists:seq(1, NumberOfFrames)), | |
Score. | |
score_frame([ 10, FirstNextFrame, SecondNextFrame | Rolls ]) -> | |
{ 10 + FirstNextFrame + SecondNextFrame, [ FirstNextFrame, SecondNextFrame | Rolls ] }; |
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
body { | |
background-color: #eee; | |
} | |
.container { | |
margin-top: 50px; | |
width: 1400px; | |
text-align: center; | |
font-family: sans-serif; | |
height: 75px; |
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
" autoload the local .vimrc file you need to have | |
" https://github.com/MarcWeber/vim-addon-local-vimrc | |
" plugin installed | |
map <Leader>t :call RunCurrentTest()<CR> | |
map <Leader>o :call OpenCurrentTest()<CR> | |
function! RunCurrentTest() |
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
$elixir stop.exs | |
Asked to stop because :normal | |
1) test stop (Test) | |
stop.exs:28 | |
** (exit) exited in: GenServer.call(#PID<0.68.0>, :stop, 5000) | |
** (EXIT) normal | |
stacktrace: | |
(elixir) lib/gen_server.ex:356: GenServer.call/3 |
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
defmodule StreamBehaviourTest do | |
use ExUnit.Case, async: true | |
test "will not pull from upstream after halt" do | |
called = fn key, x -> Process.put(key, [x|Process.get(key, [])]) end | |
results = 1..10 | |
|> Stream.each(&called.(:upstream, &1)) | |
|> Stream.take(1) | |
|> Stream.each(&called.(:downstream, &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
defmodule Paco.Collector do | |
@env String.to_atom(System.get_env("MIX_ENV") || "dev") | |
defmacro notify_loaded(text, state), do: call(@env, :do_notify_loaded, [text, state]) | |
defmacro notify_started(parser, state), do: call(@env, :do_notify_started, [parser, state]) | |
defmacro notify_ended(result, state), do: call(@env, :do_notify_ended, [result, state]) | |
defp call(:prod, _, _), do: :ok | |
defp call(_, name, args) do |
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
Verifying that +gabrielelana is my blockchain ID. https://onename.com/gabrielelana |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
PASSWORD_PATH = ".password" | |
PASSWORD_ID_PATH = ".password_id" | |
# Make sure to have installed vagrant-triggers plugin | |
# > vagrant plugin install vagrant-triggers | |
# After the first `vagrant up` stop the VM and execute the following steps |
OlderNewer