Skip to content

Instantly share code, notes, and snippets.

View altbdoor's full-sized avatar
🐵

Ng Han Seng altbdoor

🐵
  • Kuala Lumpur, Malaysia
  • 16:18 (UTC +08:00)
View GitHub Profile
@altbdoor
altbdoor / time-fix.sh
Created November 14, 2024 09:26
AI/GPT generated Bash script to rename and set dates with exiftool
#!/bin/bash
# Folder where your images are located
folder="./"
# Loop through each image in the folder
for filename in "$folder"/*; do
# Extract the date and time from the filename using regex
if [[ $filename =~ ([a-z]{3,})-([0-9]{1,2})[a-z]{2}-([0-9]{4})-at-([0-9]{1,2})([0-9]{2})-([ap]m)\.[a-z]{3,4} ]]; then
month="${BASH_REMATCH[1]}"
@altbdoor
altbdoor / note.md
Last active June 8, 2024 05:02
LTI 1.3 notes
@altbdoor
altbdoor / force-gpt3.user.js
Last active June 10, 2024 02:18
Force ChatGPT to use GPT3
// ==UserScript==
// @name Force GPT3
// @namespace altbdoor
// @match https://chatgpt.com/*
// @grant none
// @version 1.1
// @author altbdoor
// @run-at document-start
// @updateURL https://gist.github.com/altbdoor/ff538bc6b411583fdc500750e7faff04/raw/force-gpt3.user.js
// @downloadURL https://gist.github.com/altbdoor/ff538bc6b411583fdc500750e7faff04/raw/force-gpt3.user.js
@altbdoor
altbdoor / docker-compose.yml
Last active April 19, 2024 07:14
Docker compose for Wordpress and MariaDB
version: "3.9"
# borrowed from
# https://github.com/docker/awesome-compose/blob/master/wordpress-mysql/compose.yaml
services:
db:
# https://make.wordpress.org/hosting/handbook/compatibility/#wordpress-php-mysql-mariadb-versions
image: mariadb:11.3
command: '--default-authentication-plugin=mysql_native_password'
volumes:
@altbdoor
altbdoor / pack-gog-games.py
Last active March 24, 2024 16:24
Pack the GOG games entries into a SQLite database
#!/usr/bin/env python
"""
Pack the GOG games entries into a SQLite database
License: WTFPL
https://github.com/ezerear/gog-games.to_backup
"""
import json
@altbdoor
altbdoor / CzechiaFlag.java
Created March 8, 2024 08:55
Drawing Czechia flag with Java AWT
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
class CzechiaFlag {
static class CzechiaFlagComponent extends Component {
public void paint(Graphics g) {
@altbdoor
altbdoor / wsl2-alpine.md
Last active July 6, 2024 09:08
Running Alpine with WSL2 and Docker

Running Alpine with WSL2 and Docker

Prepare Windows

  1. Turn Windows features on or off
  2. Enable:
    1. Windows Subsystem for Linux (WSL)
    2. Virtual Machine Platform
  3. wsl --update
@altbdoor
altbdoor / fix-sass-include-paths.cjs
Created May 10, 2023 03:35
NodeJS script to fix include paths in Angular JSON
#!/usr/bin/env node
/* eslint-env node */
const process = require("process");
const fs = require("fs");
const args = process.argv.slice(2);
if (args.length !== 1) {
console.error("Please pass in path to angular.json file");
process.exit(1);
@altbdoor
altbdoor / duck-emote.py
Created March 21, 2023 11:06
Gather duck emotes
#!/usr/bin/env python3
import urllib.request
import urllib.parse
from bs4 import BeautifulSoup
base_url = 'https://www.sigstick.com/stickers'
params = { 'author': 'kal (we-巫巴多-duck)' }
url = f'{base_url}?{urllib.parse.urlencode(params)}'
@altbdoor
altbdoor / LICENSE
Last active October 4, 2022 12:47
Manually generating an Angular SCAM
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE