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
alias ppjson='python -c "import simplejson, sys; print simplejson.dumps(simplejson.loads(sys.stdin.read()), indent=4)" | pygmentize -f console -l js' |
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 | |
# -*- encoding: utf-8 -*- | |
# | |
# woof -- an ad-hoc single file webserver | |
# Copyright (C) 2004-2009 Simon Budig <simon@budig.de> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. |
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
// Usage | |
// $.dataSpy() | |
// $(document).bind('data.change', function(){console.log('data changed')} ) | |
// $(document).bind('data.unchange', function(){console.log('data unchanged')} ) | |
(function($) { | |
function hash(data, n) { | |
var norm = Math.pow(2, -32); |
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
# -*- coding: utf-8 -*- | |
import timeit | |
class Wildcard(object): | |
"""""" | |
@classmethod | |
def any(cls, *args, **kargs): | |
cmp_func = lambda other: True | |
return Wildcard(cmp_func, *args, **kargs) |
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
m = function() { | |
var getWeek = function(d) { | |
/*getWeek() was developed by Nick Baicoianu at MeanFreePath: http://www.meanfreepath.com */ | |
dowOffset = 1; | |
var newYear = new Date(d.getFullYear(),0,1); | |
var day = newYear.getDay() - dowOffset; | |
day = (day >= 0 ? day : day + 7); | |
var daynum = Math.floor((d.getTime() - newYear.getTime() - (d.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000) + 1; | |
var weeknum; | |
if (day < 4) { |
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
CREATE TABLE `sic_code` ( | |
`code` varchar(32) NOT NULL DEFAULT '', | |
`label` varchar(256) DEFAULT NULL, | |
`parent_code` varchar(32) DEFAULT NULL, | |
`level` int(11) DEFAULT NULL | |
) DEFAULT CHARSET=utf8; | |
INSERT INTO `sic_code` (`code`,`label`,`parent_code`,`level`) | |
VALUES | |
('D','MANUFACTURING',NULL,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
"""See http://techspot.zzzeek.org/?p=31""" | |
from sqlalchemy.interfaces import ConnectionProxy | |
import time | |
import logging | |
logging.basicConfig() | |
logger = logging.getLogger("myapp.sqltime") | |
logger.setLevel(logging.DEBUG) | |
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
(⦿)(⦿) |
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
Default Renault radio unlock code: 1705 |
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
# -*- coding: utf-8 -*- | |
""" | |
Run as a supervisor event listener process. See http://supervisord.org/events.html for more info. | |
An example eventlistener config block looks like: | |
[eventlistener:myeventhandler] | |
command=python /path/to/eventriloquist.py | |
events=EVENT |
OlderNewer