Skip to content

Instantly share code, notes, and snippets.

let is_valid ~email =
match (String.length email, email) with
| (0, _) -> Error "empty email is not valid"
| (len, _) when len > max_email_length -> Error "Email length exceeds the limit"
| (_, email) when string_is_bigger_than max_email_length [email] -> Error "Email is bigger than the limitations"
| _ -> Ok ()
SELECT
i.invoice_id,
CONCAT(u.first_name, ' ', u.middle_name, ' ', u.last_name) AS "Nome Completo",
u.id_document AS "CPF",
u.phone_number AS "Telefone",
a.email AS "Email",
est.establishment_name AS "Nome da Loja",
i.establishment_doc AS "CNPJ da Loja",
i.invoice_number AS "Número da Nota",
i.invoice_series AS "Série da Nota",
package main
import "fmt"
type Rule struct {
Length int
Range []int
Count int
}
vim.cmd("set expandtab")
vim.cmd("set tabstop=4")
vim.cmd("set softtabstop=4")
vim.cmd("set shiftwidth=4")
vim.cmd("set number")
vim.g.mapleader = " "
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
@gmdias727
gmdias727 / .bashrc
Created November 30, 2024 23:06
Add this to your .bashrc if you want a toggle function to switch between US and ABNT-2 keyboard layouts on linux.
function toggle_layout {
currentLayout=$(setxkbmap -query | grep layout | awk '{print $2}')
if [ "$currentLayout" == "br" ]; then
setxkbmap us && notify-send -t 1000 "Switched to US Layout"
else
setxkbmap br && notify-send -t 1000 "Switched to ABNT-2 Layout"
fi
}
@gmdias727
gmdias727 / i3status.conf
Created November 30, 2024 19:32
my personal i3 status bar configuration (November 30 2024)
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
@gmdias727
gmdias727 / config
Last active November 30, 2024 23:04
i3wm config file (November 30 2024)
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
@gmdias727
gmdias727 / seed_drizzle_zod_faker.ts
Created November 7, 2024 03:40 — forked from ironheart122/seed_drizzle_zod_faker.ts
TS Seed Script: Drizzle ORM + Zod + Faker (Minimal)
// tsx seed.ts
import { faker } from '@faker-js/faker';
import { pgTable, text, varchar, timestamp } from 'drizzle-orm/pg-core';
import { drizzle, PostgresJsDatabase } from 'drizzle-orm/postgres-js';
import { createInsertSchema } from 'drizzle-zod';
import { customAlphabet } from 'nanoid';
import postgres from 'postgres';
import { z } from 'zod';
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"outline_panel": {
@gmdias727
gmdias727 / index.js
Created August 26, 2024 15:00
GET ALL CARDS FROM TRELLO BOARD
import fetch from 'node-fetch';
import fs from "fs";
import { formatDate } from "date-fns"
// provide the following
const key = ""
const token = ""
const boardId = ""
fetch(`https://api.trello.com/1/boards/${boardId}/cards?key=${key}&token=${token}`, {