Skip to content

Instantly share code, notes, and snippets.

View balodja's full-sized avatar

Vladimir Korolev balodja

View GitHub Profile
@balodja
balodja / gist:b94b9b6f96d880eb987a4c860e681ba8
Created October 5, 2023 18:40
trace_transaction example
> curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"trace_transaction","params":["0x3582b81e8b625727c3e9ff3bca08c0c45f9c5e65c14a19df287cbd9562cf6f2d"],"id":67}' 127.0.0.1:8545 | json_pp
{
"id" : 67,
"jsonrpc" : "2.0",
"result" : [
{
"action" : {
"callType" : "call",
"from" : "0x8495d37adfd0c8e39cb4303e393f6afcd5827212",
"gas" : "0x27cfd",
@balodja
balodja / nonce_search.py
Created July 14, 2023 06:32
multithreading vs multiprocessing
#!/usr/bin/env python3
# Generate test file with fish:
# $ for counter in (seq 200); head -c 128 /dev/urandom | xxd -ps -c 0 >> data.txt; end
# Benchmark results:
#
# > time ./nonce_search.py --runner single --workers 2 data.txt > /dev/null
# ________________________________________________________
# Executed in 28.04 secs fish external
struct IndentedIO <: IO
io::IO
n::Int
end
IndentedIO(io::IndentedIO, n::Int) = IndentedIO(io.io, n + io.n)
indentation(io::IO) = 0
indentation(io::IndentedIO) = write(io.io, repeat(" ", io.n))
{
stdenv,
buildPythonPackage,
jupyter_core,
vega,
notebook
}:
buildPythonPackage {
pname = "notebook-exts";
{ lib, buildPythonPackage, fetchFromGitHub, fetchPypi,
sqlalchemy, dateutil, jupyter, nbconvert, notebook,
nbformat, traitlets, jupyter_core, jupyter_client,
tornado, requests, jsonschema, alembic, rapidfuzz
}:
let
traitlets' = traitlets.overridePythonAttrs(old: rec {
version = "4.3.3";
src = fetchPypi {
inherit (old) pname;
@balodja
balodja / config.nix
Last active August 7, 2021 10:28
snad part of config.nix
{
snadShell =
let
plotext = ps: with ps; buildPythonPackage rec {
pname = "plotext";
version = "3.1.3";
src = fetchFromGitHub {
owner = "piccolomo";
repo = "plotext";
@balodja
balodja / isoforest.log
Created August 2, 2021 00:16
am i dreaming?
++ for FIELD in g gr r
++ for ALGO in iso
++ echo Running iso for g
Running iso for g
++ OUTPUT=static_results/iso_scores_g.dat
++ '[' -e static_results/iso_scores_g.dat ']'
++ zwadp -c iso -a 30 -j 20 -o static_results/iso_scores_g.dat --oid features/sid_extragal_short_g_100.dat --feature features/feature_extragal_short_g_100.dat
real 0m52.145s
user 20m7.772s
def myfunc(x):
    return (1, 'a', 3.20, x)
static PyObject *__pyx_pf_1b_myfunc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
@balodja
balodja / pymc-study.ipynb
Last active June 28, 2019 17:43
playing around with pymc
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.