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
""" | |
Attempting to set session variables directly from TestCases can | |
be error prone. Use this super-class to enable session modifications | |
from within your tests. | |
Usage | |
----- | |
class MyTest(SessionEnabledTestCase): |
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
App.ExercisesNewController = App.ObjectController.extend | |
create: -> | |
situation_id = $('#id_situation').val() | |
situation = App.Situation.find(situation_id) | |
@content.set 'situation', situation | |
rows = situation.get('rows') | |
@content.save().then => | |
for i in [1..8] | |
hand = App.Hand.createRecord |
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
# Sharing Django Users and Sessions Across Projects | |
By Dustin Farris on 22 Feb 2012 | |
This document describes how to share users created using Django's auth system with other | |
Django projects. It is not a hack; it simply makes use of the database router and | |
middleware system that Django comes with out of the box. | |
## Introduction |
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 ast | |
from django.contrib.contenttypes.models import ContentType | |
from rest_framework import serializers | |
from addresses.serializers import AddressSerializer | |
from users import models | |
class AddressesField(serializers.RelatedField): |
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
scriptencoding utf-8 | |
" Powerline setup | |
set guifont=Droid\ Sans\ Mono\ for\ Powerline:h15 | |
set laststatus=2 | |
" MVim options | |
set guioptions-=T " Removes top toolbar | |
set guioptions-=r " Removes right hand scroll bar | |
set go-=L " Removes left hand scroll bar |
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
color codeschool | |
set guifont=Monaco:h12 | |
let g:NERDTreeWinPos = "right" | |
set guioptions-=T " Removes top toolbar | |
set guioptions-=r " Removes right hand scroll bar | |
set go-=L " Removes left hand scroll bar | |
autocmd User Rails let b:surround_{char2nr('-')} = "<% \r %>" " displays <% %> correctly | |
:set cpoptions+=$ " puts a $ marker for the end of words/lines in cw/c$ commands | |
let g:syntastic_python_checkers=['pylint'] |
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
# Put user (homebrew) installations ahead of system installations | |
export PATH="/usr/local/bin:$PATH" | |
# Use local node binaries before global binaries | |
export PATH="./node_modules/.bin:$PATH" | |
# Use colors for terminal output | |
export CLICOLOR=1 | |
# Initialize virtualenvwrapper |
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
# Add RVM to PATH for scripting | |
PATH=$PATH:$HOME/.rvm/bin | |
alias run='./manage.py runserver 0.0.0.0:8000' | |
alias mkenv='mkvirtualenv `basename $PWD` && setvirtualenvproject && add2virtualenv app' | |
alias pycclean='find . -name "*.pyc" -exec rm {} \;' | |
alias dsh='./manage.py shell' | |
alias sm='./manage.py schemamigration' |
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 User(AbstractUser): | |
pass | |
class UserSerializer(serializers.ModelSerializer): | |
username = serializers.EmailField() | |
class Meta: | |
model = User | |
OlderNewer