Skip to content

Instantly share code, notes, and snippets.

View mrtazz's full-sized avatar
👨‍🔧
computer plumbing

Daniel Schauenberg mrtazz

👨‍🔧
computer plumbing
View GitHub Profile
#!/usr/bin/env python
#
# Python version of picture downloader script
#
import sys
import urllib
# print usage if too less arguments are supplied
import socket
import time
HOST = 'localhost' # The remote host
PORT = 9999
MSGLEN = 100 * 1000 * 1000
# create the socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# connect to host and port
s.connect((HOST, PORT))
import socket
import time
HOST = 'localhost' # The remote host
PORT = 8888
MSGLEN = 60 * 1000
# create the socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# connect to host and port
s.connect((HOST, PORT))
@mrtazz
mrtazz / carbon.md
Created November 6, 2009 01:50 — forked from defunkt/carbon.md

Vim

autocmd BufWritePre * :%s/\s\+$//e

Emacs

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Textmate

git symbolic-ref HEAD refs/heads/newbranch
rm .git/index
git clean -fdx
<do work>
git add your files
git commit -m 'Initial commit'
is now
git checkout --orphan newbranch
#!/bin/sh
git stash
git symbolic-ref HEAD refs/heads/$1
rm .git/index
git clean -f -d
@mrtazz
mrtazz / license
Created January 27, 2010 11:56 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Daniel Schauenberg
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
#!/bin/sh
#
# Shell script to sync all content of the DropBox
# download folder to the OSX download folder
#
# Best used when attached to a folder action
#
SOURCE="/Users/mrtazz/DropBox/Downloads/"
DESTINATION="/Users/mrtazz/Downloads"
#!/bin/sh
#
# script to backup to a mounted sparseimage
#
# tests if the image is mounted and if not,
# tries to mount it. After backup, the image
# is detached again
#
SOURCE=~/
# Rakefile for building tex file
require "rake/clean"
BASE = "documentname"
TYPE = ".tex"
OUT = ".pdf"
TEXFILE = FileList[BASE+TYPE]
OUTFILE = FileList[BASE+OUT]
BIBTEXCMD = "bibtex"