Skip to content

Instantly share code, notes, and snippets.

View JakobTischler's full-sized avatar

Jakob Tischler JakobTischler

View GitHub Profile
@JakobTischler
JakobTischler / Frank Herbert - Dune #1 - Dune.cue
Created August 27, 2021 13:02
Dune series Audiobook .cue files
FILE ""
TRACK 1 AUDIO
TITLE "Book One: Dune — Chapter 1"
INDEX 01 0:0:00
TRACK 2 AUDIO
TITLE "Chapter 2"
INDEX 01 35:22:46
TRACK 3 AUDIO
TITLE "Chapter 3"
INDEX 01 62:48:28
@JakobTischler
JakobTischler / TVMaze-Set-Episode-Status.js
Created August 11, 2021 10:08
Goes through defined seasons and sets their episodes' status to the wanted status.
/**
* Delays the script execution for a specified amount of time. Returns a promise that gets resolved after `amount` ms. Must be called in an `async` function with `await`.
* @param {Number} amount The length in ms. Default: `1000`.
* @returns {Promise} The promise.
*/
function sleep(amount = 1000) {
return new Promise((resolve) => {
setTimeout(resolve, amount);
});
}
@JakobTischler
JakobTischler / normalize-in-range.js
Created August 11, 2021 09:55
Normalizes a `value` between `min` and `max` and then casts it onto a range between `rangeMin` (defaults to 0) and `rangeMax` (defaults to 1). The initial normalization can be clamped between 0 and 1 (`clamp`, defaults true). The return value describes where `value` would lay if `min` and `max` were represented by the `rangeMin` and `rangeMax` r…
/**
* Normalizes a `value` between `min` and `max` and then casts it onto a range between `rangeMin`
* (defaults to 0) and `rangeMax` (defaults to 1). The initial normalization can be clamped between
* 0 and 1 (`clamp`, defaults true). The return value describes where `value` would lay if `min`
* and `max` were represented by the `rangeMin` and `rangeMax` range.
*
* Read as: "value is to min and max as result is to rangeMin and rangeMax"
*
* @param {number} value The value to cast.
* @param {number} min The lower value of the normalization set. `min < max` must be true.
@JakobTischler
JakobTischler / get-int-parts.js
Last active August 11, 2021 09:50
Returns a list of numbers as fractions of the input number. Eg. 23 in 6 parts = [ 4, 4, 4, 4, 4, 3 ] (smooth) or [ 8, 3, 3, 3, 3, 3 ] (tight).
// Modes:
// "Smooth" spreads the number list so they are as close together as possible (+- 1). E.g. 23 in 6 parts = [ 4, 4, 4, 4, 4, 3 ]
// "Tight" has 1 number with a "rest" value, and the remaining numbers identical to each other. E.g. 23 in 6 parts = [ 8, 3, 3, 3, 3, 3 ]
const Mode = {
Smooth: 1,
Tight: 2,
};
function getIntParts(number, numParts, mode = Mode.Smooth) {
const val = number / numParts;
@JakobTischler
JakobTischler / Bitwarden-Delete-Empty-Folders.js
Created August 11, 2021 09:00
In the Bitwarden Web Vault, goes through each folder, checks if it's empty, and deletes it if so. To be pasted and executed in the browser console.
var sleep = (ms = 1000) => {
return new Promise((resolve) => setTimeout(resolve, ms));
};
async function deleteEmptyFolders(startIndex = 0) {
const config = {
sleepBetweenFolder: 250,
sleepAfterLinkClick: 100,
sleepAfterEditClick: 500,
sleepAfterDeleteClick: 1200,
GIANTS Engine Runtime 5.0.1 (build date: Mar 28 2014)
Copyright (c) 2008-2012, GIANTS Software GmbH (www.giants-software.com), All Rights Reserved.
Copyright (c) 2003-2012, Christian Ammann and Stefan Geiger, All Rights Reserved.
Application: FarmingSimulator2013
Main System
Cpu Name: Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
Cpu Core(s): 4 @ 2.4 GHZ
OS: Windows NT 6.2 64-bit
Physics System
Driver: NVIDIA PhysX Runtime
@JakobTischler
JakobTischler / CourseplayWaypointAttributes.txt
Last active December 30, 2015 01:59
Courseplay waypoint attributes
pos
[type: string]
[accepts: 'flt flt' (2D flt vector)]
[desc: position of the waypoint]
angle
[type: float]
[accepts: 'flt']
[desc: vector angle to next waypoint (in degrees) (bearing to the meridian)]
@JakobTischler
JakobTischler / drive.lua
Last active December 15, 2015 03:59
automatic closing/opening of covers
function courseplay:openCloseCover(self)
--courseplay:debug("self.cp.tipperHasCover = " .. tostring(self.cp.tipperHasCover), 3);
if self.cp.tipperHasCover then
for i=1, table.getn(self.cp.tippersWithCovers) do
local tIdx = self.cp.tippersWithCovers[i];
local tipper = self.tippers[tIdx];
--INFO: setPlane(true) = open / setPlane(false) = closed
if tipper.plane.bOpen ~= nil and (self.ai_mode == 1 or self.ai_mode == 2 or self.ai_mode == 5) then
--courseplay:debug(string.format("recordnumber=%s, maxnumber=%s, currentTipTrigger=%s, plane.bOpen=%s", tostring(self.recordnumber), tostring(self.maxnumber), tostring(self.currentTipTrigger ~= nil), tostring(tipper.plane.bOpen)), 3);
@JakobTischler
JakobTischler / dabblet.css
Created October 9, 2012 12:09
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="es-ES">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width">
<title>Toptaller Newsletter Especial &mdash; Horario verano</title>
<style type="text/css">
body {
background-color:#E9E9E9;