Skip to content

Instantly share code, notes, and snippets.

View pedrouid's full-sized avatar
🛠️
Building @WalletConnect Network

Pedro Gomes pedrouid

🛠️
Building @WalletConnect Network
View GitHub Profile
@pedrouid
pedrouid / ethereumTokenInterfaces.md
Last active January 9, 2020 07:21
Ethereum Token Standard Interfaces (ERC-20 vs ERC-223 vs ERC-777)

ERC20 - Token Standard

https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md

contract ERC20 {
   function totalSupply() constant returns (uint theTotalSupply);
   function balanceOf(address _owner) constant returns (uint balance);
   function transfer(address _to, uint _value) returns (bool success);
   function transferFrom(address _from, address _to, uint _value) returns (bool success);
   function approve(address _spender, uint _value) returns (bool success);
@pedrouid
pedrouid / windowResize.js
Created March 22, 2018 00:25
Window Responsiveness React High Order Component
import React, { Component } from 'react';
function windowResize(WrappedComponent) {
return class extends Component {
state = {
width: '',
height: ''
};
updateDimensions = () => {
const w = typeof window !== 'undefined' ? window : '';
@pedrouid
pedrouid / keybase.md
Created April 5, 2018 19:24
Keybase proof

Keybase proof

I hereby claim:

  • I am pedrouid on github.
  • I am pedrouid (https://keybase.io/pedrouid) on keybase.
  • I have a public key ASDDFwDqo6cL3R8995Y0mPgSp8ZPq2PnjfR_z-HpyPhoxgo

To claim this, I am signing this object:

@pedrouid
pedrouid / remote-work.md
Last active October 1, 2020 23:19
REMOTE WORK PLATFORMS & COMPANIES
@pedrouid
pedrouid / bignumber.js
Last active November 25, 2021 18:48
BigNumber Helper Functions (Javascript & Typescript)
import BigNumber from "bignumber.js";
export function random() {
return BigNumber.random().toString();
}
export function toFixed(value, decimals) {
return new BigNumber(`${value}`).toFixed(decimals).toString();
}
@pedrouid
pedrouid / git-submodule.md
Created September 24, 2018 00:11
Git Submodules Cheatsheet

Add Submodule

git submodule add git@mygithost:project lib/project

Update Submodule

cd lib/project && git pull && cd ../.. && git commit -a -m 'update submodule'
@pedrouid
pedrouid / randomId.js
Last active December 17, 2018 14:44
Random ID Generator (Javascript) | 170 bytes
function r(l=32){var r="",a='abcdefghijklmnopqrstuvwxyz',c=a.toUpperCase()+a+'0123456789';for(var i=0; i<l; i++)r+=c.charAt(Math.floor(Math.random()*c.length));return r;}
@pedrouid
pedrouid / express.js
Created December 1, 2018 16:43
Node.js Hello World Server Example (http vs express.js vs fastify.js)
const express = require('express');
const app = express();
// Routes
app.get('/', (req, res) => {
res.send('Hello World!');
});
// Listen
const port = process.env.PORT || 5000;
@pedrouid
pedrouid / webcrypto-examples.md
Created December 15, 2018 01:07
Web Cryptography API Examples
@pedrouid
pedrouid / setup-ssl.md
Last active May 31, 2025 17:30
Setup SSL with NGINX reverse proxy

Get a Free SSL Certificate With Let’s Encrypt

Let’s Encrypt is a free, automated, and open Certificate Authority.

  1. Install tools for using the Let's Encrypt certificates using Certbot
  sudo apt-get update \
  sudo apt-get install software-properties-common