Skip to content

Instantly share code, notes, and snippets.

View henrikvtcodes's full-sized avatar

Henrik VT henrikvtcodes

View GitHub Profile
# How to remove the "you do not have an enterprise subscription" warning from proxmox
# https://dannyda.com/2020/05/17/how-to-remove-you-do-not-have-a-valid-subscription-for-this-server-from-proxmox-virtual-environment-6-1-2-proxmox-ve-6-1-2-pve-6-1-2/
sed -i.backup -z "s/res === null || res === undefined || \!res || res\n\t\t\t.data.status.toLowerCase() \!== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service
@henrikvtcodes
henrikvtcodes / multi-git-remote.sh
Last active February 22, 2024 03:32
Pushing to multiple git remotes from one origin
# First - add your fetch remote
# This is effectively the "single source of truth" that git will pull new changes from
git remote add origin <fetch remote url>
# Next - add the fetch remote again as a push
git remote set-url --add --push origin <fetch remote url>
# Finally - add the url(s) you'd like to push to
git remote set-url --add --push origin <push remote 1 url>
git remote set-url --add --push origin <push remote 2 url>
@henrikvtcodes
henrikvtcodes / apvideoskip.js
Last active March 9, 2023 17:38
Tampermonkey userscript that for skipping CollegeBoard AP Daily videos
// ==UserScript==
// @name CollegeBoard AP Classroom Video Skipper
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Auto watch AP Classroom videos
// @author Anon
// @match https://apclassroom.collegeboard.org/*/assignments*
// @icon https://www.google.com/s2/favicons?sz=64&domain=https://apstudents.collegeboard.org/
// @grant unsafeWindow
// ==/UserScript==
@henrikvtcodes
henrikvtcodes / clear.js
Created March 8, 2023 14:52
A quick way to clear all the annoying animated Assignment cards on College Board AP Classroom
function clearCards(num = 5) { // num = the number of cards you want to clear
let buttons = document.querySelectorAll("[aria-label=\"Dismiss card\"]");
let i = 0;
buttons.forEach((button) => {
if (i > num) return;
button.click()
i++;
});
@henrikvtcodes
henrikvtcodes / README.md
Last active December 18, 2023 08:14
Two utilities that help with using `class-variance-authority`, Tailwind CSS, and `clsx`

Utilities for using Tailwind and CVA

Here are two utility functions created by merging the power of Joe Bell's class-variance-authority package, tailwind-merge, and clsx.

twcx

Combines tailwind-merge and clsx into a function that allows for conditional classnames without the worry of Tailwind style conflicts as the output is ran thru twMerge to get rid of duplicates.

twCVA

Takes in a cva instance and returns a function that extends cva's functionality with power of the aforementioned twcx function.

@henrikvtcodes
henrikvtcodes / timezone.sh
Created January 13, 2023 03:54
Helpful Timezone things for Ubuntu
# Check your current time
timedatectl
# Set timezone (US EST for example)
timedatectl set-timezone 'America/New_York'
# Change what NTP servers you're using
sudo nano /etc/systemd/timesyncd.conf
# Add this line
NTP=time.cloudflare.com time.google.com
# Then Ctrl+X to save
@henrikvtcodes
henrikvtcodes / timezones.ps1
Created June 29, 2022 14:18
Windows 11 Timezone Hack
# I had to figure out how to change my timezone in Windows 11 because of that weird bug where it gets greyed out - so I figured I'd document it.
# ---------- How to change your timezone in Windows 11 (10?) using Powershell/Cmd ----------
# Step 1: Open up a Powershell or Cmd Prompt window as Administrator
# Step 2: Test TZUTIL
TZUTIL /?
# Step 3: Figure out what new timezone you need