Skip to content

Instantly share code, notes, and snippets.

View witsch's full-sized avatar
💭
204 No Content

Andreas Zeidler witsch

💭
204 No Content
View GitHub Profile
@arrel
arrel / Throttling
Created July 29, 2010 20:38
Throttle bandwidth to individual domains on os x
#!/bin/bash
# if you do not have access to run the script, run "chmod 755 throttling"
# to run enter in terminal "./throttling [speed]"
# full (no throttling)
# fast (300Kbit)
# medium (100Kbit)
# slow (10Kbit)
# wwdc (1Kbit)
# off (blocks connection)
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@kconragan
kconragan / keyrepeat.shell
Last active December 4, 2023 03:40
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@eagleon
eagleon / hircd.py
Created November 24, 2012 10:55
HIrcd – minimal IRC server in Python
#!/usr/bin/python
#
# Very simple hacky ugly IRC server.
#
# Todo:
# - Encode format for each message and reply with ERR_NEEDMOREPARAMS
# - starting server when already started doesn't work properly. PID file is not changed, no error messsage is displayed.
# - Delete channel if last user leaves.
# - [ERROR] <socket.error instance at 0x7f9f203dfb90> (better error msg required)
@jzempel
jzempel / pipdiff.py
Last active December 11, 2015 15:59
View a summary list of package release differences between your local environment and PyPI.
#!/usr/bin/env python
try:
from pip import get_installed_distributions
except ImportError:
from sys import exit
exit("pip not available")
from pkg_resources import parse_version
@mgedmin
mgedmin / convert-zope-svn-to-git.rst
Last active December 13, 2015 16:59
Instructions for converting Zope SVN repositories to Git

Converting Zope SVN repositories to Git

This process has one critical flaw and you probably don't want to use it. git-svn is simpler.

You need:

  • svn-all-fast-export (from the Debian/Ubuntu package of the same name;
@joostrijneveld
joostrijneveld / gpg2qrcodes.sh
Created May 20, 2014 19:43
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
@drocco007
drocco007 / .gitignore
Last active May 27, 2018 09:08
Postgres/WebSocket demo
*.html
@yamionp
yamionp / locustfile.py
Last active March 21, 2024 22:56
Websocket Locust Sample. locustfile and Echo/Chat Server
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import json
import uuid
import time
import gevent