Skip to content

Instantly share code, notes, and snippets.

View juzim's full-sized avatar

Julian Zimmermann juzim

View GitHub Profile
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CapsLock::
SetFormat, Integer, H
WinGet, WinID,, A
ThreadID:=DllCall("GetWindowThreadProcessId", "UInt", WinID, "UInt", 0)
InputLocaleID:=DllCall("GetKeyboardLayout", "UInt", ThreadID, "UInt")
#!/bin/bash
ncpath='/var/www/nextcloud'
htuser='www-data'
htgroup='www-data'
rootuser='root'
printf "Creating possible missing Directories\n"
mkdir -p $ncpath/data
mkdir -p $ncpath/assets
mkdir -p $ncpath/updater
@juzim
juzim / shift_tasks.py
Last active May 8, 2019 12:12
Script to shift tasklists in zim to the next workday. Completed or excluded tasks are ignored, all others are set to `[>]` on the last day and reset on the next.
#!/usr/bin/python
import sys
import datetime
import re
from pathlib import Path
file = Path(sys.argv[1])
date_parts = list(map(lambda x: x.replace('.txt', ''), file.parts[-3:]))
with Path('out').open('w+') as nf:
@juzim
juzim / shift_tasks.py
Created May 8, 2019 12:11
Script to shift tasklists in zim to the next workday.
#!/usr/bin/python
import sys
import datetime
import re
from pathlib import Path
file = Path(sys.argv[1])
date_parts = list(map(lambda x: x.replace('.txt', ''), file.parts[-3:]))
with Path('out').open('w+') as nf:
@juzim
juzim / fanatic_com_key_extractor.js
Created January 30, 2018 20:32
Extract all steam keys from a fanatical.com order page
var nodes = document.getElementsByClassName('text-center font-weight-bold form-control')
var res = [];
for (var i = 0; i < nodes.length; i++) { res.push(nodes[i].value);}
console.log(res.join("\n"))
@juzim
juzim / packtpub_get_dl_links.js
Last active March 4, 2018 14:48
Create wget commands for all claimed books on packtpub
Delivered-To: XXX
Received: by 10.140.29.10 with SMTP id a10csp395795qga;
Fri, 9 Dec 2016 09:09:06 -0800 (PST)
X-Received: by 10.237.34.46 with SMTP id n43mr77743889qtc.105.1481303346076;
Fri, 09 Dec 2016 09:09:06 -0800 (PST)
Return-Path: <bounce-mc.us11_45970521.600833-XXX=gmail.com@mail203.atl121.mcsv.net>
Received: from mail203.atl121.mcsv.net (mail203.atl121.mcsv.net. [198.2.131.203])
by mx.google.com with ESMTPS id a17si20552195qte.223.2016.12.09.09.09.05
for <XXX>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
@juzim
juzim / code.gs
Last active March 30, 2019 07:35
Google apps script for parsing the URL of the free ebook from the packtpub newsletter
function extractPacktpubUrl() {
try {
var ss = SpreadsheetApp.getActiveSheet();
var label = GmailApp.getUserLabelByName("packt_free_ebook");
var threads = label.getThreads();
if (threads[0] == undefined || threads[0].getMessages()[0] == undefined) {
Logger.log('No valid message found');