Skip to content

Instantly share code, notes, and snippets.

@mtib
mtib / cmds
Created October 15, 2021 18:36
Commandblocks to keep players in one Chunk
# Set each command in a command block running "Repeat", "Unconditional" and "Always Active"
execute as @a[x=-1,dx=-100,y=0,dy=1000,z=-1000,dz=2000] at @s run tp @s ~0.2 ~ ~
execute as @a[x=16,dx=100,y=0,dy=1000,z=-1000,dz=2000] at @s run tp @s ~-0.2 ~ ~
execute as @a[z=16,dz=100,y=0,dy=1000,x=-1000,dx=2000] at @s run tp @s ~ ~ ~-0.2
execute as @a[z=-1,dz=-100,y=0,dy=1000,x=-1000,dx=2000] at @s run tp @s ~ ~ ~0.2
@mtib
mtib / pump.ino
Created August 21, 2019 14:44
An arduino program to both control a pump to water flowers and also show it's state on an IC2 OLED screen.
#include <Adafruit_GFX.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_SPITFT_Macros.h>
#include <gfxfont.h>
#include <Adafruit_SSD1306.h>
#include <splash.h>
#include <Wire.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 32
#!/bin/bash
_grady_completions()
{
USED_CMD=false;
GRADY_CMDS=("clone" "publish" "grade" "update");
CMD="";
let i=0;
CMD_I=0;
HAS_G_HELP=false;
@mtib
mtib / gb.diff
Created October 15, 2018 13:28
patch for enabling german "Umlaut"s in gb keyboard layout
--- gb.old 2018-10-15 15:25:36.472238473 +0200
+++ gb 2018-10-15 15:25:47.203892785 +0200
@@ -22,6 +22,10 @@
key <BKSL> { [numbersign, asciitilde, dead_grave, dead_breve ] };
key <LSGT> { [ backslash, bar, bar, brokenbar ] };
+ key <AD07> { [ u, U, U00FC, U00DC ] };
+ key <AD09> { [ o, O, U00F6, U00D6 ] };
+ key <AC01> { [ a, A, U00E4, U00C4 ] };
+
@mtib
mtib / polyhedra.conky
Created April 28, 2018 12:05
Polyhedra Changes
conky.config = {
update_interval = 0.075,
background = false,
text_buffer_size=2048,
double_buffer=true,
no_buffer=true,
use_xft=true,
minimum_width = 200,
font='Bitstream Vera Sans:size=8',
draw_shades=false,
#!/usr/bin/env python2
# import gimp functions
from gimpfu import *
def chg_text_only(text_layer, text):
font = pdb.gimp_text_layer_get_font(text_layer)
font_size, font_unit = pdb.gimp_text_layer_get_font_size(text_layer)
@mtib
mtib / hidot.gv
Last active February 5, 2018 23:45
Greetings Graph for HelloInternet
// call: dot -Tpng hidot.gv -o outfile.png
// see notes node at the end of this file
digraph G {
graph [layout=dot rankdir=TD]
who_with [shape=diamond label="Who are you with?"]
know1 [shape=diamond label="Do you know them?"]
know2 [shape=diamond label="Do you know them?"]
this is me testing if my rss reader behaves.. bear this no mind
@mtib
mtib / izlogin.sh
Last active January 31, 2018 14:20
#!/bin/bash
izibrconnect() {
num=$((($2-1)%21 + 1))
if [[ $num -lt 10 ]]; then
num="0$num";
fi
echo "pool-number: $num";
exec ssh "$1@iz${num}.ibr.cs.tu-bs.de";
}
PI=$(python -c "import math; print(math.pi);");
TAU=$(echo "scale=16;2 * $PI" | bc);
LOGIN_DATE=$(date);
function random_code {
iter=1;
while [[ iter -lt $1 ]];
do
iter=$[iter + 1];
python -c "print('{:04x} {:04x} {:04x} {:04x}'.format($RANDOM, $RANDOM, $RANDOM, $RANDOM))";