Skip to content

Instantly share code, notes, and snippets.

@mistic100
mistic100 / lil-gui-textarea.ts
Last active July 27, 2024 17:15
Add textarea support to lil-gui
import { GUI, Controller } from 'lil-gui';
export class TextController extends Controller {
private $button: HTMLButtonElement;
private $text: HTMLTextAreaElement;
constructor(parent: GUI, object: object, property: string, rows: number = 4) {
super(parent, object, property, 'textarea');
@mistic100
mistic100 / lil-gui-jscolor.ts
Last active July 27, 2024 17:14
Use jscolor.js library inside lil-gui
import { GUI, Controller } from 'lil-gui';
import '@eastdesire/jscolor';
export class ColorController extends Controller {
private $input: HTMLInputElement;
private picker: any;
constructor(parent: GUI, object: object, property: string, alpha: boolean | 'auto' = 'auto') {
super(parent, object, property, 'color');
@mistic100
mistic100 / qbitorrent-port.au3
Last active July 27, 2024 17:15
Starts qBitorrent after prompting for the listening port
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
$exeFile = "C:\Program Files\qBittorrent\qbittorrent.exe"
Opt("TrayIconHide", 1)
GUICreate("qBitorrent", 200, 75, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP, $WS_CAPTION))
GUISetFont(12, 400, 0, "Segoe UI")
  1. generate palette
ffmpeg -y -i video.webm -vf palettegen=max_colors=64 palette.png
  1. convert
ffmpeg -y -i video.webm -i palette.png -filter_complex paletteuse=dither=bayer:bayer_scale=1 -r 15 output.gif
ffmpeg -i video.mp4 -vf "select=eq(pict_type\,I)" -vsync vfr -qscale:v 2 still-%02d.jpg
@mistic100
mistic100 / vimeo-downloader.js
Created September 15, 2018 09:01
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
@mistic100
mistic100 / 1.phugo-gallery-generator.md
Last active May 1, 2021 09:17
Gallery generator for Phugo
______________________________
/ __________________________ /|
/ / ________________________/ / |
/ / /| | / / |
/ / / | | / / . |
/ / /| | | / / /| |
/ / / | | | / / / | |
/ / / | | | / / /| | |
/ /_/___| | |_______________/ / / | | |
/________| | |________________/ / | | |

Read

$ exiftool -xmp -b file.jpg > data.xmp

Write

$ exiftool -tagsfromfile data.xmp -all:all file.jpg
@mistic100
mistic100 / qchecklist.h
Created January 23, 2017 19:13
[Qt/C++] QComboBox with support of checkboxes
#ifndef QCHECKLIST
#define QCHECKLIST
#include <QWidget>
#include <QComboBox>
#include <QStandardItemModel>
#include <QLineEdit>
#include <QEvent>
#include <QStyledItemDelegate>
#include <QListView>