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
| 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
| 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
| 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
| 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
| # So, to temporarily ignore changes in a certain file: | |
| git update-index --assume-unchanged -- <file> | |
| # Then when you want to track changes again: | |
| git update-index --no-assume-unchanged -- <file> |
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 removeDuplicate(oldArray) { | |
| var newArray = []; | |
| var i = 0; | |
| var len = oldArray.length; | |
| for(; i < len; i++) { | |
| if(newArr.indexOf(arr[i])<0) { | |
| newArr.push(arr[i]) |
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([ | |
| 'dojo/on', | |
| 'dojo/Evented', | |
| 'dojo/_base/lang' | |
| ], function ( | |
| on, | |
| Evented, | |
| lang | |
| ) { | |
| 'use strict'; |
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/sh | |
| # Usage: fetchall.sh branch ... | |
| set -x | |
| git fetch --all | |
| for branch in "$@"; do | |
| git checkout "$branch" || exit 1 | |
| git rebase "origin/$branch" || exit 1 | |
| done |
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([ | |
| 'dojo/on', | |
| 'dojo/_base/window', | |
| 'dojo/dom-construct', | |
| 'dojo/Deferred' | |
| ], function ( | |
| on, | |
| win, | |
| domConstruct, | |
| Deferred |