Skip to content

Instantly share code, notes, and snippets.

View lucaelin's full-sized avatar
🏠
Working from home

lucaelin

🏠
Working from home
View GitHub Profile
@lucaelin
lucaelin / wdsCommonjsFixes.js
Last active October 14, 2022 07:28
web-dev-server commonjs patches
import { fromRollup } from '@web/dev-server-rollup';
// patch the modules load hook to clear the plugins resolveExclusions whenever a new build starts
function fixLoadSkipSelf(module) {
const originalLoad = module.load;
module.load = function(...args) {
module.resolveExclusions = new Set();
return originalLoad.call(this, ...args);
}
@lucaelin
lucaelin / set_unreachable.py
Created January 27, 2022 10:48
Mark a device as unreachable in ansible
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """

kOS physics simulation

This is a small physics simulation to predict a ships state in the future even when it is currently under acceleration. Run the example by running runpath("0:/simulation.ks"). simulation:example().. I also created an example code to land a craft using the simulated knowledge about the future, it's curde, but works just fine for me :)

glhf

ps. if you are fancy, you can pass a custom export function to the script to prevent global namespace pollution 🎉

@lucaelin
lucaelin / mikrotik.js
Last active July 6, 2019 13:13
mikrotik captive portal - timeslot prolongation
/*
* The mikrotik captive portal has a bug, causing login-durations of less than a given amount of time
* to not be subtracted from the total time you are allowed to stay online.
* The threshold at which time is actually counted seems to vary.
* This script automagically logs you out and back in in a given interval, allowing you to keep surfing indefinitely
*/
const portalURL = `http://172.31.0.1/`;
const username = `MyUsername`;
const password = `MyPassword`;