This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import fileinput | |
import re | |
for line in fileinput.input(inplace=True): | |
if fileinput.isfirstline(): | |
function = False | |
interface = False | |
class_name = "" | |
comment = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import route, put, run, request, response | |
from time import time | |
from hashlib import md5 | |
import json | |
from os import makedirs, walk, stat | |
from os.path import dirname | |
from mimetypes import guess_type | |
from datetime import datetime | |
@route('/') | |
def index(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MySQLdb | |
import unicodedata | |
mysql_cred = {'host':'localhost', 'user':'root', 'passwd':'new-password', 'db':'test'} | |
conn_latin1 = MySQLdb.connect(**mysql_cred) | |
c_latin1 = conn_latin1.cursor(MySQLdb.cursors.DictCursor) | |
c_latin1.execute("SELECT id FROM texts") | |
ids = [] | |
while 1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
vimdiff $1 $2 $3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
vimdiff $6 $7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess | |
import fileinput | |
if False: | |
revs = [] | |
for line in subprocess.check_output(['svn', 'merge', '../branches/dev', '--dry-run']).split('\n'): | |
if line.startswith('--- Merging'): | |
s = line.split(' ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dmdbtf = fopen('/home/meeuw/log.txt', 'w'); | |
function dmdbt($bt) { | |
global $dmdbtf; | |
if (isset($bt[0]['class']) && isset($bt[1]['class'])) { | |
fwrite($dmdbtf, "\"{$bt[1]['class']} {$bt[1]['function']}\" -> ". | |
"\"{$bt[0]['class']} {$bt[0]['function']}\"\n" | |
); | |
fflush($dmdbtf); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import re | |
CANTSMUDGE = '<?php //cantsmudgethis ?>' | |
class RewStream: | |
def __init__(self, holdlines=0): | |
self.holdlines = holdlines | |
self.current = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @match http://www.carddreams.nl/* | |
// ==/UserScript== | |
// a function that loads jQuery and calls a callback function when jQuery has finished loading | |
function addJQuery(callback) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
script.textContent = "window.$=jQuery.noConflict(true);(" + callback.toString() + ")();"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | |
# ex: ts=8 sw=4 sts=4 et filetype=sh | |
if getargbool 0 rd.loop; then | |
info "Mount /sysroot as r/w" | |
mount -o remount,rw /sysroot | |
mkdir /run/initramfs/loop | |
mount -o bind /sysroot /run/initramfs/loop | |
umount /sysroot |