Skip to content

Instantly share code, notes, and snippets.

@pauladam
pauladam / scribe.go
Last active August 29, 2015 14:23
Scribe
// tree
// .
// ├── bin
// │   └── scribe
// └── src
// └── scribe
// └── scribe.go
// $ gb build all; bin/scribe
// Jesse
@pauladam
pauladam / prepare-commit-msg
Created February 18, 2015 21:17
cc recommender
#!/bin/sh
user=`git st | grep 'modified' | cut -d ":" -f 2 | tr -d ' ' | while read fn; do
git --no-pager blame $fn
done | cut -d " " -f 2- | cut -d ')' -f 1 | sed 's/[0-9].*//' | tr -d '(' | sort | uniq -c | sort -n | tail -r | head -n 1 | cut -d ' ' -f 3-`
echo $user
cat $1 > /tmp/commit-msg
echo '\n' > $1
echo "cc: $user" >> $1
cat /tmp/commit-msg >> $1
@pauladam
pauladam / est.json
Created November 21, 2014 17:42
ex. estimates json doc
{
"estimates": {
"post_impressions": 38760.211670480545
},
"id": "135249540516_10153617542060517",
"predictions": {
"post_impressions": {
"series_high": [
[
1387211207,
@pauladam
pauladam / ad-creation-spec.yaml
Last active August 29, 2015 14:07
Ad creation spec
ad-account id: id
page id: id
post id: id
message: message
campaign:
id: id
objective: objective
name: name
@pauladam
pauladam / .mongorc.js
Created May 9, 2013 20:00
Mongo rc file
DBQuery.prototype._prettyShell = true;
/*
*
* Mongo Hacker
* MongoDB Shell Enhancements for Hackers
*
* Tyler J. Brock - 2013
*
@pauladam
pauladam / jr-test.txt
Created April 19, 2013 00:27
Re-opening Java classes from Jruby example
jr-test $: cat jr-test.rb
require 'java'
class java::lang::String
# redefine length to give random values
# instead of the correct one
def length
(rand() * 100).to_i
end
end
@pauladam
pauladam / bandcamp-metal-201304.txt
Created April 18, 2013 21:35
04/2013 bandcamp metal list
http://agnosy.bandcamp.com/
http://antimelodix.bandcamp.com/
http://auralmusic.bandcamp.com/album/sem-skugginn
http://barghestsoulless.bandcamp.com/
http://bhoc.bandcamp.com/album/black-hole-of-calcutta-s-t-2
http://cardinalwyrm.bandcamp.com/
http://celtachor.bandcamp.com/
http://chelseawolfe.bandcamp.com/
http://churchburn.bandcamp.com/
http://coldbluemountain.bandcamp.com/
@pauladam
pauladam / curl-easy-escape-test.c
Last active December 16, 2015 03:59
curl_easy_escape tester.
#include <stdio.h>
#include <curl/curl.h>
int main(int argc, char *argv[])
{
CURL *curl;
CURLcode res;
char *ch;
int length = 0;
@pauladam
pauladam / gruff-numbers-theme.rb
Last active December 15, 2015 12:18
Minimal numbers theme for Gruff graphs
# Ex. http://sht.tl/8dl5S
graph.theme = {
:colors => %w(#3C6D99 #6DA464 #EDAF5E #CB4042 #845288 #8F9291),
:marker_color => '#AAAAAA',
:background_colors => %w(white white)
}
graph.line_width = 2.5
graph.dot_radius = 2
graph.legend_font_size = graph.marker_font_size = 9
@pauladam
pauladam / c-struct-to-julia.jl
Created March 5, 2013 22:37
Example of evaluating c structs from c function calls from Julia. N.B. C struct types are of the OSX variant
type c_passwd
pw_name::Ptr{Uint8}
pw_passwd::Ptr{Uint8}
pw_uid::Int32
pw_gid::Int32
pw_change::Int32
pw_class::Ptr{Uint8}
pw_gecos::Ptr{Uint8}
pw_dir::Ptr{Uint8}
pw_shell::Ptr{Uint8}