Skip to content

Instantly share code, notes, and snippets.

View natpen's full-sized avatar

Natalie Pendragon natpen

View GitHub Profile
@natpen
natpen / .bashrc
Created October 21, 2014 17:04
This is not the greatest .bashrc in the world, no. This is just a tribute.
# MISC
alias less='less -r'
# --show-control-chars: help showing Korean or accented characters
alias ls='ls -F --color --show-control-chars'
alias ll='ls -l'
# GIT
alias gs='git status'
alias ga='git add'
alias gau='git add -u'
@natpen
natpen / .bash_profile
Created October 21, 2014 17:05
This is not the greatest .bash_profile in the world, no. This is just a tribute.
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
var extend = require('extend');
var spawn = require('child_process').spawn;
var csv = require('csv');
var ls = spawn('git', ['log']);
ls.stdout.on('data', function (data) {
parser.write(data);
});
var spawn = require('child_process').spawn;
var csv = require('csv');
var ls = spawn('git', ['log']);
ls.on('close', function (code) {
console.log('exit code ' + code);
});
var parser = csv.parse({ delimiter: '\t' });
@natpen
natpen / python_recursive_fuzzy_float_comparison.py
Last active July 15, 2016 17:21
python recursive fuzzy float comparison
def _is_close(a, b, rel_tol=1e-09, abs_tol=0.0):
return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
def _is_fuzzy_equal(expected, actual):
if isinstance(expected, set):
expected = list(expected)
if isinstance(actual, set):
@natpen
natpen / compose-game-artifacts.pl
Created September 20, 2016 02:01
Quick and dirty perl script I wrote to compose a bunch of game artifact PDFs. Some have "repeat me" modifiers in the filename, which this respects. The goal is just an easily-printable pdf to take to the neighborhood printing shop.
#!/usr/bin/env perl
use strict;
use warnings;
# NOTE: have to use absolute dirpath for ARGV[0] for now
use IO::Dir;
use File::Basename;
my $pdfjoin_input_args = "";