Skip to content

Instantly share code, notes, and snippets.

Avatar

Petr Šťastný SoptikHa2

View GitHub Profile
@SoptikHa2
SoptikHa2 / code-wars.rs
Created Jul 14, 2019
Code wars - behaviour tree
View code-wars.rs
// Petr Šťastný <petr.stastny01@gmail.com>
// 2019-07-14
// trait = interface
pub trait CodingBlock {
fn execute(&self) -> Option<&Action>;
}
// Define enums. Each enum variant can
// have another type inside it.
View keybase.md

Keybase proof

I hereby claim:

  • I am soptikha2 on github.
  • I am soptikha2 (https://keybase.io/soptikha2) on keybase.
  • I have a public key ASDpSr1gNR-vLwiyvC6a_PZhQEgmbNqBtyxssiJVZ59Itgo

To claim this, I am signing this object:

View markov-chain.py
import sys
from random import randint
def next_letter(probs, letter):
if not letter in probs:
return None
probs_for_letter = probs[letter]
sum_of_probs = 0
for prob in probs_for_letter:
sum_of_probs += probs_for_letter[prob]
View debug-annotation.sed
SED PROGRAM:
x
z
x
:x
s/$/%;%90123456789/
:y
s/(.)%((%?.)*\\1)|;.*/\3\2/
t y
/\n/ b z
View backtrace-alacritty.txt
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7fc3204e5900 (LWP 3788547) "alacritty" 0x00007fc320a81abb in sched_yield () from /usr/lib/libc.so.6
2 Thread 0x7fc31985c700 (LWP 3788559) "config watcher" 0x00007fc320b8be32 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
3 Thread 0x7fc31965b700 (LWP 3788560) "PTY reader" 0x00007fc320a9af3e in epoll_wait () from /usr/lib/libc.so.6
4 Thread 0x7fc31945a700 (LWP 3788561) "config watcher" 0x00007fc320b8be32 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
5 Thread 0x7fc319259700 (LWP 3788562) "config watcher" 0x00007fc320a9af3e in epoll_wait () from /usr/lib/libc.so.6
(gdb) thread 1
[Switching to thread 1 (Thread 0x7fc3204e5900 (LWP 3788547))]
#0 0x00007fc320a81abb in sched_yield () from /usr/lib/libc.so.6
@SoptikHa2
SoptikHa2 / koswatcher.sh
Last active Jan 25, 2021
Watch KOS for teacher assignment changes and notify user
View koswatcher.sh
#!/usr/bin/env bash
declare -A subject_teachers
#┌───────┐
#│ SETUP │
#└───────┘
# 1. Install chromedriver
# 2. Make sure notify-send properly sends notifications
# 3. (Optional) Install espeak-ng and voice bank for voice warning