Skip to content

Instantly share code, notes, and snippets.

View andytill's full-sized avatar

Andy Till andytill

View GitHub Profile
@qrilka
qrilka / httpc-test.escript
Created April 4, 2014 14:19
httpc error in R16B03-1
#!/usr/bin/env escript
main(_Args) ->
application:start(sasl),
inets:start(),
BadAddress = "http://10.255.255.1:8000/ru/",
spawn(fun()-> io:format("Res1:~P~n",
[httpc:request(get, {BadAddress,[]},[
{connect_timeout,1000}
],[]%,P
@lpgauth
lpgauth / gist:2b3220f4bceeed6f62d0
Created July 18, 2014 18:11
HiPE lock contention
(rtb-gateway@h033.bloomdigital.com)9> lcnt:start(), lcnt:rt_opt({copy_save, true}), lcnt:clear(), timer:sleep(250), lcnt:collect(), lcnt:conflicts().
lock id #tries #collisions collisions [%] time [us] duration [%]
----- --- ------- ------------ --------------- ---------- -------------
hipe_mfait_lock 1 156537 156367 99.8914 2832642 1119.0905
pollset 1 5002 195 3.8984 17340 6.8505
drv_ev_state 16 6683 46 0.6883 2031 0.8024
timeofday 1 10206 301 2.9492 602 0.2378
run_queue 28 62350 107 0.1716 122 0.0482
timer_wheel 1 9350 123 1.3155 114 0.0450
proc_link 8902 21641 16 0.0739 91 0.0360
@xandkar
xandkar / labeled_and_optional_args_in_erlang.md
Last active August 29, 2015 14:17
Labeled (and optional) arguments in Erlang

One of the things I found myself wishing I had in Erlang was labeled arguments. Even with common operations from stdlib (like lists:foldl) - I constantly forget the correct order of arguments, and it becomes that much more error-prone in complex cases (see cowboy_req:new/14, for instance).

Another desirable feature is optional arguments, which are assigned a default value when omitted.

It turns-out that the semantics of these requirements are fully met by records!

@joesepi
joesepi / gist:6299513
Last active December 21, 2015 11:29
How to get SublimeLinter working in Sublime Text 3 (ST3)

How to get SublimeLinter working in SublimeText3 (ST3)

This shouldn't be that hard.

I have done a number of things over the last few hours to get this to work and I wasn't taking notes, so this is what I think needs to happen to install SublimeLinter in ST3

The first thing you need to do is uninstall SublimeLinter if you have it installed:

  • Assuming you have Package Controll installed, hit Cmd + Shift + P to bring up the panel and type "remove" and choose "Package Control: Remove Package" and then choose SublimeLinter from the resulting menu

Let's really make sure that all of that SublimeLinter stuff is gone:

  • Navigate to ~/Library/Application\ Support/Sublime\ Text\ 3/
@BlackMac
BlackMac / ctags_autocomplete.py
Created February 14, 2012 09:48
autocomplete over project for Sublime Text 2
# CTags based autocompletion plugin for Sublime Text 2
# You can add the file to the User Package in ~/Library/Application Support/Sublime Text 2/Packages and restart Sublime Text 2.
# generate the .tags file in your project root with "ctags -R -f .tags"
import sublime, sublime_plugin, os
class AutocompleteAll(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
tags_path = view.window().folders()[0]+"/.tags"
@larshesel
larshesel / unlocking-the-superpowers-of-the-erlang-vm.txt
Last active November 20, 2017 11:23
unlocking-the-superpowers-of-the-erlang-vm.org
* Unlocking the super-powers of the Erlang VM
Lars Hesel Christensen
VerneMQ Engineer
twitter: @larshesel
✉ lars@vernemq.com
✉ lhc@larshesel.dk
github.com/larshesel
import edu.uci.ics.jung.algorithms.layout.CircleLayout;
import edu.uci.ics.jung.algorithms.layout.Layout;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.util.TestGraphs;
import java.awt.Dimension;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;
@0xYUANTI
0xYUANTI / bench.erl
Created February 16, 2011 12:41
disk_log vs file
-module(bench).
-compile(export_all).
%% Luke Gorrie's favourite profiling macro.
-define(TIME(Tag, Expr),
(fun() ->
%% NOTE: timer:tc/4 does an annoying 'catch' so we
%% need to wrap the result in 'ok' to be able to
%% detect an unhandled exception.
{__TIME, __RESULT} =

Code review practices

The following is meant to be a set of guidelines, not dogma. Use your best judgement. The goal is threefold, to have a practice for engineers to learn about what we collectively care about. To maintain quality of the code base as well as knowledge sharing about our systems.

Role of the author

  • Create PR, make sure to include JIRA ticket if such exists in the description or title of PR
  • Assign 2 developers as minimum but can include the whole team if the author feels it's needed.
  • Answer any questions the reviewer has.
  • Push changes after review is done as a new commit and make sure reviewer and yourself are satisfied with the change.