Skip to content

Instantly share code, notes, and snippets.

View GlauberF's full-sized avatar
🎯
Foco e determinação nos objetivos.

Glauber Funez GlauberF

🎯
Foco e determinação nos objetivos.
View GitHub Profile
@GlauberF
GlauberF / nGram.js
Last active July 14, 2022 17:53
NGram
//////////////////////////////////////
// Example
// nGram(2)('Brasil');
/////////////////////////////////////
/**
* Factory returning a function that converts a value string to n-grams.
*
* @param {number} n
*/
@GlauberF
GlauberF / .htaccess
Created June 13, 2022 11:46 — forked from cyberwani/.htaccess
Block the HTTRACK using HTACCESS files
Options All -Indexes
# Ultimate htaccess Blacklist 2 from Perishable Press
# Deny domain access to spammers and other scumbags
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ADSARobot|ah-ha|almaden|aktuelles|Anarchie|amzn_assoc|ASPSeek|ASSORT|ATHENS|Atomz|attach|attache|autoemailspider|BackWeb|Bandit|BatchFTP|bdfetch|big.brother|BlackWidow|bmclient|Boston\ Project|BravoBrian\ SpiderEngine\ MarcoPolo|Bot\ mailto:craftbot@yahoo.com|Buddy|Bullseye|bumblebee|capture|CherryPicker|ChinaClaw|CICC|clipping|Collector|Copier|Crescent|Crescent\ Internet\ ToolPak|Custo|cyberalert|DA$|Deweb|diagem|Digger|Digimarc|DIIbot|DISCo|DISCo\ Pump|DISCoFinder|Download\ Demon|Download\ Wonder|Downloader|Drip|DSurf15a|DTS.Agent|EasyDL|eCatch|ecollector|efp@gmx\.net|Email\ Extractor|EirGrabber|email|EmailCollector|EmailSiphon|EmailWolf|Express\ WebPictures|ExtractorPro|EyeNetIE|FavOrg|fastlwspider|Favorites\ Sweeper|Fetch|FEZhead|FileHound|FlashGet\ WebWasher|FlickBot|fluffy|FrontPage|GalaxyBot|Generic|Getleft|GetRight|
@GlauberF
GlauberF / .php-cs-fixer.php
Created May 4, 2022 13:13 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@GlauberF
GlauberF / deepDiffObj.js
Last active March 16, 2022 13:37
deepDiffObj, Function to analyze two objects and return if there were changes, if there were not, if something was deleted etc.
const deepDiffMapper = function () {
return {
VALUE_CREATED: 'created',
VALUE_UPDATED: 'updated',
VALUE_DELETED: 'deleted',
VALUE_UNCHANGED: 'unchanged',
map: function (obj1, obj2) {
if (this.isFunction(obj1) || this.isFunction(obj2)) {
throw 'Invalid argument. Function given, object expected.';
}
[
{
"id":1 ,
"name":"page_count",
"type":"number",
"arrayItemType":"string",
"eval":false,
"nullable":false,
"pattern":"",
"expression":"",
@GlauberF
GlauberF / aggregate_mongo.js
Last active February 5, 2022 14:32
get real object in for_id_supplier
// Requires official MongoShell 3.6+
db = db.getSiblingDB("....");
db.getCollection("produtos").aggregate(
[
{
"$project" : {
"_id" : NumberInt(0),
"produtos" : "$$ROOT"
}
},
@GlauberF
GlauberF / optimize-css.gulpfile.js
Created January 26, 2022 12:39 — forked from subodhkumarWM/optimize-css.gulpfile.js
CSS optimization post Angular prod build
const gulp = require("gulp");
const filter = require("gulp-filter");
const purify = require("gulp-purify-css");
const gzip = require("gulp-gzip");
const brotli = require("gulp-brotli");
const clean = require("gulp-clean");
const { series, parallel } = require("gulp");
// #1 | Optimize CSS
/*
@GlauberF
GlauberF / ijessica
Last active January 21, 2022 19:47
ijessica
#EXTM3U
#EXT-X-SESSION-DATA:DATA-ID="com.xui.1_5_5r2"
#EXTINF:-1 tvg-logo="http://a5.vc/3pv" group-title="Canais | Globo",Globo Brasilia FHD
http://x00.so:80/Jessicadias/Hd9hF6/131151.ts
#EXTINF:-1 tvg-logo="http://a5.vc/3pv" group-title="Canais | Globo",Globo Brasilia HD
http://x00.so:80/Jessicadias/Hd9hF6/131164.ts
#EXTINF:-1 tvg-logo="http://a5.vc/3pv" group-title="Canais | Globo",Globo Brasilia SD
http://x00.so:80/Jessicadias/Hd9hF6/131116.ts
#EXTINF:-1 tvg-logo="http://a5.vc/3pv" group-title="Canais | Globo",Globo EPTV Campinas SD
http://x00.so:80/Jessicadias/Hd9hF6/131210.ts
@GlauberF
GlauberF / parseFunctionString.ts
Last active December 2, 2021 22:26
Parse a string function definition and return a function object. Does not use eval. Analisa uma definição de função em string e retorna um objeto de função. Não usa eval.
class ParseFunctionString {
/* Parse a string function definition and return a function object. Does not use eval.
* @param {string} str
* @return {function}
*
* Example:
* var f = function (x, y) { return x * y; };
* var g = parseFunction(f.toString());
* g(33, 3); //=> 99
*/
@GlauberF
GlauberF / n-grams.php
Last active July 18, 2021 21:10
- pt: Nos campos de linguística computacional e probabilidade, um n-grama é uma sequência contígua de n itens de uma determinada amostra de texto ou fala. Os itens podem ser fonemas, sílabas, letras, palavras ou pares de bases de acordo com a aplicação. Os n -gramas normalmente são coletados de um corpus de texto ou fala.[1] -en: In the fields o…
<?php
function pre_print_r($var){
echo "<pre>";
print_r($var);
echo "</pre>";
}
function Bigrams($word){