Skip to content

Instantly share code, notes, and snippets.

View juliomerisio's full-sized avatar

Julio Merisio juliomerisio

View GitHub Profile

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 November 20, 2022 12:22
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 January 8, 2024 19:16
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
/*
dado o seguinte cenário, um objeto que pode ter valores aninhados até 2 níveis,
deve-se remover a chave do primeiro nível se alguma das chaves aninhadas
for (undefined ou {} ou '' ou null) - 0 não conta
*/
const isObject = (v) => typeof v === 'object' && !Array.isArray(v)
const isEmptyObject = (obj) => isObject(obj) && (Object.keys(obj).length === 0)
const isNull = (v) => v === '' || v === null || v === undefined;
@supahfunk
supahfunk / background.js
Created June 22, 2021 14:56
GLSL Background size cover - R3F
const Background = () => {
const { viewport } = useThree()
const scale = useMemo(() => ((40 + 15) / viewport.distance), [viewport])
const [bgTexture] = useTexture(['./bg.png'])
const shaderArgs = useMemo(() => ({
uniforms: {
uTexture: { value: bgTexture },
uResolution: { value: { x: viewport.width, y: viewport.height } },
uImageRegsolution: { value: { x: bgTexture.image.width, y: bgTexture.image.height } },