Skip to content

Instantly share code, notes, and snippets.

@aphexmunky
aphexmunky / hardhat.config.ts
Created May 28, 2021
Updated hardhat config for forking from local mainnet node
View hardhat.config.ts
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/
View brownie-network-add.sh
!#/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 Jan 26, 2019
Calculates the kardashev value for a civilisation given its power usage in watts
View kardashev.py
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 Jan 18, 2019
python int to base conversion
View baseconv.py
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 Aug 30, 2018 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
View git-reset-author.sh
#!/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 Jul 2, 2018
magic-wormhole on Ubuntu 18.04 LTS - Homebrew build logs
View # magic-wormhole - 2018-07-02_10-48-58.txt
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 Jun 27, 2018
consul on Ubuntu 18.04 LTS - Homebrew build logs
View # consul - 2018-06-27_10-51-22.txt
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 Jun 27, 2018
consul on Ubuntu 18.04 LTS - Homebrew build logs
View # consul - 2018-06-27_10-09-13.txt
Homebrew build logs for consul on Ubuntu 18.04 LTS
Build date: 2018-06-27 10:09:13
@aphexmunky
aphexmunky / download-latest.sh
Created Jan 11, 2018
Downloads the latest file in the root of an s3 bucket presuming the directory has the same name as the bucket
View download-latest.sh
#!/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-
View gist:3e5f446837f72c728e93bfeb54f6d088

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: