Skip to content

Instantly share code, notes, and snippets.

@taschmidt
taschmidt / pia.ps1
Last active December 6, 2023 03:17
PIA set qBittorrent port forward
# adapted from https://www.reddit.com/r/PrivateInternetAccess/comments/njwip9/qbittorrent_and_private_internet_access_pia_vpn/
# requires running "Install-Module PsIni"
Import-Module PsIni
# get qBittorrent process
$qbProc = Get-Process qbittorrent -ErrorAction SilentlyContinue
# if qBit is running, it's closed
if ($qbProc) {

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 2 -hls_list_size 0 -f hls filename.m3u8

@taschmidt
taschmidt / omit.ts
Created April 29, 2021 13:05
Alternative to lodash omit
export const omitSingle = <T>(key: keyof T, { [key]: _, ...obj }: T) => obj;
@taschmidt
taschmidt / moment-msdate.ts
Created March 26, 2020 10:53
Typescript definition for moment-msdate
import * as moment from 'moment-timezone';
// moment-msdate doesn't provide strong types, so add them here
declare module 'moment' {
export function fromOADate(oaDate: number, offset?: (string | number)): moment.Moment;
interface Moment {
toOADate(): number;
}
}