Skip to content

Instantly share code, notes, and snippets.

View Rainyan's full-sized avatar

Rainyan

  • Finland
  • 00:07 (UTC +02:00)
View GitHub Profile
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
#!/usr/bin/env python
# Linux usage: ./extract_tampermonkey_script.py "/home/<USER>/.config/<BROWSER>/Default/Local Extension Settings/<EXTENSION_ID>"
# i.e.: ./extract_tampermonkey_script.py "/home/foo/.config/google-chrome-beta/Default/Local Extension Settings/gcalenpjmijncebpfijmoaglllgpjagf"
# Mac usage: ./extract_tampermonkey_script.py "/Users/<USER>/Library/Application Support/Google/Chrome/Default/Local Extension Settings/<EXTENSION_ID>/"
# i.e.: ./extract_tampermonkey_script.py "/Users/foo/Library/Application Support/Google/Chrome/Default/Local Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo/"
import leveldb
import sys
import re
@mkropat
mkropat / knownpaths.py
Last active November 5, 2024 15:09
Python wrapper around the SHGetKnownFolderPath Windows Shell function
import ctypes, sys
from ctypes import windll, wintypes
from uuid import UUID
class GUID(ctypes.Structure): # [1]
_fields_ = [
("Data1", wintypes.DWORD),
("Data2", wintypes.WORD),
("Data3", wintypes.WORD),
("Data4", wintypes.BYTE * 8)
@dmsul
dmsul / vim_crash_course.md
Last active September 1, 2024 08:51
Vim Crash Course

NOTE: Specific examples given for options, flags, commands variations, etc., are not comprehensive.

NORMAL MODE

Vim has 2 main "modes", that chance the behavior of all your keys. The default mode of Vim is Normal Mode and is mostly used for moving the cursor and navigating the current file.

Some important (or longer) commands begin with ":" and you will see the text you enter next at the bottom left of the screen.

:q[uit] - quit (the current window of) Vim. ("Window" here is internal to Vim, not if you have multiple OS-level windows of Vim open at once.)
:q! - force quit (if the current buffer has been changed since the last save)
:e[dit] {filename} - read file {filename} into a new buffer.

@jix
jix / resolve_tco_links.user.js
Last active July 16, 2024 02:01
User script to resolve t.co links on twitter
@rannmann
rannmann / SteamUserFunctions.php
Last active August 31, 2023 15:03
Convert Steam IDs to and from Community IDs and User IDs
<?php
/* Examples
toSteamID(25490879) // STEAM_0:1:12745439
toSteamID(76561197985756607) // STEAM_0:1:12745439
toSteamID("STEAM_0:1:12745439") // STEAM_0:1:12745439
toUserID(25490879) // 25490879
toUserID(76561197985756607) // 25490879
toUserID("STEAM_0:1:12745439") // 25490879
@sym3tri
sym3tri / JapaneseRegex.js
Created May 19, 2011 02:46
Regex to test for presence of Japanese characters
// REFERENCE UNICODE TABLES:
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
// http://www.tamasoft.co.jp/en/general-info/unicode.html
//
// TEST EDITOR:
// http://www.gethifi.com/tools/regex
//
// UNICODE RANGE : DESCRIPTION
//
// 3000-303F : punctuation
@kevinsqi
kevinsqi / Hanazawa Kana - Recover Decoration (Nisekoi ED2) guitar chords.txt
Last active August 22, 2018 23:52
Hanazawa Kana - Recover Decoration (Nisekoi ED2) guitar chords
Hanazawa Kana - Recover Decoration (Nisekoi ED2)
Guitar chords by Kevin Qi - http://kevinqi.com
Guitar cover video - https://www.youtube.com/watch?v=LPfPyERsvWc
================================================
[Intro]
Abmin7 | Bbmin7 | Abmin7 | Bbmin7 |
Abmin7 | Bbmin7 | Cmin7b5 |