View incluir_arquivo.php
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
define("ID_UNIDADE", "999"); //id da unidade onde o processo está | |
define("ID_SERIE", "50070"); //Tipo do documento que irá ser incluído, deve ser um tipo externo | |
define("SISTEMA, "meuSistemaNoSei'");//Nome do Sistema no menu Adminsitração/ Sistema | |
define("SERVICO", "servicoDoMeuSistema"); //Nome do Serviço dentro do Sistema | |
function inclui_evidencia_sei($cpf,$nome,$protocolo,$nome_arquivo,$arquivo){ | |
$DocumentoRecebido = array(); | |
$DocumentoRecebido['Tipo'] = 'R'; | |
$DocumentoRecebido['Destinatarios'] = null; | |
$DocumentoRecebido['Interessados'] = array(array('Sigla' => $cpf, 'Nome' => $nome)); | |
$DocumentoRecebido['Data'] = "" . date("d/m/Y"); |
View atividades.puml
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
@startuml | |
actor Foo1 | |
boundary Foo2 | |
control Foo3 | |
entity Foo4 | |
database Foo5 | |
Foo1 -> Foo2 : To boundary | |
Foo1 -> Foo3 : To control | |
Foo1 -> Foo4 : To entity | |
Foo1 -> Foo5 : To database |
View gist:1eafb2046f0cd66eaec8
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
// global scope | |
(function(){ | |
// outer scope | |
var fibonacci = function(){ | |
my_return = "0, "; | |
current_number = 0; | |
minus_one_order = 0; | |
minus_two_order = 0; | |
max_order=12; | |
for(current_order = 1;current_order<=max_order;current_order+=1){ |
View gist:4220070
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
abruno:/tmp$ cat notas.txt | |
Fulano 8.3 7.6 9.5 6.4 | |
Sicrano 5.6 8.9 7.4 7.5 | |
Beltrano 5.6 7.8 9.4 5. 3 | |
abruno:/tmp$ cat notas.py | |
notas={} | |
for linha in open('notas.txt'): | |
linha_list = linha.strip().split(' ') | |
notas[linha_list[0]]=linha_list[1:] | |
print notas |
View exp_verify.py
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 eval_expr(text): | |
test_char = lambda c: c in '1234567890.,*/+-()' | |
for char in text: | |
if not test_char(char): | |
raise Exception('Invalid Char in String') | |
return long(eval(text,{},{})) |
View gist:3037221
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
#http://hal.freedesktop.org/docs/udisks/Device.html | |
def mount(device, fs): | |
""" | |
>>> mount('/dev/sdb1','ext3') | |
/media/pendrive | |
>>> mount('/dev/sdc2','ext2') | |
'' | |
""" | |
res = '' |
View gist:3022589
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
import dbus | |
def changelabel(device, newlabel): | |
"""Change label of device. | |
>>> changelabel('/dev/sdc1','Boot') | |
True | |
>>> changelabel('/dev/sxpto','Data') | |
False | |
""" | |
res = False |
View filesystem.py
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
import io | |
_DEFAULTBS=io.DEFAULT_BUFFER_SIZE | |
def clone(input_file='/dev/zero', output_file='/dev/null', bs=_DEFAULTBS, count=None): | |
"""Make a clone of one file or device. Emule the command dd, without type conversion | |
>>> clone(output_file='/tmp/swap.img',bs=512,count=8*2*1024*1024*1024) | |
True | |
>>> clone(input_file='/dev/sde',output_file='/tmp/pendrive.clone',bs=1024,count=7969178) | |
True |