Skip to content

Instantly share code, notes, and snippets.

View jsyqrt's full-sized avatar

Jason Carter jsyqrt

View GitHub Profile
@jsyqrt
jsyqrt / .vimrc
Created May 11, 2018 03:27
my simple vimrc file
" enable syntax highlighting
syntax enable
" show line numbers
set number
set wrap
" set tabs to have 4 spaces
set tabstop=4
  1. create a proxy agent.
from cpchain import chain, config
from cpchain.chain.models import OrderInfo
from cpchain.crypto import RSACipher, get_addr_from_public_key
from cpchain.account import Accounts

w3 = chain.utils.default_w3
@jsyqrt
jsyqrt / proxy.sh
Last active August 11, 2018 12:19
#!/bin/bash
function launchProxy {
ip=127.0.0.1
port=8118
proxy="http://$ip:$port"
# launch shadowsocks local daemon and privoxy service.
go get -u -v github.com/ramya-rao-a/go-outline
go get -u -v github.com/acroca/go-symbols
go get -u -v github.com/mdempsky/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v golang.org/x/tools/cmd/godoc
go get -u -v github.com/zmb3/gogetdoc
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/fatih/gomodifytags
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v sourcegraph.com/sqs/goreturns
@jsyqrt
jsyqrt / sendRawTx.py
Created August 7, 2019 08:27
send raw transaction to cpchain testmainnet or mainnet.
import sys
from cpc_fusion import Web3 as w
def sendRawTransactionTestMainnet():
chainID = 42
endpoint = "http://13.229.143.32:8501"
myAddress = "abb528bffc707c2c507307e426ce810a7ad93ed6"
toAddress = "abb528bffc707c2c507307e426ce810a7ad93ed6"
keystoreFilePath = "/home/jsyqrt/go/src/bitbucket.org/cpchain/chain/examples/testmainnet/data/data22/keystore/key22"
password = "password"
@jsyqrt
jsyqrt / img2ascii.py
Created August 23, 2019 05:26
A python script to convert an image to ASCII image, txt file.
# Python code to convert an image to ASCII image.
import sys, random, argparse
import numpy as np
import math
from PIL import Image
# gray scale level values from:
# http://paulbourke.net/dataformats/asciiart/
@jsyqrt
jsyqrt / xxx.go
Created September 20, 2019 12:24
// Mode defines the type a dpor engine makes.
type Mode uint
// DporMode
const (
NormalMode Mode = iota
FakeMode
DoNothingFakeMode
PbftFakeMode
)
tags
cpchain
rpt

Consider Impeach Status in Rpt

  • current rpt calculation method.