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
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
@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

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