Skip to content

Instantly share code, notes, and snippets.

View fenollp's full-sized avatar

Pierre Fenoll fenollp

View GitHub Profile

Keybase proof

I hereby claim:

  • I am fenollp on github.
  • I am fenollp (https://keybase.io/fenollp) on keybase.
  • I have a public key ASAPCTAJhxr4eoNo_rM7TwkuQ_fPQZ3GSXnP4pijTX7laQo

To claim this, I am signing this object:

@fenollp
fenollp / func.ged.sh
Created November 10, 2017 15:53
git sed s%pattern%replacement%flags [-- git-grep flags]
#!/bin/bash
ged() {
local sprf="$1" ; shift
[[ "$sprf" == 's%'* ]] || return 10 # MUST be s%p%r%f
local p="$(echo "$sprf" | cut -d% -f2)"
[[ "$p" == '' ]] && return 11
if git status --porcelain | grep '^ ' | grep .; then return 12; fi
local git_grep='git grep -IE'
local f="$(echo "$sprf" | cut -d% -f4)"
@fenollp
fenollp / pp_stack_inside_try_catch.erl
Created August 23, 2017 21:04
Test printing ST with -Wall & OTP20
%% Copyright © 2017 Pierre Fenoll ‹pierrefenoll@gmail.com›
%% See LICENSE for licensing information.
%% -*- coding: utf-8 -*-
%% @module Test printing ST with -Wall & OTP20
-module(pp_stack_inside_try_catch).
-export([m/1]).
@fenollp
fenollp / compile.log
Created August 20, 2016 01:00
rebar3 error erldocs_other
0 erldocs_other.git master (19.0) ∀ DEBUG=1 rebar3 compile
===> Expanded command sequence to be run: [{default,app_discovery},
{default,install_deps},
{default,lock},
{default,compile}]
===> Verifying dependencies...
===> Fetching erldocs ({git,"git://github.com/rebar/rebar.git",
{ref,
"1387a83e24eba0a794e9890c3351871a0fb7262e"}})
===> sh info:
#!/bin/bash
#
url='http://hands.wtf/build/bundle.js'
matches=$(curl $url -s | grep -Eo ',([a-z0-9]{3}):' | sed 's/,//;s/://' | sort -u)
to_exclude='102 110 114 116 add arc map max min oss pan poo end fap fps get red set six src sub tan tos uas url uv2 dot fog'
exclude=''
for word in $to_exclude; do
%% Copyright © 2016 Pierre Fenoll ‹pierrefenoll@gmail.com›
%% See LICENSE for licensing information.
%% -*- coding: utf-8 -*-
-module(cmp_fun_v_func).
%% cmp_fun_v_func: compare calling a function vs calling a function applying a fun.
%% 44> G = fun (Fun, Times) -> lists:sum([T || _ <- lists:seq(1,Times), {T,_Ret} <- [timer:tc(cmp_fun_v_func, Fun, [Times])]]) / Times end.
%% #Fun<erl_eval.12.50752066>
%% 45> G(fn, 1000000). G(fnc, 1000000).
diff --git a/common_test/ct.html b/common_test/ct.html
index 8e53182..4687893 100644
--- a/common_test/ct.html
+++ b/common_test/ct.html
@@ -51,10 +51,7 @@
<item><p>Whatever added by <code>init_per_suite/1</code> or
<code>init_per_testcase/2</code> in the test suite.</p></item>
</list></div>
-<div id="types" class="category"><h4><a href="#types">Types</a></h4><hr/>
- <div class="type"><h3 id="type-handle">handle() = handle() (see module ct_gen_conn) | term()</h3></div>
@fenollp
fenollp / 1.txt
Created February 25, 2016 08:55
compiling kazoo 2915ccc7f00f2f9a0e0e8d37d5eef136e52f7853
$ git clone git@github.com:2600hz/kazoo.git && cd kazoo && git checkout 2915ccc7f00f2f9a0e0e8d37d5eef136e52f7853 && make
wget 'https://raw.githubusercontent.com/ninenines/erlang.mk/'2.0.0-pre.2'/erlang.mk' -O ./erlang.mk
mkdir deps
make -f erlang.mk deps
make[1]: Entering directory '/home/pete/kazoo'
git clone https://github.com/ninenines/erlang.mk .erlang.mk.build
if [ -f build.config ]; then cp build.config .erlang.mk.build; fi
cd .erlang.mk.build && make
make[2]: Entering directory '/home/pete/kazoo/.erlang.mk.build'
/(where|and|or)\s*([^\s=]*?)\s*(=|<>|>=|=<|>|<)\s*(\\"|")([^\4]*?)\4/g
MATCH_NUM,GROUP,START,END,VALUE
1,1,1231,1236,"where"
1,2,1237,1245,"pres_uri"
1,3,1245,1246,"="
1,4,1246,1247,""""
1,5,1247,1281,"sip:user_7z7b6s@teste.sip.90e9.com"
2,1,1283,1286,"and"
2,2,1287,1293,"callid"
%% Copyright © 2013 Pierre Fenoll ‹pierrefenoll@gmail.com›
%% See LICENSE for licensing information.
%% -*- coding: utf-8 -*-
-module(ifdef_in_fun).
%% 12:40 < stobix>| Grr... It would seem that I can't use ifdef directives inside function bodies. Any reason why, or is it just a design flaw?
%% 1> c(ifdef_in_fun).
%% ifdef_in_fun.erl:16: syntax error before: '-'
%% ifdef_in_fun.erl:18: syntax error before: '-'