Skip to content

Instantly share code, notes, and snippets.

View larsgw's full-sized avatar

Lars Willighagen larsgw

View GitHub Profile
@hubgit
hubgit / citation-schema.json
Last active May 2, 2022 08:57
Mapping of Highwire/Google Scholar citation_* meta fields to schema.org properties, as a JSON-LD context document. Definitions starting with "#" are invalid.
{
"@context": {
"_links": "http://stateless.co/hal_specification.html#links",
"title": "http://schema.org/name",
"description": "http://schema.org/description",
"publisher": "#http://schema.org/publisher > http://schema.org/Organization > http://schema.org/name",
"firstpage": "http://schema.org/pageStart",
"doi": "#http://schema.org/sameAs (URL)",
"volume": "#http://schema.org/isPartOf > http://schema.org/PublicationVolume > http://schema.org/volumeNumber",
"volume": "#http://schema.org/isPartOf > http://schema.org/PublicationIssue > http://schema.org/issueNumber",
@rbnvrw
rbnvrw / LaTeXScaleBars.md
Last active July 29, 2022 14:40
Adding scalebars to images in LaTeX

Scalebar with background

Scalebar with background

To change the backgroundcolor, adjust the scalebgcolor variable to use the desired color. Add the following code to your preamble:

\usepackage{tikz}
\usepackage[usenames, dvipsnames]{color}
\definecolor{scalebgcolor}{rgb}{0.08,0.52,0.80}
var incognito = function(require, module, exports) {
"use strict";
function isWebkitRequestFileSystem() {
return !!window.webkitRequestFileSystem
}
function isFirefoxIndexedDB() {
return !!window.indexedDB && /Firefox/.test(window.navigator.userAgent)
}
function isIE10PlusOrEdge() {
if (document.documentMode) {
#!/usr/bin/env python3
import zipfile
import sys
import re
import xml.etree.ElementTree as ET
namespaces = {
'a': 'http://schemas.openxmlformats.org/drawingml/2006/main',
'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
@Cyberes
Cyberes / How to re-implement remove-background in ocrmypdf.md
Last active October 21, 2025 20:26
Re-implement --remove-background in OCRmyPDF

I needed --remove-background so I re-implemented this feature myself.

https://github.com/ocrmypdf/OCRmyPDF

Build Dependencies

Leptonica

This feature requires Leptonica, an image processing and analysis library. You have to build it from source, which is why it was removed from OCRmyPDF.