Skip to content

Instantly share code, notes, and snippets.

View nickva's full-sized avatar

Nick Vatamaniuc nickva

  • USA
View GitHub Profile
@nickva
nickva / progbar.py
Created October 15, 2018 19:21 — forked from jhlb/progbar.py
progbar.py : Print current position in file versus file length.
#!/bin/env python
import sys, os
USAGE="""
./progbar.py PROCESS_ID [FILE_DESCRIPTOR_NUMBER]
Usage:
./progbar.py PROCESS_ID
@nickva
nickva / build_otp.sh
Created October 10, 2018 22:26 — forked from gburd/build_otp.sh
Shell script to build a debug or valgrind enabled Erlang OTP release and other helpful notes.
#!/usr/bin/env bash
# Note: erlang depends on ncurses, openssl at a minimum
usage ()
{
echo "usage: $0 <release> <type>"
echo " release: R14B01|R14B02|R14B03|R14B04|R15B|R15B01|R15B02|R15B03|R16B|R16B01|R16B02"
echo " type: normal, opt, gcov, gprof, debug, valgrind, or lcnt"
@nickva
nickva / bench.erl
Created June 7, 2016 17:08 — forked from 0xYUANTI/bench.erl
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} =
@nickva
nickva / magic_ring.cpp
Last active November 27, 2017 18:02 — forked from rygorous/magic_ring.cpp
The magic ring buffer.
#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <string.h>
#include <Windows.h>
// This allocates a "magic ring buffer" that is mapped twice, with the two
// copies being contiguous in (virtual) memory. The advantage of this is
// that this allows any function that expects data to be contiguous in
// memory to read from (or write to) such a buffer. It also means that