Skip to content

Instantly share code, notes, and snippets.

View jneidel's full-sized avatar
🐧
Living GNU/Life

Jonathan Neidel jneidel

🐧
Living GNU/Life
View GitHub Profile
@jneidel
jneidel / utils.js
Last active February 26, 2019 17:10
Utilities
// Return an array of numbers for specified range
function range( min, max ) {
min -= 2;
return Array.from( new Array( max - min - 1 ), ( x,i ) => i - min );
}
// Return a random number from specified range
const randomNum = ( min, max ) => Math.floor( ( Math.random() * max ) + min );
// Get width of window
@jneidel
jneidel / lighter-darker-color-gen.js
Last active January 17, 2018 14:19
Generate lighter/darker color
var pad = function(num, totalChars) {
var pad = '0';
num = num + '';
while (num.length < totalChars) {
num = pad + num;
}
return num;
};
// Ratio is between 0 and 1
@jneidel
jneidel / setup.md
Last active March 30, 2024 07:56
Various often used building blocks

HTML

Basic Page:

<html>
<head>
  <meta charset="UTF-8">
  <title></title>
  <link rel="icon" href="">
@jneidel
jneidel / timestamping-with-mpv.md
Last active March 3, 2023 17:27
Timestamping with mpv

Timestamping with mpv

Background

I did some usability testing and wanted to measure performance. We did a recording where the participants were solving the tasks.

And I wanted a quick and easy way to note down the beginning and end of a task. I needed these value pairs (like 300.52, 313.4, as the seconds since the start of the video) to do some computation with them.

Solution

@jneidel
jneidel / project-planner.md
Last active September 26, 2023 02:01
Project planner

Für den Project Planner Kurs gibt es zwei Sachen zu beachten:

  1. Du musst einen Account erstellen
  2. Zum Schauen der Videos musst du über die von mir bereit gestellten Video links gehen, ansonsten geht das nicht (nicht auf irgendwas freischalten klicken).

Videos

@jneidel
jneidel / Migrate norg to org.md
Last active April 26, 2025 19:44
Migrate Neorg files to org-mode (.norg -> .org)

Migrate neorg files to orgmode files

I wanted to switch from nvim-neorg to emacs orgmode. The major hurdle for switching was not setting up orgmode, but migrating my thousands of files that I still had in the .norg format.

The script contained here is what I used to migrate all of my files at scale. In the test files you can see how different features will be transformed by the script. Enjoy.