Skip to content

Instantly share code, notes, and snippets.

View nathanlesage's full-sized avatar

Hendrik Erz nathanlesage

View GitHub Profile
@nathanlesage
nathanlesage / index.htm
Created December 2, 2023 17:27
Wordle clone
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zettle</title>
<style>
body {
background-color: rgb(69, 69, 95);
color: white;
@nathanlesage
nathanlesage / index.htm
Last active February 4, 2025 19:54
ContentEditable Demo (CodeMirror 6)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ContentEditable Demo</title>
<script src="index.js"></script>
</head>
<body>
@nathanlesage
nathanlesage / export_comments.lua
Created June 11, 2022 13:43
A Pandoc filter for exporting HTML comments
-- Default: Don't export comments
local comments = nil
function Meta (meta)
-- If there is a "comments" field in the YAML frontmatter, extract this
if meta.comments then
comments = pandoc.utils.stringify(meta.comments)
end
return meta
end
@nathanlesage
nathanlesage / sotu.csv
Created June 4, 2022 12:35
State of the Union (SOTU) Corpus
We can't make this file beautiful and searchable because it's too large.
Good afternoon: At the beginning of each new year, as we reflect on the state of our American Union, we seek again a definition of what America means. Carl Sandburg came close to capturing its real meaning in three simple words that became the title for one of his greatest poems: "The People, Yes." America has risen to greatness because again and again when the chips were down, the American people have said yes--yes to the challenge of freedom, yes to the dare of progress, and yes to the hope of peace---even when defending the peace has meant paying the price of war. America's greatness will endure in the future only if our institutions continually rededicate themselves to saying yes to the people--yes to human needs and aspirations, yes to democracy and the consent of the governed, yes to equal opportunity and unlimited horizons of achievement for every American. It is in this spirit of rededication that I will send to the Congress in the next few days the fourth section of my 1973 State of the Union rep
@nathanlesage
nathanlesage / tts.sh
Created January 17, 2022 22:23
A small utility function to quickly convert a text file into a spoken track
# TTS COMMAND
#
# This command is a handy utility that allows you to quickly convert
# a text file into a speech recording.
#
# NOTE: This will only work on macOS, since it relies on the `say`
# command which utilizes Apple's speech synthesis system.
#
# REQUIRED: ffmpeg. You can easily install this using `brew install ffmpeg`
#
@nathanlesage
nathanlesage / index.md
Last active May 16, 2019 15:49
ScanTailor Compiler Run macOS 10.14.4 Mojave

Setting up the current ScanTailor on macOS (tested on Mojave 10.14.4)

Reference: https://forum.diybookscanner.org/viewtopic.php?t=3407#p20608

  1. Download the experimental branch from here: https://github.com/Tulon/scantailor/tree/experimental (Or, possibly, in the future: Some other fork of ScanTailor)
  2. In the file scantailor-experimental/filters/page_split/OptionsWidget.cpp add after all the #include-statements the following line: #include <QButtonGroup>
  3. Via homebrew run: brew install cmake eigen qt5 jpeg libtiff boost
  4. CD into the scantailor-directory (root level)
  5. Run cmake . -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/5.8.0_2 -- attention: Replace the Qt-version with the one that brew installed!
  6. if it was successful (read the last few lines of output), run: make
@nathanlesage
nathanlesage / github_download_counter.php
Last active November 17, 2023 14:09
This PHP file simply requires an online web server and some variables by you and it will show you the overall statistics of your repository.
<?php
/*
* GitHub Download Counter page
* Created by Hendrik Erz <[email protected]>
* Licensed via GNU GPL v3
*/
// CONFIG
$repo = 'Zettlr/Zettlr'; // The repository