Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2024 15:48
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@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
@miguelmota
miguelmota / external_link_arrow.txt
Last active April 30, 2024 15:17
Unicode UTF-8 external link arrow symbol (closest thing to it)
@miguelmota
miguelmota / example.go
Last active September 17, 2023 05:42
Go encode unsigned transaction, decode transaction, sign and broadcast examples
package main
import (
"context"
"encoding/hex"
"fmt"
"log"
"math/big"
"github.com/ethereum/go-ethereum/common"
@Phate6660
Phate6660 / rust recommendations and alternatives.md
Last active September 1, 2023 16:49
My growing list of Rust programs to use.
@spalladino
spalladino / falsehoods-that-ethereum-programmers-believe.md
Last active March 8, 2024 14:34
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

<body onload="d=m=document;n=Math.random;c=z.getContext`2d`;f=g=>c.fillStyle=g;r=(...y)=>c.fillRect(...y);L=_=>{clearInterval(m);v=i=X=m=s=0;h=71;P=[1,2,3].map(k=>({x:X+=150,y:n()*86}))};L();R=_=>{f`gold`;r(0,0,X,X);f`red`;for({x,y} of P){r(x,0,16,y);r(x,y+48,16,102-y)}r(0,h,8,8);c.fillText(s,0,8)};R();d.onclick=_=>{v=-5;m=m||setInterval('h=h*(h>0);h>=142&&L();h+=v+=0.5;for(p of P){p.x-=2;if(p.x<-31){p.x+=450;p.y=n(s++)*86}p.x<8&&(h<p.y||h>p.y+48)&&L()}R()',35)}"><canvas id=z>
@miguelmota
miguelmota / install_go.sh
Last active August 22, 2021 11:38
Linux download and install Go (golang)
# https://golang.org/dl/
wget https://golang.org/dl/go1.14.6.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.14.6.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
@miguelmota
miguelmota / README.md
Last active February 2, 2024 02:22
Web-based terminal sharing programs

Comparison of web-based terminal sharing programs

In no particular order:

web app TLS support basic authentication support self-host storage multiple process support replay write from web 2-way read custom share urls webrtc support requires SSH client open source server open source language stars
gotty go 14k
ttyd C 2.7k
wetty JS 2.5k
ttycast JS
@miguelmota
miguelmota / add_user.sh
Last active September 5, 2022 06:16
Linux add user example
sudo useradd -m mota
# alternative way to create home directory
# mkhomedir_helper mota
sudo passwd mota
sudo su - mota
sudo whoami