Skip to content

Instantly share code, notes, and snippets.

View BlvckBytes's full-sized avatar

Philip Hell BlvckBytes

  • Austria, Vienna
  • 09:01 (UTC +02:00)
View GitHub Profile
@BlvckBytes
BlvckBytes / h_bridge.ino
Created November 20, 2025 13:26
Simple symmetric-duty-time H-bridge with dead-time, ideal for cheap ATTinys as a substitution for the corresponding ASIC
#define BRIDGE_A_PIN 3
#define BRIDGE_B_PIN 4
#define ON_TIME_US 2000
#define DEAD_TIME_US 100
void setup() {
pinMode(BRIDGE_A_PIN, OUTPUT);
digitalWrite(BRIDGE_A_PIN, LOW);
pinMode(BRIDGE_B_PIN, OUTPUT);
digitalWrite(BRIDGE_B_PIN, LOW);
@BlvckBytes
BlvckBytes / config.yml
Created May 25, 2025 17:36
MyPet pagination feature entries
Pagination:
AvailableShops:
TotalRows: 6
PreviousPage:
Type: ARROW
Title: '&bPrevious Page'
Lore:
- ' '
- '&7Currently on {currentPage}&8/&7{numberOfPages}'
NextPage:
@BlvckBytes
BlvckBytes / led_lamp_control.cpp
Last active March 15, 2025 18:08
Simple brightness- and color-temperature controller for a strip of WS2812-LEDs
#include <Arduino.h>
#include <EEPROM.h>
#include <Adafruit_NeoPixel.h>
#define LED_DATA_PIN 11
#define LED_COUNT 100
#define LED_WRITE_CLEARANCE_MS 5
#define POT_TEMPERATURE A1
#define POT_BRIGHTNESS A2
/*
Author: BlvckBytes <blvckbytes@gmail.com>
Created On: 05/18/2022
This small state machine manages controlling a pump's on/off cycles based on the parameters
the macros provide. The sensor is in essence a constant current source, which will operate at
a range of voltages (mine goes from around 8 to 32 volts) and will always drive the same current
through it's in-series load, which is linear to the pressure measured. In this case: 4mA = 0 bar
and 20mA = 10 bar.
@BlvckBytes
BlvckBytes / ConstantPoolUtfPatcher.java
Created March 20, 2023 23:25
UTF-Constant patching classloader
/*
* MIT License
*
* Copyright (c) 2023 BlvckBytes
*
* 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
@BlvckBytes
BlvckBytes / StatisticsHook.java
Created February 26, 2023 20:47
Hook into the statistics map of an EntityPlayer to receive update callbacks in real-time
import me.blvckbytes.autowirer.ICleanable;
import me.blvckbytes.autowirer.IInitializable;
import me.blvckbytes.bbreflect.IReflectionHelper;
import me.blvckbytes.bbreflect.RClass;
import me.blvckbytes.bbreflect.handle.ClassHandle;
import me.blvckbytes.bbreflect.handle.FieldHandle;
import me.blvckbytes.bbreflect.handle.predicate.Assignability;
import me.blvckbytes.bukkitboilerplate.ILogger;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.objects.Object2IntMap;
@BlvckBytes
BlvckBytes / apply-mappings.sh
Last active February 20, 2022 10:37
Override keys on macOS in a way that I'm used to
#!/bin/bash
ERR=`launchctl unload dev.blvckbytes.kbremap.plist 2>&1`
launchctl load dev.blvckbytes.kbremap.plist
[ -z "$ERR" ] && echo "Updated launchd!" || echo "Installed launchd!"

Textbox Component (Angular)

A versatile text-input that covers most common use-cases and saves a lot of preliminary work.

demo

Inputs

  • @Input() placeholder: string Placeholder for this textbox
  • @Input() icon: string Name of SVG icon inside /graphics