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
| angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) { | |
| $httpProvider.responseInterceptors.push([ | |
| '$q', '$templateCache', 'activeProfile', | |
| function($q, $templateCache, activeProfile) { | |
| // Keep track which HTML templates have already been modified. | |
| var modifiedTemplates = {}; | |
| // Tests if there are any keep/omit attributes. | |
| var HAS_FLAGS_EXP = /data-(keep|omit)/; |
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
| <?php | |
| /* | |
| Protocol details: http://amp-protocol.net/ | |
| Full client implementation of the protocol: http://twistedmatrix.com/trac/browser/sandbox/jerub/ampclient.php | |
| */ | |
| require('ampclient.php'); | |
| // Create an AMP client | |
| $client = new AMP($host, $port); |
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
| # redis-server - Redis Datastore Server | |
| # | |
| # Redis is a key value in memory persistent datastore | |
| # . Assumes certain config options: | |
| # | |
| # * bind 127.0.0.1 | |
| # * daemonize yes | |
| # * pid, data, log, and config directories are expected to live in: /var/run/redis/redis.pid, /var/lib/redis/ , /var/log/redis/, /etc/redis/redis.conf | |
| description "Redis server" |
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
| # Combine results from separate Django querysets linearly | |
| from itertools import chain | |
| good_ids = (2,8,13,11,22,42,56,61,46) | |
| good = Money.filter(id__in=good_ids).order_by('id') | |
| bad = Money.exclude(id__in=good_ids) | |
| # Throwing good money after bad | |
| money = list(chain(bad, good)) |
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
| # Assumes user/pass of admin/aaa, md5 hashed in the server password file | |
| def logincram(user='admin', password='47bce5c74f589f4867dbd57e9ca9f808', port=2025): | |
| s = smtplib.SMTP(host='localhost', port=port) | |
| s.ehlo() | |
| s.esmtp_features["auth"] = 'CRAM-MD5' | |
| s.debuglevel = 5 | |
| s.login(user, password) | |
| def loginplain(user='admin', password='aaa', port=2025): |
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 python | |
| """ | |
| mate_pdb.py | |
| Execute a script file in the debugger using breakpoints set | |
| via Bookmarked Lines in TextMate. | |
| Intended usage is to call from within a TextMate Command in | |
| your Python bundle |