Skip to content

Instantly share code, notes, and snippets.

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

Bruno Macabeus macabeus

:octocat:
⁽⁽٩(๑˃̶͈̀ ᗨ ˂̶͈́)۶⁾⁾
View GitHub Profile

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 April 19, 2024 16:24
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 14, 2022 23:21
What's the longest keyword sequence in Javascript?
@sinclairtarget
sinclairtarget / fish.sim
Last active February 21, 2022 15:18
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);
@sinclairtarget
sinclairtarget / 1-cat-pdp7.s
Last active April 2, 2024 20:15
cat through the ages
" cat
lac 017777 i " Load accumulator (AC) with argument count
sad d4 " Skip next if we have more than 4 words of args
jmp nofiles " Otherwise, jump to nofiles
lac 017777 " Load AC with address of args
tad d1 " Increment AC by 1, past argument count
tad d4 " Increment AC by 4, now AC points to first real arg
dac name " Save arg pointer from AC into 'name'