Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🔧
computer plumbing

Daniel Schauenberg mrtazz

👨‍🔧
computer plumbing
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am mrtazz on github.
  • I am mrtazz (https://keybase.io/mrtazz) on keybase.
  • I have a public key whose fingerprint is 2645 C34D 6808 41B6 DEA1 460B 5718 2B38 86AE 7F3C

To claim this, I am signing this object:

View picture_download.py
#!/usr/bin/env python
#
# Python version of picture downloader script
#
import sys
import urllib
# print usage if too less arguments are supplied
View simple_tcp_client.py
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))
View simple_udp_client.py
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))
View carbon.md

Vim

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

Emacs

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

Textmate

View git_create_empty_branch.sh
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
View git_empty_branch.sh
#!/bin/sh
git stash
git symbolic-ref HEAD refs/heads/$1
rm .git/index
git clean -f -d
View 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
View from_dropbox.sh
#!/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"
View backup.sh
#!/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=~/