Skip to content

Instantly share code, notes, and snippets.

View TkTech's full-sized avatar
Converting coffee into code

Tyler Kennedy TkTech

Converting coffee into code
View GitHub Profile
diff --git a/smsapp/conversationmodel.cpp b/smsapp/conversationmodel.cpp
index 7cd80abc..755f3796 100644
--- a/smsapp/conversationmodel.cpp
+++ b/smsapp/conversationmodel.cpp
@@ -142,8 +142,11 @@ void ConversationModel::createRowFromMessage(const ConversationMessage& message,
return;
}
- ConversationAddress sender = message.addresses().first();
- QString senderName = message.isIncoming() ? SmsHelper::getTitleForAddresses({sender}) : QString();
@TkTech
TkTech / example.py
Created March 21, 2021 21:31
Rewrite links in Markdown
from humanmark import loads, dumps, ast
doc = loads('[a](../b.c)')
links = doc.find(
# Only find link nodes
ast.Link,
# We don't want to rewrite links that use a reference
f=lambda link: link.reference is None,
# A negative value means to search the entire tree.
@TkTech
TkTech / PostToSlack.js
Last active October 8, 2020 18:53
Post the results of a Google Form to a Slack channel webhook
var webhook = 'https://hooks.slack.com/services/***';
var header = 'A user requested an integration be reviewed.';
var whoLeader = 'Review requested by:';
function OnSubmit(e) {
var responses = e.response.getItemResponses();
UrlFetchApp.fetch(webhook, {
method: 'post',
payload: JSON.stringify({
public class TryCatch {
public void test() {
try {
int i = 1 / 0;
} catch(ArithmeticException e) {
return;
}
}
}
@TkTech
TkTech / keybase.md
Created April 1, 2019 15:31
keybase.md

Keybase proof

I hereby claim:

  • I am tktech on github.
  • I am tktech (https://keybase.io/tktech) on keybase.
  • I have a public key ASBPQ8lLlGEka9GPqnlF03t7ZfyA6lw7Fpr5MaBTaB8l_Qo

To claim this, I am signing this object:

1 x Intel Core i7 4770K Unlocked Quad Core 3.5GHZ Processor LGA1150 Haswell 8MB Cache Retail
1 x Corsair Cooling Hydro Series H110 High Performance CPU Cooler LGA1150 1155 1156 1366 2011 FM1 FM2
1 x ASUS Maximus VI Extreme ATX LGA1150 Z87 DDR3 SATA3 USB3.0 DVI HDMI Motherboard
2 x Corsair Dominator Platinum 16GB 2X8GB DDR3-1866 240PIN C9 DIMM 1.5V Dual Channel Memory Kit
2 x ASUS GeForce GTX 770 1110MHZ 2GB 7010MHZ GDDR5 DVI HDMI PCI-E Video Card
1 x Corsair Carbide Series Air 540 High Airflow Cube Case ATX Window 2X5.25 2X3.5INT USB3.0 No PS
1 x Corsair AX1200I 1200W Digital ATX 12V 80 Plus Platinum Modular Power Supply 140mm Fan
2 x Bitfenix BFA-ACL-30OK15-RP Alchemy LED Connect Lit 30CM 15 LEDs - Orange
2 x Seagate Barracuda 2TB 7200RPM SATA3 64MB Cache 3.5in Internal Hard Drive
import struct
from collections import namedtuple
Column = namedtuple('Column', 'start end')
with open('assets/minecraft/font/glyph_sizes.bin', 'rb') as fin:
sizes = [Column(
b >> 4,
b & 0x0F
from getmymail import Client
c = Client.from_email('tk@tkte.ch')
c.login_keychain('tk@tkte.ch')
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""clean_db.py
Helps to immunize registration spam from a MediaWiki installation.
Usage:
clean_db.py scan <dbstring> [options]
clean_db.py bans <dbstring>
##!/usr/bin/env python
# -*- coding: utf-8 -*-
"""yggdrasil.py
A tool for debugging and exploring yggdrasil, Minecraft's new
authentication system.
Usage:
yggdrasil.py login <username> [--password=<password>]
yggdrasil.py migrated <username>