Skip to content

Instantly share code, notes, and snippets.

View Camilotk's full-sized avatar

Camilo Cunha de Azevedo Camilotk

View GitHub Profile
@Camilotk
Camilotk / using-uuid-as-pk.md
Created October 31, 2023 16:39 — forked from rponte/using-uuid-as-pk.md
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@Camilotk
Camilotk / from-scratch-boolean.js
Created October 6, 2023 12:33 — forked from RodrigoDornelles/from-scratch-boolean.js
from scratch boolean logic recreation based on the pure functional paradigm and lambda calculus.
const TRUE = (p) => (q) => (p)
const FALSE = (p) => (q) => (q)
const OR = (p) => (q) => p(p)(q)
const NOT = (p) => (p)(FALSE)(TRUE)
const AND = (p) => (q) => (p)(q)(FALSE)
const PROG = (func) => FALSE(func())(PROG)
const PRINT = (text) => () => TRUE(console.log(text))
const IF = (cond) => (execute) => (nonexecute) => (cond(execute)(nonexecute))()
PROG
@Camilotk
Camilotk / ElixirLinkedList.ex
Created March 22, 2023 21:58 — forked from aaruel/ElixirLinkedList.ex
Elixir Linked List Implementation
defmodule LinkedList do
defstruct data: 0,
next: nil,
index: 0
def new(data \\ 0, index \\ 0) do
%__MODULE__{data: data, index: index}
end
def push(
@Camilotk
Camilotk / using-details-summary-github.md
Created November 21, 2022 18:33 — forked from scmx/using-details-summary-github.md
Using <details> <summary> expandable content on GitHub with Markdown #details #summary #markdown #gfm #html

How to use <details> <summary> expandable content on GitHub with Markdown

Firstly, what is <details> <summary>?

The HTML Details Element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the <summary> element. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details.

Example

type Eq<A, B> = <X>(a: A, eq: (x: A & B) => X) => X;
const refute = (x: never) => x;
const refl = <A, X>(a: A, eq: (x: A) => X) => eq(a);
const sickos = <A>(x: A, eq: Eq<A, number>) => eq(x, (x) => x);
const two = sickos(2, refl);
type Ty<A> =
| { tag: "number"; eq: Eq<A, number> }
| { tag: "string"; eq: Eq<A, string> };

Roadmap de estudos de SQL

Aviso: Muitas vezes detalhes de várias operações podem variar de banco para banco. Em questões onde fiquei em dúvida, este documento segue o funcionamento do PostgreSQL, pois é o banco que conheço melhor.

Pré-requisito: Álgebra Relacional básica

Antes de começar a escrever SQL, você precisa entender o modelo de como um banco de dados relacional funciona. Não precisa se aprofundar muito, mas você precisa entender como que dados e relacionamentos entre eles são representados. (Nota importante: Relacionamento e relação não são a

@Camilotk
Camilotk / rich-already-answered-that.md
Created May 12, 2022 01:17 — forked from reborg/rich-already-answered-that.md
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@Camilotk
Camilotk / clojure-beginner.md
Created April 18, 2022 23:29 — forked from yogthos/clojure-beginner.md
Clojure beginner resources

Introductory resources

// not iterable
{
const myItem = {
a: 1,
b: 2
}
// const r = [...myItem] // TypeError: myItem is not iterable
}
// now object is iterable