Skip to content

Instantly share code, notes, and snippets.

View J0B10's full-sized avatar
📖

Jonas J0B10

📖
  • Baden-Württemberg Germany
  • 23:30 (UTC +02:00)
View GitHub Profile
@J0B10
J0B10 / jer_export.py
Last active February 2, 2022 21:24
MCEdit Filter for generating a Just Enough Resources compatible worldgen.json
#! python version 2.7
import os
import json
import re
# The MCEdit 1.0 filter name
displayName = "JER export"
# filter settings
inputs = (
@J0B10
J0B10 / JSR385Demo.java
Last active January 17, 2022 10:24
Demonstrates how the Java Units of Measurements API defined in JSR385 can help to prevent conversion errors.
package io.github.J0B10.JSR385Demo;
import com.intelligt.modbus.jlibmodbus.exception.ModbusIOException;
import com.intelligt.modbus.jlibmodbus.exception.ModbusNumberException;
import javax.measure.Quantity;
import javax.measure.Unit;
import javax.measure.quantity.Energy;
import javax.measure.quantity.Power;
import javax.measure.quantity.Time;
@J0B10
J0B10 / icons.py
Created September 29, 2021 14:11
Changes folder icons if the folder contains a .ico file with the right name
import os
for root, dirs, files in os.walk("."):
for file in files:
if file.endswith(".ico"):
path = os.path.abspath(os.path.join(root, file))
parent= os.path.dirname(path)
parentName = os.path.basename(parent)
if "." + parentName.lower() + ".ico" == file:
print("Updating icon of '%s'" % parentName)
@J0B10
J0B10 / README.md
Last active November 23, 2020 11:26
Einfache Sortierverfahren

Bubblesort

Vorgehensweise

  • Das Array wird wiederholt von links nach rechts durchlaufen.
  • Steht eine größere Zahl vor einer kleineren Zahl, so werden die beiden Zahlen miteinander vertauscht. Damit steht am Ende des 1.Durchlaufs das größte Element ganz rechts.
  • Wiederhole solange Arraydurchläufe, bis das ganze Array sortiert ist.

Komplexität

@J0B10
J0B10 / blue_flow.eft
Last active August 22, 2019 07:36
RGB Lightning layouts for Logitech Keyboard
{
"device_layout" : 4,
"device_model" : "Logitech.Gaming.Keyboard.G810",
"device_name" : "G810",
"name" : "Flowing LOGI",
"transition_list" :
[
{
"color" : "#0069ff",
"curve" : 0,
@J0B10
J0B10 / RGBdu.ino
Last active May 6, 2019 16:43
RGBduino
#include <Adafruit_NeoPixel.h>
#define RGB_DATA_PIN 2 //Digital Pin connected to the led stripes data line
#define BUTTON_PIN 12 //Digital Pin connected to a button for control of the circuit
#define PIXEL_COUNT 25 //Number of rgb leds connected to the board
#define TICK_RATE 20 //milliseconds between each loop (determines accuracy for button press detection)
#define CLICK_MAX_TIME 500 //How long a click of the button should take at max (in milliseconds)
@J0B10
J0B10 / cloudSettings
Last active November 18, 2021 10:25
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-11-18T10:25:29.496Z","extensionVersion":"v3.4.3"}
@J0B10
J0B10 / ObsidianPreventer.java
Last active June 11, 2018 14:27
Prevents generation of any blocks by lava and water merging
/**
* Copyright 2018 Jonas Blocher
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* <p>