Skip to content

Instantly share code, notes, and snippets.

View figloalds's full-sized avatar
🙂
Learning crazy new ways to build astoundingly fucking amazing applications.

Felype Rennan figloalds

🙂
Learning crazy new ways to build astoundingly fucking amazing applications.
  • SoftLeader Sistemas LTDA
  • Uberlândia - Brazil
View GitHub Profile
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',
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace Figlotech.Core.Autokryptex
{
public sealed class FiRandom {
private long Seed;
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)) {
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);
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);
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]';
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]) :
/*
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 }
]
// 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
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;