Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# (1) copy to: ~/bin/ssh-host-color
# (2) set: alias ssh=~/bin/ssh-host-color
#
# Inspired from http://talkfast.org/2011/01/10/ssh-host-color
# Fork from https://gist.github.com/773849
#
set_term_bgcolor(){
@themoriarty
themoriarty / bench_book
Created April 6, 2017 03:49
benchmark comparison bookmarklet
javascript:function%20tryToParse%28content%29%20%7Bconst%20lines%20%3D%20content.split%28%22%5Cn%22%29%3Blet%20header%20%3D%20undefined%3Blet%20values%20%3D%20%5B%5D%3Bfor%20%28let%20i%20%3D%200%3B%20i%20%3C%20lines.length%3B%20%2B%2Bi%29%20%7Bconst%20line%20%3D%20lines%5Bi%5D.trim%28%29%3Bif%20%28line.length%20%21%3D%200%29%20%7Bif%20%28header%20%3D%3D%3D%20undefined%29%20%7Bheader%20%3D%20line%3B%7D%20else%20%7Bconst%20match_result%20%3D%20line.match%28/%28%5CS%2B%29%5Cs%2B%28%5Cd%2B%29%20ms%5Cs%2B%5Cd%2B%20ms%5Cs%2B%5Cd%2B%5Cs%2B%5B%5Cd%5C.%5D%2B%5Cs%2Bitems%5C/s/%29%3Bif%20%28match_result%29%20%7Bvalues.push%28%7Bname%3A%20match_result%5B1%5D%2C%20%22avg%22%3A%20parseFloat%28match_result%5B2%5D%29%7D%29%3B%7D%7D%7D%7Dif%20%28header%20%21%3D%3D%20undefined%20%26%26%20values.length%20%3E%200%29%20%7Breturn%20%7Bkey%3A%20header%2C%20results%3A%20values%7D%3B%7Dreturn%20undefined%3B%7Dfunction%20getBenchmarkResults%28%29%20%7Bconst%20comments%20%3D%20document.getElementsByClassName%28%22comment-body%22%29%3Bc
@themoriarty
themoriarty / .debugger...generated-sources...#utility.yul
Created April 28, 2021 00:21
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
{
function abi_decode_t_address_fromMemory(offset, end) -> value {
value := mload(offset)
validator_revert_t_address(value)
}
function abi_decode_t_uint256(offset, end) -> value {
value := calldataload(offset)
validator_revert_t_uint256(value)