Skip to content

Instantly share code, notes, and snippets.

Avatar

Troy Pracy troyp

  • Lismore, NSW, Australia
View GitHub Profile
@troyp
troyp / Shell Commands ePub
Created Nov 28, 2021 — forked from jamesktan/Shell Commands ePub
Unzipping & Zipping ePub from Command Line
View Shell Commands ePub
// 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 Oct 5, 2021 — forked from Earnestly/llpp.conf.xml
Basic vi-like emulation using llpp's new keymapping. Also some other defaults and examples for custom fonts.
View llpp.conf.xml
<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 Jul 29, 2021 — forked from muktupavels/toggle-decorations.c
Simple app to toggle window decorations.
View toggle-decorations.c
/*
* 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 Jul 29, 2021 — forked from AquariusPower/windowtweaks.c
Add/remove decorations, input hint, window focus protocol
View windowtweaks.c
/*
* 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
View Makefile
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 Jul 22, 2021 — forked from Skylark95/ImgurAlbum.sh
Bash script to download images for an Imgur album
View ImgurAlbum.sh
#!/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
@troyp
troyp / global-input-unstable-v1.xml
Created Jul 20, 2021
global-input wayland protocol DRAFT PREVIEW
View global-input-unstable-v1.xml
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="global_input_v1">
<copyright>
Copyright (C) 2017 Greg V (greg@unrelenting.technology)
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
@troyp
troyp / redir.md
Created May 8, 2021 — forked from romainl/redir.md
Redirect the output of a Vim or external command into a scratch buffer
View redir.md

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window:

View word highlight.user.js
// ==UserScript==
// @name word highlight
// @namespace http://ss-o.net/
// @description keywords highlight for Google Search and All
// @include http://*
// @include https://*
// ==/UserScript==
// スクロール中のみハイライトするように変えた。
//console.time("highlight");
(function word_hightlight(loaded){
@troyp
troyp / monad-reader-contents.md
Last active Jul 25, 2020
The Monad.Reader contents
View monad-reader-contents.md

The Monad.Reader Issue 1 (March 1, 2005)

  • Pseudocode: Natural Style by Andrew J. Bromage
  • Pugs Apocryphon 1 – Overview of the Pugs project by Autrijus Tang
  • An Introduction to Gtk2Hs, a Haskell GUI Library by Kenneth Hoste
  • Implementing Web-Services with the HAIFA Framework by Simon D. Foster
  • Code Probe – Issue one: Haskell XML-RPC, v.2004-06-17 by Sven Moritz Hallberg

The Monad.Reader Issue 2 (May 2005)