View __init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
class DisallowLogsHandler(logging.Handler): | |
def emit(self, record): | |
raise AssertionError(f'Unexpected log: "{self.format(record)}"') | |
logging.lastResort = DisallowLogsHandler(level=logging.WARNING) |
View S3 config api.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"IndexDocument": { | |
"Suffix": "index.html" | |
}, | |
"ErrorDocument": { | |
"Key": "api/1.2.2/404.html" | |
}, | |
"RoutingRules": [ | |
{ | |
"Condition": { |
View cleanup_generate.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x -e | |
check() { | |
mkdir -p /tmp/a /tmp/b | |
cp generate.cr /tmp/a/ | |
sed -i -e "${1}d" generate.cr | |
cp generate.cr /tmp/b/ | |
(cd /tmp/b && crystal build --warnings=none generate.cr) || return 4 | |
(cd /tmp/a && crystal build --warnings=none generate.cr) || return 5 |
View konversation.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --unified --recursive konversation-1.7.2/src/viewer/chatwindow.cpp konversation-1.7.2.new/src/viewer/chatwindow.cpp | |
--- konversation-1.7.2/src/viewer/chatwindow.cpp 2017-05-09 17:29:00.000000000 +0200 | |
+++ konversation-1.7.2.new/src/viewer/chatwindow.cpp 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; |
View dump_quassel_logs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Create a file tree with all chat logs from Quassel. | |
Usage: | |
./dump_quassel_logs.py /var/lib/quassel/quassel-storage.sqlite | |
The file names will have this format: | |
./network/#channel/YYYY-MM-DD.log | |
The lines in each file will have this format: | |
[HH:MM:SS] <nick> message |
View THE 99 HOLE.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_name() | |
return "THE 99-HOLE" | |
end | |
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 parraleln.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def paralleln(items : Indexable(T), &block : T -> R) forall T, R | |
results = Array(R).new(items.size) { r = uninitialized R } | |
done = Channel(Exception?).new | |
items.each_with_index do |item, i| | |
spawn do | |
begin | |
results[i] = block.call(item) | |
rescue e | |
done.send e |
View pacman_rollback.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
last_lines = lines = None | |
with open('/var/log/pacman.log') as log_file: | |
for line in log_file: | |
if re.search(r'\btransaction started\b', line): | |
lines = [] |
NewerOlder