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
$tam-xs-max: 380px;
$tam-sm-max: 750px;
$tam-md-max: 1400px;
$tam-lg-max: 4096px; // nem vai ser usado :v
$tam-xs-min: 0;
$tam-sm-min: $tam-xs-max;
$tam-md-min: $tam-sm-max;
$tam-lg-min: $tam-md-max;
//
// ApiService
// Felype Rennan / 2017
// usage Example:
// try {
// var values = await this.api.get('api/Values');
// } catch(err) {
// // handle some err
// }
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;
// 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
/*
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 }
]
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]) :
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]';
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);
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);
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)) {