Skip to content

Instantly share code, notes, and snippets.

View ydm's full-sized avatar

Йордан Миладинов ydm

  • Sofia, Bulgaria
View GitHub Profile
#!/bin/bash
# URL prefix
url_prefix='http://testing.mainnet.beacon-api.nimbus.team/eth/v2/beacon/blocks'
# Range of numbers to loop over
start=6209538
end=9453725
# Number of workers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
xbindkeys
openrazer-daemon
polychromatic
~/.xbindkeysrc
```
"xdotool key KP_1"
b:9
@ydm
ydm / convert_golang_time.py
Last active June 14, 2024 20:16
Converts the default golang format of time.Time to a Python datetime.
# https://gist.github.com/ydm/dba727d2f1bb9fafac9437b63024efe0
from datetime import datetime, timedelta
import pytz
def convert_golang_time(s):
'''
>>> convert_golang_time('2024-06-14 22:40:35.106900879 +0300 EEST m=+8.946057668')
'2024-06-14T22:40:35.106901+03:00'
'''
package main
import (
"context"
"errors"
"fmt"
"io"
"net/http"
"time"
)
#![feature(associated_type_defaults)]
#![feature(generic_const_exprs)]
#[derive(Debug)]
struct Vector<const D: usize> {
v: [f32; D],
}
impl<const D: usize> Vector<D> {
fn new() -> Self {
#!/bin/bash
# NODE=${BEACON_NODE:-http://127.0.0.1:3500}
NODE=${BEACON_NODE:-http://testing.mainnet.beacon-api.nimbus.team}
out() { printf "%s %s\n" "$1" "$2"; }
error() { out "==> ERROR:" "$@"; } >&2
die() { error "$@"; exit 1; }
[ -z "$1" ] && die "usage: $0 <slot> <index>"
import datetime
GENESIS_SLOT = 0
GENESIS_TIME = 1606824023
SECONDS_PER_SLOT = 12
def compute_slot_at_timestamp(ts):
time_since_genesis = ts - GENESIS_TIME
#!/usr/bin/env python
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install panoramix-decompiler
panoramix --verbose 0x608060405260043610601d5760003560e01c8063a7a0d53714602557005b36602357005b005b602b603d565b60405190815260200160405180910390f35b6000604b6001600260036050565b905090565b600081605b8486606b565b60639190606b565b949350505050565b8082018082111560a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea2646970667358221220757c61a1eafd86a1b02f30444f0267f582a66d49df50078bc5c81528bcc144ac64736f6c63430008180033
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.