Skip to content

Instantly share code, notes, and snippets.

@hoppfrosch
hoppfrosch / NewAutoClicker.ahk
Last active January 23, 2024 05:15
Auto Clicker - auto-clicks when the left mouse button is held down. . #ahk #script #snippet
# Source http://slanter-ahk.blogspot.de/2009/02/ahk-new-auto-clicker.html
# This is a new 5-line autoclicker made possible with the release of AHK 1.0.48. Use Insert to toggle it on and off.
LButton::
While GetKeyState("LButton","P")
Send {LButton}
Return
Insert::Hotkey, LButton, Toggle
@protrolium
protrolium / ffmpeg.md
Last active July 5, 2025 20:17
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@sanich038
sanich038 / CSS Parallax Header Image.markdown
Created September 19, 2015 16:55
CSS Parallax Header Image
@jbasinger
jbasinger / iconextractor.cs
Last active October 29, 2023 14:39
Icon Extraction in Windows using NodeJS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Drawing;
using System.IO;
using Newtonsoft.Json;
/*
ffmpeg -i "$file" -f s32be -acodec pcm_s32be -ar 44100 -af "volume=0.5" tcp://espip:5522
*/
#include "i2s.h"
#include <ESP8266WiFi.h>
const char* ssid = "***********";
const char* password = "**********";
WiFiServer pcmServer(5522);
static WiFiClient pcmClient;
@siamak
siamak / gradient.js
Last active April 5, 2019 11:09
Steps in Gradient
/**
* GradientArray • Steps gradient.
* @author Siamak Mokhtari <[email protected]>
* @date 06/21/16.
*/
class GradientArray {
// Convert a hex color to an RGB array e.g. [r,g,b]
// Accepts the following formats: FFF, FFFFFF, #FFF, #FFFFFF
hexToRgb(hex) {
let r, g, b, parts;
@define-private-public
define-private-public / HttpServer.cs
Last active May 27, 2025 16:03
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@SeeJayDee
SeeJayDee / tiny_IRremote.cpp
Last active June 24, 2024 03:36
tiny_IRremote - Arduino IRremote ported to the ATtiny
/*
* tiny_IRremote
* Version 0.2 July, 2016
* Christian D'Abrera
* Fixed what was originally rather broken code from http://www.gammon.com.au/Arduino/
* ...itself based on work by Ken Shirriff.
*
* This code was tested for both sending and receiving IR on an ATtiny85 DIP-8 chip.
* IMPORTANT: IRsend only works from PB4 ("pin 4" according to Arduino). You will need to
* determine which physical pin this corresponds to for your chip, and connect your transmitter
@RandomInsano
RandomInsano / 1b-button1.bin.base64
Last active August 27, 2024 15:03
Reverse Engineering an Airoha AB1127-based Bluetooth Selfie button
AAEAAElGAxAHAQBPAA0AXAA3AJMAYQD0ACUBGQAIASEAAgF7AAABIwEJAiwAawKXApoFMQCHBbgA6AagABEGsQACBrMABwa6AAcGwQAAN1cAAkUCAAAAAAAAAB5XAfnRLT9oEFb2aLEcn0FIo7WrrAMByR8EAVL6UenPKMtXW5xHbzFVi7Ge1DcKipEEAf8CAAFRVy8ZntSD/AwAAAAAAFRaVU1JIFNFTEZJRSBTVElDSwAAQCUAIDRWBJQAMiL8AgQ4GBgZgwEAAAAAAAAAAQAYAAATCVRaVU1JIFNFTEZJRSBTVElDSwMDJBEAAAAAAAAAG1YEAgSdBgE6CgEhEAHUCQYIZGQU8dQUAbsnAS4CBiz//y3/xXRWAgFBZQEKq1aJVhYC/v4CBAJYADwWAz6AUAEBUA0CBgYgAQANAQABAQMDAQAPAQMFAw8PFgEBAwQB8TYBAwUCBQUCAQMEAfIJAYEEDgJfAqECSQABAjMCdQK2ZgENAQP/AA0DAQ0BEv8ADQH/AA0C/wANA/8ADQT/ABaWgV2fg2kokTEjkTFtgUl6g2rtg2sJAAAAgU0bgoFxg2uFg2u1g2u6AAAAgpMKg2vTg2v3g2wLg2vfgv2EgpJXg2vrg2ymg2y9g2K4g097g2zMg2zog2ujgd9bg2OUgeIDgeESgeGFgeHBg2n2g2mIg2Lkgdv6g2w/gd3Yg2o3g172gd/6g17KgS+sg2z+g20Dg20IgTGIsVYRAQMFAQICDQQAAAEAAAEAAAEAAAEhAQMYAxvJUQEBgAEPLwC7qwFgrVsArgNsLf/FEzaDYcmDbQ2BX6GCZaeDYpWCGXAAAAAAAACCP9IAAAAAAACRMzyCdkWCdkaDXfeDZHaC/WWBNp62VwABAAAAAACVAosxAAASAW5cEgAN3JAABKXgRAjwAgDUW5AADZp0BPACAVKgAgDeDn4BfzcSAA7t72A7fgF/NxIADUyQADAY7vCj7/D1go6DdZMAo6Oj4JAAMBi0Ywvg/qPg/xIADJmA
@savetheclocktower
savetheclocktower / README.md
Last active July 16, 2025 13:34
Using a rotary encoder as a volume control for the Raspberry Pi

Using a rotary encoder as a volume control

On my RetroPie machine I wanted a hardware volume knob — the games I play use a handful of emulators, and there's no unified software interface for controlling the volume. The speakers I got for my cabinet are great, but don't have their own hardware volume knob. So with a bunch of googling and trial and error, I figured out what I need to pull this off: a rotary encoder and a daemon that listens for the signals it sends.

Rotary encoder

A rotary encoder is like the standard potentiometer (i.e., analog volume knob) we all know, except (a) you can keep turning it in either direction for as long as you want, and thus (b) it talks to the RPi differently than a potentiometer would.

I picked up this one from Adafruit, but there are plenty others available. This rotary encoder also lets you push the knob in and treats that like a button press, so I figured that would be useful for toggling mute on and off.