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
other_arr = ["four"] | |
["one","two","four"].reject {|element| other_arr.include?(element) } | |
=> ["four"] |
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
% Symmetric Push-Sum Protocol | |
loop(#node{name=Name, value=Value, weight=Weight} = State) -> | |
receive | |
{push, From, {V0, W0}} -> | |
V1 = Value/2, | |
W1 = Weight/2, | |
From ! {symmetric_push, self(), {V1, W1}}, | |
loop(update(V0 + V1 , W0 + W1, State)); | |
{symmetric_push, {V0, W0}} -> |
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
-module(spsp). | |
-export([sum/0, average/0, add_peers/2]). | |
-record(node, { | |
value, | |
weight, | |
peers = [] | |
}). | |
sum() -> |
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 "annoystream/version" | |
module Annoystream | |
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
## syncronous panes | |
# open up multiple panes and hit Ctrl-B a then start typing :O !!! | |
bind a set-window-option synchronize-panes |
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
% bench:start(). | |
% {result1,57663,result2,43880} | |
-module(bench). | |
-export([start/0]). | |
-record(record, { | |
key, | |
one = 1.0, |
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
nnoremap <buffer> <localleader>s :rightbelow vsplit<CR>:execute 'normal! /^' . expand('<cword>') . "\<cr>"<cr>:nohlsearch<cr> |
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
λ (rramsden@richard) gdk-pixbuf-2.26.2 brew install -vd --with-wxgtk erlang | |
/usr/local/bin/brew: loading /usr/local/Library/Formula/erlang.rb | |
Warning: Your Xcode (4.4) is outdated | |
Please install Xcode 4.4.1. | |
/usr/local/bin/brew: loading /usr/local/Library/Formula/automake.rb | |
/usr/local/bin/brew: loading /usr/local/Library/Formula/autoconf.rb | |
/usr/local/bin/brew: loading /usr/local/Library/Formula/libtool.rb | |
/usr/local/bin/brew: loading /usr/local/Library/Formula/wxgtk.rb | |
/usr/local/bin/brew: loading /usr/local/Library/Formula/gtk+.rb |
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
class UsersController < ApplicationController | |
requires_authentication [:index, :show] | |
def index | |
@users = User.order(:id) | |
respond_to do |format| | |
format.html | |
format.csv { send_data @users.to_csv } | |
format.xls # { send_data @users.to_csv(col_sep: "\t") } | |
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
Compiled lib/elixir/lib/stream.ex | |
Compiled lib/elixir/lib/string/chars.ex | |
Compiled lib/elixir/lib/supervisor/behaviour.ex | |
Compiled lib/elixir/lib/string.ex | |
Compiled lib/elixir/lib/system.ex | |
Compiled lib/elixir/lib/tuple.ex | |
Compiled lib/elixir/lib/uri.ex | |
Compiled lib/elixir/lib/version.ex | |
make[1]: Entering directory `/opt/erlang/elixir' | |
==> unicode (compile) |