Skip to content

Instantly share code, notes, and snippets.

@DraTeots
DraTeots / ComPort over Network.md
Last active April 28, 2024 14:16
ComPort over Network
@KalleMacD
KalleMacD / TwineiOS
Last active April 28, 2024 14:14
How to make a Twine game into an iOS web-app
//This quick guide will show you how add an optional web-app (iOS) view to your Twine game!
//First you'll need to open up your Twine (.tws) file.
1. Add a new passage to your story and name it "script"
2. Enter the tags section and add the word "script"
3. Now, in the main body, add the code:
document.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
@MM1212
MM1212 / InheritClasses.ts
Created December 20, 2023 19:47
Inherit any number of classes with some type-safety
type GrabConstructorParameters<T> = {
[K in keyof T]: T[K] extends new (...args: infer P) => any ? P : never;
}
// https://stackoverflow.com/a/50375286
type UnionToIntersection<U> =
(U extends any ? (x: U)=>void : never) extends ((x: infer I)=>void) ? I : never
type JoinConstructors<T extends (new (...args:any[]) => any)[]> =
new (...args: GrabConstructorParameters<T>) => UnionToIntersection<InstanceType<T[number]>>
@thomasheller
thomasheller / INSTALL.md
Last active April 28, 2024 14:08
Install Arch Linux in VirtualBox VM
@pbnj
pbnj / .tmux.conf
Last active April 28, 2024 14:08
Toggle-able Terminal in Tmux
bind-key -n 'C-\' run-shell -b ${HOME}/.local/bin/tmux-toggle-term
@josephg
josephg / 0dedict.py
Last active April 28, 2024 14:07
Apple dictionaries
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
from struct import unpack
from zlib import decompress
import re
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data'
f = open(filename, 'rb')
import UIKit
final class TransitionDelegate: NSObject,
UIViewControllerTransitioningDelegate {
private let interactiveController = UIPercentDrivenInteractiveTransition()
private let duration = CATransaction.animationDuration()
func presentationController(forPresented presented: UIViewController,
@broestls
broestls / Remove_VMwareTools.ps1
Last active April 28, 2024 14:05
Force removal of VMware Tools, Program Files, and Windows Services
# This script will manually rip out all VMware Tools registry entries and files for Windows 2008-2019
# Tested for 2019, 2016, and probably works on 2012 R2 after the 2016 fixes.
# This function pulls out the common ID used for most of the VMware registry entries along with the ID
# associated with the MSI for VMware Tools.
function Get-VMwareToolsInstallerID {
foreach ($item in $(Get-ChildItem Registry::HKEY_CLASSES_ROOT\Installer\Products)) {
If ($item.GetValue('ProductName') -eq 'VMware Tools') {
return @{
reg_id = $item.PSChildName;
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 14:09
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@ronny
ronny / direct-plex-atv4.md
Last active April 28, 2024 14:02
Direct play Plex videos in TV 4

DirectPlay Plex videos in TV 4

TV 4 and TV 4K

TV 4 supports HEVC natively up to 1080p30 (I think).

TV 4K has a hardware HEVC decoder that can support up to 2160p60.

Supported best format