Skip to content

Instantly share code, notes, and snippets.

@wzulfikar
wzulfikar / type-of.ts
Last active May 29, 2025 18:37
type-of.ts
type BetterTypeof<T> =
T extends number
? "number" | "integer" | "NaN"
: T extends string
? "string"
: T extends boolean
? "boolean"
: T extends undefined
? "undefined"
: T extends null
@wzulfikar
wzulfikar / README.md
Last active April 3, 2025 23:25
split-schema.sql

Schema Splitter

Splits a PostgreSQL schema dump into multiple files based on configuration.

Why

Managing one-big SQL file can be difficult. This script split such SQL file into multiple files based on specific criteria. It was created to help manage declarative migration schema for Supabase.

Usage

@wzulfikar
wzulfikar / replace-emails.js
Last active March 28, 2025 09:25
JS script to replace emails with random emails
/**
* Grok wrote this :)
* The prompt: js script that i can run in browser console to detect all html tags which contain email.
* i want to replace those emails from eg john@gmail.com to a random email based on random first and last name.
*/
// Function to generate completely random email with full name
function generateRandomFullEmail() {
const firstNames = ['sandra', 'john', 'mary', 'peter', 'lisa', 'david', 'emma', 'robert'];
const lastNames = ['smith', 'johnson', 'brown', 'taylor', 'wilson', 'davis', 'clark', 'lewis'];
@wzulfikar
wzulfikar / capabilities.txt
Created March 9, 2025 23:02 — forked from jlia0/agent loop
Manus tools and prompts
# Manus AI Assistant Capabilities
## Overview
I am an AI assistant designed to help users with a wide range of tasks using various tools and capabilities. This document provides a more detailed overview of what I can do while respecting proprietary information boundaries.
## General Capabilities
### Information Processing
- Answering questions on diverse topics using available information
- Conducting research through web searches and data analysis
@wzulfikar
wzulfikar / is_ai.rs
Created February 12, 2025 13:51
Blazing fast AI content detector with Rust
pub fn is_ai(text: &str) -> bool {
text.to_lowercase().starts_with("ah, i see")
}
@wzulfikar
wzulfikar / books-2023.md
Last active October 31, 2024 10:58
Books - Reading list 2023

📖 Reading List 2023

Goal is to read at least 1 book a month and at max 24 books a year.

Take it slow, enjoy the read, keep the momentum, and learn something. See comments for updates.

▲▼▲

# Month Book Title Skimmed? Reading? Read? Recommended?
@wzulfikar
wzulfikar / .aliases
Last active May 10, 2024 20:40
Shell aliases I use every day.
alias zshso="source ~/.zshrc"
alias zshedit="nano ~/.zshrc"
alias clr="clear"
alias cl="clear"
alias hist=history
alias ytdl="youtube-dl" # Example: ytdl https://www.youtube.com/watch?v=BBJa32lCaaY
alias graph="graph-easy" # Example: echo '[a],[c]->[b]' | graph --as=boxart
alias pn="pnpm" # Example: pn i (install packages from package.json)
alias cat="bat -p" # Replace cat with bat (plain style)
@wzulfikar
wzulfikar / .nanorc
Created May 10, 2024 20:29
.nanorc
# Enable syntax highlighting. See: https://gist.github.com/BlakeGardner/5587269 – 2024-05-10
include "/opt/homebrew/share/nanorc/*.nanorc"
# Display line numbers to the left of the text area – 2024-05-10
set linenumbers
set constantshow
@wzulfikar
wzulfikar / .Brewfile
Last active May 10, 2024 20:09
My Brewfile. Generated using `brew bundle dump --global`
tap "facebook/fb"
tap "ggozad/formulas"
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask-fonts"
tap "homebrew/services"
tap "lokalise/cli-2"
tap "mongodb/brew"
tap "oven-sh/bun"
brew "act"
@wzulfikar
wzulfikar / docker-ps-vertical
Last active March 14, 2024 13:36
vertical format for docker ps
export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"
// usage:
docker ps --format="$FORMAT"