Skip to content

Instantly share code, notes, and snippets.

View g-andrade's full-sized avatar

Guilherme Andrade g-andrade

  • Dash Games
  • Lisbon, Portugal
  • 03:54 (UTC +01:00)
View GitHub Profile
-module(drift_test).
-export([run/1]).
run(Timeout) ->
MonoStartTs = erlang:monotonic_time(millisecond),
OsStartTs = os:system_time(millisecond),
receive
after
Timeout ->
@g-andrade
g-andrade / Makefile
Last active June 25, 2020 11:40
Makefile rule that looks for bad indentation within itself
check-makefile-indentation:
@awk '/^[[:space:]]/ && /^[^\t]/{print FILENAME":"FNR":"$$0}' \
$(MAKEFILE_LIST)
@g-andrade
g-andrade / test.proto
Last active July 28, 2020 16:10
Slow Erlang compilation times
syntax = "proto3";
package foobariots.shobblethrock;
message Foobar0 {
int64 a = 1;
string b = 2;
oneof c {
@g-andrade
g-andrade / test_pb.erl
Created July 28, 2020 16:07
Slow Erlang compilation times
This file has been truncated, but you can view the full file.
%% -*- coding: utf-8 -*-
%% @private
%% Automatically generated, do not edit
%% Generated by gpb_compile version 4.13.0
-module(test_pb).
-export([encode_msg/2, encode_msg/3]).
-export([decode_msg/2, decode_msg/3]).
-export([merge_msgs/3, merge_msgs/4]).
-export([verify_msg/2, verify_msg/3]).
@g-andrade
g-andrade / duplicate_socket_async_ref.escript
Created October 21, 2020 14:58
Duplicate socket async reference
#!/usr/bin/env escript
-module(duplicate_socket_async_ref).
-mode(compile).
-export([main/1]).
main([]) ->
{ok, ListenSocket, ListenPort} = create_listen_socket(),
spawn_link(fun () -> run_socket_acceptor(ListenSocket) end),
try_reproducing_the_issue(ListenPort, 0).