Skip to content

Instantly share code, notes, and snippets.

set-option -g default-terminal "screen-256color"
set-option -g prefix C-z
unbind-key C-b
bind-key z send-prefix
bind-key C-z last-window
bind r source-file ~/.tmux.conf
bind c new-window -c "#{pane_current_path}"
set -g base-index 1
@wraithan
wraithan / watch.sh
Created August 5, 2014 22:02
I like how easy it is to build simple bash scripts. I take this and then use `nodemon --exec "./watch.sh"` and basically have CI locally on my system.
#!/bin/bash
if make unit; then
osx-notifier --type 'pass' --title "nodejs-agent" --message 'unit tests';
else
osx-notifier --type 'fail' --title "nodejs-agent" --message 'unit tests';
fi
if make integration; then
osx-notifier --type 'pass' --title "nodejs-agent" --message 'integration tests';
else
@wraithan
wraithan / test.js
Created July 27, 2014 03:45
Test every second looking for a sample every 6 minutes on average
var hard_min = 60
var target = 360
var hard_max = target*2
var samples = 1e7
function test(multiplier) {
var data = []
var period = target * multiplier
var min = hard_max
var max = hard_min
ok 1166 NR URL utilities determining whether an HTTP status code is an error should mark a request asserting teapotness as an error
ok 1167 NR URL utilities determining whether an HTTP status code is an error should mark a request with timed-out auth as an error
ok 1168 NR URL utilities determining whether an HTTP status code is an error should mark a request for enhanced calm (brah) as an error
ok 1169 NR URL utilities copying parameters from a query hash shouldn't throw on missing configuration
ok 1170 NR URL utilities copying parameters from a query hash shouldn't throw on missing source
ok 1171 NR URL utilities copying parameters from a query hash shouldn't throw on missing destination
ok 1172 NR URL utilities copying parameters from a query hash should copy parameters from source to destination
ok 1173 NR URL utilities copying parameters from a query hash shouldn't copy ignored parameters
ok 1174 NR URL utilities copying parameters from a query hash shouldn't overwrite existing parameters in destination
@wraithan
wraithan / main.c
Created June 6, 2014 23:59
push data from c
#include <sys/socket.h>
#include <strings.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <unistd.h>
int my_send(int socket, char* message) {
if (send(socket, message, strlen(message), 0) < 0) {
puts("failure");
null < 1
// true
null < 0
// false
null == 0
// false
null > 0
// false
null > -1
// true

Keybase proof

I hereby claim:

  • I am wraithan on github.
  • I am wraithan (https://keybase.io/wraithan) on keybase.
  • I have a public key whose fingerprint is 3AA3 F784 1CB1 6711 FB69 1172 8E2F B742 BBB3 7689

To claim this, I am signing this object:

------------
|end |home|
------+-----+-----
|back |shift|alt |
|space| |----|
| | |ctrl|
------------------
-------------
|pgup |pgdn |
@wraithan
wraithan / cbv.py
Created January 8, 2014 22:13
Stab at moving to CSV
import calendar
import json
from collections import defaultdict
from django.http.response import (HttpResponse, HttpResponseBadRequest,
HttpResponseForbidden)
from django.db.models import Avg, Min, Max, Sum
from django.views.generic.base import View
from ordereddict import OrderedDict
ethernet: 10.0.0.1
wifi: 192.168.0.1
localhost: 127.0.0.1
server listening on 192.168.0.1:
ethernet: fail
wifi: success
localhost: fail
server listening on 0.0.0.0: