Skip to content

Instantly share code, notes, and snippets.

@eduardosan
eduardosan / atualizacao-20181210.sql
Last active August 29, 2015 14:11
Atualização Softwares Licenciados
CREATE TABLE aquisicoes_software (id_software INT NOT NULL, id_aquisicao INT NOT NULL, id_tipo_licenca INT NOT NULL, PRIMARY KEY(id_software, id_aqui
sicao, id_tipo_licenca));
CREATE INDEX IDX_6BCDE8B1270B845A ON aquisicoes_software (id_software);
CREATE INDEX IDX_6BCDE8B1CF537CBE2AFF7683 ON aquisicoes_software (id_aquisicao, id_tipo_licenca);
ALTER TABLE aquisicoes_software ADD CONSTRAINT FK_6BCDE8B1270B845A FOREIGN KEY (id_software) REFERENCES software (id_software) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE software_estacao DROP CONSTRAINT fk_9bbdd0f8270b845a;
ALTER TABLE software_estacao DROP CONSTRAINT fk_9bbdd0f8cf537cbe;
alter table software_estacao DROP CONSTRAINT software_estacao_pkey;
@eduardosan
eduardosan / twitter-extract
Last active August 29, 2015 14:22
Extrai dados do Twitter
#!/usr/env python
# -*- coding: utf-8 -*-
import twitter
import pprint
api = twitter.Api(consumer_key='consumer_key',
consumer_secret='consumer_secret',
access_token_key='access_token',
access_token_secret='access_token_secret')
PagarMe_Transaction Object
(
[_attributes:protected] => Array
(
[payment_method] => boleto
[card_hash] =>
[amount] => 8000
[postback_url] => http://ecodobem.com.br/act/retorno.pagarme.php
[soft_descriptor] =>
[installments] => 1
@eduardosan
eduardosan / python.py
Created August 18, 2016 11:31
Python basic cgi
#!/usr/bin/env python
# -*- coding: UTF-8 -*-# enable debugging
import cgitb
cgitb.enable()
print("Content-Type: text/html;charset=utf-8")
print("")
print("Hello World!")
@eduardosan
eduardosan / perl.cgi
Created August 18, 2016 11:33
Perl basic cgi
#!/usr/bin/perl -wT
use strict;
use HTML::Template;
use constant TMPL_FILE => "$ENV{DOCUMENT_ROOT}/template.tmpl";
my $tmpl = new HTML::Template(filename => TMPL_FILE);
my $time = localtime;
$tmpl->param(current_time => $time);
print "Content-type: text/html\n\n",
@eduardosan
eduardosan / template.tmpl
Created August 18, 2016 11:34
Perl CGI Template
<html>
<head><title>Hello</title></head>
<body>Hello World<br>
Current Time is <TMPL_VAR NAME="current_time">
</body>
</html>
//show AST in GUI
JFrame frame = new JFrame("Antlr AST");
JPanel panel = new JPanel();
JScrollPane scrollPane = new JScrollPane(panel);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
scrollPane.setBounds(50, 30, 300, 50);
TreeViewer viewr = new TreeViewer(Arrays.asList(
parser.getRuleNames()),tree);
viewr.setScale(1.5);//scale a little
@eduardosan
eduardosan / installcacic.bat
Last active February 20, 2019 19:32
Script .BAT para instalação do Cacic
cls
@echo off
set __COMPAT_LAYER=RunAsInvoker
REM COMANDO ABAIXO USADO PARA EXECUTAR O INSTALLCACIC SEM QUESTIONAMENTOS.
REM ###########################################################################
REM # INSERIR DADOS NECESSÁRIOS PARA A INSTALAÇÃO #
REM ## Usuário do ftp está como padrão. ##