Skip to content

Instantly share code, notes, and snippets.

@sambacha
sambacha / Info.plist
Last active February 12, 2021 12:27 — forked from pnc/ocr-shot.sh
OCR
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMFolderAction</key>
<string>AMAddingFolderItems</string>
</dict>
</plist>
@skurfuerst
skurfuerst / gen-types.mjs
Created January 16, 2021 21:10
Generate runtypes from TypeScript definitions using ts-morph
// RUN with a recent node.js version, using "node gen-types.mjs"
// DEPENDS on typescript and ts-morph
import { Project } from "ts-morph";
import { writeFileSync } from "fs";
const project = new Project({
tsConfigFilePath: "tsconfig.json",
});
@angerman
angerman / Installation.md
Last active February 1, 2024 11:38
Installing nix on macOS BigSur

The nixos.org website suggests to use:

sh <(curl -L https://nixos.org/nix/install)

For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use

sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
@aleclarson
aleclarson / .rollup-plugin-preserve-jsx.md
Last active May 11, 2022 06:43
rollup-plugin-preserve-jsx

rollup-plugin-preserve-jsx

Preserve JSX with proper tree-shaking.

  • acorn-jsx is injected for you.
  • @babel/plugin-syntax-jsx is needed if you're using Babel.

 

TODO

assert() (sometimes called invariant())

Instead of checks like:

if (value === null) {
  throw new Error("missing value")
}
doSomethingThatNeedsValue(value)
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.6.8;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
@sambacha
sambacha / compile.js
Last active January 29, 2021 04:37
solidity abi generator on compile
const path = require("path");
const fs = require("fs");
const solc = require("solc");
const compile = filename => {
const sourcePath = path.join(__dirname, filename);
const input = {
sources: {
[sourcePath]: {
@sambacha
sambacha / .ALL_THINGS_GITWORKFLOW.md
Last active January 30, 2021 00:14
Generate CHANGELOG via Git and Bash only

Omnibus Gist of Git

@spalladino
spalladino / falsehoods-that-ethereum-programmers-believe.md
Last active August 16, 2025 20:50
Falsehoods that Ethereum programmers believe

Falsehoods that Ethereum programmers believe

I recently stumbled upon Falsehoods programmers believe about time zones, which got a good laugh out of me. It reminded me of other great lists of falsehoods, such as about names or time, and made me look for an equivalent for Ethereum. Having found none, here is my humble contribution to this set.

About Gas

Calling estimateGas will return the gas required by my transaction

Calling estimateGas will return the gas that your transaction would require if it were mined now. The current state of the chain may be very different to the state in which your tx will get mined. So when your tx i