Skip to content

Instantly share code, notes, and snippets.

View FunctionDJ's full-sized avatar
🏠
Working from home

Function FunctionDJ

🏠
Working from home
View GitHub Profile
@FunctionDJ
FunctionDJ / selfhosted-bookmark-comparison.md
Last active October 19, 2022 11:27
Comparison of self-hostable bookmark applications

Comparison of self-hostable bookmark management applications

Fields with "🔗" can be clicked for the relevant documentation or info

Espial LinkAce linkding Shaarli Shiori
Tags ✔️ ✔️ ✔️ ✔️ ✔️
Mobile friendly ✔️ ✔️ ✔️ ✔️ ✔️
Support for file-based DB ✔️ ⚠️1 ✔️ ✔️ ✔️
Bookmarklet ✔️ ✔️ ✔️ ✔️ 2
Import/Export ✔️ ✔️ ✔️ ✔️
@FunctionDJ
FunctionDJ / funky-delete.js
Created March 4, 2022 10:52
Foobar2000 SpiderMonkeyPanel script for faster track deletion when playing tracks
/** @param {FbMetadbHandle} track */
const playTrack = track => {
const result = fb.RunContextCommandWithMetadb("Play", track)
if (result !== true) {
throw new Error(`Play command failed for track "${track.Path}"`)
}
}
const makeLogger = (...prefixed) => (
(...args) => {
@FunctionDJ
FunctionDJ / spectrogram.js
Created March 2, 2022 09:34
marc2k3's spectrogram edited
"use strict"
window.DefineScript("Spectrogram Edit")
include("./felpers.js")
const ffmpegFilterConfig = "atrim=0:30,showspectrumpic=legend=0:s=512x512"
const titleFormatImagePath = fb.TitleFormat(`$crc32($lower(%path%'${ffmpegFilterConfig}')).jpeg`)
const titleFormatCue = fb.TitleFormat("$if($or($strcmp(%__cue_embedded%,yes),$strcmp($right(%path%,3),cue)),cue,)")
const dataFolder = pathJoin(fb.ProfilePath, "js_data")
idemptCreateFolder(dataFolder)
export const patchCommandHints = () => {
Scene_OmoriFile.prototype.createCommandHints = function() {
this._commandHints = new Sprite(new Bitmap(Math.ceil(Graphics.boxWidth / 2), 60));
this.addChild(this._commandHints);
this._commandHints.position.set(16,Graphics.boxHeight-this._commandHints.height-4);
this._commandHints.bitmap.clear();
let iconSize = 31;
/**
Backup / transfer your favourited gifs between clients (works without mods & in the browser)
by Ven#8810 at https://discord.com/channels/538759280057122817/755005784999329883/859937854897782804
Backup gifs:
*/
JSON.stringify(Object.values(webpackJsonp.push([[],{['']:(_,e,r)=>{e.cache=r.c}},[['']]]).cache).find(m=>m?.exports?.default?.getRandomFavorite).exports.default.getFavorites());
/*
Restore them later:
*/
@FunctionDJ
FunctionDJ / Bookmark Code.js
Last active October 5, 2021 15:01
YouTube 3/2 Aspect Ratio Toggler (No dependencies)
(() => {
let existing = document.querySelector("#ar")
if (existing) {
existing.remove()
} else {
let styleNode = document.createElement("style")
styleNode.id = "ar"
styleNode.type = "text/css"
styleNode.appendChild(document.createTextNode("video{transform:scaleX(calc((3/2) / (16/9)))}"))
document.head.appendChild(styleNode)
@FunctionDJ
FunctionDJ / shortcuts.md
Last active September 14, 2021 10:19
Google Spreadsheet Shortcuts on QWERTZ / German Keyboard
Name Shortcut
Toggle show formulas Ctrl + ö
Show keyboard shortcuts (somewhat useless on a different layout) Ctrl + #
Insert current date Ctrl + ü
Insert current time Ctrl + Shift + ü
Insert current date and time Ctrl + Alt + Shift + ü
Insert rows/columns or Open insert menu Ctrl + Alt + +
@FunctionDJ
FunctionDJ / Example.php
Created September 9, 2021 14:53
phpstan/larastan issue
<?php
namespace Database\Seeders;
use App\Models\ItemProfile;
class Foo
{
public function run(): void
{
@FunctionDJ
FunctionDJ / tasks.json
Created September 9, 2021 12:11
PHPStan problem matcher for VSCode tasks.json
{
"owner": "phpstan",
"source": "phpstan",
"severity": "error",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": [
{
"regexp": "^\\s*Line\\s*(.*)$",
"file": 1,
},
/**
* Types for character / expression rendering by https://github.com/FunctionDJ
*
* Credit goes to https://github.com/ac2pic and https://github.com/AndrielChaoti
* for initial types at https://github.com/CCDirectLink/crosscode-re-docs/blob/master/gui/faces.md
*/
type Mapped<T> = {
[key: string]: T
}