Skip to content

Instantly share code, notes, and snippets.

View keynslug's full-sized avatar

Andrew Mayorov keynslug

View GitHub Profile
@keynslug
keynslug / gist:3879247
Created October 12, 2012 13:42
Ranch Issue
# cd ranch && git log -1 --oneline
cd09998 Add the {nodelay, boolean()} option controlling TCP_NODELAY
# erl -pa lager/ebin ranch/ebin cowboy/ebin -boot start_sasl
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
1 : =PROGRESS REPORT==== 12-Oct-2012::17:30:44 ===
2 : supervisor: {local,sasl_safe_sup}
3 : started: [{pid,<0.35.0>},
%% vim:set softtabstop=4 shiftwidth=4 tabstop=4:
-module(sign_certificate).
-author("Michael Taylor <[email protected]>").
%% External exports
-export([sign_certificate/1]).
% sign a certificate from a certificate signing request (CSR)
% RequestDER is a CSR binary in DER format
% return Certificate as binary in DER format
@keynslug
keynslug / bpr
Created February 17, 2015 11:11
bpr
#!/usr/bin/env escript
%%
%%! -noshell +pc unicode
main([BinTerm]) ->
[Bin] = consult(BinTerm ++ "."),
io:setopts(user, [{encoding, unicode}]),
io:format(user, "~ts~n", [Bin]),
erlang:halt();
@keynslug
keynslug / unite.patch
Created May 20, 2015 15:17
unite.patch
diff --git a/src/unite_compact.erl b/src/unite_compact.erl
index 012908f..9b03e61 100644
--- a/src/unite_compact.erl
+++ b/src/unite_compact.erl
@@ -246,18 +246,21 @@ format_case(Failure, ST, Color) ->
format_source(Failure, ST) ->
case get(source, Failure) of
undefined ->
- format_stack_line(hd(ST));
+ format_stack_line(ST);
@keynslug
keynslug / skin.iwsd
Created December 27, 2015 20:15
Make images of PlantUML diagrams
skinparam DefaultFontName "Neucha"
skinparam BackgroundColor transparent
skinparam Shadowing false
skinparam Handwritten true
skinparam Note {
BorderColor #303030
BackgroundColor #CEEEFE
FontSize 12
}
@keynslug
keynslug / gist:767b576ec4d351f69a0fddfcf52a86a6
Created December 22, 2017 10:21
rebar3.report.1513938047
Rebar3 report
version 3.4.7
generated at 2017-12-22T10:20:10+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task:
Entered as:
-----------------

Keybase proof

I hereby claim:

  • I am keynslug on github.
  • I am keynfawkes (https://keybase.io/keynfawkes) on keybase.
  • I have a public key ASAdNQQPuciP96ecrpouRZTn3s4FA5X7jejrAjoLeGZTZwo

To claim this, I am signing this object:

@keynslug
keynslug / ct.log
Created October 26, 2018 09:44
Common Test console log
%%% server_SUITE: .
=CRASH REPORT==== 26-Oct-2018::12:40:53.997593 ===
crasher:
initial call: cowboy_clear:connection_process/5
pid: <0.653.0>
registered_name: []
exception error: bad argument
in function gproc:unreg/1
called as gproc:unreg({p,l,{gproc_ps_event,<<"room1">>}})
in call from chat_server_message_handler:handle_event/2 (/Users/keynslug/ws/erlang-school/chat/_build/test/lib/chat_server/src/chat_server_message_handler.erl, line 96)
==> Starting Consul agent...
==> Consul agent running!
Version: 'v1.5.1'
Node ID: 'bd03081c-76cf-7c40-1a3d-e305a4db0a31'
Node name: 'n2'
Datacenter: 'dc1' (Segment: '<all>')
Server: true (Bootstrap: false)
Client Addr: [127.0.0.1] (HTTP: 8500, HTTPS: -1, gRPC: -1, DNS: 8600)
Cluster Addr: 172.23.0.2 (LAN: 8301, WAN: 8302)
Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false
@keynslug
keynslug / email_address_parse.yrl
Created February 4, 2021 19:25
email address parser
% Based on RFC5321 (Simple Mail Transfer Protocol)
% https://tools.ietf.org/rfc/rfc5321.txt
% + Added support for RFC6532 via RFC6531 (SMTP Extension for Internationalized Email)
% https://tools.ietf.org/rfc/rfc6532.txt
% https://tools.ietf.org/rfc/rfc6531.txt
Nonterminals
mailbox
localpart
domainpart