Skip to content

Instantly share code, notes, and snippets.

View fersilva16's full-sized avatar
🦀

Fernando Silva fersilva16

🦀
View GitHub Profile
@matthen
matthen / hello_world.py
Last active August 29, 2024 12:50
Hello world in python, using genetic algorithm
"""Hello world, with a genetic algorithm.
https://twitter.com/matthen2/status/1769368467067621791
"""
import random
import time
from dataclasses import dataclass
from itertools import chain
from typing import Iterable, List
@Grubba27
Grubba27 / generic-proxy.ts
Created January 3, 2024 19:56
create your own tRPC-like api with JavaScript proxy and a little bit of ts magic
const setProxySettings = (
{
call,
filter,
}: {
call: ({ path, args }: { path: unknown; args: unknown[] }) => any;
filter: (path: string[]) => unknown;
} = {
call: ({ path, args }) => {
return {
@jgcmarins
jgcmarins / decision-matrix.md
Created September 25, 2023 14:49
Looking for a new career opportunity? Use this table to create a ranking of all job offers

Table of concepts and definitions

Concept Definition
Autonomy How well will this company give me autonomy to do my job?
Freedom How much freedom will I have to balance work and personal life?
Responsibilities What level of responsibilities will I have, and how extensive will they be?
Culture How well does this company's culture align with my values, and how open is the company to allowing me to contribute to the culture I believe in?
Tech Stack How closely does the tech stack used by this company align with my preferences, and to what extent is the company willing to allow me to use the stack I prefer?
Personal Growth How big is the potential of this company to help me keep growing?
@JLarky
JLarky / IsolateCSS.tsx
Last active July 10, 2023 09:23
How to use shadow dom to isolate CSS of React component https://twitter.com/JLarky/status/1657989891526123520
export function IsolateCSS(props: { children: React.ReactNode }) {
const onceRef = useRef(false);
const [shadowRoot, setShadowRoot] = useState<ShadowRoot>();
const ref = useCallback((ref: HTMLDivElement | null) => {
if (ref && onceRef.current === false) {
onceRef.current = true;
setShadowRoot(ref.attachShadow({ mode: 'open' }));
}
}, []);

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

@sibelius
sibelius / data_modeling.md
Created October 31, 2022 17:09
Data modeling

What is Data Modeling?

Data modeling is to decide where and how are you going to store your data.

You need to think in the shape of data.

In how many tables/collections should you separate your data?

What are the fields of each table/collection?

@sibelius
sibelius / zettelkasten-notion-sample.md
Last active October 23, 2022 21:13
one sample zettelkasten in my notion

Stuck on a Good Salary

Apprenticeship Patterns

Stuck on a Good Salary

You can easily get stuck on a "good" salary.

you feel that you are stuck

defmodule Quine do
@header "defmodule Quine do\n @header \""
@indent """
def indent(str) do
str
|> String.split(\"\\n\")
|> Enum.map(&(\" \" <> &1))
|> Enum.join(\"\\n\")
end
@marcelgsantos
marcelgsantos / documentacao-arquitetura-de-sistemas.md
Last active March 12, 2024 19:03
Documentação de Arquitetura de Sistemas - Compilado de Perguntas e Respostas Feitas na Comunidade

Questões sobre Documentação da Arquitetura de Sistemas

1. Perguntas

Fiz algumas perguntas nas redes sociais e ferramentas de comunicação como Twitter, LinkedIn, Slack, Discord e Telegram sobre como as pessoas costumam documentar a arquitetura de sistemas.

  1. Vocês costumam desenhar diagramas para documentar a arquitetura dos sistemas que vocês constroem?

  2. O que vocês costumam representar: código, infraestrutura ou ambos?

@Widdershin
Widdershin / ssr.md
Last active May 1, 2024 17:36
The absurd complexity of server-side rendering

In the olden days, HTML was prepared by the server, and JavaScript was little more than a garnish, considered by some to have a soapy taste.

After a fashion, it was decided that sometimes our HTML is best rendered by JavaScript, running in a user's browser. While some would decry this new-found intimacy, the age of interactivity had begun.

But all was not right in the world. Somewhere along the way, we had slipped. Our pages went uncrawled by Bing, time to first meaningful paint grew faster than npm, and it became clear: something must be done.

And so it was decided that the applications first forged for the browser would also run on the server. We would render our HTML using the same logic on the server and the browser, and reap the advantages of both worlds. In a confusing series of events a name for this approach was agreed upon: Server-side rendering. What could go wrong?

In dark rooms, in hushed tones, we speak of colours.