This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let uni = [ | |
'', | |
'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', | |
'dez', | |
'onze', 'doze', 'treze', 'quatorze', 'quinze', 'dezesseis', 'dezessete', 'dezoito', 'dezenove', | |
] | |
let dezenas = [ | |
'', | |
'dez', | |
'vinte', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace Figlotech.Core.Autokryptex | |
{ | |
public sealed class FiRandom { | |
private long Seed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async asyncForEach(array, callback) { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array); | |
} | |
} | |
async asyncParallelForEach(array, callback, nParallelism) { | |
nParallelism = Number(nParallelism); | |
if(!nParallelism || isNaN(nParallelism)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getAnagrams = (str) => { | |
if(str.length === 1) { | |
return [str]; | |
} | |
let anagrams = []; | |
for(let i = 0; i < str.length; i++) { | |
let newStr = Array.from(str).filter(Boolean); | |
let thisChar = newStr.splice(i, 1); | |
newStr = newStr.join(''); | |
const subAnagrams = getAnagrams(newStr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getCombinations = (map, digitCount) => { | |
let numCombinations = Math.pow(map.length, digitCount); | |
const retv = []; | |
for(let i = 0; i < numCombinations; i++) { | |
let current = []; | |
let val = i; | |
do { | |
let idx = Math.floor(val % map.length); | |
current.push(map[idx]); | |
val = Math.floor(val / map.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!HATE_IS_DEFINED) { | |
const commentFilter = [ | |
'top fan', 'badge', 'contributor', 'peasant', 'flex', | |
'esbanja', 'selo', 'super fã', ' ostent', | |
'💎', '⊂_', | |
]; | |
class Hate { | |
constructor() { | |
const POST_ROOT_SELECTOR = '._5jmm._5pat'; | |
const LIVE_INDICATOR_SELECTOR = 'div[data-testid=live-indicator]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const queryStringToObject = (url, ignoreObjectsAndArrays) => { | |
return url.substring(url.indexOf('?')+1) | |
.split('&') | |
.reduce( | |
(a,b)=> { | |
const kvp = b.split('=') | |
const frag = {} | |
const nVal = Number(kvp[1]) | |
frag[kvp[0]] = | |
(kvp[1] === 'true' || kvp[1] === 'false') ? Boolean(kvp[1]) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
what it does: | |
Wraps objects to respond to data path strings separated by '/' | |
ex: vpFoo['path/to/0/property'] <= same as => foo.path.to[0].property | |
usage: | |
const foo = { | |
bar: 12, | |
something: [ | |
{ baz: 14 } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original code: | |
const $r = ()=>Math.random() | |
const __n= (b,n)=> (b+(n-(Math.random()*(n*2)))).toFixed(2) | |
const __f = (k,v,b,n) => `${k}(${__n(b,n)}${v},${__n(b,n)}${v})` | |
const __w = ()=>__f('translate','px',0,$r()>0.9?12:2); | |
const __el = document.querySelectorAll('*'); | |
const __t = () => setTimeout(()=> {__el.forEach(i=> {i.style.transition="50ms ease-in-out"; i.style.transform = __w();});__t()}, 100+($r()*1600)) | |
__t() | |
// Minified version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void EnviarArquivo(string url, string arquivo, string param, string contentType, NameValueCollection dadosFormulario) { | |
string b = "---------------------------" + DateTime.Now.Ticks.ToString("x"); | |
byte[] bBytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + b + "\r\n"); | |
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); | |
req.ContentType = "multipart/form-data; boundary=" + b; | |
req.Method = "POST"; | |
req.KeepAlive = true; |
NewerOlder