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 getLastDigit(n) { | |
| const n10 = n/10; | |
| return Math.round((n10 - Math.floor(n10)) * 10); | |
| } | |
| function removeLastDigit(n) { | |
| return parseInt((n - getLastDigit(n))/10); | |
| } | |
| function splitDigits(n) { |
| const symbolToMorse = { | |
| a: '.-', | |
| b: '-...', | |
| c: '-.-.', | |
| d: '-..', | |
| e: '.', | |
| f: '..-.', | |
| g: '--.', | |
| h: '....', | |
| i: '..', |
| const path = require('path'); | |
| const chalk = require('chalk'); | |
| const fileToTest = process.argv[2]; | |
| if(!fileToTest) throw new Error('define the file to test'); | |
| let PADDING = -4; | |
| let success = 0; | |
| let fails = 0; | |
| function describe(suite, fn = function(){}) { |
| const _ = require('lodash'); | |
| function getEquationVariables(equation) { | |
| variables = equation.match(/[a-z]/g); | |
| return _.chain(variables).compact().uniq().value(); | |
| } | |
| function getAllVariables(equations) { | |
| return _.chain(equations) | |
| .map(getEquationVariables) |
| { | |
| "version": 1, | |
| "hash": "b657e22827039461a9493ede7bdf55b01579254c1630b0bfc9185ec564fc05ab", | |
| "block_height": 477230, | |
| "inputs": [ | |
| { | |
| "n": 0, | |
| "address": "1GLctvTi81GDYZF5F6nif2MdbxUnAGHATZ", |
| const dayOfMonth = d => `${d.getDate()}/${d.getMonth()}/${d.getFullYear()}`; | |
| const midnightDistance = d => Math.abs(realMidnightDistance(d)); | |
| const realMidnightDistance = d => (d.getHours() - 12) > 0 ? -midnightDistancePM(d) : midnightDistanceAM(d); | |
| const midnightDistanceAM = d => (d.getHours() * 60) + d.getMinutes(); | |
| const midnightDistancePM = d => ((24 - d.getHours()) * 60) - (60 - d.getMinutes()); | |
| const excludeDistLessThan = threshold => d => realMidnightDistance(d) > threshold; | |
| const closestToMidnight = d => |
| /* | |
| 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. | |
| -- | |
| */ |
| 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) => { |
I hereby claim:
To claim this, I am signing this object:
| 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); |