Skip to content

Instantly share code, notes, and snippets.

@yrong
yrong / ECDSA.sol
Created December 13, 2022 17:58 — forked from BjornvdLaan/ECDSA.sol
Verification of externally created ECDSA signatures in Solidity
pragma solidity ^0.4.24;
contract ECDSA {
function verify() public returns (bool) {
bytes32 message = ethMessageHash("TEST");
bytes memory sig = hex"bceab59162da5e511fb9c37fda207d443d05e438e5c843c57b2d5628580ce9216ffa0335834d8bb63d86fb42a8dd4d18f41bc3a301546e2c47aa1041c3a1823701";
address addr = 0x999471bb43b9c9789050386f90c1ad63dca89106;
@yrong
yrong / launch.json
Created September 15, 2022 10:36 — forked from 0xGabi/launch.json
VSCode configuration to debug using hardhat in a monorepo
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "hardhat test",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${workspaceFolder}/packages/hardhat/node_modules/.bin/hardhat",
"args": ["test", "--network", "localhost"],
@yrong
yrong / tmux-cheatsheet.markdown
Created June 29, 2022 14:02 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Parachain 众筹拍卖模块

流程

  • 管理员创建众筹 crowdfund::create
    • 参数
      • orign: Origin
        • 要求 Signed ,任何账号都可以发起众筹
      • cap: Balance
  • 最多可以筹得的硬顶
@yrong
yrong / reflection.go
Created December 29, 2020 13:54 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"fmt"
"io"
"log"
"os"
"os/exec"
//
// Companion code to https://medium.com/statuscode/pipeline-patterns-in-go-a37bb3a7e61d
//
// To run:
// go get github.com/pkg/errors
// go run -race pipeline_demo.go
//
package main
@yrong
yrong / mysql-conf.sh
Created November 9, 2020 00:50 — forked from lesstif/mysql-conf.sh
MySQL Server configuration file for docker.
#!/bin/bash
export MYSQL_CNF=$(cat <<CNF
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
@yrong
yrong / customEdge.html
Created November 12, 2019 13:33 — forked from davidjgraph/customEdge.html
Custom edge example for mxGraph
<!--
$Id: markers.html,v 1.4 2013/10/28 08:44:55 gaudenz Exp $
Copyright (c) 2006-2014, JGraph Ltd
Demonstrates creating a custom edge in mxGraph
-->
<html>
<head>
<title>Custom edge example for mxGraph</title>
@yrong
yrong / customEdge.html
Created November 12, 2019 13:33 — forked from davidjgraph/customEdge.html
Custom edge example for mxGraph
<!--
$Id: markers.html,v 1.4 2013/10/28 08:44:55 gaudenz Exp $
Copyright (c) 2006-2014, JGraph Ltd
Demonstrates creating a custom edge in mxGraph
-->
<html>
<head>
<title>Custom edge example for mxGraph</title>