Skip to content

Instantly share code, notes, and snippets.

View ahmadawais's full-sized avatar
CommandCode.ai the first coding agent that continuously learns your coding taste

Ahmad Awais ahmadawais

CommandCode.ai the first coding agent that continuously learns your coding taste
View GitHub Profile
@ahmadawais
ahmadawais / sendy-install-digital-ocean.md
Last active May 28, 2026 00:59
Install Sendy on DigitalOcean 2022

You can open the Marketplace tab and search for the current LAMP stack.

We will use the LAMP stack on a Basic plan for 5$/month.

php -v

# if php 8 then
@ahmadawais
ahmadawais / remove-inline-sourcemaps.mjs
Created April 1, 2026 16:47
remove-inline-sourcemaps.mjs
#!/usr/bin/env node
import { readdir, readFile, stat, writeFile } from 'node:fs/promises';
import path from 'node:path';
const rootDir = path.resolve(process.argv[2] ?? process.cwd());
const skipDirs = new Set(['.git', 'node_modules']);
const sourceMapLine = /^[ \t]*\/\/# sourceMappingURL=data:app[^\r\n]*(?:\r?\n)?/gm;
let filesChecked = 0;
@ahmadawais
ahmadawais / .zshrc
Created April 24, 2017 03:38
Print status for all fail2ban jails.
# Print status for all fail2ban jails.
function f2bstall() {
JAILS=($(fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'))
for JAIL in ${JAILS[@]}
do
echo "--------------- 👀 JAIL STATUS: $JAIL ... ---------------"
fail2ban-client status $JAIL
echo "--------------- ... ---------------"
done
}
@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active September 30, 2025 13:13
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@ahmadawais
ahmadawais / default.md
Created July 8, 2025 19:50 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
@ahmadawais
ahmadawais / aa_URLtoAttachmentID.php
Created August 16, 2014 12:06
Get the Attachment ID from an Image URL in WordPress
function pn_get_attachment_id_from_url( $attachment_url = '' ) {
global $wpdb;
$attachment_id = false;
// If there is no url, return.
if ( '' == $attachment_url )
return;
// Get the upload directory paths
@ahmadawais
ahmadawais / _debug.scss
Created February 15, 2017 11:16
DEBUG CSS for XDEBUG
/* ----------------------------------------------------------------------------
* DEBUG CSS for XDEBUG
* ------------------------------------------------------------------------- */
pre.xdebug-var-dump {
display: table;
width: 100%;
padding: 5rem;
margin: 5rem;
font: 2.5rem/2.5 'Operator Mono';
}
@ahmadawais
ahmadawais / build.tsx
Created May 24, 2024 20:32
React email build script
import { render } from '@react-email/render';
import fs from 'fs';
import path from 'path';
import React from 'react';
// Get a list of all files in the 'emails' directory
const emailFiles = fs.readdirSync('./emails');
// Create a new directory named 'build' if it doesn't exist
if (!fs.existsSync('build')) fs.mkdirSync('build');
@ahmadawais
ahmadawais / legacy-verified.csv
Created April 23, 2023 21:25 — forked from travisbrown/legacy-verified.csv
Twitter accounts with legacy verification on 4 April 2023 (see https://twitter.com/travisbrown/status/1643229276278235136)
We can't make this file beautiful and searchable because it's too large.
Twitter ID, Screen name, Followers
12,jack,6526006
13,biz,2608289
20,ev,1679155
57,SarahM,17448
59,Tim535353,9340
76,marciadorsey,19501
224,davepell,57523
291,goldman,916937