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
(function ($) { | |
/** Watch for changes on CSS properties | |
* @param {String} property CSS attribute | |
* @param {String} id Watcher ID, used later for "un-watching" | |
* @param {Function} fn Function to get called when attribute changes. As first argument function receives new value, +this+ inside function refers to element. | |
* @returns {jQuery} | |
*/ | |
$.fn.watch = function (property, id, fn) { | |
id += "Watcher"; |
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
(function () { | |
var r = /{(\w+)}/g; | |
window._ = function (s, d) { | |
if(!s) | |
return ""; | |
if(!d) | |
return s; | |
return s.replace(r, function (c, p) { |
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
// For use with MooTools | |
// Published under MIT license | |
window.Comparable = new Class({ | |
// You class needs to implement "compareTo" method | |
// with same signature: | |
// compareTo: function (other) { | |
// if(this < other) return -1; | |
// if(this > other) return 1; | |
// return 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
import sys | |
import re | |
changes_re = re.compile('^(\-{3}|\+{3}) (.+)\s+\d{4}\-\d{2}-\d{2}.*$') | |
lines = open(sys.argv[0], 'r').readlines() | |
diffs = {} | |
last_path = '' | |
for line in lines: | |
path = changes_re.findall(line) |
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
def generate_slug_from_title | |
self[:slug] = self[:title].downcase.gsub(/[^a-z0-9]/,'-').squeeze('-').gsub(/^\-|\-$/,'') if new_document? | |
end |
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 | |
/* | |
Usage: | |
class Custom_Pdf_Generator extends Pdf_Generator { | |
public drawEntityInRow($order) { | |
$this->drawRow(array( | |
$order->getId(), | |
$order->getCreatedDate(), |
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 windmill | |
from windmill.bin import admin_lib | |
admin_lib.configure_global_settings() | |
windmill.settings['TEST_URL'] = "http://127.0.0.1:3456/" | |
windmill.settings['START_FIREFOX'] = True | |
windmill.settings['JAVASCRIPT_TEST_DIR'] = os.path.join(os.path.dirname(os.path.abspath(__file__)), "tests") | |
admin_lib.setup() |
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 os, shutil, sys | |
from setuptools import find_packages, setup | |
from setuptools.command import sdist | |
from setuptools import Command | |
ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) |
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
# Note: may be Apache 2.0 license-contaminated. | |
# (I haven't checked whether there is a significant license compatibility issue here.) | |
import os, logging | |
import tempfile | |
import windmill | |
from windmill.bin import admin_lib | |
from twisted.internet import defer | |
from foolscap.api import eventually | |
from allmydata.util import log, fileutil |
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
2010-05-14 17:12:23+0200 [-] Log opened. | |
2010-05-14 17:12:23+0200 [-] twistd 10.0.0 (/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python 2.6.5) starting up. | |
2010-05-14 17:12:23+0200 [-] reactor class: twisted.internet.selectreactor.SelectReactor. | |
2010-05-14 17:12:23+0200 [-] foolscap.pb.Listener starting on 51817 | |
2010-05-14 17:12:23+0200 [-] twisted.protocols.ftp.FTPFactory starting on 8021 | |
2010-05-14 17:12:23+0200 [-] Starting factory <twisted.protocols.ftp.FTPFactory instance at 0x207b170> | |
2010-05-14 17:12:23+0200 [-] allmydata.frontends.sftpd.SSHFactory starting on 8022 | |
2010-05-14 17:12:23+0200 [-] Starting factory <allmydata.frontends.sftpd.SSHFactory instance at 0x2091e90> | |
2010-05-14 17:12:23+0200 [-] nevow.appserver.NevowSite starting on 3456 | |
2010-05-14 17:12:23+0200 [-] Starting factory <nevow.appserver.NevowSite instance at 0x76ca80> |
OlderNewer