Skip to content

Instantly share code, notes, and snippets.

View matthewphiong's full-sized avatar
😻

Matthew Phiong matthewphiong

😻
View GitHub Profile
@matthewphiong
matthewphiong / config
Created November 13, 2011 07:02
Sublime CodeIntel config file
{
"Python": {
"python": '~/.virtualenvs/your_env/bin/python',
"pythonExtraPaths": ['~/.virtualenvs/your_env/lib/python2.6/site-packages',
]
},
}
@matthewphiong
matthewphiong / Procfile
Created November 9, 2011 18:21
Heroku Django Procfile
web: python my_django_app/manage.py collectstatic --noinput; bin/gunicorn_django --workers=4 --bind=0.0.0.0:$PORT my_django_app/settings.py
@matthewphiong
matthewphiong / iframe_oauth.txt
Created October 16, 2011 16:07
Facebook iFrame OAuth URL
https://graph.facebook.com/oauth/authorize?
client_id=...&
redirect_uri=http://apps.facebook.com/yoursuperduperapp/&
type=user_agent&
display=page
@matthewphiong
matthewphiong / iframe_oauth.htm
Created October 16, 2011 16:05
Facebook iFrame OAuth
<script type='text/javascript'>top.location.href = '<theurl>';</script>
@matthewphiong
matthewphiong / canvas_auth.txt
Created October 16, 2011 16:02
Facebook canvas app authorization process
https://graph.facebook.com/oauth/authorize?
client_id=...&
redirect_uri=http://apps.facebook.com/yoursuperduperapp/
@matthewphiong
matthewphiong / base_1col.html
Created August 7, 2011 08:31
Use it anywhere in your template
<ul>
{% for category in categories %}
<li>{{ category.name }}</li>
{% endfor %}
</ul>
@matthewphiong
matthewphiong / settings.py
Created August 7, 2011 08:28
Point it to your TEMPLATE_CONTEXT_PROCESSORS in your settings.py file
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
# ...
"yourapp.context_processors.categories"
)
@matthewphiong
matthewphiong / context_processors.py
Created August 7, 2011 08:25
Django custom context processor function
# The context processor function
def categories(request):
all_categories = Category.objects.all()
return {
'categories': all_categories,
}