Skip to content

Instantly share code, notes, and snippets.

View MarcoWorms's full-sized avatar
:shipit:
undefined

Marco Guaspari Worms MarcoWorms

:shipit:
undefined
View GitHub Profile
name description
ask-questions-if-underspecified
Clarify requirements before implementing. Do not use automatically, only when invoked explicitly.

Ask Questions If Underspecified

Goal

Ask the minimum set of clarifying questions needed to avoid wrong work; do not start implementing until the must-have questions are answered (or the user explicitly approves proceeding with stated assumptions).

@MarcoWorms
MarcoWorms / ralph.sh
Last active January 10, 2026 07:45
ralph wiggum
#!/usr/bin/env zsh
emulate -L zsh
setopt pipefail
RW() {
emulate -L zsh
setopt pipefail
local prompt="$1"
local stop="$2"

Images are from https://www.refactoringui.com/ book

Hue is measured in degrees

  • 0° is red
  • 120° is green
  • 240° is blue.

hue examples

Saturation is how colorful or vivid a color looks

/**
* @notice Determine whether or not a given target and calldata is valid
* @dev In order to be valid, target and calldata must pass the allowlist conditions tests
* @param targetAddress The target address of the method call
* @param data The raw calldata of the call
* @return isValid True if valid, false if not
*/
function validateCalldataByOrigin(
string memory originName,
{
"id": "TOKEN_APPROVE_VAULT",
"implementationId": "IMPLEMENTATION_YEARN_VAULTS",
"methodName": "approve",
"paramTypes": ["address", "uint256"],
"requirements": [
["target", "isVaultUnderlyingToken"],
["param", "isVault", "0"]
]
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20, Ownable {
constructor() ERC20("Weed", "WEED") {
_mint(0xCA88C5D43Bb11eDBcBC1436fEFA9d578d8D64489, 420 * 10 ** decimals());
}
@MarcoWorms
MarcoWorms / ftm.md
Last active October 19, 2021 19:53
Buying $FTM to use Fantom Opera network services

Buying FTM

  1. If you have no other cryptos yet create and account at an exchange, for buying FTM we recommend Binance - Same link without referal code because it integrates the Fantom Opera network (the main fantom network)

  2. After creating an account at an exchange, deposit FIAT money (that's crypto lingo for paper money) into your exchange balance

  3. Once you have deposited funds you can either purchase FTM directly from a market or use the binance automatic converter.

Installing a browser wallet

const seed = 1234
const shuffledDeck = shuffle(seed, deck)
const { pipe, sortBy, prop, pluck } = require('ramda')
const shuffle = (seed, deck) => {
const routine = pipe(
deck => deck.map((card, index) => ({
rank: seededRandom(seed + index),
card,
})),
sortBy(prop('rank')),
pluck('card')