Skip to content

Instantly share code, notes, and snippets.

View zeisss's full-sized avatar
🍪
Eat More Chocolate Cookies!

Stephan zeisss

🍪
Eat More Chocolate Cookies!
View GitHub Profile
#!/usr/bin/python
import os.path
import os
import sys
import datetime
class AtomWriter:
def __init__ (self, title, link = "http://localhost"):
self.title = title
self.link = link
#!/usr/bin/ruby
# This script watches modifications on the given directory, using the new
# FSEvents API in Leopard.
# This is a modification from the original watch script provided by Apple's Developer Package
# usage: watch [path/to/watch] [bash cmd to execute]
# by Julius Eckert
"""
Parse the wikipedia dump into tiny parts.
"""
import sys, string
from xml.sax import saxutils, handler, make_parser
#!/bin/sh
# This script performs an automated update of your wordpress blog.
# Please perform still some logical check (dbupdate, blog testing afterwards and so on)
# No error checking included!
WORKDIR=$HOME/public_html
BLOG_DIR=blog
WORDPRESS_URL=http://wordpress.org/latest.zip
#!/bin/sh
URL=url_with_zips
LINKS=`curl $URL | grep -o "http:.*.zip"`
for link in $LINKS
do
FILENAME=`echo $link | grep -o "[A-Za-z0-9_]*.zip" | grep -o "[A-Za-z0-9_]*"`
TIME_LS=`ls --full-time $FILENAME.zip`
if [ -f $FILENAME.zip ]; then
#Copyright Jon Berg , turtlemeat.com
# Modified by Stephan Zeissler, moinz.de
###
# Creates a simple webserver running on port 80
# Every request is logged into a request-<id>.log file containg the path, headers and body
# The response is always 200 and the content of the file response.txt
###
@zeisss
zeisss / gist:1473086
Created December 13, 2011 17:43
Testcase with buggy highlight_code function from CodeIgniter 2.1.0
<?php
/**
* Code Highlighter
*
* Colorizes code strings
*
* @access public
* @param string the text string
* @return string
*/
wp-recentcomments/core.php
Line 186
- $json .= '"reviewerName":"' . $comment->comment_author . '",';
+ $json .= '"reviewerName":"' . htmlentities($comment->comment_author) . '",';
@zeisss
zeisss / producer.js
Created October 22, 2012 22:12
node-amqp worker/producer which print their effectiveness
var amqp = require('amqp'),
util = require('util');
var con = amqp.createConnection();
con.on('ready', function () {
con.exchange('new-users', {type: 'fanout', confirm: true}, function (ex) {
ex.setMaxListeners(100);
var counter = 0,
@zeisss
zeisss / gist:4987149
Created February 19, 2013 15:59
Create a simple png file with fancy colors
package main
import (
"fmt"
"os"
"image"
"image/png"
"image/color"
)
func paintImage(img *image.RGBA) {