Skip to content

Instantly share code, notes, and snippets.

View troyp's full-sized avatar

Troy Pracy troyp

  • Lismore, NSW, Australia
View GitHub Profile
@troyp
troyp / ua.md
Last active November 10, 2023 01:37 — forked from jwodder/ua.md
D&D 5e Unearthed Arcana Index

D&D 5e Unearthed Arcana Index

Because finding anything in this page is harder than it should be

Date Article Contents
2015-02-02 Unearthed Arcana: Eberron [PDF] Changelings, shifters, warforged, Wizard (Artificer), rules for action points, dragonmarks
@troyp
troyp / CreateCBL.py
Created September 8, 2023 19:00 — forked from maforget/CreateCBL.py
Create CBL from a Text File
import re;
import os;
with open('sorting.txt') as f:
lines = f.readlines()
with open('template.cbl') as f:
cbl = f.read()
for l in lines:
@troyp
troyp / waitForKeyElements.js
Created August 18, 2022 02:02 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@troyp
troyp / pdf-to-txt.java
Created April 1, 2022 14:51 — forked from zhouhoo/pdf-to-txt.java
use tika to convert pdf file to txt.
//although it is hard job to convert pdf to text, tika tool is cool for this. it can auto detect pdf format and choose parser to parse the pdf.
package june;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
@troyp
troyp / Shell Commands ePub
Created November 28, 2021 05:59 — forked from jamesktan/Shell Commands ePub
Unzipping & Zipping ePub from Command Line
// To unzip the epub, move the ePub to a folder, cd to it then simply:
unzip MyEbook.epub
// To zip up an epub:
1. zip -X MyNewEbook.epub mimetype
2. zip -rg MyNewEbook.epub META-INF -x \*.DS_Store
3. zip -rg MyNewEbook.epub OEBPS -x \*.DS_Store
Some explanations necessary here. We start each line with two flags:
@troyp
troyp / llpp.conf.xml
Created October 5, 2021 21:09 — forked from Earnestly/llpp.conf.xml
Basic vi-like emulation using llpp's new keymapping. Also some other defaults and examples for custom fonts.
<llppconfig>
<ui-font size='18'>
<![CDATA[/home/earnest/.local/share/fonts/Fontin-Regular.otf]]>
</ui-font>
<defaults zoom='100'
auto-scroll-step='12'
horizontal-scroll-step='24'
case-insensitive-search='true'
uri-launcher='$BROWSER &quot;%s&quot;'
@troyp
troyp / toggle-decorations.c
Created July 29, 2021 11:49 — forked from muktupavels/toggle-decorations.c
Simple app to toggle window decorations.
/*
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@troyp
troyp / windowtweaks.c
Last active July 29, 2021 11:51 — forked from AquariusPower/windowtweaks.c
Add/remove decorations, input hint, window focus protocol
/*
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
CC=gcc
CFLAGS=-Wall -O2 `pkg-config --cflags x11`
LDFLAGS=`pkg-config --libs x11`
SOURCES=toggle-decorations.c
EXECUTABLE=$(patsubst %.c,%,$(SOURCES))
all: $(EXECUTABLE)
clean: $(EXECUTABLE)
@troyp
troyp / ImgurAlbum.sh
Created July 22, 2021 20:08 — forked from Skylark95/ImgurAlbum.sh
Bash script to download images for an Imgur album
#!/bin/bash
#
# ImgurAlbum.sh
#
# Bash script to download images for an Imgur album
#
if [ -z "$1" ]; then
echo "ImgurAlbum: missing Album ID"
echo "Usage: ImgurAlbum [Album ID]"
exit