Skip to content

Instantly share code, notes, and snippets.

View xthezealot's full-sized avatar

The Zealot xthezealot

View GitHub Profile
@xthezealot
xthezealot / README.md
Last active February 27, 2025 23:51
AI Editor Rules

AI Code Editor Prompts

Works for Cursor and Windsurf.

Foundational Prompt

A prompt is generated with Grok 3 Thinking, based on this template:

Upon receiving a file containing multiple LLM prompts separated by `---`, each with coding rules for various tools, follow these steps to create a single, optimized prompt for an AI coding assistant:
@xthezealot
xthezealot / README.md
Last active January 29, 2025 14:59
Crystal SMTP Client

Crystal SMTP Client

Usage

smtp = SmtpClient.new("SMTP_HOST")
begin
  smtp.authenticate("SMTP_USERNAME", "SMTP_PASSWORD")
  smtp.send_email(
 from: "FROM_EMAIL",
@xthezealot
xthezealot / README-real.md
Last active January 27, 2025 15:52
Hello World HTTP benchmark

Real HTTP form routing benchmark

  • Hardware: macOS on M3

Cost Efficiency

Cost Efficiency

Crystal 1.15

@xthezealot
xthezealot / Dockerfile
Created March 18, 2024 15:35
Ruby on Rails in Alpine Docker container
# syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.3.0
FROM registry.docker.com/library/ruby:$RUBY_VERSION-alpine as base
# Rails app lives here
WORKDIR /rails
# Set production environment
@xthezealot
xthezealot / README.md
Created June 7, 2022 18:59
Kali Linux on Surface Pro 4

Kali Linux on Surface Pro 4

  1. Enter UEFI (keep volume [+] and ⏻ button at power up), disable Secure Boot and make USB first in boot order.

  2. Install Kali with Gnome environment.

  3. Install the Linux Surface kernel.

    wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/linux-surface.gpg
    
@xthezealot
xthezealot / log-color.svg
Last active September 11, 2020 15:14
gowww
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xthezealot
xthezealot / gatsby-antd.jsx
Created April 21, 2020 14:43
React configurations
// Gatsby + Ant Design + Less
// gatsby-config.js plugins
{
resolve: `gatsby-plugin-less`,
options: {
javascriptEnabled: true,
modifyVars: {
hack: `true; @import "${__dirname}/src/components/antd.less";`,
@xthezealot
xthezealot / install.sh
Last active August 27, 2018 23:39
Setup Openbox on FreeBSD as a VMware guest
#!/bin/sh
# Install
pkg install open-vm-tools xf86-input-vmmouse xf86-video-vmware xorg openbox obmenu
# Run services on start (see /etc/rc.conf)
sysrc dbus_enable="YES"
sysrc moused_enable="YES"
sysrc vmware_guest_vmblock_enable="YES"
sysrc vmware_guest_vmhgfs_enable="YES"
@xthezealot
xthezealot / README.md
Last active August 3, 2023 14:07
Normalize unicode file names (converts UTF-8 NFD to NFC). Required by macOS clients through AFP/NFS/SMB. Tested on Synology DSM 6.2 with built-in Python 2.7.12.

NFCFN.py

Normalize unicode file names (converts UTF-8 NFD to NFC).
Required by macOS clients through AFP/NFS/SMB.

Tested on Synology DSM 6.2 with built-in Python 2.7.12.

Usage

@xthezealot
xthezealot / .htaccess
Last active May 21, 2019 11:12
Run Go binary server on PHP/Apache shared hosting
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/up.php
# TODO: Handle random port.
# TODO: Use ProxyPass or ProxyPassMatch instead of mod_proxy's RewriteRule for better performance.
RewriteRule ^(.*) http://127.0.0.1:8080/$1 [P]