- Bytes and Blobs by David Flanagan
- Conference Wifi Redux by Malte Ubi
- Sashimi - https://github.com/cramforce/Sashimi
- Run Your JS everywhere with Jellyfish by Adam Christian - http://jelly.io Project
- Fighting Crime and Kicking Apps with Batman.js by Nick Small
- Hello Jo by Dave Balmer - Project - http://joapp.com
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
def override_urls(self): | |
return [ | |
url(r'^offer/(?P<offer_id>\d+)/(?P<resource_name>%s)/(?P<offer_transaction_id>\d+)/$' % self._meta.resource_name, self.wrap_view('get_offer_transaction_id'), name="api_get_offer_transaction_id"), | |
url(r'^offer/(?P<offer_id>\d+)/(?P<resource_name>%s)/$' % self._meta.resource_name, self.wrap_view('get_offer_transaction'), name="api_get_offer_transaction"), | |
] |
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
patterns = [ | |
(r'^(?P<resource_name>offer)/(?P<pk_list>\w[\w/;-]*)/$', someview), | |
(r'^offer/(?P<offer_id>\d+)/(?P<resource_name>transaction)/$', someotherview), | |
(r'^offer/(?P<offer_id>\d+)/(?P<resource_name>transaction)/(?P<offer_transaction_id>\d+)/$', someview), | |
] | |
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
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
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.models import Model | |
from django.auth.models import User | |
class Achievement(Model): | |
user = models.foreignKey(User) | |
created_at = models.DateTimeField() | |
def fetch_achievement(self): | |
#do some achievement logic in here |
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.auth.models import User | |
from django.shortcuts import get_object_or_404 | |
#this view would be publicly accessable | |
def hook(request, username=None): | |
user = get_object_or_404(User, username=username) #cant remember the syntax | |
if not isinstance(User, user): | |
return user #this returns a 404 | |
#now we know what user we are dealing with |
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 Container(models.Model): | |
children = models.OneToManyField(Child) #I know this one to many field does not exist | |
class Child(models.Model): | |
random_field = models.IntegerField(default=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
#in your forms | |
#if you are using django.contrib.auth.views.login | |
#pass EmailAuthenticationForm to the authentication_form argument. | |
class EmailAuthenticationForm(AuthenticationForm): | |
""" | |
Extends the standard django AuthenticationForm, to support 75 character | |
usernames. 75 character usernames are needed to support the EmailOrUsername | |
auth backend. | |
""" |
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
# Usage: show <local-port> <subdomain> | |
function show() { | |
DOMAIN=".tekacs.com" | |
REMOTE="$2$DOMAIN" | |
ssh -tR 1080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:1080 localhost" | |
} |
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
#copy target folder or file to public folder in your dropbox | |
function dropshare() | |
{ | |
cp -Rv $1 ~/Dropbox/Public/ | |
} |