Skip to content

Instantly share code, notes, and snippets.

@lispc
lispc / gist:b0e218393eea2dab1e68294c1497b867
Last active December 4, 2024 13:59
博客来电子书自动转化简体中文-Tampermonkey
// ==UserScript==
// @name 博客来简体
// @namespace http://tampermonkey.net/
// @version 0.2
// @description 博客来电子书自动转化简体中文
// @author lispczz
// @match https://viewer-ebook.books.com.tw/viewer/epub_v3/*
// @require https://cdn.jsdelivr.net/npm/[email protected]/data.min.js
// @require https://cdn.jsdelivr.net/npm/[email protected]/data.t2cn.min.js
// @require https://cdn.jsdelivr.net/npm/[email protected]/data.cn2t.min.js
@lispc
lispc / Greeter.yul
Last active January 5, 2022 06:45
generated by running "solc -o build --asm --ir Greeter.sol"
/*=====================================================*
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
/// @use-src 0:"Greeter.sol"
object "Greeter_59" {
@lispc
lispc / sync_deps.sh
Created June 23, 2022 05:54
sync_deps.sh
function sync_agg() {
cd halo2-snark-aggregator
find . -name Cargo.toml | xargs gsed -i 's#^halo2_proofs = .*$#halo2_proofs = { path = "../../halo2/halo2_proofs", default-features = true }#g'
find . -name Cargo.toml | xargs gsed -i 's#^zkevm-circuits = .*$#zkevm-circuits = { path = "../../zkevm-circuits/zkevm-circuits" }#g'
find . -name Cargo.toml | xargs gsed -i 's#^eth-types = .*$#eth-types = { path = "../../zkevm-circuits/eth-types" }#g'
cd ..
}
function sync_agg_git() {
@lispc
lispc / 700lines fork.patch
Created July 28, 2022 02:45
700lines fork
diff --git a/src/evm/eei.ts b/src/evm/eei.ts
index 9793588..12d545b 100644
--- a/src/evm/eei.ts
+++ b/src/evm/eei.ts
@@ -1,5 +1,5 @@
import { debug as createDebugLogger } from 'debug'
-import { Account, Address, BN, MAX_UINT64 } from 'ethereumjs-util'
+import { Account, Address, BN, MAX_UINT64, toBuffer } from 'ethereumjs-util'
import { Block } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
@lispc
lispc / .prettierrc.json
Created January 10, 2024 08:09
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
@lispc
lispc / row_usage.py
Created July 24, 2024 00:57
row_usage.py
import csv
import json
#psql -h XX -U XX XX -c "\copy (select index, convert_from(proof, 'UTF8')::json->>'row_usages' as row_usages from chunk where index < 3529100 and deleted_at IS NULL order by index desc limit 500) To STDOUT With CSV" > 500row.csv
# Open your file
with open('500row.csv', 'r') as file, open('output.csv', 'w', newline='') as output_file:
# Create DictReader
reader = csv.DictReader(file, fieldnames=['chunk_index', 'data'])