If you, like me, resent every dollar spent on commercial PDF tools,
you might want to know how to change the text content of a PDF without
having to pay for Adobe Acrobat or another PDF tool. I didn't see an
obvious open-source tool that lets you dig into PDF internals, but I
did discover a few useful facts about how PDFs are structured that
I think may prove useful to others (or myself) in the future. They
are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.
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
# tmux configuration file | |
# set terminal to "screen-256color" | |
set -g default-terminal "screen-256color" | |
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
bind r source-file ~/.tmux.conf |
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
// ==UserScript== | |
// @name Reddit Display Inline Images | |
// @namespace http://userscripts.org/users/432375 | |
// @description Displays linked imgaes directly in the page | |
// @version 2.0 | |
// @updateURL https://userscripts.org/scripts/source/124010.meta.js | |
// @include http://www.reddit.com/* | |
// @include https://www.reddit.com/* | |
// @author aditya | |
// @grant GM_xmlhttpRequest |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SetWorkingDir, %A_ScriptDir% ; Ensures a consistent starting directory. | |
#SingleInstance, Force | |
If %0% ; The script was called with at least 1 argument, expectedly the user drag'n'dropped something onto the script. | |
Loop, %0% | |
input := %A_Index% | |
If FileExist(input) ; Not sure if this needed, since user can't drag'n'drop an unexisting file. | |
FileRead, input, %input% |
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
; Quotation marks | |
0 `(")((?:[^"]*?(?:"")?)*?)("(?!"))` `\1=(2,#ff0000,0) \2=(3,#00ff00,0) \3=(3,#ff0000,0)` | |
; 0args | |
0 `^(.*::)?\s*(#ErrorStdOut|#InstallKeybdHook|#InstallMouseHook|#NoEnv|#NoTrayIcon|#Persistent|#WinActivateForce|Edit|EnvUpdate|KeyHistory|ListHotkeys|ListVars|Reload|SplashTextOff|WinMinimizeAll|WinMinimizeAllUndo)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` | |
; 1u | |
0 `^(.*::)?\s*(#If|#InputLevel|#SingleInstance|#UseHook|Break|Catch|Continue|Critical|Exit|ExitApp|FileEncoding|FileRecycleEmpty|ListLines|OnExit|Return|SetCapsLockState|SetNumLockState|SetScrollLockState|Suspend|Throw)(\s*,\s*|\s+([^;]*?))?(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \4=(2,${VAR},#ff0000) \5=(3,${COMM},0)` | |
; 2u | |
0 `^(.*::)?\s*(#IfWinActive|#IfWinNotActive|#IfWinExist|#IfWinNotExist|#Warn|ClipWait|Pause|SoundBeep)(\s*,\s*|\s+([^;]*?))?(\s+;.*$)?(\s*,\s*([^;]*?))?(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \4=(2,${VAR},#ff0000) \5=(3,${COMM},0) \7=(2,${VAR},#00ff00) \8=(3,${COMM},0)` | |
; 3u | |
0 `^(.*::)?\s |
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
0 `(")((?:[^"]*?(?:"")?)*?)("(?!"))` `\1=(2,#ff0000,0) \2=(3,#00ff00,0) \3=(3,#ff0000,0)` | |
; 0args | |
0 `^(.*::)?\s*(#ErrorStdOut)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` | |
0 `^(.*::)?\s*(#InstallKeybdHook)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` | |
0 `^(.*::)?\s*(#InstallMouseHook)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` | |
0 `^(.*::)?\s*(#NoEnv)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` | |
0 `^(.*::)?\s*(#NoTrayIcon)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` | |
0 `^(.*::)?\s*(#Persistent)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` | |
0 `^(.*::)?\s*(#WinActivateForcet)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` | |
0 `^(.*::)?\s*(Edit)(\s+;.*$)?$` `\1=(2,${STR},0) \2=(2,${OP},0) \3=(3,${COMM},0)` |