Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Foco e determinação nos objetivos.

Glauber Funez GlauberF

🎯
Foco e determinação nos objetivos.
View GitHub Profile
@GlauberF
GlauberF / .php-cs-fixer.php
Created May 4, 2022 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
View .php-cs-fixer.php
<?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 Mar 16, 2022
deepDiffObj, Function to analyze two objects and return if there were changes, if there were not, if something was deleted etc.
View deepDiffObj.js
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.';
}
View fparans.json
[
{
"id":1 ,
"name":"page_count",
"type":"number",
"arrayItemType":"string",
"eval":false,
"nullable":false,
"pattern":"",
"expression":"",
@GlauberF
GlauberF / aggregate_mongo.js
Last active Feb 5, 2022
get real object in for_id_supplier
View aggregate_mongo.js
// 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 Jan 26, 2022 — forked from subodhkumarWM/optimize-css.gulpfile.js
CSS optimization post Angular prod build
View optimize-css.gulpfile.js
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
/*
View 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 Dec 2, 2021
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.
View parseFunctionString.ts
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 Jul 18, 2021
- 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…
View n-grams.php
<?php
function pre_print_r($var){
echo "<pre>";
print_r($var);
echo "</pre>";
}
function Bigrams($word){
@GlauberF
GlauberF / parseFunction.js
Created May 4, 2021 — forked from lamberta/parseFunction.js
Parse a JavaScript string function definition and return a function object. Does not use eval.
View parseFunction.js
/* 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
*/
function parseFunction (str) {
@GlauberF
GlauberF / DOMinator.ts
Created Mar 25, 2021
Generate HTML from Typescript
View DOMinator.ts
// Library
// Simple transformation of Javascript to HTML.
class Dominator {
private readonly eventListeners: any[];
private readonly children: any[];
private element: any;
private id: any;
private content: any;
private properties: any;
private tag: any;