Skip to content

Instantly share code, notes, and snippets.

@Rio6
Rio6 / copyFleet.js
Last active September 17, 2020 22:30
A script that exports your currrent fleet to a script that replaces your current fleet with the exported fleet
/*
* A script that exports your currrent fleet to a script that
* replaces your current fleet with the exported fleet.
*
* by R26
*/
console.log(`JSON.parse(atob("${btoa(JSON.stringify(commander.buildBar))}")).forEach((e, i) => buildBar.setSpec(i, e)); control.savePlayer()`);
@Rio6
Rio6 / scrollTab.js
Last active December 31, 2020 18:28
Enables scrolling on fleet tab buttons
/*
* Enables scrolling on fleet tab buttons
*
* Also change it so tabs can be deleted/renamed by clicking the buttons
* instead of dragging.
*
* by R26
*/
(function() {
@Rio6
Rio6 / flip.js
Last active November 5, 2021 01:56
A script that lets you press f when dragging a part to flip it. Only works on your own client.
/*
* A script that lets you press f when dragging a part to flip it.
* Only works on your own client.
*
* by R26
*/
window.flipPartHooks = window.flipPartHooks || {
design_onkeyup: designMode.onkeyup,
design_rotatePart: designMode.rotatePart,
design_draw: designMode.draw,
@Rio6
Rio6 / fleetshare.js
Last active December 22, 2025 18:46
Adds bottons to import and export individual fleet to the fleet menu for Istrolid.
/*
* Adds bottons to import and export individual fleet to the fleet menu
* by R26
*/
window.r26_fleetshare = window.r26_fleetshare || {
fleetUI: window.fleetUI,
};
r26_fleetshare.showShareBox = false;
r26_fleetshare.fleetNum = -1;
@Rio6
Rio6 / prune-backup.sh
Last active September 7, 2022 01:39
Prune list of backup files to be daily, weekly, monthly, and yearly depending on the backup age.
#!/bin/sh
# usage: prune-backup [-f] files...
# By default the script prints files to be deleted. Use -f to actually delete.
# Assuming the file names have format of %Y-%m-%dT*
# exit on failure, disable glob
set -ef
filter_date() {
format="$1"