Skip to content

Instantly share code, notes, and snippets.

View vitorsouzaalmeida's full-sized avatar

Vitor S. Almeida vitorsouzaalmeida

View GitHub Profile
@BRonen
BRonen / arithmetic.jq
Created August 16, 2025 16:56
Reverse polish notation arithmetic interpreter in JQ
def tokens:
split(" ") | map(select(length > 0));
def isnum:
test("^-?([0-9]+(\\.[0-9]+)?)$");
def evaluate:
def eval($tokens):
if ($tokens | length) == 0 then
error("ending unexpected")
(*
Everything here is really ugly as I didn't clean it,
some bits come from the Coq-HoTT library.
The main idea is that given funext and any
h-set with multiple provably distinct elements.
Univalence is only used to prove s_true_neq_s_false
Then by funext you can get the induction principle to contract.
@AndrasKovacs
AndrasKovacs / TwoStageRegion.md
Last active July 26, 2025 08:26
Lightweight region memory management in a two-stage language
module type T = sig
module type S
end
module T = struct
module type S = T
end
module type K_Bool = functor (X : T) (Y : T) -> T
@Grubba27
Grubba27 / cripto.go
Created June 21, 2023 20:31
Generate public address using message and private from metamask
package cripto
import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
)
// from: https://gist.github.com/dcb9/385631846097e1f59e3cba3b1d42f3ed#file-eth_sign_verify-go
func VerifySig(from, sigHex string, msg []byte) bool {
@Grubba27
Grubba27 / get_url_params.ts
Created January 30, 2023 21:09
Get url params
type GetParams<
Text extends string,
Result extends string = ''
> =
Text extends `${ infer L }${ infer R }`
? L extends '/'
? Result
: GetParams<R, `${ Result }${ L }`>
: Result

Como Pensar

Ler e entender um pouco desse artigo. https://wiki.c2.com/?FeynmanAlgorithm

  • Reconhecer como você pensa
  • Descrever métodos que você usa para pensar
  • Entender métodos diferentes de pensar
  • Fazer perguntas sobre tudo(incluindo sobre perguntas)

Perguntas

Examples

[@import stdlib.http.v1];

(x => y => (x_plus_y: x + y) => );

((A, x))
(f: () -> (A: *, x: A)) =>
  (A, x) = (f ());
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> };