Skip to content

Instantly share code, notes, and snippets.

View adyliu's full-sized avatar
🎯
Focusing

Ady Liu adyliu

🎯
Focusing
  • Beijing, China
View GitHub Profile
@adyliu
adyliu / rinkeby-peers-list.txt
Last active October 12, 2021 16:07
get the peers of rinkeby of ethereum
> console.log(admin.peers.map(function(e){return 'admin.addPeer("enode://'+e.id+'@'+e.network.remoteAddress+'");'}).sort().join('\n'))
admin.addPeer("enode://0db812a93f04c5d255d6b49e2982d682de95fb4d627cb71b1ae09c95ccd142cbfd1e4d81de8f6abd53d7039f71d1b76791637550b8457ccb75ab84924a3427a6@35.170.185.206:30303");
admin.addPeer("enode://15512c6ddd95ade68b6825c464cd076f1ef1b9ccd6675fc6c1a64d9131980e0219fe616c8878a7e9d815df96b6635d90ee2a4ec3a14ec88d4e27839d912f9186@35.236.199.169:30303");
admin.addPeer("enode://1f6dcd2e10a93b7373fd17a715d1a337f73a2a6807a358d2ab0bf9c9a70e78997df4d32468fa1886a8158a947ab44998fa6ca34c53c543bb557024ada2e687eb@34.203.75.150:30303");
admin.addPeer("enode://22745f606bf7846714bb55f0a98437e2b09da1928647965ef511d908392c4110e0a7709c2cc1630b48ff074cf0d519ede1d1b124a4f88aa21b794ddc0e7052e3@34.219.84.192:18546");
admin.addPeer("enode://2ca86aaa816920575eca798a30ee657dcc593a5420c20d129f9008ffe5432e54901f4f0846bb9a88ccde5d8531f14f22528b2ea314386815531f98c51c7818ff@18.234.144.172:30303");
admin.addP
@adyliu
adyliu / AddressChecker.java
Created August 3, 2018 07:33
ethereum address checker
package demo;
import java.math.BigInteger;
import java.util.Arrays;
import org.web3j.crypto.Hash;
import org.web3j.utils.Numeric;
public class AddressChecker {
@hayeah
hayeah / gist:52b67ee963066ef66b727bf005930add
Last active August 9, 2018 06:42
EVM Homstead Instruction Set
0x00 STOP
0x01 ADD
0x02 MUL
0x03 SUB
0x04 DIV
0x05 SDIV
0x06 MOD
0x07 SMOD
0x08 ADDMOD
0x09 MULMOD
@MethodGrab
MethodGrab / macOS External Display Fix.md
Last active November 16, 2022 20:54
A fix for blurry text on external displays in macOS & OS X

macOS External Display Fix

A fix for blurry text on external displays in macOS & OS X.

  1. Run the patch (src) which will create a new directory in the CWD called DisplayProductID-YYYY:

    ruby ./patch-edid.rb
  2. Reboot into recovery mode (hold down CMD-R while rebooting)

@adoc
adoc / pkcs7.py
Last active July 25, 2021 09:46
#pkcs7.py3: Implementation of PKCS #7 padding. Based on: http://japrogbits.blogspot.com/2011/02/using-encrypted-data-between-python-and.html
"""
Python implementation of PKCS #7 padding.
RFC 2315: PKCS#7 page 21
Some content-encryption algorithms assume the
input length is a multiple of k octets, where k > 1, and
let the application define a method for handling inputs
whose lengths are not a multiple of k octets. For such
algorithms, the method shall be to pad the input at the
trailing end with k - (l mod k) octets all having value k -
@michael-simons
michael-simons / UTF8.java
Last active November 11, 2020 22:46
Java and handling of UTF-8 codepoints in the supplementary range
public class UTF8 {
public static void main(String[] args) {
// See http://www.fileformat.info/info/unicode/char/1f4a9/index.htm
final String poo = "A pile of poo: 💩.";
System.out.println(poo);
// Length of chars doesn't equals the "real" length, that is: the number of actual codepoints
System.out.println(poo.length() + " vs " + poo.codePointCount(0, poo.length()));
// Iterating over all chars