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
# Python *built-ins* | |
import datetime | |
import os | |
import time | |
# Pip-installed *Python* libraries | |
import boto | |
import requests | |
# Django *built-ins* |
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 django.contrib.auth.models import User | |
from tastypie import fields | |
from tastypie.resources import ModelResource | |
from profiles.models import Profile | |
class UserResource(ModelResource): | |
# Assumes a OneToOneField on the ``Profile``. | |
bio = fields.CharField(attribute='profile__bio', blank=True, default='', readonly=True) | |
website = fields.CharField(attribute='profile__website', blank=True, default='', readonly=True) |
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 operator | |
from haystack.query import SearchQuerySet, SQ | |
stuff = ['foo', 'bar', 'baz'] | |
the_filters = reduce(operator.or_, [SQ(tag=tag_name) for tag_name in stuff]) | |
sqs = SearchQuerySet().filter(the_filters) |
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
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) | |
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 | |
# Enable the 2D Dock | |
defaults write com.apple.dock no-glass -bool true | |
# Make Dock icons of hidden applications translucent | |
defaults write com.apple.dock showhidden -bool true | |
# Disable menu bar transparency |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>author</key> | |
<string>Daniel Lindsley</string> | |
<key>name</key> | |
<string>My Twilight</string> | |
<key>settings</key> | |
<array> |
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/bash | |
# This hook is run after every virtualenv is activated. | |
export OLD_GEM_HOME=$GEM_HOME | |
export GEM_HOME=$VIRTUAL_ENV/gems/ | |
export GEM_PATH= | |
export PATH=$VIRTUAL_ENV/gems/bin:$PATH |
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 oauth2 import Error | |
from django.utils.translation import ugettext as _ | |
from tastypie.authentication import Authentication | |
from oauth_provider.utils import initialize_server_request, send_oauth_error, get_oauth_request | |
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES | |
from oauth_provider.store import store, InvalidTokenError |
NewerOlder