Skip to content

Instantly share code, notes, and snippets.

View cds-amal's full-sized avatar
🏠
Working from home

cds-amal cds-amal

🏠
Working from home
  • Flushing USA
View GitHub Profile

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

1 EIP Purpose and Guidelines
2 Homestead Hard-fork Changes
3 Addition of CALLDEPTH opcode
4 EIP Classification
5 Gas Usage for `RETURN` and `CALL*`
6 Renaming SUICIDE opcode
7 DELEGATECALL
8 devp2p Forward Compatibility Requirements for Homestead
20 ERC-20 Token Standard
55 Mixed-case checksum address encoding
@cds-amal
cds-amal / create_repo_labels.sh
Created August 3, 2021 05:34 — forked from liuderchi/create_repo_labels.sh
To Create Labels for your Repo
#!/bin/bash
set -e
# NOTE to create labels for your repo
# to support types from commit message guide (feat, fix, docs, style, refactor, test, chore)
# by hitting GitHub API v3
#
# https://docs.github.com/en/rest/reference/issues#create-a-label
# https://developer.github.com/v3/issues/labels/#create-a-label
@cds-amal
cds-amal / find-old-branches.sh
Created July 18, 2021 02:22 — forked from mroderick/find-old-branches.sh
A small script to find stale branches
#!/bin/bash
# This is a very naive script, it doesn't do grouping and returns all branches
# I only really care about branches that have not seen commits in two months
#
# I am hoping to find some time to write a tool that can output these reports for me
# In the meantime, I am using this
echo "Merged branches"
for branch in `git branch -r --merged | grep -v HEAD`;do echo -e `git log --no-merges -n 1 --format="%ci, %cr, %an, %ae, " $branch | head -n 1` \\t$branch; done | sort -r
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
},
// Set default mocha options here, use special reporters etc.
const sig_type = (o) =>
o.name.trim() === "" ? `${o.type}` : `${o.name}: ${o.type}`;
// converts inputs object into (name : type, ... )
// skips internal type
//
const expand_io = (o) => o.map((param) => sig_type(param)).join(", ");
const abi = (contract) => {
const funcs = contract.abi.filter((x) => x.type === "function");
@cds-amal
cds-amal / _tmux_pane_words.zsh
Created June 27, 2021 20:11 — forked from blueyed/_tmux_pane_words.zsh
ZSH configuration to complete words from tmux pane(s)
# Complete words from tmux pane(s) {{{1
# Source: http://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html
# Gist: https://gist.github.com/blueyed/6856354
_tmux_pane_words() {
local expl
local -a w
if [[ -z "$TMUX_PANE" ]]; then
_message "not running inside tmux!"
return 1
fi
const BigNumber = require("bignumber.js");
const txlog =
{
type: 'transaction',
actions: [
{
type: 'callexternal',
address: '0x62D0f3297d6D5F7e6b6434A3fFd6B5c4820eE45E',
contextHash: '0x4be60db92cada79b8066139b76b1cfb0319fbf46439ef2b7c575a4dd88480618',
/* Named capture groups (ECMAScript regex flavour)
*/
const rex = new RegExp(
"(?<protocol>https://)" + // capture group https://
"(?<gitService>[^:/]+)" + // anything not a : or /
"/" +
"(?<orgName>[^/]+)" + // capture org name
"/" +
"(?<repo>[^#]+)" + // capture repo
/**
* @param {number[]} nums
* @return {number}
*/
const XXXremoveDuplicates = (nums) => { //{{{
if (nums.length === 0) return 0;
let last_item = nums[0];
let last_item_index = 0;