This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
telnet_echo.py by @TimelessP | |
https://gist.github.com/TimelessP/5abce3c64c4b671d79121d1e459aecb3 | |
Run using: | |
`twistd -ny telnet_echo.py` | |
""" | |
from twisted.application.internet import TCPServer | |
from twisted.application.service import Application | |
from twisted.conch.telnet import TelnetProtocol, TelnetTransport | |
from twisted.internet.protocol import ServerFactory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def calculate_new_coordinate(ship_coordinate, ship_heading, ship_speed, time_elapsed_seconds, heading_hold=False, | |
depth_metres=0): | |
""" | |
Calculates the new coordinates of the ship (lat, long), given the current heading, speed in knots, | |
and the time elapsed in seconds. A spherical Earth model is used, with no tides. | |
:param ship_coordinate: (lat, long) in range -90 <= lat <= 90, -180 <= long <= 180. | |
:param ship_heading: heading in degrees in range 0 <= heading <= 360. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
editquill - a super-minimal, line-mode, sandboxed text editor utility | |
created by @TimelessP, 2022-02-05 | |
MIT licence | |
https://gist.github.com/TimelessP/c6b0c20b314f6213ced329286fa6d4bf | |
""" | |
import copy | |
import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// myGetRoll(), myGetPitch(), myGetBearing(), mySetHorizonTexture() | |
// by Timeless Prototype | |
// Helps with attitude indicator (artificial horizon) display on a prim, plus a few other functions you will probably want for any flying vehicle instruments. | |
// Created 2009-12-01 | |
// Please give credit to Timeless Prototype in documentation when using anything from this script. | |
key craftKey = NULL_KEY; | |
// Returns the roll relative to the horizon (0.0), ranging from 90.0 (right wing down) to -90.0 (left wing down). Assumes frame of reference is East-facing at zero rotation. | |
float myGetRoll(rotation rot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import fastapi | |
from fastapi.responses import HTMLResponse | |
import logging | |
import uvicorn | |
from fastapi_utils.tasks import repeat_every | |
# requirements.txt: | |
# fastapi~=0.65.1 | |
# uvicorn~=0.13.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run this script as root. | |
# Break on any errors. | |
set -e | |
apt-get update | |
dpkg --configure -a | |
apt-get -y autoremove |
NewerOlder