Skip to content

Instantly share code, notes, and snippets.

@sibelius
sibelius / woovi_job.md
Last active August 31, 2024 16:18
Woovi Job Description
@steveruizok
steveruizok / cache.ts
Last active May 8, 2025 03:01
weak map gist
export class Cache<T extends object, K> {
items = new WeakMap<T, K>()
get<P extends T>(item: P, cb: (item: P) => K) {
if (!this.items.has(item)) {
this.items.set(item, cb(item))
}
return this.items.get(item)!
}

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

@supahfunk
supahfunk / InstancedMesh.js
Last active January 29, 2024 12:53
React-three fiber instanced mesh with Drei
import { useGLTF, Instances, Instance } from '@react-three/drei'
import { MathUtils } from 'three'
const InstancedMesh = () => {
const { nodes } = useGLTF('./model.glb')
const randomVector = (r) =>
Array(3)
.fill()
.map(() => MathUtils.randFloatSpread(r))
@vit0rr
vit0rr / start.md
Last active April 22, 2025 14:27
Como iniciar no Rust?

A maneira mais comum para começar a estudar Rust é ler o livro oficial da linguagem. Irá ensinar sobre vários dos conceitos mais importantes sobre a linguagem.

A leitura pode ser acompanhada por:

@samselikoff
samselikoff / 1-PictureForm.js
Last active June 8, 2023 02:04
Diff of the PictureForm component from "Let's build a feature – Cropped Image Uploads!" https://youtu.be/W5__zfYrtt8
import Button from "@/components/Button";
import ImageCropper, {
getCroppedImage,
getDataURLFromFile,
} from "@/components/ImageCropper";
import Modal from "@/components/Modal";
import useCurrentUser from "@/hooks/use-current-user";
import useMutation from "@/hooks/use-mutation";
import { UserIcon } from "@heroicons/react/outline";
import { gql } from "graphql-request";
@supahfunk
supahfunk / coveruv.glsl
Last active January 29, 2024 12:39
Cover UV / Contain UV
/*------------------------------
Background Cover UV
--------------------------------
u = basic UV
s = screensize
i = image size
------------------------------*/
vec2 CoverUV(vec2 u, vec2 s, vec2 i) {
float rs = s.x / s.y; // Aspect screen size
float ri = i.x / i.y; // Aspect image size
@matheus1lva
matheus1lva / gist:2efb09a9bffe2b0998acdee0168c0340
Created September 10, 2021 18:53
find files and run lint and tests based on only files that changed
#!/usr/bin/node
/* eslint-disable @typescript-eslint/no-unused-expressions */
// eslint-disable-next-line import/no-extraneous-dependencies
const sh = require('shell-tag');
const detectChangedFiles = () => {
const appFolders = ['routes', 'pages', 'modules', 'hooks'];
const changedFiles = sh`git diff develop --name-only`;
return changedFiles.split(/\n/g).filter((file) => {
@sibelius
sibelius / learning-path-web3.md
Last active August 21, 2024 01:08
Learning Path Web3
  • learn blockchain concepts
  • learn ethereum
  • learn how to use metamask
  • learn how to use hardhat (https://hardhat.org/)
  • learn how to deploy and interact with a smart contract
  • learn common smart contract standards like ERC20 (token), ERC721 (nft), ERC1155 (opensea)
  • learn ipfs
  • learn how to read blockchain explorers like https://etherscan.io/
  • learn how to use web3 and etherjs
  • learn solidity