This file contains 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
// ==UserScript== | |
// @name Prusa Connect - Custom Live Camera Feed | |
// @namespace https://r3fuze.github.io | |
// @match https://connect.prusa3d.com/printer* | |
// @run-at document-idle | |
// @grant none | |
// @version 0.4.0 | |
// @author fz | |
// @description Replace the slow camera snapshots in Prusa Connect with a custom live camera feed by using a Raspberry Pi running μStreamer. | |
// ==/UserScript== |
This file contains 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
/** | |
* Moves the specified amount forwards and left in the current direction | |
* (calculated based on current yaw) | |
* | |
* @param forward, double sideways how far to move | |
* @param left how far to the left to move | |
*/ | |
public void moveRelative(double forward, double left) { | |
final float yaw = getLocation().getYaw(); | |
final double xToMove = - forward * Math.sin(yaw) + left * Math.cos(yaw); |
This file contains 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
<?php | |
class Socket | |
{ | |
private $sock; | |
public function __construct() | |
{ | |
$this->sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
if(!$this->sock) | |
throw new Exception("Socket.create() failed; reason: " . socket_strerror(socket_last_error($this->sock)) . "\n"); |