View simple_args_parsing.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# a simple way to parse shell script arguments | |
# | |
# please edit and use to your hearts content | |
# | |
ENVIRONMENT="dev" |
View git-branch-status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moved to github --> https://github.com/bill-auger/git-branch-status/ |
View strange_bash_feature.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COUNT=1 | |
FILE=$0 | |
# run this script with bash | |
# i bet you can't predict the outcome | |
function printsleep { | |
echo COUNT=$(( COUNT++ )) | |
echo printsleep >> $FILE |
View strnchr.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
/* | |
Returns a pointer to the first occurrence of character in the C string str. | |
The terminating null-character is considered part of the C string. Therefore, | |
it can also be located to retrieve a pointer to the end of a string. | |
@param str the string to be searched | |
@param len the number of characters to search | |
@param character the character to search for |
View minimal_cidr_list.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
from ipaddress import IPv4Network | |
from collections import defaultdict | |
if __name__ == "__main__": | |
inputs = defaultdict(list) | |
for line in sys.stdin: | |
cidr = line.strip().decode('utf-8') |
View misspell_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run https://github.com/client9/misspell linter | |
SCRIPT=$(readlink -f "$0") | |
SCRIPTPATH=`dirname "$SCRIPT"` | |
# get to repo root | |
cd $SCRIPTPATH/../../.. | |
WRITE="" | |
while [ "$1" != "" ]; do | |
PARAM=${1%%=*} |
View svg_abs_to_rel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decimal import Decimal | |
from xml.dom import minidom | |
import sys | |
import os | |
import re | |
import simplejson as json | |
import string | |
import tornado.options | |
import logging |
View iphone_messages_dump.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright Jehiah Czebotar 2013 | |
# http://jehiah.cz/ | |
import tornado.options | |
import glob | |
import os | |
import sqlite3 | |
import logging | |
import datetime | |
import csv |
View simulate_memcached.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
""" | |
This is a test script to simulate a memcached instance on a server | |
that has gone south and is accepting connections, but generally not | |
responding. | |
The goal of this script is to help test/develop correct client | |
side settings for timeouts/failure scenarios |
View nsq_testing.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nsqutils | |
import ( | |
"sync" | |
"time" | |
nsq "github.com/nsqio/go-nsq" | |
) | |
// Producer is an interface that nsq.Producer fulfills |
NewerOlder