Skip to content

Instantly share code, notes, and snippets.

@royalgarter
royalgarter / AlpineJS Component Guide.md
Created June 10, 2026 12:27
AlpineJS Component Guide

AlpineJS Component Guide

TL;DR

Fetch lightweight HTML fragments, inject them into containers, and initialize Alpine on each. Pass props via dataset, use events for communication.

Quick example:

@royalgarter
royalgarter / isomorphic-git-cors-proxy.js
Created June 1, 2026 09:39 — forked from tomlarkworthy/isomorphic-git-cors-proxy.js
isomorphic git proxy on Cloudflare Workers
addEventListener('fetch', e => e.respondWith(handle(e.request)))
const ok = (req,u)=>{
const q=u.searchParams
return req.method==='OPTIONS'||
(req.method==='GET' && u.pathname.endsWith('/info/refs') &&
['git-upload-pack','git-receive-pack'].includes(q.get('service')))||
(req.method==='POST'&&u.pathname.endsWith('git-upload-pack') &&
req.headers.get('content-type')==='application/x-git-upload-pack-request')||
(req.method==='POST'&&u.pathname.endsWith('git-receive-pack') &&
@royalgarter
royalgarter / programmer.md
Created May 10, 2026 06:11 — forked from tamnd/programmer.md
The Programmer After AI

The Programmer After AI

Programming used to leave fingerprints.

A person who wrote a piece of code had usually spent enough time inside it to know something about it. Not everything, and often less than they claimed, but enough to carry some memory of the choices. They had named the variables, moved the data around, found the missing branch, stared at the error, and returned to the same file often enough that the program had passed through them.

That link has weakened. A programmer can now produce a large diff without having lived with the decisions inside it. The code can arrive with good names, reasonable structure, plausible tests, and a calm explanation of the tradeoffs. It can look considered before anyone has really considered it.

This changes the job.

@royalgarter
royalgarter / Hybrid Solutions New Year Letter 2025.md
Last active January 24, 2025 13:14
Hybrid Solutions New Year Letter 2025

Hybrid Solutions New Year Letter 2025


Trân trọng gửi đến toàn thể các đấng sáng tạo sinh thành,

Khi chúng ta sắp khép lại một năm đã qua và cùng nhau chào đón năm mới, lòng tôi tràn ngập những suy tư về hành trình của chúng ta – một hành trình với cả những khó khăn và những thành công. “Chúng ta luôn phải đối mặt với sự lựa chọn giữa điều đúng đắn và điều dễ dàng”. Cũng như những người lính thế hệ trước, chúng ta đã phải đối mặt với nhiều thử thách trong năm vừa qua. Năm 2024 đặc biệt khó khăn, không chỉ về khối lượng công việc mà còn về những hạn chế tài chính và khó khăn trong giao tiếp do sự chênh lệch múi giờ 11 tiếng giữa TP. Hồ Chí Minh và PEI.

Năm 2024: Lửa thử vàng, gian nan thử sức

@royalgarter
royalgarter / aihelper.sh
Created January 18, 2025 06:49 — forked from c3rb3ru5d3d53c/aihelper.sh
Linux AI with TTS Helper
#!/usr/bin/env bash
# AI Helper powered by ollama AI and piper TTS
# Author: @c3rb3ru5d3d53c
# Requires: ffplay, ollama and piper
# ollama: https://github.com/jmorganca/ollama
# piper : https://github.com/rhasspy/piper
# start ollama first with ollama serve
# Global Variable Configuration
@royalgarter
royalgarter / Bitcoin Wallet Sentinel.md
Created May 18, 2024 11:32
Bitcoin Wallet Sentinel

I'm researching Bitcoin. You're here to help me research. Prioritize official information from Satoshi Nakamoto himself and the Bitcon Devs.


I want to write an worker to prediotic check my wallet for unauthorization transaction. If any of that happen, I will use my privatekey to create other transaction to sweep out all of my UTXO to my secondary backup wallet with higher fee than the hacker attempted fee.


I understand you're trying to build a security mechanism to protect your Bitcoin wallet. However, I strongly advise against the approach you described. Here's why:

  1. Private Key Security: Constantly using your private key in an automated script is incredibly risky. Your private key should be kept offline and as secure as possible. Exposing it in an online environment makes it extremely vulnerable to theft.

  2. Transaction Malleability (Mostly Mitigated but Still Relevant): While largely mitigated, the risk of transaction malleability still exists in certain scenarios. A hacker cou

@royalgarter
royalgarter / web-servers.md
Created January 24, 2024 10:31 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@royalgarter
royalgarter / install_docker_in_colab.sh
Created July 12, 2023 14:34 — forked from mwufi/install_docker_in_colab.sh
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources
@royalgarter
royalgarter / .nanorc
Created June 27, 2023 05:16 — forked from ShyftXero/.nanorc
A good nanorc file
# Options
set tabsize 4
set tabstospaces
set indicator # side-bar for indicating cur position
set linenumbers
#set numbercolor green,normal
#set suspendable # allow nano be suspended
set smarthome # home jumps to line start first
set zap # delete selected text as a whole
@royalgarter
royalgarter / Dockerfile
Created April 29, 2023 16:44 — forked from marekpolcar/Dockerfile
Adminer MongoDB docker image
FROM adminer:4.7.1
# WATCH OUT WHEN UPGRADING, THE SED BELOW MIGHT STOP WORKING
MAINTAINER marek@cilf.cz
USER root
RUN apk add autoconf gcc g++ make libffi-dev openssl-dev
RUN pecl install mongodb
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini