This file contains hidden or 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 | |
# | |
# Author: Brian Beck <[email protected]> | |
# Usage: watch PATH COMMAND... | |
# | |
# This script watches PATH and runs COMMAND whenever PATH or a descendent | |
# of PATH is modified. COMMAND is everything after the first argument. | |
# | |
# If PATH is "-", then the list of paths comes from standard input. | |
# |
This file contains hidden or 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
ko = {}; | |
ko.Observable = function(value) { | |
this.value = value; | |
this.subscribers = []; | |
}; | |
ko.Observable.prototype.get = function() { | |
return this.value; |
This file contains hidden or 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 inspect | |
class Meta(type): | |
def __init__(cls, name, bases, attrs): | |
for attr, value in attrs.items(): | |
if inspect.isfunction(value): | |
setattr(cls, attr, decorate(value)) | |
for base in bases: | |
for attr in dir(base): | |
value = getattr(base, attr) |
This file contains hidden or 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 re | |
import itertools | |
key_re = re.compile(r'(.*?)(\d*)$') | |
def string_key(s): | |
name, number = key_re.match(s).groups() | |
return (name, number and int(number)) | |
def group_key((i, (name, number))): |
NewerOlder