Skip to content

Instantly share code, notes, and snippets.

View huahuayu's full-sized avatar
🎯
Focusing

Shiming huahuayu

🎯
Focusing
View GitHub Profile
@huahuayu
huahuayu / main.go
Created September 7, 2022 13:37 — forked from miguelmota/main.go
Golang Solidity "abi.encodePacked" example
package main
import (
"bytes"
"encoding/hex"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/common/math"
)
{
"groups": {},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"payload": {
"data": {
"config_update": {
"channel_id": "acmeChannel",
"isolated_data": {},
"read_set": {
"groups": {
"Application": {
"groups": {
{
"payload": {
"data": {
"config_update": {
"channel_id": "acmechannel",
"isolated_data": {},
"read_set": {
"groups": {
"Application": {
"groups": {
{
"data": {
"data": [
{
"payload": {
"data": {
"config": {
"channel_group": {
"groups": {
"Consortiums": {
2019-04-25 20:30:49 [PicGo INFO] Before transform
2019-04-25 20:30:49 [PicGo INFO] Transforming...
2019-04-25 20:30:49 [PicGo INFO] Before upload
2019-04-25 20:30:49 [PicGo INFO] Uploading...
2019-04-25 20:30:53 [PicGo SUCCESS]
https://raw.githubusercontent.com/huahuayu/img/master/20190425203048.png
2019-04-25 20:35:44 [PicGo INFO] Before transform
2019-04-25 20:35:44 [PicGo INFO] Before upload
2019-04-25 20:35:47 [PicGo SUCCESS]
https://raw.githubusercontent.com/huahuayu/img/master/20190425203544.png
@huahuayu
huahuayu / install-tmux.sh
Created March 16, 2020 15:52 — forked from pokev25/install-tmux.sh
Install tmux 2.8 on centos 7
# Install tmux 2.8 on Centos
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar -xf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=/usr/local
@huahuayu
huahuayu / bootstrap.sh
Created March 13, 2019 09:20
bootstrap.sh version 1.4
#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# if version not passed in, default to latest released version
export VERSION=1.4.0
# if ca version not passed in, default to latest released version
@huahuayu
huahuayu / cache.go
Created February 11, 2019 06:58 — forked from zemirco/cache.go
golang database layer with cache
type CacheInterface interface {
Get(key string) ([]byte, error)
Set(key string, value interface{}) error
}
// Cache implements CacheInterface.
type Cache struct {
// wrap redis pool connection
// or whatever you need
}
@huahuayu
huahuayu / bufferedchannel.go
Created January 23, 2019 06:12
[bufferedchannel]bufferedchannel with waiting group #waiting group #channel
package main
import (
"gpool"
"fmt"
"net/http"
"time"
)
func main() {