Skip to content

Instantly share code, notes, and snippets.

View TehMillhouse's full-sized avatar

Max Wagner TehMillhouse

  • Karlsruhe, Baden-Württemberg, Germany
View GitHub Profile
@TehMillhouse
TehMillhouse / gist:fdaffc4b129283633b37
Last active August 29, 2015 14:21
flask-fucking-sqlalchemy.
#! /usr/bin/env python3
# step 1: create two databases, test and test2
# step 2: execute this
from sqlalchemy import Column, Integer, Enum
from sqlalchemy.schema import CreateSchema
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
@TehMillhouse
TehMillhouse / ovh_watch.py
Created September 1, 2014 12:22
OVH API watcher
#! /usr/bin/env python
import urllib.request
import json
import subprocess
import time
import sys
url ="https://www.ovh.com/js/dedicatedAvailability/availability-data"
ks1_key = "142sk1" # KS-1, the cheapest box they have
@TehMillhouse
TehMillhouse / mirrormirror.py
Created June 23, 2014 21:53
Python DSL recipe
#! /usr/bin/env python
import re
def extract_text(func):
thisfile = open(func.__code__.co_filename)
for _ in range(func.__code__.co_firstlineno):
thisfile.readline()
next_line = thisfile.readline()
func_text = []
@TehMillhouse
TehMillhouse / tweetmenu.hs
Created May 18, 2012 00:59
Haskell KIT Mensa tweetbot based on twitter
{-- Simple KIT mensa page parser. It doesn't rely on the stack-based structure of html, don't get your hopes up. It mainly uses regexes and the functional equivalent of the sledgehammer to get to something that looks like it might be a menu.
The tweets are sent using a perl script called TTYtter, because I couldn't find a twitter/oath-library that would install in cabal --}
import Data.Maybe
import System.Environment
import Network.Curl
import Data.List.Split
import Text.Regex
import Text.Regex.Posix
import Data.List
import System.Process