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
require([ | |
'dojox/dtl', | |
'dojox/dtl/Context', | |
'dojox/dtl/filter/strings' | |
], function (dtl) { | |
var tplString = 'Hello {{ name|title }}! ' + | |
'seu nome tem {{ name|wordCount }} palavras!' | |
var tpl = new dtl.Template(tplString); |
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 profile = { | |
basePath: "./", | |
releaseDir: "./dist/", | |
mini: true, | |
optimize: 'closure', | |
layerOptimize: 'closure', | |
cssOptimize: 'comments', | |
stripConsole: 'all', | |
selectorEngine: 'lite', |
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.conf import settings | |
from django.contrib.auth.models import User | |
class EmailOrUsernameModelBackend(object): | |
def authenticate(self, username=None, password=None): | |
if '@' in username: | |
kwargs = {'email': username} | |
else: | |
kwargs = {'username': username} | |
try: |
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 fabric.api import env, local, require | |
def deploy(): | |
"""fab [environment] deploy""" | |
require('environment') | |
maintenance_on() | |
push() | |
syncdb() | |
migrate() |
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
define('loja', ['dojo/has'], function (has) { | |
var id = 123; | |
var pagina = 'departamento' | |
var depto = 'eletronicos' | |
has.add('loja-id-' + id, true); | |
has.add('loja-pagina-' + pagina, true); | |
has.add('loja-depto-' + depto, true); | |
return has; |
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
define('InfiniteIterator', [ | |
'dojox/collections/_base', | |
'dojo/_base/lang' | |
], function ( | |
dxc, | |
lang | |
) { | |
'use strict'; | |
function InfiniteIterator(array) { |
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 TemplateDoesNotExist | |
def load_template_source(template_name, template_dirs=None): | |
try: | |
return open(template_name).read(), template_name | |
except IOError: | |
raise TemplateDoesNotExist, template_name |
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
mkdir heroku | |
cd heroku/ | |
virtualenv --no-site-packages env | |
source env/bin/activate | |
pip install bottle gevent | |
pip freeze > requirements.txt | |
cat >app.py <<EOF | |
import bottle | |
import os |
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> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<link href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dijit/themes/claro/claro.css" | |
rel="stylesheet" | |
type="text/css" | |
> | |
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js" |
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
define('delayable-xhr', [ | |
'dojo/request/xhr', | |
'dojo/request/util', | |
'dojo/Deferred' | |
], function ( | |
xhr, | |
util, | |
Deferred | |
) { | |
'use strict'; |