Skip to content

Instantly share code, notes, and snippets.

View hewigovens's full-sized avatar
🐛
Fixing

Tao Xu hewigovens

🐛
Fixing
View GitHub Profile
import Foundation
// MARK: - Errors
public enum BGIParserError: Error {
case fileNotFound(String)
case readFailed(Error)
case propertyListError(Error)
case unsupportedFormat
}
@hewigovens
hewigovens / privacy-pools-ceremony_attestation.log
Created February 26, 2025 05:30
Attestation for Privacy Pools Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm hewigovens-360470 and I have contributed to the Privacy Pools Ceremony.
The following are my contribution signatures:
Circuit # 1 (withdraw)
Contributor # 366
Contribution Hash:
98808868 fc428b75 00f66a9c 94be9080
9df6c6c4 029f86f1 00b19b38 8ebe1894
89994ffe b7d06526 013dc093 8b6ca6d3
99a63345 31628072 3738d78c f639f393
@hewigovens
hewigovens / main.go
Created March 24, 2024 23:47
Serving files
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
fmt.Println("Serving files in the current directory on port 8080")
@hewigovens
hewigovens / query.sh
Created August 4, 2023 01:14
Query vitalik.eth using thegraph API
curl --location 'https://api.thegraph.com/subgraphs/name/ensdomains/ens' \
--header 'Content-Type: application/json' \
--data '{
"query": "query getRecords($id: String!) {\n domain(id: $id) {\n name\n isMigrated\n createdAt\n resolver {\n texts\n coinTypes\n contentHash\n addr {\n id\n }\n }\n id\n }\n}",
"variables": {
"id": "0xee6c4522aab0003e8d14cd40a6af439055fd2577951148c14b6cea9a53475835"
},
"operationName": "getRecords"
}'
@hewigovens
hewigovens / combine-images.sh
Created April 19, 2023 11:05
Merge images into a PDF by ChatGPT
#!/bin/bash
# Check if the correct number of arguments were provided
if [ $# -eq 0 ]; then
echo "Usage: $0 image_directory file_extension compression_quality"
exit 1
fi
dir="$1"
ext="${2:-png}"
@hewigovens
hewigovens / .gitignore
Last active July 5, 2022 23:56
Useful scripts for Trust Wallet Core
*~
.vscode
node_modules/
// Copyright © 2017-2020 Trust Wallet.
//
// This file is part of Trust. The full Trust copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
import Security
@_cdecl("random32")
public func random32() -> UInt32 {
var bytes = [UInt8](repeating: 0, count: 32)
@hewigovens
hewigovens / test-cors.js
Last active April 8, 2021 07:21
Test CORS
var testEndpointCORS = (url) => {
var method = "POST";
var xhr = new XMLHttpRequest();
var json = {
jsonrpc: "2.0",
method: "eth_getBlockByHash",
params: [
"0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
true,
],
@hewigovens
hewigovens / secp256k1_ec_recover.js
Last active July 5, 2020 00:34
Recover address from Ethereum message
#!/usr/bin/env node
const { utils } = require('ethers');
const secp256k1 = require('secp256k1');
function ethereumMessage(str) {
const data = Buffer.from(str, 'utf8');
const prefix = Buffer.from(
`\u{19}Ethereum Signed Message:\n${data.length}`,
'utf8',
@hewigovens
hewigovens / main.go
Last active December 5, 2019 06:23
call wallet core from go on macOS
package main
// #cgo CFLAGS: -I${SRCDIR}/wallet-core/include
// #cgo LDFLAGS: -L${SRCDIR}/wallet-core/build/ios -lTrezorCrypto -lTrustWalletCore -lprotobuf -lc++
// #include <TrustWalletCore/TWHDWallet.h>
// #include <TrustWalletCore/TWString.h>
import "C"
import "fmt"