Skip to content

Instantly share code, notes, and snippets.

Björn-Egil Dahlberg psyeugenic

Block or report user

Report or block psyeugenic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@psyeugenic
psyeugenic / Makefile
Created Apr 25, 2016
Rebar3 Makefile for all projects
View Makefile
REBAR3_URL=https://s3.amazonaws.com/rebar3/rebar3
ifeq ($(wildcard rebar3),rebar3)
REBAR3 = $(CURDIR)/rebar3
endif
REBAR3 ?= $(shell test -e `which rebar3` 2>/dev/null && which rebar3 || echo "./rebar3")
ifeq ($(REBAR3),)
REBAR3 = $(CURDIR)/rebar3
@psyeugenic
psyeugenic / beam-coverage.pl
Last active Aug 29, 2015
Generate coverage statistics for Erlang/OTP VM (BEAM)
View beam-coverage.pl
#!/usr/bin/perl -w
use strict;
use warnings;
# Usage:
# Make sure lcov is installed and is in your path:
#
# Ubuntu: sudo aptitude install lcov
#
# Ensure ERL_TOP variable is set
View wat.erl
%% or like this
merge_threads_2([#{type := T, counters := C0}=M, #{type := T, counters := C1}|Ms],Acc) ->
merge_threads_2([M#{counters := add_counters(C0,C1)}|Ms],Acc);
merge_threads_2([M1,M2|Ms0],Acc) -> merge_threads_2([M1|Ms0],[M2|Acc]);
merge_threads_2([M],Acc) -> [M|merge_threads_2(Acc,[])];
merge_threads_2([],_) -> [].
add_counters(M1,M2) ->
maps:map(fun(Key,V1) ->
You can’t perform that action at this time.