brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import urllib2 | |
| gh_url = 'https://api.github.com' | |
| req = urllib2.Request(gh_url) | |
| password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
| // Lack of tail call optimization in JS | |
| var sum = function(x, y) { | |
| return y > 0 ? sum(x + 1, y - 1) : | |
| y < 0 ? sum(x - 1, y + 1) : | |
| x | |
| } | |
| sum(20, 100000) // => RangeError: Maximum call stack size exceeded | |
| // Using workaround |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
| <VirtualHost *> | |
| ServerName example.com | |
| WSGIDaemonProcess www user=max group=max threads=5 | |
| WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
| <Directory /home/max/Projekte/flask-upload> | |
| WSGIProcessGroup www | |
| WSGIApplicationGroup %{GLOBAL} | |
| Order deny,allow |
Inspired by https://gist.github.com/havenwood/4724778.
# for topaz
class String
def _rjust(x,c=" ")| import win32clipboard | |
| formats = {val: name for name, val in vars(win32clipboard).items() if name.startswith('CF_')} | |
| def format_name(fmt): | |
| if fmt in formats: | |
| return formats[fmt] | |
| try: | |
| return win32clipboard.GetClipboardFormatName(fmt) | |
| except: |
| # Generate a 440 Hz square waveform in Pygame by building an array of samples and play | |
| # it for 5 seconds. Change the hard-coded 440 to another value to generate a different | |
| # pitch. | |
| # | |
| # Run with the following command: | |
| # python pygame-play-tone.py | |
| from array import array | |
| from time import sleep |
| #!/usr/bin/perl | |
| use Mysql; | |
| use strict; | |
| use vars qw($school_name); | |
| use vars qw($pass); | |
| require "./cgi-lib.pl"; |
| """ | |
| A simple proxy server. Usage: | |
| http://hostname:port/p/(URL to be proxied, minus protocol) | |
| For example: | |
| http://localhost:8080/p/www.google.com | |
| """ |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"