This file contains hidden or 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
name: Comprehensive Workflow Example | |
on: | |
# Push event - triggers on pushes to specified branches and paths | |
push: | |
branches: | |
- main | |
- zeph/testing | |
tags: | |
- v* |
This file contains hidden or 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
class ContainerOfConstants(type): | |
def __new__(metacls, name, bases, namespace): | |
namespace["_const_values"] = frozenset( | |
value | |
for key, value in namespace.items() | |
if not key.startswith("_") | |
) | |
cls = super().__new__(metacls, name, bases, namespace) | |
cls._initializing = True | |
return cls |
This file contains hidden or 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
-- 1. Approximate the indexer table row counts: | |
SELECT | |
psut.relname AS table_name, | |
pc.reltuples::BIGINT AS estimated_count, | |
pg_total_relation_size(psut.schemaname || '.' || psut.relname) AS estimated_size, | |
pg_size_pretty(pg_total_relation_size(psut.schemaname || '.' || psut.relname)) AS size_human | |
FROM | |
pg_stat_user_tables psut | |
INNER JOIN | |
pg_class pc |
This file contains hidden or 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
\set PROMPT1 '%M:%[%033[1;31m%]%>%[%033[0m%] %n@%/%R%#%x ' | |
\pset null '[null]' | |
\set COMP_KEYWORD_CASE upper | |
\timing | |
\set HISTSIZE 2000 | |
\x auto |
This file contains hidden or 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
SCENARIO = test_config.yml | |
SKIP = --skip-runner | |
RESETDB = --reset-db | |
debug-blockgen: | |
python run_runner.py \ | |
--conduit-binary ./conduit \ | |
--scenario $(SCENARIO) \ | |
--keep-alive $(SKIP) \ | |
--test-duration 30s \ | |
$(RESETDB) |
This file contains hidden or 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
# ... assume the various _VERSION_ vars are defined | |
export PATH=$(GOPATH)/bin:$(PATH) | |
go install golang.org/dl/go$(GOLANG_VERSION_BUILD)@latest | |
go$(GOLANG_VERSION_BUILD) download | |
go$(GOLANG_VERSION_BUILD) mod tidy -compat=$(GOLANG_VERSION_SUPPORT) | |
# So for example, the last three lines may be: | |
go install golang.org/dl/go1.17.13@latest | |
go1.17.13 download |
This file contains hidden or 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
package main | |
import ( | |
"encoding/csv" | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
"log" | |
"os" |
This file contains hidden or 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
set export | |
set shell := ["zsh", "-cu"] | |
NETWORKS := `echo $HOME` + "/networks" | |
NAME := "conduitnetwork" | |
CURR_NETWORK := NETWORKS + "/" + NAME | |
GO_ALGORAND := "/Users/zeph/github/tzaffi/go-algorand" | |
NODE_TEMPLATE := GO_ALGORAND + "/test/testdata/nettemplates/TwoNodesFollower100Second.json" | |
PRIVATE_DATA_NODE := "Primary" | |
DATA_NODE := env_var_or_default("DATA_NODE", PRIVATE_DATA_NODE) |
This file contains hidden or 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
# ❯ pip freeze | grep pycg | |
# pycg==0.0.6 | |
clean: | |
rm reachable.json everything.json diff.json | |
reachable.json: | |
pycg --package algosdk tests/steps/account_v2_steps.py tests/steps/application_v2_steps.py tests/steps/other_v2_steps.py tests/steps/steps.py -o reachable.json | |
EVERYTHING := $(shell find algosdk -name "*.py") |
This file contains hidden or 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 atexit | |
from collections import Counter, defaultdict | |
import sys | |
CALLS = Counter() # defaultdict(int) | |
def hook(frame, event, arg): | |
if event != "call": |
NewerOlder