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
ln -s /usr/local/git/contrib/completion/git-completion.bash /usr/local/etc/bash_completion.d/git | |
(unless of course /usr/local/etc/bash_completion.d/git already exists, in which case you shouldn't be reading this) |
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
First, install it from http://www.sublimetext.com/2 | |
Next, install the package control extension from here: | |
http://wbond.net/sublime_packages/package_control | |
Installation instructions here: http://wbond.net/sublime_packages/package_control/installation | |
Restart Sublime, then hit Shift+Apple+P and search for "Package Control: Install Package" |
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/sh | |
echo "Purging pyc files and empty directories..." | |
# Start from the repository root. | |
cd ./$(git rev-parse --show-cdup) | |
# Delete .pyc files and empty directories. | |
find . -name "*.pyc" -delete > /dev/null 2>&1 & | |
find . -type d -empty -delete > /dev/null 2>&1 & |
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
>>> import sys | |
>>> sys.path.append('/usr/local/google_appengine/') | |
>>> from dev_appserver import fix_sys_path | |
>>> fix_sys_path() | |
>>> from google.appengine.api.croninfo import GrocValidator | |
>>> GrocValidator().Validate('invalidsyntax') | |
Traceback (most recent call last): | |
File "<input>", line 1, in <module> | |
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/croninfo.py", li | |
ne 78, in Validate |
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 bash | |
# file: ~/.virtualenvs/postmkvirtualenv | |
# This hook is run after a new virtualenv is activated. | |
# setup python interpretor and sitepackages | |
# for Sublime Text's SublimeCodeIntel plugin. | |
# codeintel looks in the root of any folder opened via `subl foldername` | |
# for foldername/.codeintel/config | |
# it also looks in ~/.codeintel/config |
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
import six | |
from rest_framework import serializers, exceptions, parsers | |
class PullSerializerMixin(object): | |
pull_model = None | |
def __init__(self, *args, **kwargs): | |
self.pull_model = kwargs.pop('pull_model', self.pull_model) | |
super(PullSerializerMixin, self).__init__(*args, **kwargs) |
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
from toolz import concat | |
def page_iterator(query, page_size=999, **kwargs): | |
''' | |
Returns an iterator over pages of a query. | |
Can be used to work-around the 1000 entity limit in remote_api_shell | |
:params query: The query we're using. | |
:params page_size: The page size to return. | |
:params qwargs: Additional options for fetch_page |
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
""" | |
A simply SublimeText plugin to run a command if matches a selector. | |
Usage example - my `Default (OSX).sublime-mousemap`: | |
[ | |
// for Python we use Anaconda's goto command, for go we use go_guru, | |
// for others we use built-in goto command | |
{ "button": "button1", "modifiers": ["ctrl"], "command": "mousemap_wrap", | |
"press_command": "drag_select", "args": { "commands": [ | |
{ |
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
Function.prototype.notifier = (function () {"use strict"; | |
// (C) WebReflection - Mit Style License | |
function create(callback) { | |
function notifier() { | |
var args = [].slice.call(arguments), output; | |
if (fire(notifier, "before", callback, this, args, null)) { | |
try { | |
output = callback.apply(this, args); | |
} catch(e) { | |
fire(notifier, "error", callback, this, args, e); |
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
class AbstractMixin(object): | |
_classcache = {} | |
@classmethod | |
def contribute(cls): | |
return {} | |
@classmethod | |
def construct(cls, *args, **kwargs): | |
attrs = cls.contribute(*args, **kwargs) |
OlderNewer