Skip to content

Instantly share code, notes, and snippets.

View devrsantos's full-sized avatar
🏠
Trabalhando em casa

Renan Augusto dos Santos devrsantos

🏠
Trabalhando em casa
View GitHub Profile
@devrsantos
devrsantos / README-Template.md
Created January 30, 2018 16:29 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@devrsantos
devrsantos / obterEmpregos.js
Last active March 12, 2022 02:12
Busca de empregos
const curl = require("curl");
const jsdom = require("jsdom");
const url = "https://bauruempregos.com.br/home/vagas";
curl.get(url, null, (err, resp, body) => {
if (resp.statusCode == 200) {
parseData(body);
}
});
function parseData(html) {
const fetch = require('node-fetch');
const defer = new Promise((resolve, reject) => {
setTimeout(() => {
if (true) {
resolve('Hello! It works!');
} else {
reject('Error');
}
}, 2000);
});
@devrsantos
devrsantos / example_fetch.js
Created September 3, 2018 16:12
Exemplo simples de CRUD utilizando Fetch_API
const url = '';
const listar = () => {
fetch(url).then(function(response){
response.json().then(function(result){
for (var key in result) {
console.log(result[key].nome);
}
})
});
};
function removeAcento(text)
{
text = text.toLowerCase();
text = text.replace(new RegExp('[ÁÀÂÃ]','gi'), 'a');
text = text.replace(new RegExp('[ÉÈÊ]','gi'), 'e');
text = text.replace(new RegExp('[ÍÌÎ]','gi'), 'i');
text = text.replace(new RegExp('[ÓÒÔÕ]','gi'), 'o');
text = text.replace(new RegExp('[ÚÙÛ]','gi'), 'u');
text = text.replace(new RegExp('[Ç]','gi'), 'c');
return text;
@devrsantos
devrsantos / encryption.js
Created May 21, 2019 20:40 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv);
function REMOVE_COLUNAS() {
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
spreadsheet.getRange('A:A').activate();
spreadsheet.getActiveSheet().deleteColumns(spreadsheet.getActiveRange().getColumn(), spreadsheet.getActiveRange().getNumColumns());
spreadsheet.getRange('E:E').activate();
spreadsheet.getActiveSheet().deleteColumns(spreadsheet.getActiveRange().getColumn(), spreadsheet.getActiveRange().getNumColumns());
function remove_colunas(spreadsheet) {
spreadsheet.getRange('BN:BN').activate();
spreadsheet.getActiveSheet().deleteColumns(spreadsheet.getActiveRange().getColumn(), spreadsheet.getActiveRange().getNumColumns());
spreadsheet.getRange('BI:BI').activate();
spreadsheet.getActiveSheet().deleteColumns(spreadsheet.getActiveRange().getColumn(), spreadsheet.getActiveRange().getNumColumns());
spreadsheet.getRange('BD:BD').activate();
spreadsheet.getActiveSheet().deleteColumns(spreadsheet.getActiveRange().getColumn(), spreadsheet.getActiveRange().getNumColumns());
const empresa = "cpfl paulista";
const categoria = "luz";
const valor = "187,47";
const consumo = "224";
const data_leitura = "25/01/2019";
const data_emissao = "26/01/2019";
const data_vencimento = "11/02/2019";
const data_proxima_leitura = "24/02/2019"
const check_pagamento = "PAGO";
db.pessoa.update({nome: "Renan"}, {$inc: {sobrenome: "Santos"}});
WriteResult({
"nMatched": 0,
"nUpserted": 0,
"nModified": 0,
"writeError": {
"code": 14,
"errmsg": "Cannot increment with non-numeric argument: {sobrenome: \"Santos\"}"
},
})