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
| try: | |
| import sqlparse.format as sqlformat | |
| except ImportError: | |
| def sqlformat(query, **kwargs): | |
| """Monkey patch sqlparse.format if package not installed""" | |
| return query | |
| def debug_query(query, engine): | |
| """Return a parametrized and formated sql query for debugging |
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
| funcs: | |
| python setup.py build_ext --inplace | |
| test: funcs | |
| gcc -L. test.c -o test -lmyfuncs | |
| clean: | |
| rm -f test *.o *.so funcs.c |
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
| #!/usr/bin/env bash | |
| # | |
| # This is sp, the command-line Spotify controller. It talks to a running | |
| # instance of the Spotify Linux client over dbus, providing an interface not | |
| # unlike mpc. | |
| # | |
| # Put differently, it allows you to control Spotify without leaving the comfort | |
| # of your command line, and without a custom client or Premium subscription. | |
| # |
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
| sudo apt-get install libsnappy-dev | |
| wget https://leveldb.googlecode.com/files/leveldb-1.9.0.tar.gz | |
| tar -xzf leveldb-1.9.0.tar.gz | |
| cd leveldb-1.9.0 | |
| make | |
| sudo mv libleveldb.* /usr/local/lib | |
| cd include | |
| sudo cp -R leveldb /usr/local/include |
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
| // I mean, seriously, localStorage is supported even by your mum. How about instead of | |
| // casing the feature out, you give users in-memory (stale) storage instead? | |
| // If they close your application, they deserve to lose data anyway. | |
| // if (!('localStorage' in window)) { | |
| if (!Modernizr.localstorage) { | |
| window.localStorage = { | |
| _data : {}, | |
| setItem : function(id, val) { return this._data[id] = String(val); }, | |
| getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; }, |
NewerOlder