Skip to content

Instantly share code, notes, and snippets.

View franklinbr's full-sized avatar

Franklin Anderson de O. Souza franklinbr

View GitHub Profile
#!/bin/bash
arquivo_entrada='script.sql'
arquivo_tmp='temporario.sql'
arquivo_saida='saida.sql'
function AjustesIniciais() {
head -n1 ${arquivo_entrada} | tail -n1 > ${arquivo_tmp}
echo "" >> ${arquivo_tmp}
head -n3 ${arquivo_entrada} | tail -n1 | sed 's/\$/variavel/g' >> ${arquivo_tmp}
$1 = '11', $2 = '22', $3 = '33', $4 = '44', $5 = '55', $6 = '66', $7 = '77', $8 = '88', $9 = '99', $10 = '10'
select campo1, campo2, campo3 from tabela1 where campo1 = $1 and campo2 <> $2 and campo3 in ($3, $4, $5, $6, $7, $8, $9, $10);
@franklinbr
franklinbr / shell script
Last active May 10, 2019 09:06
Jao leme Recursive
#!/bin/bash
file='file.bmp' #arquivo que queres copiar para os demais diretorios
pattern=$(ls -R | grep '^\.' | grep -v '\.:') # lista os diretorios recursivamente com pequenos ajustes cosmeticos
for path in $(echo $pattern)
do
cp -rfv ${file} ${path/:/\/}
done
Tabela "client.tb_tipo_complemento"
Coluna | Tipo | Modificadores
---------------------+------------------------+----------------------------------------------------------------------
tp_tipo_complemento | character varying(1) | não nulo
id_tipo_complemento | bigint | não nulo valor padrão de nextval('sq_tb_tipo_complemento'::regclass)
in_ativo | boolean |
cd_tipo_complemento | character varying(255) |
ds_glossario | character varying(255) |
ds_label | character varying(255) |
ds_mensagem_erro | character varying(255) |
var original1 = null;
var original2 = null;
var permissao = 0;
$('li[class=box-imagem]').each(function(i, obj){
$('li[class=box-imagem]').each(function(j, obk){
if(i != j && i > j) {
original2 = $(obk).data('original');
original1 = $(obj).data('original');
if(original1 == original2) {
mysql> show function status;
+-------------------+------------------------------------------+----------+----------------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+-------------------+------------------------------------------+----------+----------------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| ocomon | calcTempoUtil | FUNCTION | michelle@10.0.58.116 | 2016-06-13 13:45:24 | 2016-06-13 13:45:24 | DEFINER | | utf8 | utf8_general_ci | latin1_swedish_ci |
| ocomon | sp_contagem_chamados_por_faix
name | current_setting | source | sourcefile | sourceline
----------------------------+------------------------------------------+--------------------+-----------------------------+------------
application_name | psql | client | |
archive_command | test ! -f /wals/%f && cp %p /wals/%f | configuration file | /dados/data/postgresql.conf | 206
archive_mode | on | configuration file | /dados/data/postgresql.conf | 203
autovacuum | on | configuration file | /dados/data/postgresql.conf | 477
checkpoint_segments | 30 | configuration file | /dados/data/postgresql.conf | 192
checkpoint_timeout | 10min | conf
$('#tblPercurso').find('table:first > tbody > tr:eq(1) > td:eq(0)')
.find('input').val('101');
$('#tblPercurso').find('table:first > tbody > tr:eq(1) > td:eq(1)')
.find('input').val('DIV. PE/AL - DIV.AL/SE');
$('#tblPercurso').find('table:first > tbody > tr:eq(1) > td:eq(2)')
.find('select > option:eq(2)').prop('selected', true);
$('#tblPercurso').find('table:first > tbody > tr:eq(1) > td:eq(3)')
[
{
"101":104,
"DIV. PE/AL - DIV.AL/SE":"DIV. PE/AL -ENTR. BR416",
"AL":"AL",
"0,00":"0,00",
"247,80":"16,50"
},
{
"101":104,