Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
from StringIO import StringIO | |
from django.core.handlers.wsgi import WSGIRequest | |
def fake_get(path='/', user=None): | |
req = WSGIRequest({ | |
'REQUEST_METHOD': 'GET', | |
'PATH_INFO': path, | |
'wsgi.input': StringIO()}) | |
from django.contrib.auth.models import AnonymousUser | |
req.user = AnonymousUser() if user is None else user |
from django import http | |
from django.utils.http import urlquote | |
from django import urls | |
from django.conf import settings | |
from django.utils.deprecation import MiddlewareMixin | |
class AppendOrRemoveSlashMiddleware(MiddlewareMixin): | |
"""Like django's built in APPEND_SLASH functionality, but also works in | |
reverse. Eg. will remove the slash if a slash-appended url won't resolve, |
from geopy import units, distance | |
from mezzanine.core.managers import CurrentSiteManager | |
class GeoManager(CurrentSiteManager): | |
def near(self, latitude=None, longitude=None, distance_range=30): | |
queryset = super(GeoManager, self).get_query_set() | |
if not (latitude and longitude and distance_range): | |
return queryset.none() |
A few months ago I read Drew Neil's article about split windows and the project drawer. It's a great article and I strongly recommend you to go ahead and read it.
The article got me spending some time with netrw and sure enough, it replaced NERDTree. One thing that annoyed me though, was its default for deleting directories. Quoting from :help netrw-delete
.
Deleting/removing files and directories involves moving the cursor to the file/directory to be deleted and pressing "D". Directories must be empty first before they can be successfully removed.
This is not a default I'm happy with, but as with everything else in Vim, netrw is customisable. The default command for deleting local directories is rmdir
which requires the directory to be empty. By setting `g:netrw_localrmdir
var Promise = function(wrappedFn, wrappedThis) { | |
this.then = function(wrappedFn, wrappedThis) { | |
this.next = new Promise(wrappedFn, wrappedThis); | |
return this.next; | |
}; | |
this.run = function() { | |
wrappedFn.promise = this; | |
wrappedFn.apply(wrappedThis); | |
}; |
/** | |
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
* | |
* To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
* the height of element `.foo` —which is a full width and height cover image. | |
* | |
* iOS Resolution Quick Reference: http://www.iosres.com/ | |
*/ | |