Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / README.md
Last active February 28, 2023 02:10
Deploy custom Optimism rollup instructions

Instructions

Unofficial guide on deploying a custom Optimism rollup on Kovan

⚠️ Notice: Guide updated April 2021. Check out the Optimism discord for additional help and support.

Clone optimism contracts:

git clone git@github.com:ethereum-optimism/optimism.git
@spalladino
spalladino / falsehoods-that-ethereum-programmers-believe.md
Last active May 20, 2024 21:04
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

@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@kunal365roy
kunal365roy / gist:3c37ac9d1c3aaf31140f7c5faa083932
Created March 30, 2020 20:46
Parity vs. Geth Error Code responses
PARITY_SUBSCRIPTION_INVALID_TRANSPORT = -32090
eth_subscribe
{"id":4,"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads",{}]}
PARITY: {"jsonrpc": "2.0", "id": 4, "error": {"code": -32090, "message": "Subscriptions are not available on this transport."}}
GETH: {"jsonrpc":"2.0","id":4,"error":{"code":-32000,"message":"notifications not supported"}}
PARITY_EXCEPTION_ERROR = -32016
eth_estimateGas
{"id": 1, "jsonrpc": "2.0", "params": [{"to": "0x61935cbdd02287b511119ddb11aeb42f1593b7ef", "data": "0xa6c3bf33000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000", "value": "0x3ff2e795f5000", "gasPrice": "0x1bf08eb00", "from": "0x6f67fedc36664c4d954cb4487c0377c9050bd1a0"}], "method": "eth_estimateGas"}
@janaz
janaz / get-aws-console-url.js
Last active March 27, 2024 12:05
Generate AWS console URL from the credentials stored in environment variables
/**
* This little program prints out the url to the AWS console
* generated from the local AWS credentials stored in environment variables:
* AWS_ACCESS_KEY_ID
* AWS_SECRET_ACCESS_KEY
* AWS_SESSION_TOKEN
*
* Steps:
* 1. Create a JSON object
* session = JSON.stringify({
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
// This is universal, works with Infura -- set provider accordingly
const ethers = require('ethers')
//const provider = ethers.getDefaultProvider('rinkeby')
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL)
function hex_to_ascii(str1) {
var hex = str1.toString();
var str = '';
for (var n = 0; n < hex.length; n += 2) {
@jacobtomlinson
jacobtomlinson / .gitignore_global
Created August 18, 2017 10:08
An example global gitignore file
# An example global gitignore file
#
# Place a copy if this at ~/.gitignore_global
# Run `git config --global core.excludesfile ~/.gitignore_global`
# Compiled source #
###################
*.com
*.class
*.dll
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway: