Skip to content

Instantly share code, notes, and snippets.

View mdornseif's full-sized avatar

Maximillian Dornseif mdornseif

View GitHub Profile
@henrik
henrik / README.markdown
Created February 6, 2009 21:49
Stitch Zoomify tiles into a single image (Ruby + ImageMagick).
application: filehangar
version: live
runtime: python
api_version: 1
handlers:
- url: /remote_api
script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
login: admin
@keeto
keeto / Function.docStringMethod.js
Created April 2, 2010 07:20
Function docStrings in JavaScript
// As a Function method..
(function(){
Function.prototype.docString = function(){
var doc = this[this.toSource ? 'toSource' : 'toString']().match(/['"]\*(.*)\*['"]/);
return (doc) ? doc[1].replace(/^\s+|\s+$/g, '') : '';
};
})();
#!/usr/bin/env python
"""
Credit System for Python Code
This program analyzes Python code with pylint
and calculates a credit for the code, depending
on a miimum required score and the previous run.
"""
import sys
"""
Here's how to run a command from Python piping a string in to stdin and reading the
output back in to another string. It took me way too long to work this out.
"""
from subprocess import Popen, PIPE
output = Popen(
['java', '-jar', 'yuicompressor-2.4.2.jar', '--type=css'],
stdin=PIPE, stdout=PIPE
@lovasoa
lovasoa / README.markdown
Last active January 25, 2020 01:05
The dezoomify script is capable of grabbing images from a webpage containing a Zoomify viewer and automatically stitching the images with javascript and the HTML5 <canvas> element.

Dezoomify

Out of date

This gist is out of date The project now has a true git repository: https://github.com/lovasoa/dezoomify

Reassemble tiles of a zoomify-powered image

This script makes one downloadable image from an image viewable via a flash zoomify interface.

@mdornseif
mdornseif / bejeweled.py
Last active September 26, 2015 19:08
simple bot to play Bejeweled 3 on a Mac for you - something like http://www.youtube.com/watch?v=nhgWLZFn-PM
#!/usr/bin/env python
# encoding: utf-8
"""
bejeweled.py - simple bot to play Bejeweled 3 on a Mac for you
Created by Maximillian Dornseif on 2011-08-09.
"""
import sys
import os
@ambar
ambar / gist:1534274
Created December 29, 2011 14:15 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@techtonik
techtonik / caller_name.py
Created March 21, 2012 19:29
Python - inspect - Get full caller name (package.module.function)
# Public Domain, i.e. feel free to copy/paste
# Considered a hack in Python 2
import inspect
def caller_name(skip=2):
"""Get a name of a caller in the format module.class.method
`skip` specifies how many levels of stack to skip while getting caller
name. skip=1 means "who calls me", skip=2 "who calls my caller" etc.
@mdornseif
mdornseif / gist:2834507
Created May 30, 2012 08:19 — forked from ambar/gist:1534274
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt