Skip to content

Instantly share code, notes, and snippets.

@10gic
10gic / unmarshal_interface.go
Last active September 3, 2023 13:23 — forked from tkrajina/unmarshal_interface.go
Unmarshal JSON to specific interface implementation
package main
import (
"encoding/json"
"reflect"
)
type Something interface{}
type Something1 struct {
@10gic
10gic / example.go
Created March 22, 2023 14:23 — forked from fxfactorial/example.go
ABI encode struct in golang
package main
import (
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
)
@10gic
10gic / SslUtil.java
Last active April 5, 2024 16:28 — forked from rohanag12/SslUtil.java
Create an SslSocketFactory using PEM encrypted certificate files
/**
* Utility class to read encrypted PEM files and generate a
* SSL Socket Factory based on the provided certificates.
*
* Note:
* Java use jks (Java KeyStore) format, but openssl usual use pem format.
* We can convert it by keytool (jdk build-in tool), or use BouncyCastle
* library to handle pem.
*
* The original code is by Sharon Asher (link below). I have modified