Skip to content

Instantly share code, notes, and snippets.


Michaël Fortin fortinmike

View GitHub Profile
fortinmike / reclaim-disk-space.bat
Last active Jan 5, 2021
Aggressively reclaim disk space in a Windows partition
View reclaim-disk-space.bat
:: Reclaims Windows disk space in a "destructive" manner (can't uninstall service packs and updates afterwards, etc.).
:: Use at your own risk. Useful for Windows installations in space-constrained environments, such as a small Boot Camp
:: partition on a Mac.
:: [IMPORTANT] It is strongly suggested to make a full-disk backup of your Windows partition before running this script,
:: as you can't roll back service packs and updates afterwards.
:: [IMPORTANT] Run this script as admin (required to run `Dism.exe` among other things).
fortinmike /
Last active Feb 13, 2020
Transmission (transmission-daemon) + OpenVPN + Private Internet Access (PIA) automatic port forwarding when VPN connects
#!/usr/bin/env bash
# This script sets the Transmission port to a port that is dynamically
# opened by PIA when we access their port forwarding API at
# Don't forget to set your Transmission username and password and to
# make this script executable! `$ chmod +x`
# Dependencies:
# - jq (`apt install jq`)
fortinmike /
Created Mar 5, 2019
Convert EPUB files and packages to MOBI using the Calibre CLI (the app must be installed)
DIRNAME=$(dirname -- "$1")
BASENAME=$(basename -- "$1")
if [ ! -d "$1" ]; then
# The EPUB is already a file, convert straight away
/Applications/ "$1" "$DIRNAME/$"
# The EPUB is a directory, convert it to a file before conversion
fortinmike /
Last active Oct 7, 2020
A rough guide on how to embed a Unity view in a native iOS or React Native-based app
// NOTE: Copied and cleaned-up from Unity/Libraries/
// REASON: The .mm file did not expose an interface and categorically overrode the Unity app delegate subclass
// using `IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController)`, preventing us from providing our own
// subclass of `VuforiaNativeRendererController` to serve as the final app delegate. Diff this file with the
// source file (specified above) to view the applied changes.
#import "CustomVuforiaNativeRendererController.h"
#import "VuforiaRenderDelegate.h"
// Unity native rendering callback plugin mechanism is only supported
fortinmike / json-8.0.json
Last active Aug 29, 2015
TeamCity 9.0 build artifact JSON output change
View json-8.0.json
"files": [
"size": 600176,
"modificationTime": "20150611T140222-0400",
"content": {
"href": "/httpAuth/app/rest/8.0/builds/id:280/artifacts/content/"
"children": {
"href": "/httpAuth/app/rest/8.0/builds/id:280/artifacts/children/"