Skip to content

Instantly share code, notes, and snippets.

View topogigiovanni's full-sized avatar

Giovanni Mendes Mansueto topogigiovanni

View GitHub Profile
@topogigiovanni
topogigiovanni / sh
Created May 27, 2022 17:36
permite rodar .sh via github actions
@ atualizar permissao para rodar .sh via github actions
git update-index --chmod=+x your_script.sh
import { buildData } from "./build-data";
<let/data = []/>
<let/selected = null/>
<div class="jumbotron">
<div class="row">
<div class="col-md-6">
<h1>Marko 6 (keyed)</h1>
@topogigiovanni
topogigiovanni / jwt.php
Created May 6, 2022 12:36 — forked from douglascabral/jwt.php
Example of JWT with Pure PHP
<?php
$key = 'your-secret-key-here';
$header = [
'typ' => 'JWT',
'alg' => 'HS256'
];
$header = json_encode($header);
$header = base64_encode($header);
https://purge.jsdelivr.net/npm/@mailbiz/onsite-linxcommerce-vendor@next
@topogigiovanni
topogigiovanni / dele-git-commits
Created April 1, 2022 11:55
Deletar todos os commits de um repositório no git
Checkout
git checkout --orphan latest_branch
Add all the files
git add -A
Commit the changes
@topogigiovanni
topogigiovanni / Exclude-node_modules.md
Created January 7, 2022 11:04 — forked from anuraghazra/Exclude-node_modules.md
Exclude node_modules folder when copying directory.

Handy Trick To Get Rid Of node_modules

This one is a simple and handy trick when you want to copy your directories without node_modules folder.

Enter this command in your terminal.

robocopy SOURCE DEST /mir /xd node_modules
@topogigiovanni
topogigiovanni / Exclude-node_modules.md
Created January 7, 2022 11:04 — forked from anuraghazra/Exclude-node_modules.md
Exclude node_modules folder when copying directory.

Handy Trick To Get Rid Of node_modules

This one is a simple and handy trick when you want to copy your directories without node_modules folder.

Enter this command in your terminal.

robocopy SOURCE DEST /mir /xd node_modules
if (req.http.host ~ "^mobile\.example\.com") {
set req.http.host = "example.com";
set req.url = regsub(req.url, "^/", "/mobile/");
set req.url = regsub(req.url, "$", "?theme=mobile");
}
var tzoffset = (new Date()).getTimezoneOffset() * 60000; //offset in milliseconds
var localISOTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -1);
// => '2015-01-26T06:40:36.181'
@topogigiovanni
topogigiovanni / iterate-over-databases-mongo
Last active June 10, 2021 01:44
rodar query em todos databases mongos mongodb
// Switch to admin database and get list of databases.
db = db.getSiblingDB("admin");
dbs = db.runCommand({ "listDatabases": 1 }).databases;
// Iterate through each database.
dbs.forEach(function(database) {
db = db.getSiblingDB(database.name);
// Get the Group collection
collection = db.getCollection("Group");