This file contains hidden or 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
if 'test' in sys.argv: | |
DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3' |
This file contains hidden or 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.template import defaultfilters | |
from django.utils import timezone | |
localtime = timezone.template_localtime(my_date) | |
template_style_date = defaultfilters.date(localtime, settings.DATETIME_FORMAT) | |
# settings.DATETIME_FORMAT is the Django default by default, but can be overwritten in your settings.py |
This file contains hidden or 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
var renderer2 = angular.module('pak', ['pak.filters', 'pak.services',...]); | |
renderer2.run(['$rootScope', function($rootScope) { | |
$rootScope.some_function = function() { | |
console.log('HELLO WORLD!!!!'); | |
}; | |
// function is available in all CHILD SCOPES | |
}]); |
This file contains hidden or 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
/* | |
Updates An Accordion's Icon. | |
Just include: | |
<span class="accordion-icon">+</span> | |
To your accordion-toggle! | |
*/ | |
"use strict"; | |
$(function() { |
This file contains hidden or 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 | |
grep -ri $1 $2 --exclude-dir={lib,css,stylesheets} --exclude=*{app.min.js,app.js,templates.js} --color |
This file contains hidden or 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
<div ng-repeat="group in groups"> | |
<div data-group={{group.id}} group-droppable>{{group.name}}</div> | |
<div ng-repeat="pak in paks" draggable> | |
<!-- ... pak display --> | |
</div> | |
</div> | |
<script> | |
<!-- angular directive boilerplate --> |
This file contains hidden or 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
<!doctype html> | |
<html xmlns:ng="http://angularjs.org"> | |
<script src="http://code.angularjs.org/angular.js"></script> | |
<body> | |
<div id="angular-free"> | |
I am a completely inert {{double-curly}}. Angular can't touch this! | |
Free to do whatever jQuery craziness strikes your fancy. | |
Or hell, add a backbone app here. | |
</div> | |
<!-- don't add ng-app="angular-app" - that's what kicks off auto-bootstrapping!!! --> |
This file contains hidden or 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
watch: { | |
scripts: { | |
files: [js + '/**/*.js'], | |
tasks: ['concat:js'], | |
}, | |
handlebars: { | |
files: ['templates/**/*.hbs'], | |
tasks: ['handlebars'], | |
}, | |
css: { |
This file contains hidden or 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
# where user_roles is an array filled with strings | |
# option's value and text will both be role | |
<select ng-model="selectedUser.role" ng-options="role for role in user_roles"> | |
</select> | |
# where supported_languages is an array filled with objects | |
# option's value will be language.code and option's text will be language.label | |
<select ng-model="selectedUser.language_code" |
This file contains hidden or 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
<!--[if lte IE 8]> | |
{% if DEVELOPMENT %} | |
<script type="text/javascript" src="https://getfirebug.com/releases/lite/1.3/firebug-lite.js"></script> | |
{% endif %} | |
<![endif]--> |