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 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 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
| 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 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 | |
| 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 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(){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. |
NewerOlder