Skip to content

Instantly share code, notes, and snippets.

View object-Object's full-sized avatar
🏳️‍⚧️
[object Object]

[object Object] object-Object

🏳️‍⚧️
[object Object]
View GitHub Profile
@object-Object
object-Object / README.md
Created March 6, 2024 23:51
Make IntelliJ IDEA use the native Windows file picker dialog

Open Help > Edit Custom Properties... and add the following lines:

ide.win.file.chooser.native=true
sun.awt.windows.useCommonItemDialog=true
@object-Object
object-Object / pain_and_suffering.md
Created February 24, 2024 23:49
How to rename your user and home folder on Windows 11

I finally got tired of my laptop deadnaming me, and decided to fix it. Here's what worked for me.

  1. Back up all drives.
  2. Back up the registry.
  3. Create a system restore point.
  4. Take a picture of your taskbar, start menu, Quick Access pinned items, and VSCode taskbar right click pinned items (if you use VSCode), since you might have to clear these.
  5. Restart your computer, and log into a different admin acount.
    • I used the hidden Administrator account, which can be activated with this command: net user administrator /active:yes
  6. Use netplwiz to rename the user: https://superuser.com/a/1011089
  7. Follow these steps to rename the home folder and update the registry: https://winhelponline.com/blog/rename-user-profile-folder-windows
@object-Object
object-Object / query.promql
Last active October 30, 2023 04:55
PromQL query to return the current Eastern Time Zone UTC offset.
# PromQL query to return the current Eastern Time Zone UTC offset.
# based on https://medium.com/@tom.fawcett/time-of-day-based-notifications-with-prometheus-and-alertmanager-1bf7a23b7695
# https://en.wikipedia.org/wiki/Eastern_Time_Zone
# EDT (summer): UTC-4
# EST (winter): UTC-5
# second Sunday in March: 02:00 EST -> 03:00 EDT (07:00 UTC)
# first Sunday in November: 02:00 EDT -> 01:00 EST (06:00 UTC)
# after March and before November
from typing import Any
from hatchling.plugin import hookimpl
from hatchling.version.source.plugin.interface import VersionSourceInterface
class BrokenException(Exception):
def __new__(cls, *args: object):
raise TypeError("This hides the real error message") from None
@object-Object
object-Object / GlobalTeleport.c
Last active August 2, 2022 22:05
A Hex Casting spell circle and ComputerCraft programs to implement a /tp command.
// thoth spell to convert hex to dec
{
flock_dis
// 16^4 place
16
4
power
multiplicative
@object-Object
object-Object / HexCastingParser.py
Created July 17, 2022 00:48
A parser to display pattern names for Hex Casting hexes.
from __future__ import annotations
import regex
from typing import Literal
from enum import Enum
# working as of https://github.com/gamma-delta/HexMod/blob/c00815b7b9d90593dc33e3a7539ce87c2ece4fc9/Common/src/main/java/at/petrak/hexcasting/common/casting/RegisterPatterns.java
# setup:
# - run "pip install regex"
# - download this script somewhere
@object-Object
object-Object / startup.lua
Last active November 4, 2021 14:38
Program to run a BuildCraft-style quarry with the Create mod for Minecraft.
--[[
top: y gearshift (on = -y, off = +y)
bottom: z gearshift (on = down, off = up)
front:
red: x gearshift (on = -x, off = +x)
blue: z up endstop
yellow: z down endstop
purple: y endstop
green: x endstop
back: x gantry (on = move) - inverted
@object-Object
object-Object / startup.lua
Last active July 9, 2020 22:42
CC+Plethora wireless storage system
local chestPrefix="minecraft:ironchest_gold_"
local prefix="$"
local prefixPattern="^%"..prefix
local inputInterval=3
local warnInterval=60
local feederInterval=4
local channel=1
local autoFeeder=false
local cachedSlot=false
@object-Object
object-Object / lightgame.s
Created February 5, 2020 04:13
Program for the 6502 processor to run a reaction game
.org $8000
reset:
lda #$ff ; set all of A register of 6522 to output
sta $6003
lda #$7f ; set all but last pin of B register of 6522 to output
sta $6002
lda #$01 ; initial value of output: 1 0 0 0 0 0 0