Skip to content

Instantly share code, notes, and snippets.

View FrankDeGroot's full-sized avatar
🔋

Frank de Groot - Schouten FrankDeGroot

🔋
View GitHub Profile
for (const template of document.getElementsByTagName("template")) {
customElements.define(
template.id,
class extends HTMLElement {
constructor() {
super();
this.attachShadow({
mode: "open"
}).appendChild(template.content.cloneNode(true));
}
FN+R = Break
FN+S = Sys Rq
FN+C = Scroll Lock
FN+E = Insert
FN+W = Pause
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
@FrankDeGroot
FrankDeGroot / Pem2Jws.java
Created February 1, 2022 11:28
Create JWS from PEM
private String readPublicKey() throws Exception {
val key = new String(this.getClass().getResourceAsStream("/publicKey.pem").readAllBytes())
.replace("-----BEGIN PUBLIC KEY-----", "")
.replaceAll(System.lineSeparator(), "")
.replace("-----END PUBLIC KEY-----", "");
val encoded = Base64.getDecoder().decode(key);
val keySpec = new X509EncodedKeySpec(encoded);
val keyFactory = KeyFactory.getInstance("RSA");
val jsonWebKey = PublicJsonWebKey.Factory.newPublicJwk(keyFactory.generatePublic(keySpec));
val jsonWebKeySet = new JsonWebKeySet(jsonWebKey);
Get-NetIPAddress | Where-Object {$_.AddressFamily -eq 'IPv4'} | Format-Table ifIndex,IPAddress,InterfaceAlias
@FrankDeGroot
FrankDeGroot / ListRoles.ps1
Created March 30, 2021 12:16
List group membership of current user
whoami /groups /fo list | findstr /c:"Group Name:" | % {$_.replace("Group Name: ","")} | Sort-Object
@FrankDeGroot
FrankDeGroot / ReverseScroll.ps1
Last active December 8, 2021 09:55
Reverse Mouse Wheel Scroll
Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device Parameters" | Where-Object -Property FlipFlopWheel -EQ -Value 0 | Set-ItemProperty -Name FlipFlopWheel -Value 1
@FrankDeGroot
FrankDeGroot / rebuildicons.cmd
Last active November 1, 2021 07:08
Rebuild Icons on Windows 10
taskkill /im explorer.exe /f
taskkill /im runtimebroker.exe /f
del %USERPROFILE%\AppData\Local\Microsoft\Windows\Explorer\iconcache*
del %USERPROFILE%\AppData\Local\Microsoft\Windows\Explorer\thumbcache*
start explorer.exe
@FrankDeGroot
FrankDeGroot / gist:b3af3102f46b73c43160583f07902e81
Created March 6, 2021 08:08
SSH Config without host warnings
Host *
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
LogLevel ERROR
@FrankDeGroot
FrankDeGroot / settings.json
Created March 6, 2021 08:04
Windows Terminal custom settings fragments
[
{
"guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"hidden": false,
"name": "Ubuntu-18.04",
"source": "Windows.Terminal.Wsl"
},
{
"guid": "{67237ada-0f41-97ed-5b91-78d99368f41a}",
"hidden": false,