Skip to content

Instantly share code, notes, and snippets.

View leog's full-sized avatar

Leo Giovanetti leog

View GitHub Profile
@leog
leog / script.user.js
Last active October 3, 2025 17:58
JIRA Status Badges + Transition on GitHub PR List + PR Page
// ==UserScript==
// @name JIRA Status Badges + Transition on GitHub PRs (Secrets in TM Storage)
// @namespace http://tampermonkey.net/
// @version 2025-09-15
// @description Show Jira status badges, highlight mismatches, and transition tickets to "Ready for QA env" from GitHub PR list and PR page
// @author You
// @match https://github.com/InfobaseCloud/symphony-app/pulls
// @match https://github.com/InfobaseCloud/symphony-app/pull/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant GM.getValue
@leog
leog / next.config.js
Created October 22, 2024 23:52
Support multiple products from a single next.js app based on app router and relying on different hosts
const appConfig = {
prodct1: {
environments: {
production: ["acme.com"],
development: [
"localhost",
"development.acme.com",
"pr-(?<prNumber>.*).acme.com",
],
}
@leog
leog / git-init.sh
Created May 30, 2024 02:32
Monorepo Private Submodule
#!/bin/sh
# Skip if `.gitmodules` exists
[ -f .gitmodules ] && {
echo ".gitmodules already initialized"
exit 0
}
./git-setup.sh website console
@leog
leog / route.ts
Last active January 14, 2025 15:30
Next-Auth Server-side Sign in
import { AuthHandler } from "node_modules/next-auth/core";
import { getServerAuthSession } from "@/server/auth";
import { cookies, headers } from "next/headers";
import { getCsrfToken } from "next-auth/react";
import { authOptions } from "@/server/auth";
import { type AuthAction } from "next-auth";
import { redirect } from "next/navigation";
import { createHash } from "crypto";
export default async function Page({
@leog
leog / seed.ts
Created July 30, 2023 17:04
Generate Fake Users and Teams with members
/* Requires faker v8.0.2 */
/* TODO: Replace "@acme.com with also a fake domain */
// Generates defined number of random users, with extraFields as needed
async function generateFakeUsers({
count = 1,
extraFields,
}: {
count: number;
@leog
leog / api_generator.js
Created March 12, 2022 02:51 — forked from v1vendi/api_generator.js
REST API functional generator
const fetch = (...args) => console.log(...args) // mock
function httpRequest(url, method, data) {
const init = { method }
switch (method) {
case 'GET':
if (data) url = `${url}?${new URLSearchParams(data)}`
break
case 'POST':
case 'PUT':
case 'PATCH':
@leog
leog / tsconfig.json
Last active October 19, 2021 21:42
Configuración TypeScript
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"outDir": "docs",
"sourceMap": true,
"target": "ES6",
"noImplicitAny": true,
"noImplicitReturns": true,
"strict": true,
@leog
leog / script.js
Created September 29, 2021 00:21
Modal base (sin modularización ni función constructora)
const button = document.querySelector('button');
let modal;
let backdrop;
button.addEventListener('click', showModalHandler);
function showModalHandler() {
if (modal) {
return;
@leog
leog / folder_index.html
Created January 15, 2021 21:30
directory_index.rb
<html>
<head>
<title>${header}</title>
<meta name="description" content="${header}"/>
</head>
<body>
${readme_content}
<hr>
<table>
@leog
leog / directory_listing.rb
Last active January 15, 2021 15:06 — forked from teiko/directory_listing.rb
Directory Listing Plugin for Jekyll
# Title: Directory Listing Plugin for Jekyll
# Author: Simon Heimlicher http://simon.heimlicher.com
# Description: Display list of pages and directories beneath current directory
# Configuration: You can set default title in _config.yml as follows:
# directory_listing_title: "Contents: "
# directory_listing_prefix: "Contents of "
#
# Syntax {% directory_listing Title of Listing %}
#
# Example 1: