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 instance_method_lru_cache(*cache_args, **cache_kwargs): | |
''' | |
Just like functools.lru_cache, but a new cache is created for each instance | |
of the class that owns the method this is applied to. | |
''' | |
def cache_decorator(func): | |
@wraps(func) | |
def cache_factory(self, *args, **kwargs): | |
# Wrap the function in a cache by calling the decorator | |
instance_cache = lru_cache(*cache_args, **cache_kwargs)(func) |
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
# | |
# Workaround for unusual PostgreSQL syntax, where functions act like columns. | |
# Recipe provided by zzzeek (Mike Bayer), author of SA. | |
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3594/using-text-in-a-join | |
# https://bitbucket.org/zzzeek/sqlalchemy/issues/3566/figure-out-how-to-support-all-of-pgs#comment-23564706 | |
# | |
from sqlalchemy.ext.compiler import compiles | |
from sqlalchemy.sql import functions | |
from sqlalchemy.sql.elements import ColumnClause |
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 python3 | |
# | |
# 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 program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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> | |
<head> | |
<script src="lib/jquery/jquery.js"></script> | |
<script src="lib/jquery/jquery-ui.js"></script> | |
<script src="lib/jsplumb/jquery.jsPlumb.js"></script> | |
<script> | |
$(function() { | |
jsPlumb.importDefaults({ |
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 | |
# | |
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html) | |
# modified by mike@mikepearce.net | |
# modified by aconway@[redacted] - handle diffs that introduce new files | |
# modified by t.broyer@ltgt.net - fixes diffs that introduce new files | |
# modified by m@rkj.me - fix sed syntax issue in OS X | |
# modified by alex@phatcore.com - search for last SVN commit; allow diff | |
# against non-tracking branch; remove function names on @@ lines. | |
# |