Skip to content

Instantly share code, notes, and snippets.

@aphexmunky
aphexmunky / hardhat.config.ts
Created May 28, 2021 23:54
Updated hardhat config for forking from local mainnet node
import { task } from "hardhat/config"
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"
import { BigNumber } from "ethers"
import "@nomiclabs/hardhat-waffle"
// When using the hardhat network, you may choose to fork Fuji or Avalanche Mainnet
// This will allow you to debug contracts using the hardhat network while keeping the current network state
// To enable forking, turn one of these booleans on, and then run your tasks/scripts using ``--network hardhat``
// For more information go to the hardhat guide
// https://hardhat.org/hardhat-network/
!#/bin/sh
brownie networks add Avalanche avax-avash host=http://127.0.0.1:9650/ext/bc/C/rpc chainid=43112 explorer=https://cchain.explorer.avax.network/
@aphexmunky
aphexmunky / kardashev.py
Last active January 26, 2019 00:46
Calculates the kardashev value for a civilisation given its power usage in watts
import math
def kardashev(p):
"""
Carl Sagans formula for determining the value intermediate kardashev scale value
Parameters:
p (int): the value in watts the civilisation uses
Returns:
@aphexmunky
aphexmunky / baseconv.py
Created January 18, 2019 11:54
python int to base conversion
def toStr(n,base):
convertString = "0123456789ABCDEF"
if n < base:
return convertString[n]
else:
return toStr(n//base,base) + convertString[n%base]
@aphexmunky
aphexmunky / git-reset-author.sh
Created August 30, 2018 10:50 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@aphexmunky
aphexmunky / # magic-wormhole - 2018-07-02_10-48-58.txt
Created July 2, 2018 09:49
magic-wormhole on Ubuntu 18.04 LTS - Homebrew build logs
Homebrew build logs for magic-wormhole on Ubuntu 18.04 LTS
Build date: 2018-07-02 10:48:58
@aphexmunky
aphexmunky / # consul - 2018-06-27_10-51-22.txt
Created June 27, 2018 10:18
consul on Ubuntu 18.04 LTS - Homebrew build logs
Homebrew build logs for consul on Ubuntu 18.04 LTS
Build date: 2018-06-27 10:51:22
@aphexmunky
aphexmunky / # consul - 2018-06-27_10-09-13.txt
Created June 27, 2018 09:11
consul on Ubuntu 18.04 LTS - Homebrew build logs
Homebrew build logs for consul on Ubuntu 18.04 LTS
Build date: 2018-06-27 10:09:13
@aphexmunky
aphexmunky / download-latest.sh
Created January 11, 2018 10:21
Downloads the latest file in the root of an s3 bucket presuming the directory has the same name as the bucket
#!/bin/bash │2017-12-28 17:35:07 93049433 location-report-28-12-2017-17:00:22.csv
│2017-12-29 00:35:07 92385322 location-report-29-12-2017-00:00:21.csv
dir=`basename $PWD` │2017-12-29 10:34:04 88874615 location-report-29-12-2017-10:00:21.csv
download=`aws s3 ls s3://$dir/ | sort | tail -n 1 | awk '{print $4}'` │2017-12-29 17:34:40 89295406 location-report-29-12-2017-

Keybase proof

I hereby claim:

  • I am aphexmunky on github.
  • I am aphexmunky (https://keybase.io/aphexmunky) on keybase.
  • I have a public key ASCpxQwtuGY_YUiDTSvo4dinYyFuJdubxExTRNxQqlX_ogo

To claim this, I am signing this object: