Skip to content

Instantly share code, notes, and snippets.

View groovecoder's full-sized avatar

luke crouch groovecoder

View GitHub Profile
Note.AddView = Backbone.View.extend({
el: '#addNote',
noteList: null,
events: {
"click button#btnAdd": "actionSubmit"
},
initialize: function(options){
this.geo = options.geo;
@groovecoder
groovecoder / gist:4199571
Created December 4, 2012 01:03
build gource for directory
PWD=`pwd`
files=`ls`
for file in $files; do
if [ -d $file ]; then
cd $file
echo "git pull"
git pull
cd ..
echo "gource --output-custom-log $file.txt $file"
gource --output-custom-log $file.txt $file
{% set learn_copy = "HTML" %}
{% include 'landing/learn_fineprint.html' %}
def _document_last_modified(request, document_slug, document_locale):
"""Utility function to derive the last modified timestamp of a document.
Mainly for the @condition decorator."""
nk = u'/'.join((document_locale, document_slug))
nk_hash = hashlib.md5(nk.encode('utf8')).hexdigest()
cache_key = DOCUMENT_LAST_MODIFIED_CACHE_KEY_TMPL % nk_hash
try:
last_mod = cache.get(cache_key)
if not last_mod:
doc = Document.objects.get(locale=document_locale,
@groovecoder
groovecoder / gist:4261039
Created December 11, 2012 18:57
document children wtf?
(Pdb) p Document.objects.get(slug='parent')
<Document: [en-US] parent>
(Pdb) p Document.objects.get(slug='child')
<Document: [en-US] child>
(Pdb) p Document.objects.get(slug='child').parent
<Document: [en-US] parent>
(Pdb) p (Document.objects.get(slug='parent') == Document.objects.get(slug='child').parent)
True
(Pdb) p Document.objects.get(slug='parent').children
<django.db.models.fields.related.RelatedManager object at 0xa4d4eac>
MEDIA_ROOT = path('media')
# Absolute path to the directory for the humans.txt file.
HUMANSTXT_ROOT = MEDIA_ROOT
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'
<script>
var states = ['selected', 'analysis', 'story', 'implement', 'review', 'test', 'released'],
ghBugs = [],
bzBugs = [],
kanBugs = {};
_.each(states, function(state) {
kanBugs[state] = [];
});
# See: https://github.com/mozilla/django-browserid/issues/8 (TODO)
BROWSERID_DISABLE_CERT_CHECK = True
BROWSERID_CACERT_FILE = None
requirejs.config({
baseUrl: 'js',
paths: {
'lib': '../lib',
},
shim: {
underscore: {
exports: '_'
}
}
requirejs.config({
baseUrl: 'js',
paths: {
'lib': '../lib',
},
shim: {
underscore: {
exports: '_'
}
}