Skip to content

Instantly share code, notes, and snippets.

View sudomaxime's full-sized avatar

Maxime Nadeau sudomaxime

View GitHub Profile
INCLUDE QUESTION
BOOL should_admit
PROGRAM email
! Simple program to deal with email question management
IF QUESTION.ABOUT_EMAIL
GOTO USE_PERSONAL_EMAIL
USE_PERSONAL_EMAIL
@sudomaxime
sudomaxime / container.lua
Last active May 3, 2022 18:25
get a table struct with informations about a bunch of containers
function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
function makeInventoriesHash (containers)
inputHash = {
-- Inventory by inputs
inputs = {},
@sudomaxime
sudomaxime / switcheroo.sql
Created August 31, 2022 14:33
Exemple de switch d'URL, base de données MYSQL avec architecture Wordpress >= 8
UPDATE wp_options SET option_value = replace(option_value, 'http://localhost/wp', 'VOTRE_URL_DE_PRODUCTION_ICI') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://localhost/wp','VOTRE_URL_DE_PRODUCTION_ICI');
UPDATE wp_posts SET post_content = replace(post_content, 'http://localhost/wp', 'VOTRE_URL_DE_PRODUCTION_ICI');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://localhost/wp','VOTRE_URL_DE_PRODUCTION_ICI');
@sudomaxime
sudomaxime / doc-example.json
Created December 9, 2023 17:47
doc-example.json
{
"endpoint": "/user",
"handler": "UserCreateHandler",
"inputs": {
"body": {
"email": {
"type": "string",
"pipeline": [
{
"type": "check",
@sudomaxime
sudomaxime / procedural.ts
Created March 29, 2024 18:35
Simple example of procedural approach to clean architecture without interfaces
import * as z from 'zod';
// ENTITY ========================================================
const userEntityPresenter = z.object({
id: z.number(),
name: z.string(),
email: z.string()
});