Skip to content

Instantly share code, notes, and snippets.

View crisidev's full-sized avatar
🦀

Matteo Bigoi crisidev

🦀
View GitHub Profile
@crisidev
crisidev / goto.py
Created May 5, 2020 14:05 — forked from georgexsh/goto.py
python goto with system trace function
import sys
def j(lineno):
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno
@crisidev
crisidev / goto.py
Created May 5, 2020 14:05 — forked from georgexsh/goto.py
python goto with system trace function
import sys
def j(lineno):
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno
RUST_BACKTRACE=full /home/bigo/.cargo/bin/xidlehook --not-when-fullscreen --socket /home/bigo/.xidlehook.sock --timer 290 "/home/bigo/.bin/i3exit notify-lock" "" --timer 10 "/home/bigo/.bin/i3exit lock" "" --timer 290 "/home/bigo/.bin/i3exit notify-suspend" "" --timer 10 "/home/bigo/.bin/i3exit suspend-auto" ""
thread 'main' panicked at 'timer error: the timer is shutdown, must be called from the context of Tokio runtime', /home/bigo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/time/delay.rs:96:23
stack backtrace:
0: 0x56172dc235c5 - backtrace::backtrace::libunwind::trace::h508d2c55eb856ef2
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: 0x56172dc235c5 - backtrace::backtrace::trace_unsynchronized::h31c9d8a0097b92f8
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: 0x56172dc235c5 - std::sys_common::backtrace::_pr