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/env python | |
# This module provides a 'with' for using curses in Python. | |
# from: http://www.finalcog.com/python-with-curses-with_curses | |
from __future__ import with_statement | |
import curses | |
class WithCurses(object): | |
""" |
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
#include <assert.h> | |
#include <stdarg.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
enum type { | |
NIL, |
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
// Ported from http://blog.inspirit.ru/wp-content/uploads/qsort/Main.as | |
function flashSort( array ) { | |
var a = array, n = array.length; | |
var i = 0, j = 0, k = 0, t, hold, flash; | |
var m = ~~( n * 0.125 ); | |
var l = [], anmin = a[ 0 ], nmax = 0, nmove = 0; | |
while ( ++i < n ) { |
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
/* | |
Add a bookmark to this | |
javascript:(function(){var c=document.getElementsByTagName("link");for(var d=0;d<c.length;d++){var a=c[d];if(a.rel=='stylesheet'||a.type=="text/css"){var e="css_buster_"+Math.floor(Math.random()*1000000000);var g=a.href.split("?",2);var f;if(g.length>1){var b=g[1].indexOf("&")==-1;if(b){f=e}else{f=g[1]+"&"+e}}else{f=e}a.href=g[0]+"?"+f}}})(); | |
*/ | |
(function() { | |
var links = document.getElementsByTagName('link'); | |
for (var i = 0; i < links.length; i++) { | |
var l = links[i]; | |
if (l.rel == 'stylesheet' || l.type == 'text/css') { |
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 colorsys | |
def get_dominant_color(image): | |
""" | |
Find a PIL image's dominant color, returning an (r, g, b) tuple. | |
""" | |
image = image.convert('RGBA') | |
# Shrink the image, so we don't spend too long analysing color |
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 | |
gunicorn="/usr/local/bin/gunicorn" | |
prog="dev.maroo.info" | |
PROJECT_HOME="/home/maroo/sites/$prog" | |
pid="/var/lock/$prog" | |
RETVAL=0 | |
start() { |
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 | |
// ere2pcre -- a drop-in replacement for ereg* functions | |
// written by Kang Seonghoon <[email protected]>. | |
// | |
// this library is dedicated to the public domain. for the jurisdictions that | |
// does not recognize the public domain, CC0 1.0 Universal Public Domain | |
// Dedication applies. | |
function _ere2pcre_escape($c) { | |
if ($c == "\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
# problem: http://club.filltong.net/codingdojo/27611 | |
# coded by jong10 | |
import unittest | |
# infix to prefix(s-expression) | |
# modified from http://news.ycombinator.com/item?id=284954 | |
def parse(s): | |
for operator in ["+-", "*/"]: | |
depth = 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
#!/usr/bin/python | |
# coding: utf-8 | |
import smtplib | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEText import MIMEText | |
import email.Charset | |
GMAIL_ID = '[email protected]' | |
GMAIL_PW = 'password' |
OlderNewer