Skip to content

Instantly share code, notes, and snippets.

@walterrenner
walterrenner / punch.py
Last active August 29, 2015 14:11 — forked from koenbollen/punch.py
#!/usr/bin/env python
#
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
#
# This is the client.
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
@walterrenner
walterrenner / gist:c51d09a0fcc4b5269611
Last active August 29, 2015 14:07 — forked from philippeowagner/gist:6794344
delete *.pyc files recursively
find -type f -name "*.pyc" -delete
  • a bigger project
    • first subtask #1234
    • follow up subtask #4321
    • final subtask cc @mention
  • a separate task
@walterrenner
walterrenner / datetime_formatting.py
Last active August 29, 2015 14:06
Common Python datetime formatting strings
# A complete list of available directives id available on:
# https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior
from datetime import datetime
now = datetime.now()
print now.strftime('%d. %b %Y') # 17. Sep 2014
print now.strftime('%d.%m.%y') # 17.09.14
#"%D %d %M %Y" -> 'Wed 09 Jan 2008'
@walterrenner
walterrenner / config.ini
Last active August 29, 2015 14:06 — forked from philippeowagner/config.ini
Install the 3bot worker on your machine
[3bot-settings]
BOT_ENDPOINT=*

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

#!/usr/bin/env python
#!/usr/bin/env ruby
#!/usr/bin/env perl
#!/usr/bin/env bash
#!/usr/bin/env php
#!/usr/bin/env node
#!/usr/bin/env osascript
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
@walterrenner
walterrenner / wtf.py
Created May 16, 2014 22:06
Quick and dirty debugging with Python file operations
# wtf stands for write to file ;)
def wtf(text):
f = open("/tmp/out.log",'a')
f.write(text+'\n')
f.flush()
@walterrenner
walterrenner / keybase.md
Last active August 29, 2015 14:01
keybase

Keybase proof

I hereby claim:

  • I am walterrenner on github.
  • I am walterrenner (https://keybase.io/walterrenner) on keybase.
  • I have a public key whose fingerprint is 5D60 A491 A596 DFA6 1F80 FFDE BDFA 6854 DFC1 2741

To claim this, I am signing this object: