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
  • 03:07 (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 / log_memory_usage_example.py
Last active April 20, 2022 02:17
Example of logging memory usage before and after invoking a function in Python using decorators
# Running the script below will yield the following results:
#
# $ ipython log_memory_usage_example.py
# INFO:root:memory use before calling make_large_string : 19,340 kb
# INFO:root:memory use after calling make_large_string : 85,840 kb
#
import functools
import logging
import resource
@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 / 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 / .gitconfig
Last active November 22, 2019 10:05
.gitconfig
[branch]
autosetupmerge = true
[alias]
co = checkout
ci = commit
st = status
br = branch -a -vvv
brs = branch -a -vvv --sort committerdate
co = checkout
df = diff
@nnathan
nnathan / kernel.md
Last active November 10, 2023 08:30
Linux Kernel Resources
@nnathan
nnathan / math.md
Last active March 25, 2017 14:16
Mathematics Pointers
@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