This file contains 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(){return 2*3;}).toString() === (function(){return 6;}).toString(); // true in FF & Opera, false in IE & WebKit, because Opera don't put the actual code of the function on the string and FF optimizes the source to be the same. |
This file contains 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 | |
set -u | |
set -e | |
svnadmin create svn-mirror | |
echo "#!/bin/sh" > svn-mirror/hooks/pre-revprop-change | |
echo "exit 0" >> svn-mirror/hooks/pre-revprop-change | |
chmod +x svn-mirror/hooks/pre-revprop-change | |
svnsync init file://`pwd`/svn-mirror http://$1.googlecode.com/svn | |
svnsync sync file://`pwd`/svn-mirror | |
hg convert file://`pwd`/svn-mirror hg-mirror |
This file contains 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
BZR_SRC_LOC = "lp:openobject-server/6.1 server\n\ | |
lp:trunk addons-pr\n\ | |
lp:localiz/6.1 localization\n\ | |
lp:openobject-addons/6.1 addons\n\ | |
lp:openobject-addons/extra-trunk addons-extra\n\ | |
lp:openerp-web/6.1 web\n" | |
BZR_SRC_DIRS = $(shell echo -e $(BZR_SRC_LOC)|cut -d " " -f 3) |
This file contains 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 itertools import cycle | |
class A(object): | |
def nfe_digito_verificador(self, key): | |
numeros = reversed(map(int, key)) | |
soma = sum(n * m for n, m in zip(numeros, cycle(range(2,10)))) | |
resto = soma % 11 | |
if resto < 2: |
This file contains 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
def gerar_linha(self): | |
linha = u'%s|%s|\r\n' % (self.reg, self.ind_mov) | |
return linha + super(RegistroF001, self).gerar_linha() |
This file contains 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
Traceback (most recent call last): | |
File "verificador.py", line 74, in <module> | |
main() | |
File "verificador.py", line 68, in main | |
pool.join() | |
File "/home/santagada/.virtualenvs/x/local/lib/python2.7/site-packages/gevent/pool.py", line 103, in join | |
self._empty_event.wait(timeout=timeout) | |
File "/home/santagada/.virtualenvs/x/local/lib/python2.7/site-packages/gevent/event.py", line 74, in wait | |
result = get_hub().switch() | |
File "/home/santagada/.virtualenvs/x/local/lib/python2.7/site-packages/gevent/hub.py", line 164, in switch |
This file contains 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
# -*- coding: utf-8 -*- | |
def sorteio(): | |
""" | |
Cria a lista com os resultados oficiais publicados pela Caixa. | |
""" | |
sorteados = [] | |
while len(sorteados) < 6: | |
numero = int(input("Digite o número: ")) | |
if numero > 0 and numero <= 60: |
This file contains 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
{ | |
// JSHint Default Configuration File (as on JSHint website) | |
// See http://jshint.com/docs/ for more details | |
"maxerr" : 50, // {int} Maximum error before stopping | |
// Enforcing | |
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) | |
"camelcase" : false, // true: Identifiers must be in camelCase | |
"curly" : true, // true: Require {} for every new block or scope |
This file contains 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
#!/usr/bin/env python | |
# _*_ encoding: latin-1 | |
import random | |
#tipo de verbos | |
TD='TD' | |
TI='TI' | |
TDI='TDI' | |
NEG = 'NEG' |
This file contains 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
app.directive('checkbox', function(){ | |
return { | |
restrict: 'E', | |
require: 'ngModel', | |
scope: { | |
options: '=', | |
checked: '=ngModel', | |
label: '=label' | |
}, | |
/*jshint multistr: true */ |
OlderNewer