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 hidden or 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
{ | |
"emmet.includeLanguages": { | |
"jinja-html": "html" | |
} | |
} |
This file contains hidden or 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
def easeInOutQuad(x: int | float) -> int | float: | |
return 2 * x * x if x < 0.5 else 1 - pow(-2 * x + 2, 2) / 2 |
This file contains hidden or 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
// Here are some snippets from the file that loads all my article's markdown files and does processing on them | |
// including generating the json file for search | |
import * as fs from "fs"; | |
import path from "path"; | |
const publicDirectory = path.join(process.cwd(), "public"); | |
// At the bottom of the function that populates the cache of articles... | |
const searchFile = JSON.stringify( | |
articles.map((article) => ({ |
This file contains hidden or 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
/** | |
* This module is used at providing an easy way to override material-ui | |
* `shadows` properties. | |
* material-ui expects the shadows to be following a certain pattern. | |
* (source: https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/styles/shadows.js) | |
* This file is a slight adaptation (for colours) of the above material-ui source file. | |
* | |
* This module exports a `createShadows(hexColor: string): Array<string>` method | |
* that takes a hex color (presumably from the configuration) and returns an array | |
* of the 25 possible shadows matching the 25 elevations in material-ui. |
This file contains hidden or 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
// the cache version gets updated every time there is a new deployment | |
const CACHE_VERSION = 10; | |
const CURRENT_CACHE = `main-${CACHE_VERSION}`; | |
// these are the routes we are going to cache for offline support | |
const cacheFiles = ['/', '/about-me/', '/projects/', '/offline/']; | |
// on activation we clean up the previously registered service workers | |
self.addEventListener('activate', evt => | |
evt.waitUntil( |
This file contains hidden or 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
https://youtu.be/-C-JoyNuQJs?t=39m45s | |
When I put the reference implementation onto the website I needed to | |
put a software license on it. | |
And I looked at all the licenses that were available, and there were a lot | |
of them. And I decided that the one I liked the best was the MIT License, | |
which was a notice that you would put on your source and it would say, | |
"you're allowed to use this for any purpose you want, just leave the | |
notice in the source and don't sue me." |