Skip to content

Instantly share code, notes, and snippets.

View oprypin's full-sized avatar

Oleh Prypin oprypin

View GitHub Profile
oprypin / script.js
Last active December 1, 2023 16:12
Add a selector with checkboxes to
View script.js
// Create checkbox to hide preview rules
var checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.checked = true;
checkbox.addEventListener("change", function () {
for (var span of document.querySelectorAll(
'span[title="Rule is in preview"]',
)) {
span.closest("tr").style.display = event.currentTarget.checked
? null
oprypin /
Created September 8, 2023 13:05
Merge cimgui docking_inter branch into master and re-generate
set -ex
git merge --no-ff --no-commit "$to_merge" || true # Always fails
# But double-check that we really ended up in a merge status
git rev-list -1 MERGE_HEAD
# Reset everything to be like the merged branch
oprypin /
Created September 2, 2022 22:17
Disallow unexpected logging messages in Python unittest
import logging
class DisallowLogsHandler(logging.Handler):
def emit(self, record):
raise AssertionError(f'Unexpected log: "{self.format(record)}"')
logging.lastResort = DisallowLogsHandler(level=logging.WARNING)
oprypin / S3 config api.json
Last active December 14, 2021 22:49 — forked from straight-shoota/S3 config api
Crystal S3 Config
View S3 config api.json
"IndexDocument": {
"Suffix": "index.html"
"ErrorDocument": {
"Key": "api/1.2.2/404.html"
"RoutingRules": [
"Condition": {
oprypin /
Last active April 19, 2020 11:07
Unused code deletion based on the output not being affected
set -x -e
check() {
mkdir -p /tmp/a /tmp/b
cp /tmp/a/
sed -i -e "${1}d"
cp /tmp/b/
(cd /tmp/b && crystal build --warnings=none || return 4
(cd /tmp/a && crystal build --warnings=none || return 5
oprypin / konversation.patch
Created November 10, 2018 20:44
Patches to integrate bridge bot messages (FromGitter)
View konversation.patch
diff --unified --recursive konversation-1.7.2/src/viewer/chatwindow.cpp
--- konversation-1.7.2/src/viewer/chatwindow.cpp 2017-05-09 17:29:00.000000000 +0200
+++ 2017-11-07 00:13:25.359449297 +0100
@@ -278,7 +278,15 @@
void ChatWindow::append(const QString& nickname, const QString& message, const QHash<QString, QString> &messageTags, const QString& label)
if(!textView) return;
- textView->append(nickname, message, messageTags, label);
+ QString nickname_ = nickname;
+ QString message_ = message;
#!/usr/bin/env python3
"""Create a file tree with all chat logs from Quassel.
./ /var/lib/quassel/quassel-storage.sqlite
The file names will have this format:
The lines in each file will have this format:
[HH:MM:SS] <nick> message
oprypin / THE 99 HOLE.lua
Created August 5, 2018 21:19
My SHENZHEN I/O puzzles
View THE 99 HOLE.lua
function get_name()
return "THE 99-HOLE"
function get_description()
return {
"*alice* is an XBus input connected to an electronic transmitter.",
"*bob* is an XBus output connected to an electronic receiver.",
"Receive packets of data from *alice* and send them to *bob*.",
"Numbers are between 1 and 26.",
View ~∕.local∕share∕kservices5∕open-shell-here.desktop
[Desktop Entry]
[Desktop Action openShellHere]
Name=Open Shell Here
Exec=/usr/bin/env fbf=%f /usr/bin/konsole