Skip to content

Instantly share code, notes, and snippets.

@endolith
endolith / AutoCorrect.ahk
Last active January 31, 2024 14:02
AutoCorrect AutoHotkey spelling script
; c = case sensitive
; c1 = ignore the case that was typed, always use the same case for output
; * = immediate change (no need for space, period, or enter)
; ? = triggered even when the character typed immediately before it is alphanumeric
; r = raw output
;------------------------------------------------------------------------------
; CHANGELOG:
;
; 2011-03-21 and after: See readme.md
@ramons03
ramons03 / Notepad++AdvancedSearch.txt
Last active February 28, 2024 23:10
Notepad++ Advanced search and replace. Null, Enter char, Tab, Regular Expressions, Etc.
Open the find/replace dialog.
At the bottom will be some Search mode options. Select "Extended (\n \r \t \0 \x...)"
In either the Find what or the Replace with field entries, you can use the following escapes:
\n new line (LF)
\r carriage return (CR)
\t tab character
\0 null character
\xddd special character with code ddd
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@walkerjeffd
walkerjeffd / Synology-Diskstation-Git.md
Last active April 27, 2024 15:39
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@lastguest
lastguest / jenkins_one_at_a_time_hash.php
Last active March 20, 2024 14:11
Bob Jenkins' One-At-A-Time hashing algorithm.
<?php
// Bob Jenkins' One-At-A-Time hashing algorithm.
function jenkins_hash($key) {
$key = (string)$key;
$len = strlen($key);
for($hash = $i = 0; $i < $len; ++$i) {
$hash += ord($key[$i]);
$hash += ($hash << 10);
$hash ^= ($hash >> 6);
~r~ = Red
~b~ = Blue
~g~ = Green
~y~ = Yellow
~p~ = Purple
~o~ = Orange
~c~ = Grey?
~m~ = Darker Grey
~u~ = Black
~n~ = New Line
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active April 11, 2024 22:29
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@ECHO OFF
REM For general infos see http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
REM Set the path here if your ffmpeg executable is somewhere else as in the current directory
SET ffmpeg_path=ffmpeg.exe
SET palette=%TMP%\palette.png
SET subtitlefile=subtitle.ass
if not exist "%ffmpeg_path%" echo "Can't find ffmpeg.exe" & goto done
#NoEnv
SetBatchLines, -1
#MaxHotkeysPerInterval 200
#Include <VA>
; Create the slider window
Gui, Add, Progress, w100 h20 x0 y0 Range0-100 vVolSlider, 0
Gui, Add, Text, w100 h20 x0 y0 vVolText BackgroundTrans Center +0x200, 0
Gui, +AlwaysOnTop -Caption +ToolWindow
Gui, Show, Hide w100 h20 x0 y0, Volume
@matthewzring
matthewzring / markdown-text-101.md
Last active May 4, 2024 12:26
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers: