Skip to content

Instantly share code, notes, and snippets.

@dalbothek
dalbothek / connect-camera.user.js
Created December 16, 2023 15:30 — forked from r3Fuze/connect-camera.user.js
Prusa Connect Live Camera
// ==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==
@dalbothek
dalbothek / Default (OSX).sublime-keymap
Last active June 7, 2019 08:55
IntelliJ key map for Sublime Text 3
[
{ "keys": ["super+d"], "command": "duplicate_line" },
{ "keys": ["shift+alt+up"], "command": "swap_line_up" },
{ "keys": ["shift+alt+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+g"], "command": "find_under_expand" },
{ "keys": ["super+backspace"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+shift+a"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
{ "keys": ["super+r"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
{ "keys": ["shift+tab"], "command": "unindent" }
]
# -*- coding: utf-8 -*-
# This source file is part of mc4p,
# the Minecraft Portable Protocol-Parsing Proxy.
#
# Copyright (C) 2011 Matthew J. McGill, Simon Marti
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License v2 as published by
# the Free Software Foundation.
# -*- coding: utf-8 -*-
# This source file is part of mc4p,
# the Minecraft Portable Protocol-Parsing Proxy.
#
# Copyright (C) 2011 Matthew J. McGill, Simon Marti
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License v2 as published by
# the Free Software Foundation.
@dalbothek
dalbothek / message.py
Last active December 19, 2015 22:18
New protocol definition for mc4p
# -*- coding: utf-8 -*-
# This source file is part of mc4p,
# the Minecraft Portable Protocol-Parsing Proxy.
#
# Copyright (C) 2011 Matthew J. McGill, Simon Marti
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License v2 as published by
# the Free Software Foundation.
@dalbothek
dalbothek / pep8 --first
Created November 24, 2012 23:01
pep8 analysis of pymclogin
./mclogin.py:18:1: E302 expected 2 blank lines, found 1
./mclogin.py:19:1: W191 indentation contains tabs
./mclogin.py:38:2: E301 expected 1 blank line, found 0
./mclogin.py:44:80: E501 line too long (125 > 79 characters)
./mclogin.py:44:20: E201 whitespace after '('
./mclogin.py:44:122: E202 whitespace before ')'
./mclogin.py:44:43: E231 missing whitespace after ','
./mclogin.py:57:1: W293 blank line contains whitespace
./mclogin.py:61:137: E702 multiple statements on one line (semicolon)
./mclogin.py:61:50: E225 missing whitespace around operator
@dalbothek
dalbothek / 1.4pre.json
Created October 19, 2012 23:52
Sounds topping preview
[
{
"sounds": {
"11": {
"name": "11",
"versions": {
"streaming": [
{
"format": "mus",
"path": "streaming/11.mus",
@dalbothek
dalbothek / Bot.java
Created July 19, 2012 10:15 — forked from md-5/Bot.java
REl move code
/**
* 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);
@dalbothek
dalbothek / gist:2885528
Created June 6, 2012 23:40
Moved server placeholder
#!/bin/env python
# -*- coding: utf-8 -*-
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
import asyncore
class PBEWithMD5AndDES(object):
"""PBES1 implementation according to RFC 2898 section 6.1"""
SALT = '\x0c\x9d\x4a\xe4\x1e\x83\x15\xfc'
COUNT = 5
def __init__(self, key):
key = self._generate_key(key, self.SALT, self.COUNT, 16)
self.key = key[:8]
self.iv = key[8:16]