Skip to content

Instantly share code, notes, and snippets.

!#/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/
#!/usr/bin/env python
import base64, hashlib, hmac, json, sys, getpass
from Crypto.Cipher import AES
from Crypto.Hash import RIPEMD, SHA256
base58_chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
def prompt(p):
return getpass.getpass(p + ": ")
@aphexmunky
aphexmunky / getblock.json
Created January 26, 2013 11:48
bitcoin getblock 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048
{
"hash" : "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
"confirmations" : 213125,
"size" : 215,
"height" : 1,
"version" : 1,
"merkleroot" : "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
"tx" : [
"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098"
],
@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/

Becoming a contractor programmer in the UK

After delaying it for more than a year I have finally made the big move from a stable full time job to the dynamic world of contracting. One of the biggest reasons for delaying the move was not knowing the technicalities of getting all the machinery up and running. The main goal of this document is to provide an easily replicable process you can follow to become a contractor. I can not claim it is the best process to follow, but it has worked for me and other people who have advised me. Use my advice on your own responsibility.

I have made this a github repo with hope to receive community contributions to fix any inaccuracies, out of date information and typos.

@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 / SymmetricEncryption.java
Created October 26, 2012 14:11
Encryption Bean
package com.thehutgroup.thirdpartyplatform.service;
public interface SymmetricEncryption {
public String encrypt(String plainText, String salt);
public String encrypt(String plainText, int salt);
public String decrypt(String encryptedText, String salt);
public String decrypt(String encryptedText, int salt);
@aphexmunky
aphexmunky / MigrationCode.md
Last active January 21, 2020 11:28
Jersey Migration 1 -> 2

Jersey Migration Guide From 1 -> 2

Taken from this link

25.8.2.1. Making a simple client request

Jersey 1.x way:

Client client = Client.create();
WebResource webResource = client.resource(restURL).path("myresource/{param}");
@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]