Skip to content

Instantly share code, notes, and snippets.

View macabeus's full-sized avatar
:octocat:
⁽⁽٩(๑˃̶͈̀ ᗨ ˂̶͈́)۶⁾⁾

Bruno Macabeus macabeus

:octocat:
⁽⁽٩(๑˃̶͈̀ ᗨ ˂̶͈́)۶⁾⁾
View GitHub Profile
import os
from pathlib import Path
import modal
import re
import subprocess
from typing import Optional
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import partial
from typing import Dict

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

@klange
klange / _.md
Last active September 9, 2025 10:11
12 Years of ToaruOS

12 Years of ToaruOS

This is a repost and update to an imgur album with screenshots of ToaruOS throughout its development, as imgur is no longer a viable platform for maintaining this collection.

Early Development

My first commit in the ToaruOS repository, ecd4fe2bc170b01ad700ff76c16da96993805355, was made on January 15th, 2011. This date has become ToaruOS's "birthday". It would be another six years and two weeks before ToaruOS's first real release, 1.0.

1 - eL4aHBZ - Humble Beginnings

Instantiation in O(n)

Most of the time instantiation is actually O(n log n), this mostly don't matter as types are always small. But for big types by having an additional memory cell on every type, an array / vector can be created.

Invariants

Doesn't matter how forall is encoded, instantiation needs to copy all sections of a type that may include an occurence of the free variable being instantiated.

Maybe an additional branching can be used to prevent allocation.

@sibelius
sibelius / useCaretPosition.tsx
Created January 25, 2021 20:59
listen to caret position of an input
const useCaretPosition = () => {
const [caret, setCaret] = useState({
selectionStart: 0,
selectionEnd: 0,
});
const onEvent = useCallback((e) => {
const input = e.target;
setCaret({
-- `Cont r a` é o tipo de uma computação que produz um `a` e, quando completa,
-- irá produzir um `r`. Você pode ver como uma linha de produção com uma parte
-- "faltando" - essa parte é a função `a -> r` que o `Cont` precisa para estar
-- "completo".
newtype Cont r a = Cont { runCont :: (a -> r) -> r }
-- pode não ser imediatamente óbvio por que uma função do tipo `(a -> r) -> r`
-- precisa, em geral, produzir um `a` internamente - por parametricidade, só existem
-- duas formas de uma função polimórfica do tipo `(a -> r) -> r` existir:
@akitaonrails
akitaonrails / links.md
Created November 6, 2019 01:28
Links de referência pro Episódio 66 do Canal Akitando
@lhorie
lhorie / longest-keyword-sequence.md
Last active November 13, 2024 04:15
What's the longest keyword sequence in Javascript?
@sinclairtarget
sinclairtarget / fish.sim
Last active December 29, 2024 03:36
Simula Demonstration
Simulation Begin
! We will use this as input to Normal() below ;
Integer seed;
! Utility method for logging messages along with the current simulation
time ;
Procedure log(message); Text message; Begin
OutFix(Time, 2, 0);
OutText(": " & message);
OutImage;
@hjJunior
hjJunior / jwt-payload-parse.dart
Created January 15, 2019 18:00
Get payload of JWT token in Dart language
import 'dart:convert';
Map<String, dynamic> parseJwt(String token) {
final parts = token.split('.');
if (parts.length != 3) {
throw Exception('invalid token');
}
final payload = _decodeBase64(parts[1]);
final payloadMap = json.decode(payload);