Skip to content

Instantly share code, notes, and snippets.

View hewigovens's full-sized avatar
🪄
Debugging

Tao Xu hewigovens

🪄
Debugging
View GitHub Profile
@hewigovens
hewigovens / in.fourplex.aria2.plist
Created December 12, 2015 07:39
aria2 auto launch plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>in.fourplex.aria2</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/aria2c</string>
@hewigovens
hewigovens / pipe_source.m
Created May 24, 2016 08:41 — forked from keithduncan/pipe_source.m
Various options for streaming from the read end of a pipe until EOF
/*
pipe_source.m
clang pipe_source.m -o pipe -framework Foundation -D [ USE_SOURCE | USE_IO | USE_FILEHANDLE [ FILEHANDLE_READABILITY | FILEHANDLE_WAIT ] ]
*/
#import <Foundation/Foundation.h>
int main(void) {
enum RunLoop {
@hewigovens
hewigovens / latency.markdown
Created October 14, 2016 03:34 — 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

Keybase proof

I hereby claim:

  • I am hewigovens on github.
  • I am hewig (https://keybase.io/hewig) on keybase.
  • I have a public key ASApjhSA_bGsQJjsWGXCFz9xHdZ1XnuUTFnQMjEsfCKOEgo

To claim this, I am signing this object:

@hewigovens
hewigovens / ens_namehash.swift
Last active November 9, 2018 06:53
ens namehash in swift
import Foundation
import CryptoSwift
//https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md
extension String {
public var namehash: String {
var node = Array<UInt8>.init(repeating: 0x0, count: 32)
if self.count > 0 {
node = self.split(separator: ".")
.map { Array($0.utf8).sha3(.keccak256) }
@hewigovens
hewigovens / provider.js
Created July 2, 2018 13:20
cipher provider
__d(function(e, r, n, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}), t.provider = function(e) {
function r(e) {
i.__CIPHER_BRIDGE__ ? i.__CIPHER_BRIDGE__.postMessage(JSON.stringify(e)) : i.webkit.messageHandlers.reactNative.postMessage(JSON.stringify(e))
}
function n() {
var e = crypto.getRandomValues(new Uint8Array(4)),
@hewigovens
hewigovens / ethereumjs_abi_test.js
Created August 15, 2018 08:34
ethereumjs_abi_test.js
const ethUtil = require('ethereumjs-util');
const abi = require('ethereumjs-abi');
const result = abi.rawEncode(['bytes32'], ['bBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB'])
console.log(ethUtil.bufferToHex(result));
//0x6242624242424262624242426262624262624262626262424262426262626242
@hewigovens
hewigovens / generate-slip-0132-test-vectors.js
Last active December 22, 2024 11:46 — forked from clarkmoody/generate-slip-0132-test-vectors.js
generate-slip-0132-test-vectors.js
const bitcoinjs = require('bitcoinjs-lib') // @3.3.2
const bchaddrjs = require('bchaddrjs')
const bip39 = require('bip39')
const clone = require('lodash.clonedeep')
const networks = bitcoinjs.networks
const script = bitcoinjs.script
/*
Bitcoin 0x0488b21e - xpub 0x0488ade4 - xprv P2PKH or P2SH
@hewigovens
hewigovens / TrustWalletCore.podspec
Last active May 14, 2021 07:05
TrustWalletCore podspec
Pod::Spec.new do |s|
s.name = 'TrustWalletCore'
s.version = '2.6.7'
s.summary = 'Trust Wallet core data structures and algorithms.'
s.homepage = 'https://github.com/trustwallet/wallet-core'
s.license = 'MIT'
s.authors = { 'Alejandro Isaza' => '[email protected]' }
s.module_name = 'WalletCore'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.14'