cd ~/.config/sublime-text-2/Packages/User/
curl -O https://raw.github.com/gist/1344471/open_file_at_cursor.py
Open keyboard bindings file, and add a line to it
[
...
{ "keys": ["alt+o"], "command": "open_file_at_cursor" } // this one
#!/usr/bin/perl | |
use v5.10; | |
use strict; | |
use warnings FATAL => 'all'; | |
use Mojo::UserAgent; | |
my $latest_url = Mojo::UserAgent->new->get('http://www.sublimetext.com/2') |
cd ~/.config/sublime-text-2/Packages/User/
curl -O https://raw.github.com/gist/1344471/open_file_at_cursor.py
Open keyboard bindings file, and add a line to it
[
...
{ "keys": ["alt+o"], "command": "open_file_at_cursor" } // this one
from django.db.models import Model | |
from itertools import izip | |
def attnames(cls, _cache={}): | |
try: | |
return _cache[cls] | |
except KeyError: | |
_cache[cls] = [f.attname for f in cls._meta.fields] | |
return _cache[cls] |
from django.core.urlresolvers import get_callable | |
from django.template import TemplateDoesNotExist | |
from django.template.loader import BaseLoader | |
from django.template.context import BaseContext | |
from django.conf import settings | |
import jinja2 | |
def monkey_patch_django(): |
from itertools import imap | |
from collections import namedtuple | |
from django.db.models.query import QuerySet, ValuesQuerySet | |
class NamedTuplesQuerySet(ValuesQuerySet): | |
def iterator(self): | |
# Purge any extra columns that haven't been explicitly asked for | |
extra_names = self.query.extra_select.keys() |
# THIS VERSION IS OUTDATED | |
# see .inplace(), .cloning(), ._clone() and .clone() methods of QuerySetMixin | |
# in https://github.com/Suor/django-cacheops/blob/master/cacheops/query.py | |
from django.conf import settings | |
from django.db.models import Model, Manager | |
MUTATING_QUERYSETS = getattr(settings, 'MUTATING_QUERYSETS', False) | |
class QuerySetMixin(object): | |
def __init__(self, *args, **kwargs): |