Skip to content

Instantly share code, notes, and snippets.

@mt3
mt3 / README
Created March 1, 2013 12:07 — forked from mattweber/README
Use extractDocs.py to parse and index the StackOverflow posts.xml file into an existing index.
Usage: extractDocs.py [options] file
Options:
-h, --help show this help message and exit
-s SERVER, --server=SERVER
ElasticSearch Server
-i INDEX, --index=INDEX
Index name to use
@mt3
mt3 / latency.txt
Created January 8, 2013 14:56 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
--
-- Created by: Sean Korzdorfer
-- Created on: 06/08/12 17:05:27
-- This script incudes code from an example posted by Rob Trew
-- String Library can be obtained at:
-- http://applescript.bratis-lover.net/library/string/
-- Any line which contains a path needs to be edited for the users environment
-- NB: this could easily be edited to append.
#!/usr/bin/env python
# A quick and dirty script to rename a pinboard.in tag.
# I'll probably update this become a proper command line app one day
import urllib2
import pinboard
pinuser = ""
pinpasswd = ""
tell application "Safari" to set recipeurl to URL of front document
tell application "Safari" to set recipetitle to name of front document
set ingredients to (do shell script "curl http://recipedistiller.com/recipe/classify/?recipeurl=" & recipeurl & " | textutil -convert txt -stdin -stdout | grep '.' | sed 's/ • DELETE //g'")
set my text item delimiters to "VIEW RECIPE"
set ingredients to text item 2 of ingredients
set my text item delimiters to "©"
set ingredients to text item 1 of ingredients
@mt3
mt3 / screenr_embed
Created November 10, 2012 07:42
Testing screenr embed
<iframe src="http://www.screenr.com/embed/xhe" width="650" height="396" frameborder="0"></iframe>
@mt3
mt3 / vim-conf-makedist.sh
Created November 9, 2012 10:39 — forked from jeetsukumaran/vim-conf-makedist.sh
Create an Archive of Your Vim Configuration/Setup for Deployment on Other Machines
#! /bin/bash
function usage {
echo "`basename $0` [OPTIONS] [OUTPUT-PREFIX]"
echo "Archives Vim installation."
echo " "
echo "Options:"
echo " --windows ... build distributable for MS Windows system"
echo " -h|--help ... show help"
exit 1
@mt3
mt3 / vim-plugin-installer.sh
Created November 9, 2012 10:39 — forked from jeetsukumaran/vim-plugin-installer.sh
Script to install Vim plugin from its development source
#! /bin/bash
if [[ -z $1 ]]
then
if [[ -z $VIMRUNTIME ]]
then
VIMRUNTIME=$HOME/.vim
fi
else
VIMRUNTIME="$1"
@mt3
mt3 / README.md
Created November 4, 2012 13:22 — forked from agnoster/README.md
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@mt3
mt3 / fabfile.py
Created November 2, 2012 14:12 — forked from reinout/fabfile.py
Fabfile I use for http://reinout.vanrees.org/weblog/2012/10/30/vagrant-osx-how.html, pretty unfiltered work in progress.
from fabric.context_managers import cd
from fabric.contrib.files import exists
from fabric.decorators import hosts
from fabric.decorators import task
from fabric.operations import run
from fabric.operations import sudo
PACKAGES = [
# 'python-mapnik',
'binutils',