Skip to content

Instantly share code, notes, and snippets.

View nnathan's full-sized avatar
💭
shopt -s globstar

Naveen Nathan nnathan

💭
shopt -s globstar
  • Compton
  • 16:56 (UTC +10:00)
View GitHub Profile
@nnathan
nnathan / test_async_rabbitmq.pl
Last active August 29, 2015 14:18
Simple driver for Net::Async::AMQP
#!/usr/bin/env perl
# Inspired by one of my favourite Canadian cryptographer Tom St. Denis:
#
# This code is hereby placed in the Public Domain:
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# -- nnathan
@nnathan
nnathan / testing.md
Created February 28, 2016 16:54
testing notes from go

Lessons learned testing in Go

  • components should be silent when on the road, noisy when manufacturing

    • log/printf for debugging as you develop
  • use testing to help eliminate noise as your components are built

    • look at test output, when everything reads PASS, everything should be quiet. That means no more remaining log/printf output!
  • good unit tests help eliminate noise; less noise = more coverage!

@nnathan
nnathan / ipython_config.py
Created August 11, 2015 06:30
Per-virtualenv history for IPython
import sys
import os
c = get_config()
# per-virtualenv history (for Python 2.x)
if hasattr(sys, 'real_prefix'):
venv_name = os.path.basename(sys.prefix)
c.HistoryManager.hist_file = os.path.join(
os.path.dirname(__file__), 'history-{}.sqlite'.format(venv_name)
@nnathan
nnathan / math.md
Last active March 25, 2017 14:16
Mathematics Pointers

Why?

It seems that the microphone doesn't register with Google Chrome sometimes. This is partly to do with CoreAudio in OSX.

Fix

It seems if you google around, that people just willy-nilly sudo pkill -f coreaudiod which then restarts and should register microphone services.

@nnathan
nnathan / .vimrc
Created May 30, 2017 01:39
.vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-surround'
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-sleuth'
@nnathan
nnathan / ftd.md
Last active June 8, 2017 03:59
ftd

ftd

ftd aims to be a tool for drawing text-based diagrams in the same vein as OmniGraffle, Visio, and Monodraw. It should provide a UI that is WYSIWYG and should be "pixel perfect."

Desiderata

Software

  1. Must be cross-platform and support Desktop Linux/Windows/Mac. The UI must be consistent across all platforms.
  2. Must be released in source and binary form as public domain (i.e. prevent crippling from the bondage of licensing).
@nnathan
nnathan / hellowork.c
Created April 2, 2017 22:34
Playing with workqueues in the kernel
#include <linux/init.h>
#include <linux/module.h>
#include <linux/workqueue.h>
#include <linux/proc_fs.h>
/* proc shit */
#define PROCFS_NAME "hellowq"
static struct proc_dir_entry *hellowq_file;
static struct file_operations hellowq_proc_ops;
static char hellowq_buf[1024];
late night alumni - empty streets
solarstone & clare stagg - jewel (daniel kandi remix)
andain - what it's like (sneidjer remix)
vast vision - behind your smile (suncatcher remix)
bjorn akesson - castle technology
alex m.o.r.p.h - eternal flame
Above & Beyond - No one On Earth (Gabriel and Dresden Remix)
Yuri Kane VS Armin & Sharon - Right Back... and Love (Soulplay Extended Mash)
rank 1 & alex morph - and then
rank 1 - opus 17
@nnathan
nnathan / slqueue.c
Created January 3, 2019 06:04
Understanding BSD queue.h single linked list implementation
/*
* See queue(3) or https://www.freebsd.org/cgi/man.cgi?query=queue&sektion=3 for reference.
*/
#include <stdio.h>
#include <sys/queue.h>
struct Pattern {
char name[100];
/* Following expands to: