Skip to content

Instantly share code, notes, and snippets.

View samajammin's full-sized avatar

Sam Richards samajammin

View GitHub Profile
<ethereum context>
remember bignumbers are weird in TS/JS we are using BigInt here as much as we can and you have
formatEther and parseEther in viem as usual
all dialogs and ui should display the token * 10 ^ 18 or using formatEther - and then when you
go to send it with useScaffoldReadContract and useScaffoldWriteContract you need to
parseEther the amount in ETH back to WEI (by dividing by 10 ^18)
when you β€œcall a function” on a contract you are just making a transaction to the contract on ethereum with
some specific calldata that says what function you want to call with what parameters
huge bonus if your address inputs have a QR code scanner so you can scan a QR of someones address

"Noir in an Afternoon" cheat sheet

Codespace:

https://github.com/codespaces/new/aztecprotocol/tiny-noir-codespace

Or manually

@luckyyang
luckyyang / fomo3d.sol
Created July 26, 2018 02:56
Fomo3D smart contract
pragma solidity ^0.4.24;
/**
* @title -FoMo-3D v0.7.1
* β”Œβ”¬β”β”Œβ”€β”β”Œβ”€β”β”Œβ”¬β” ╦╦ ╦╔═╗╔╦╗ β”Œβ”€β”β”¬β”€β”β”Œβ”€β”β”Œβ”€β”β”Œβ”€β”β”Œβ”β”Œβ”Œβ”¬β”β”Œβ”€β”
* β”‚ β”œβ”€ β”œβ”€β”€β”‚β”‚β”‚ β•‘β•‘ β•‘β•šβ•β•— β•‘ β”œβ”€β”˜β”œβ”¬β”˜β”œβ”€ β””β”€β”β”œβ”€ β”‚β”‚β”‚ β”‚ └─┐
* β”΄ β””β”€β”˜β”΄ β”΄β”΄ β”΄ β•šβ•β•šβ•β•β•šβ•β• β•© β”΄ β”΄β””β”€β””β”€β”˜β””β”€β”˜β””β”€β”˜β”˜β””β”˜ β”΄ β””β”€β”˜
* _____ _____
* (, / /) /) /) (, / /) /)
* β”Œβ”€β” / _ (/_ // // / _ // _ __ _(/
* β”œβ”€β”€ ___/___(/_/(__(_/_(/_(/_ ___/__/_)_(/_(_(_/ (_(_(_
@Kartones
Kartones / postgres-cheatsheet.md
Last active December 9, 2025 11:10
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)