Skip to content

Instantly share code, notes, and snippets.

@thomastthai
thomastthai / Staging&ProductionUsingGit
Created December 23, 2024 10:12 — forked from mediabeastnz/Staging&ProductionUsingGit
Staging and Production Server using Git.
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;)
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com
#Setup#
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time.
2. ssh into the server e.g. $ ssh username@ipaddress
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private
4. Create the main repo e.g. $ git init --bare apple.git
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com
@thomastthai
thomastthai / nerd_fonts.md
Created December 2, 2024 16:32 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
@thomastthai
thomastthai / instructions.md
Created October 18, 2024 11:37 — forked from enjikaka/instructions.md
Installing Proxmox on Raspberry Pi 4 and 5 (Pimox)

Installing Proxmox on Raspberry Pi 4 and 5

With these steps I managed to get Pimox on my Raspberry Pi 4 and 5 in february 2024.

Step 1 - Flashing the OS

Install "RPi OS Lite 64-bit" with Raspberry Pi Imager. It's listed under "Raspberry Pi OS (Other)"

Karabiner layouts for symbols and navigation

Gavin Sinclair, January 2022

Introduction

I use Karabiner (configured with Gosu) to make advanced key mappings on my Apple computer. Karabiner allows you to create “layers”, perhaps simulating those on a programmable mechanical keyboard. I make good use of these layers to give me easy access (home-row or nearby) to all symbols and navigational controls, and even a numpad.

The motivation is to keep hand movement to a minimum. Decades of coding on standard keyboards has unfortunately left me with hand and wrist pain. I will soon enough own a small split keyboard which will force me to use layers to access symbols etc., so this Karabiner solution, which has evolved over months, is a training run for that.

Karabiner layouts for symbols and navigation

Gavin Sinclair, January 2022

Introduction

I use Karabiner (configured with Gosu) to make advanced key mappings on my Apple computer. Karabiner allows you to create “layers”, perhaps simulating those on a programmable mechanical keyboard. I make good use of these layers to give me easy access (home-row or nearby) to all symbols and navigational controls, and even a numpad.

The motivation is to keep hand movement to a minimum. Decades of coding on standard keyboards has unfortunately left me with hand and wrist pain. I will soon enough own a small split keyboard which will force me to use layers to access symbols etc., so this Karabiner solution, which has evolved over months, is a training run for that.

#!/bin/sh
# requirements
# - wget
# prepare directory
mkdir -p ~/.local/bin
mkdir -p ~/.config
if ! [ -x "$(command -v tmux)" ]; then
@thomastthai
thomastthai / .tmux.conf
Created August 28, 2024 06:50 — forked from ivanalejandro0/.tmux.conf
Tmux configuration file with Powerline-like status bar, system clipboard integration and some other nice tweaks.
# Install tpm + plugins with:
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# trigger plugin install with: prefix + I
# trigger plugin update with: prefix + U
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'laktak/extrakto'
@thomastthai
thomastthai / go_router_example.dart
Created March 30, 2024 07:35 — forked from onatcipli/go_router_example.dart
go_router_example.dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
main() {
CustomNavigationHelper.instance;
runApp(const App());
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@thomastthai
thomastthai / cloudflare-ddns-update.sh
Created February 19, 2024 22:56 — forked from devinderaujla/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# based on https://gist.github.com/Tras2/cba88201b17d765ec065ccbedfb16d9a
# initial data; they need to be filled by the user
#### Added multiple sub domains and proxy state set options
## API token; e.g. FErsdfklw3er59dUlDce44-3D43dsfs3sddsFoD3
api_token=<>
## the email address associated with the Cloudflare account; e.g. [email protected]
email=<>
## the zone (domain) should be modified; e.g. example.com
zone_name=example.com
@thomastthai
thomastthai / gist:83c73e508bcac01cdaee7fcbd9e7b581
Created November 14, 2023 20:36 — forked from jauderho/gist:6b7d42030e264a135450ecc0ba521bd8
HOWTO: Upgrade Raspberry Pi OS from bullseye to bookworm
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#
# Make sure everything is up-to-date
sudo apt-get update && sudo apt-get dist-upgrade
# Point to bookworm repos instead
sudo sed -i -e 's/bullseye/bookworm/g' /etc/apt/sources.list