Skip to content

Instantly share code, notes, and snippets.

View sebastian's full-sized avatar
💯
🎉

Sebastian Probst Eide sebastian

💯
🎉
View GitHub Profile
@sebastian
sebastian / dialyzer.output
Last active July 19, 2017 10:44
Basically we are receiving 97 occurrences of these two. The second one is the most common I believe.
web/controllers/view_controller.ex:1: The call 'Elixir.Phoenix.Controller':put_new_layout(_@1::#{'__struct__':='Elixir.Phoenix.Socket' | 'Elixir.Plug.Conn', 'assigns':=#{atom()=>_}, 'adapter'=>{atom(),_}, 'before_send'=>[fun((_) -> any())], 'body_params'=>#{'__struct__'=>'Elixir.Plug.Conn.Unfetched', 'aspect'=>atom(), binary()=>binary() | [any()] | map()}, 'channel'=>atom(), 'channel_pid'=>pid(), 'cookies'=>#{'__struct__'=>'Elixir.Plug.Conn.Unfetched', 'aspect'=>atom(), binary()=>binary()}, 'endpoint'=>atom(), 'halted'=>_, 'handler'=>atom(), 'host'=>binary(), 'id'=>'nil', 'joined'=>boolean(), 'method'=>binary(), 'owner'=>pid(), 'params'=>#{'__struct__'=>'Elixir.Plug.Conn.Unfetched', 'aspect'=>atom(), binary()=>binary() | [any()] | map()}, 'path_info'=>[binary()], 'peer'=>{{_,_,_,_} | {_,_,_,_,_,_,_,_},char()}, 'port'=>char(), 'private'=>#{atom()=>_}, 'pubsub_server'=>atom(), 'query_params'=>#{'__struct__'=>'Elixir.Plug.Conn.Unfetched', 'aspect'=>atom(), binary()=>binary() | [any()] | map()}, 'query_string'=>b
@sebastian
sebastian / status_assasin
Last active August 29, 2015 14:09
Script that you can run in the background that solves the dreaded "old" status syndrome on Sqwiggle
#!/usr/bin/env ruby
require 'rubygems'
require 'sqwiggle-ruby'
# If a status stays the same for more than
# a certain time, it should most definitively
# be iradicated
killit_after = 60
@sebastian
sebastian / pomodoro
Last active August 29, 2015 14:01
Pomodoro update script for sqwiggle
#!/usr/bin/env ruby
require 'rubygems'
require 'sqwiggle-ruby'
# We default to pomodori of 25 minute length.
# If the timer is started too late, you can
# start shorter pomodori by supplying the
# time as the first argument.
minutes = ARGV.size == 0 ? 25 : ARGV[0].to_i

Keybase proof

I hereby claim:

  • I am sebastian on github.
  • I am sebastianeide (https://keybase.io/sebastianeide) on keybase.
  • I have a public key whose fingerprint is 4A63 B8FD F190 0E38 3418 8CB5 0382 E03A BCEB 065F

To claim this, I am signing this object:

Parsing config file bsd.conf
libxl: error: libxl_create.c:317:libxl__domain_make domain creation fail
cannot make domain: -3
libxl: error: libxl.c:703:libxl_domain_destroy non-existant domain -1
@sebastian
sebastian / gist:659978
Created November 2, 2010 17:35
Converts a bitstring into a number
-spec(bitstring_to_number/1::(BitString::bitstring()) -> number()).
bitstring_to_number(BitString) ->
bitstring_to_number(BitString, bit_size(BitString), 0).
bitstring_to_number(_BitString, 0, Acc) -> Acc;
bitstring_to_number(BitString, CurrBitNum, Acc) ->
BitsToSkip = bit_size(BitString) - CurrBitNum,
<<_:BitsToSkip/bitstring, CurrentBit:1/bitstring, _/bitstring>> = BitString,
Addition = case CurrentBit of
<<1:1>> -> 1 bsl (CurrBitNum - 1);
@sebastian
sebastian / gist:659971
Created November 2, 2010 17:31
Does binary addition of two bitstrings of equal length and throws away the carry.
-spec(add_bitstrings/2::(Bin1::bitstring(), Bin2::bitstring()) -> bitstring()).
add_bitstrings(Bin1, Bin2) when bit_size(Bin1) =:= bit_size(Bin2) ->
add_bit_with_carry(bit_size(Bin1), Bin1, Bin2, false).
add_bit_with_carry(0, Acc, _Bin, _Carry) -> Acc;
add_bit_with_carry(BitNumber, AccBin1, Bin2, Carry) ->
Bit = BitNumber - 1,
<<Beginning:Bit/bitstring, B1:1/bitstring, Rest/bitstring>> = AccBin1,
<<_DontYetCare:Bit/bitstring, B2:1/bitstring, _Rest/bitstring>> = Bin2,
{NextBit, NextCarry} = case {B1, B2, Carry} of
@sebastian
sebastian / autorun.rb
Created October 23, 2010 15:40
Short script that compiles and runs test on erlang modules as they change
#!/usr/local/bin/ruby -w
require 'rubygems'
ERLC_FLAGS = "-Ideps +warn_unused_vars +warn_unused_import"
####
# SETUP
####