Skip to content

Instantly share code, notes, and snippets.

View Daymannovaes's full-sized avatar
🔳
.

Dayman Novaes Daymannovaes

🔳
.
  • Belo Horizonte, MG Brazil
View GitHub Profile
var output = "";
var rateCovered = 0.2;
/**
* EXPLAINING
*
* The 'output' var holds the string with the generated output,
* which should be used as INPUT in the PA
*
* the 'rateCovered' var holds the chance of a square not be a tip.
var output = "";
/**
* EXPLAINING
*
* The 'output' var holds the string with the generated output,
* which should be used as INPUT in the PA
*
* HOW TO USE
*
var output = "";
/**
* EXPLAINING
*
* The 'output' var holds the string with the generated output,
* which should be used as INPUT in the PA
*
* HOW TO USE
*
// first run npm install -g request
function requestFile(url, callback) {
return require('request').get(url, callback);
}
let url = 'https://www.google.com.br/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
// stream test
requestFile(url).pipe(require('fs').createWriteStream('image-stream.png'));
http://mg.olx.com.br/belo-horizonte-e-regiao/eletrodomesticos?f=p&pe=1200&ps=800&q=geladeira
results = $('#main-ad-list li:not(.list_native)').map((a, i) => {
let $f = $(i).find.bind($(i));
return {
href: $f('a')[0].href,
title: $f('h3').text().trim(),
price: $f('.OLXad-list-price').text().trim().replace(/R\$ ?/, '').replace(/\./, ','),
region: $f('.detail-region').text().trim().replace(/\n/g, '').replace(/\t/g, '').replace(/ +/g, ' '),
// (x, y)
let stepActionByType = {
'down': [0, 1],
'left down': [-1, 1],
'left up': [-1, 0],
'up': [0, -1],
'right up': [1, -1],
'right down': [1, 0]
};
let stepTypeOrder = [
function arrayDiffToHtmlTable(prevArray = [], currArray = []) {
let ALL_KEYS = getAllKeys(prevArray, currArray);
let mappedObjects = mapObjects(prevArray, currArray);
let table = '<table>' + buildTableHeader();
for(let key of Object.keys(mappedObjects)) {
let prevObj = mappedObjects[key][0];
let currObj = mappedObjects[key][1];
table += buildHtmlRow(prevObj, currObj);

Keybase proof

I hereby claim:

  • I am daymannovaes on github.
  • I am daymannovaes (https://keybase.io/daymannovaes) on keybase.
  • I have a public key ASDlvLfGWNsHvoN0VmEUYJ42-59zwmH5_2j_sX5Ii34hXgo

To claim this, I am signing this object:

function prettyJson(object, indent = 4, stack = []) {
stack.push(object);
let result = "{\n";
let indentString = (new Array(indent+1)).join(" ");
let indentEnd = (new Array(indent-3)).join(" ");
let keys = Object.keys(object);
keys.forEach((key, i) => {
/*
go to Promoter.io, go to a campaign and use the filter to search the time range that you want
Go to chrome dev tools and search for the url like:
https://app.promoter.io/org/YOUR_ORG_ID/campaign/YOUR_CAMP_ID/report/?start_date=2017%2F04%2F15&end_date=2018%2F03%2F28&method_name=load_es_nps_graph
be aware of the method name: load_es_nps_graph.
--
*/