Skip to content

Instantly share code, notes, and snippets.

View javiervisiedo's full-sized avatar

Javier G. Visiedo javiervisiedo

  • Tokyo, Japan
View GitHub Profile
@javiervisiedo
javiervisiedo / json_formatter.py
Last active May 5, 2022 00:09
Simple python script to format a json string sending the output to stdout or another file
import json
import argparse
import sys
def format_json(input, output):
try:
with open(input, 'r') as ifile:
contents = json.load(ifile)
except IOError as e:
print(e)
@javiervisiedo
javiervisiedo / .deps...remix-tests...remix_accounts.sol
Created January 10, 2022 10:51
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;
@javiervisiedo
javiervisiedo / latency.markdown
Created October 24, 2017 20:16 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs