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 | |
URL="http://downloads.sourceforge.net/project/linuxwacom/xf86-input-wacom/input-wacom/input-wacom-0.20.0.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flinuxwacom%2Ffiles%2Fxf86-input-wacom%2Finput-wacom%2F&ts=`date +%s`&use_mirror=freefr" | |
WORKDIR="/tmp/wacom" | |
TARFILE="$WORKDIR/wacom.tar.bz2" | |
SRCDIR="$WORKDIR/input-wacom-*" | |
SCRIPT=`readlink -e $0` | |
NAME=`basename $SCRIPT` |
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
class attribute(object): | |
""" ``attribute`` decorator is intended to promote a | |
function call to object attribute. This means the | |
function is called once and replaced with | |
returned value. | |
>>> class A: | |
... def __init__(self): | |
... self.counter = 0 | |
... @attribute |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title>Example</title> | |
<script src="uajax.js"></script> | |
</head> | |
<body> | |
<nav> | |
<ul> |
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 | |
# -*- coding: utf-8 -*- | |
import re | |
import lxml, lxml.etree as etree | |
import collections | |
import urllib2 | |
import pprint | |
import logging | |
import cPickle |
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 | |
tar -czf haxe.`haxe -version 2>&1`.tgz /usr/lib/haxe \ | |
/usr/lib/neko \ | |
/usr/lib/libneko.so \ | |
/usr/bin/neko \ | |
/usr/bin/nekoc \ | |
/usr/bin/nekotools \ | |
/usr/bin/haxe \ | |
/usr/bin/haxedoc \ |
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
/* Damn simple hex parser, with utf8 convenience functions */ | |
var utf8={ | |
decode: function(s){ | |
return decodeURIComponent(escape(s)); | |
}, | |
encode: function(s){ | |
return unescape(encodeURIComponent(s)); | |
} | |
}, | |
hex={ |
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 | |
# -*- coding: UTF-8 -*- | |
CONTROL_AUTO = 0x04 | |
CONTROL_MANUAL = 0x14 | |
FAN_MAX = 0x00 | |
FAN_MIN = 0xFF | |
READY_TO_WRITE = 0x02 | |
READY_TO_READ = 0x01 |
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 | |
# -*- coding: UTF-8 -*- | |
''' | |
==== NOTES ==== | |
``` | |
3820TG LAYOUT |
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 calendar | |
def a(year, month, day): | |
year += (month-1) // 12 | |
month = (month-1) % 12 + 1 | |
while day > calendar.monthrange(year, month)[1]: | |
day -= calendar.monthrange(year, month)[1] | |
year += month // 12 | |
month = month % 12 + 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
# myproject/myapp/management/__init__.py | |
from django.db.models.signals import post_syncdb | |
import myapp.models | |
def post_syncdb_handler(sender, **kwargs): | |
''' | |
Handler will be called on every syncdb to set initial data for models if `initial_data` attr | |
is set. |
OlderNewer