Skip to content

Instantly share code, notes, and snippets.

@mdaniel
mdaniel / Visualization.java
Created September 26, 2014 22:25
StormTopology to graphviz dot format
package com.radius.kafkastorm;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Map;
import backtype.storm.generated.Bolt;
import backtype.storm.generated.ComponentObject;
import backtype.storm.generated.GlobalStreamId;
# vim:expandtab:sw=4 sts=4
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@mdaniel
mdaniel / Dockerfile
Created November 6, 2014 02:04
Build mesos using a Docker image (for Mac OS X or systems where you don't want the dependencies splattered all over your real machine)
# copy this file and do-apt-stuff.sh into an empty directory
# along with the mesos source tar file, then "docker build ."
FROM ubuntu:14.04
MAINTAINER Matthew L Daniel <mdaniel@gmail.com>
ADD do-apt-stuff.sh /tmp/apt.sh
RUN sh -x /tmp/apt.sh && rm /tmp/apt.sh
ADD mesos-0.20.1.tar.gz /tmp
RUN cd /tmp/mesos-0.20.1 && ./configure --prefix=/opt/mesos-0.20.1 && make && make install && tar cvzf /tmp/mesos-0.20.1-bin.tar.gz -C /opt mesos-0.20.1
# now "docker cp ${container}:/tmp/mesos*bin.tar.gz mesos-0.20.1-bin.tar.gz"
@mdaniel
mdaniel / fake_parse.py
Created December 12, 2014 06:16
Run a fake copy of api.parse.com that is sufficient for demos
#! /usr/bin/env python2.7
from __future__ import absolute_import, print_function
__docformat__ = 'reStructuredText'
import json
import mimetypes
import os
import re
import stat
import time
from uuid import uuid4
@mdaniel
mdaniel / mozconfig_ff_dev
Created February 27, 2015 00:30
mozconfig to build firefox developer edition
export PATH="`brew --prefix ccache`/libexec:$PATH"
. $topsrcdir/browser/config/mozconfig
. $topsrcdir/build/macosx/mozconfig.common
export MOZILLA_OFFICIAL=1
mk_add_options MOZ_BRANDING_DIRECTORY=browser/branding/aurora
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ffdev-dbg
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options AUTOCONF=`brew --prefix autoconf213`/bin/autoconf213
ac_add_options --disable-debug
@mdaniel
mdaniel / keybase.md
Created March 20, 2015 05:21
public keybase assertion

Keybase proof

I hereby claim:

  • I am mdaniel on github.
  • I am mdaniel (https://keybase.io/mdaniel) on keybase.
  • I have a public key whose fingerprint is 8973 A0CA 67FF 5231 5C81 DB47 4742 E0C7 2E58 9FA7

To claim this, I am signing this object:

@mdaniel
mdaniel / cleanoffer.pmt.user.js
Created April 3, 2015 06:18
Calculates the monthly payment, with taxes and HOA if applicable, for a listing on cleanoffer.com. This script is San Francisco Ready(tm) in that it will show you the list price, as well as the actual price (estimated at 20% over list).
// ==UserScript==
// @name show mortgage cost on cleanoffer
// @author mdaniel
// @version 1.7.0
// @namespace http://MatthewDaniel.com/greasemonkey/cleanoffer.com
// @include http://re.cleanoffer.com/b/zephyr/mybriefcase/viewnewmatch.htm*
// @match http://re.cleanoffer.com/b/zephyr/mybriefcase/viewnewmatch.htm*
// @include http://re.cleanoffer.com/b/zephyr/listing.htm*
// @match http://re.cleanoffer.com/b/zephyr/listing.htm*
// ==/UserScript==
2015-05-27 15:36:49 -0700
hack/make.sh
dynbinary
# WARNING! I don't seem to be running in the Docker container.
# The result of this command might be an incorrect build, and will not be
# officially supported.
#
# Try this instead: make all
@mdaniel
mdaniel / Vagrantfile
Created July 7, 2015 03:39
Vagrantup pg_shard
# -*- mode: ruby -*-
# vi: set ft=ruby sw=2 sts=2:
# this controls which are implictly trusted by pg
my_subnet = "192.168.33.0/24"
host_by_ip = {
"192.168.33.10" => "pg-master",
"192.168.33.11" => "pg-slave-1",
"192.168.33.12" => "pg-slave-2",
}
@mdaniel
mdaniel / fetch_confluence.sh
Created July 24, 2015 01:18
Mirror a Confluence repo, one dir at a time
#! /bin/bash
set -eu
: '
`http://<confluenceURL>/plugins/servlet/confluence/default`
For example if your Confluence URL is
`http://foo.atlassian.net/wiki`
you would enter:
`http://foo.atlassian.net/wiki/plugins/servlet/confluence/default`
This script is designed to action "index.html", so to bootstrap the