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
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
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
.directive('addRemoveUsers', ['$state', function($state) { | |
return { | |
link: function(scope, element, attrs) { | |
element.on('click', function() { | |
scope.$apply(function() { | |
if (scope.circle.all_circle) { | |
var msg = [ | |
"An admin group's all circle contains all its users.", | |
"To remove users from this circle, please remove them", | |
"from the admin group." |
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
/* http://nanobar.micronube.com/ || https://github.com/jacoborus/nanobar/ MIT LICENSE */ | |
var Nanobar = (function () { | |
'use strict'; | |
var addCss, animation, transEvent, createBar, Nanobar, | |
css = '.nanobar{float:left;width:100%;height:4px;z-index:9999;}.nanobarbar{width:0;height:100%;float:left;transition:all .3s;}', | |
head = document.head || document.getElementsByTagName( 'head' )[0]; | |
// Create and insert style element in head if not exists |
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
total = 0 | |
RATE_OF_RETURN = 0.10 | |
for i in range(1, 11, 2): | |
total += 23000 * ((1 + RATE_OF_RETURN) ** i) | |
# total in Roth IRA after 5 years | |
print total | |
# just earnings | |
print total - (5 * 23000) |
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
(function() { | |
"use strict"; | |
angular.module('JobListingApp') | |
.config(['$routeProvider', function($routeProvider) { | |
// ListingRoute "class" to ensure that all routes have | |
// current data in JobListings before they execute a route's controllers | |
var ListingRoute = function(params) { | |
angular.extend(this, params); | |
}; |
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
{ | |
"01": { | |
"abbreviation": "AL", | |
"name": "Alabama" | |
}, | |
"02": { | |
"abbreviation": "AK", | |
"name": "Alaska" | |
}, | |
"03": { |
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
TODO |
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
STATE_TZ_MAP = { | |
'AK': 'US/Alaska', | |
'AL': 'US/Central', | |
'AR': 'US/Central', | |
'AS': 'US/Samoa', | |
'AZ': 'America/Phoenix', # Arizona is weird! | |
'CA': 'US/Pacific', | |
'CO': 'US/Mountain', | |
'CT': 'US/Eastern', | |
'DC': 'US/Eastern', |