Skip to content

Instantly share code, notes, and snippets.

View vanessasoutoc's full-sized avatar

Vanessa Souto vanessasoutoc

View GitHub Profile
@vanessasoutoc
vanessasoutoc / config.json
Created April 17, 2018 23:37
config db Agente Fairtek
{"id_agente":"1","port":"/dev/ttyUSB0","mysql_user":"fairtek","mysql_pass":"FSNjMZNhL6PzhTSR",
"mysql_url":"jdbc:mysql://oficina.hml.oficina5.com.br:3306/fairtek?serverTimezone=UTC&useSSL=false"
}
@vanessasoutoc
vanessasoutoc / chat-frontend.js
Created March 22, 2018 13:29 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@vanessasoutoc
vanessasoutoc / json_to_xml_notas_fiscais.json
Created January 18, 2018 11:38
json_to_xml_notas_fiscais
{
"transportadora": {
"-dthratualizacao": "06/12/2017 11:39",
"notasfiscais": {
"origem": [
{
"-cnpj": "60744463005078",
"notafiscal": [
{
"-numero": "84229849",
@vanessasoutoc
vanessasoutoc / errors_alerts.js
Created January 9, 2018 20:52
Errors in Array
showAlertError(error) {
console.log('showAlert');
console.log(error);
$('div.error').text(error);
$('div.error').removeAttr('hidden');
}
errorSend(err) {
var user = JSON.parse(window.localStorage.getItem('user'));
//var errJson = "";
@vanessasoutoc
vanessasoutoc / install_instant_client.txt
Last active June 11, 2019 13:44
Instant Client Oracle
INSTALAÇÃO ORACLE INSTANT CLIENT - UBUNTU
01 - BAIXAR NO SITE DA ORACLE OS ARQUIVO RPM:
oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
02 - INSTALAR OS 2 PACOTES
sudo apt-get install libaio1
sudo apt-get install alien
@vanessasoutoc
vanessasoutoc / Log Error Api Oferecimento
Created January 9, 2018 11:25
Log Error Api Oferecimento
0|server | Error
0|server | at api.alterarStatusCarga.then.catch (/home/ec2-user/server/src/modOferecimento/controllers/OferecerController.js:685:29)
0|server | at <anonymous>
0|server | at runMicrotasksCallback (internal/process/next_tick.js:121:5)
0|server | at _combinedTickCallback (internal/process/next_tick.js:131:7)
0|server | at process._tickCallback (internal/process/next_tick.js:180:9)
0|server | TypeError: Cannot read property 'length' of undefined
0|server | at Object.api.alterarStatusCarga (/home/ec2-user/server/src/modOferecimento/controllers/OferecerController.js:632:48)
0|server | at api.oferecer (/home/ec2-user/server/src/modOferecimento/controllers/OferecerController.js:679:19)
0|server | at <anonymous>
@vanessasoutoc
vanessasoutoc / .htaccess
Created December 7, 2017 01:42
Erros das rotas do Angular em produção
#Erro de rota no Angular 4, após gerar versão de produção (Apache)
#$ ng build --prod
#Acrescentar na pasta dist/ um arquivo com nome de .htaccess com os dados abaixo!
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
<VirtualHost *:80>
ServerAdmin webmaster@oficina5.com.br
DocumentRoot /home/vanessa/oferecimento/dist
ServerName oferecimento.dev.oficina5.com.br
ServerAlias oferecimento.dev.oficina5.com.br
<Directory "/home/vanessa/oferecimento/dist/">
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerAdmin webmaster@oficina5.com.br
DocumentRoot /home/vanessa/oferecimento/dist
ServerName oferecimento.dev.oficina5.com.br
ServerAlias oferecimento.dev.oficina5.com.br
<Directory "/home/vanessa/oferecimento/dist/">
AllowOverride All
</Directory>
@vanessasoutoc
vanessasoutoc / json_large.py
Created April 27, 2017 14:18
Read large json in python with ijson
import ijson
jsonData = ijson.items(open('file_path/file.json', encoding='latin-1'), 'DESPESA.item')
for prefix in jsonData:
for key,value in prefix.items():
print('key: ', key)
print(' value: ', value)