- jq: https://stedolan.github.io/jq/
- gron: https://github.com/tomnomnom/gron (very similar: http://git.codemadness.org/json2tsv/)
- jd (strutural JSON diff): https://github.com/josephburnett/jd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createPublicClient, createWalletClient, http, defineChain } from 'viem' | |
import { celoAlfajores } from 'viem/chains' | |
import { privateKeyToAccount } from 'viem/accounts' | |
const devChain = defineChain({ | |
...celoAlfajores, | |
id: 1337, | |
name: 'local dev chain', | |
network: 'dev', | |
rpcUrls: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
conn = sqlite3.connect(":memory:") | |
conn.row_factory = sqlite3.Row | |
def print_query_plan(query, bindings={}): | |
depth_of = {0: -1} | |
result = conn.execute("EXPLAIN QUERY PLAN " + query, bindings).fetchall() | |
for r in result: | |
depth = depth_of[r['parent']] + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#defaultView:ImageGrid | |
SELECT DISTINCT * | |
WHERE { | |
SERVICE wikibase:mwapi { | |
bd:serviceParam wikibase:api "EntitySearch" . | |
bd:serviceParam wikibase:endpoint "www.wikidata.org" . | |
bd:serviceParam mwapi:search ?company_name . | |
bd:serviceParam mwapi:language "en" . | |
?comp wikibase:apiOutputItem mwapi:item . | |
?num wikibase:apiOrdinal true . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import eth_keyfile | |
from web3 import Account, Web3 | |
from web3.middleware import geth_poa_middleware | |
w3 = Web3(Web3.HTTPProvider("http://geth.goerli.ethnodes.brainbot.com:8545")) | |
w3.middleware_onion.inject(geth_poa_middleware, layer=0) | |
addr = "8f5ea3bb3e99c317b8745918f6973f7afbf659c3" | |
first_stuck = 226164 | |
stuck_nonces = range(first_stuck, first_stuck + 20) | |
gas_price = w3.toWei(10, "gwei") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from typing import List, Union, Callable | |
from lxml import etree as ET | |
from io import BytesIO | |
tei = '{http://www.tei-c.org/ns/1.0}' | |
ns = { | |
None: 'http://www.tei-c.org/ns/1.0', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
table_name, | |
pg_size_pretty(table_size) AS table_size, | |
pg_size_pretty(indexes_size) AS indexes_size, | |
pg_size_pretty(total_size) AS total_size, | |
round(total_size / sum(total_size) OVER () * 100, 2) AS percent | |
FROM ( | |
SELECT | |
table_name, | |
pg_table_size(table_name) AS table_size, |