Skip to content

Instantly share code, notes, and snippets.

@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 / Mediakeys.ahk
Last active February 10, 2024 10:26
Media keys shortcuts for AutoHotkey
; AutoHotkey Media Keys
^!Space::Send {Media_Play_Pause}
^!Left::Send {Media_Prev}
^!Right::Send {Media_Next}
^!NumpadMult::Send {Volume_Mute}
^!NumpadAdd::Send {Volume_Up}
^!NumpadSub::Send {Volume_Down}
@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>
@mistic100
mistic100 / check-version.iss
Last active January 3, 2024 22:22
[InnoSetup] Prevent install if newer version is already installed
#define AppId "{INSERT HERE YOUR GUID}"
#define AppName "My App"
#define AppVersion "1.7"
[CustomMessages]
english.NewerVersionExists=A newer version of {#AppName} is already installed.%n%nInstaller version: {#AppVersion}%nCurrent version:
[Code]
// find current version before installation
function InitializeSetup: Boolean;
var Version: String;
@mistic100
mistic100 / one-instance.cpp
Last active July 1, 2023 22:08
[C] Use Windows mutex to create a single instance app
#include <windows.h>
int main(int argc, char *argv[])
{
// ensure only one running instance
HANDLE hMutexHandle = CreateMutex(NULL, TRUE, L"my.mutex.name");
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
return 0;
}
@mistic100
mistic100 / players.ini
Created November 2, 2014 13:07
Logitech multimedia keys support for AIMP (file is in C:\Program Files\Logitech\SetPointP)
[Players]
AIMP3=cmd,AIMP3.exe,Winamp v1.x,xxx,xxx,40045,40046,40047,40044,40048,0,1,WinAmp 5
AIMP2=cmd,AIMP2.exe,Winamp v1.x,xxx,xxx,40045,40046,40047,40044,40048,0,1,WinAmp 5
; Starts qBitorrent after prompting for the listening port
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
$iniFile = "C:\Users\USER\AppData\Roaming\qBittorrent\qBittorrent.ini"
$exeFile = "C:\Program Files\qBittorrent\qbittorrent.exe"
  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
@mistic100
mistic100 / qtoolbarext.hpp
Last active July 16, 2022 05:28
[Qt/C++] Custom QToolBar allowing to add a button/menu with text and icon
#ifndef QTOOLBAREXT_H
#define QTOOLBAREXT_H
#include <QToolBar>
#include <QMenu>
#include <QToolButton>
/**
* @brief Custom QToolBar allowing to add a button/menu with text and icon
@mistic100
mistic100 / vcredist.iss
Last active April 27, 2022 05:17
[InnoSetup] Include VC++ Redistribuable (http://stackoverflow.com/a/11172939/1207670)
; The VCRedistNeedsInstall function checks if a given version of VC++ is already installed
; Modify the function with one (or more) of the VC_* constants to suit your version
[Run]
Filename: "{app}\redist\vcredist_x86.exe"; Parameters: "/q /norestart /q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; Check: VCRedistNeedsInstall; WorkingDir: {app}\redist; StatusMsg: Installing VC++ 2013 Redistributables...
[Code]
#IFDEF UNICODE
#DEFINE AW "W"
#ELSE