Skip to content

Instantly share code, notes, and snippets.

@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%.
//
// 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
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"fmt"
"io"
"log"
"os"
"os/exec"
@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
import (
"fmt"
"reflect"
"strings"
)
type Human struct {
Head string `json:"a1" xml:"x1"`
# Theory
[White Paper](https://darwinia.network/ChainRelay_Technical_Paper(Preview)_EN.pdf)
[Darwinia-Ethereum Bridge](https://docs.google.com/document/d/1NVDSk6KZXV5CjE20cNPA8Swmmd89IYeWyN0T9lRBOEM)
# Projects Navigation
## [Darwinia Bridge SPV Module](https://github.com/darwinia-network/darwinia-common/tree/master/frame/bridge)

Parachain 众筹拍卖模块

流程

  • 管理员创建众筹 crowdfund::create
    • 参数
      • orign: Origin
        • 要求 Signed ,任何账号都可以发起众筹
      • cap: Balance
  • 最多可以筹得的硬顶
@yrong
yrong / test_macro.rs
Created April 23, 2021 16:12
rust macro
#![feature(no_std)]
#![no_std]
#![feature(prelude_import)]
#![feature(print_internals)]
#![feature(fmt_internals)]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
fn main() {
let fib = {
@yrong
yrong / manual.rs
Created July 31, 2021 17:06
consensus-manual-seal
use std::sync::Arc;
use asgard_runtime::Header;
use polkadot_service::{FullBackend, LongestChain};
use sc_client_api::ExecutorProvider;
pub use sc_consensus_aura::{ImportQueueParams, StartAuraParams};
use sc_consensus_manual_seal::InstantSealParams;
use sc_consensus_slots::SlotProportion;
use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager};
use sc_telemetry::{Telemetry, TelemetryWorker, TelemetryWorkerHandle};
@yrong
yrong / gist:13afd20937e31430e95228604241ed70
Created June 17, 2022 06:11
add debug info to substrate node
https://github.com/paritytech/substrate/issues/11604#issuecomment-1150974582