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
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
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
| """Decorator to quickly add statsd (graphite) instrumentation to Celery | |
| task functions. | |
| With some slight modification, this could be used to instrument just | |
| about any (non-celery) function and be made abstract enough to customize | |
| metric names, etc. | |
| Stats reported include number of times the task was accepted by a worker | |
| (`started`), the number of successes, and the number of times the task | |
| raised an exception. In addition, it also reports how long the task took |
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 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Monkey Patch for tornado | |
| """ | |
| import cProfile as profile | |
| from tornado.options import options | |
| from tornado.web import HTTPError |
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 | |
| """ | |
| Use pip to get a list of local packages to check against one or more package | |
| indexes for updated versions. | |
| """ | |
| import pip | |
| import sys, xmlrpclib | |
| from cStringIO import StringIO | |
| from distutils.version import StrictVersion, LooseVersion |
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
| # Show current git branch or SVN subfolder in prompt. | |
| GREEN="\[\033[0;32m\]" | |
| LIGHT_GREEN="\[\033[1;32m\]" | |
| GRAY="\[\033[1;30m\]" | |
| LIGHT_BLUE="\[\033[1;34m\]" | |
| LIGHT_GRAY="\[\033[0;37m\]" | |
| COLOR_OFF="\[\e[0m\]" | |
| function prompt_func() { | |
| PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | |
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
| defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' |
NewerOlder