Skip to content

Instantly share code, notes, and snippets.

View ahmadawais's full-sized avatar
Building the LLM computing primitive at Langbase.com

Ahmad Awais ⌘ ahmadawais

Building the LLM computing primitive at Langbase.com
View GitHub Profile
@ahmadawais
ahmadawais / sendy-install-digital-ocean.md
Last active May 6, 2024 13:02
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 / flywheel-local-xdebug-vscode.md
Last active May 3, 2024 12:07
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 / 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 / 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 / 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
295,joshk,149086
@ahmadawais
ahmadawais / wordpress-sites.csv
Created July 25, 2017 10:47
Sites Using WordPress
We can't make this file beautiful and searchable because it's too large.
vanessasmoney.com
purechristiangraphicdesign.com
crosson.com.br
driveinteractivepdx.com
nkforsterguitars.com
wildsnow.com
yourmortgage.co.uk
pupamag.com
alvissconsulting.com
serviceproeastidaho.com
@ahmadawais
ahmadawais / mixin.scss
Last active January 25, 2023 09:09
Sass SCSS Responsive Media Queries Mixin for Eight Different Screen Sizes
/**
* MIXIN: Responsive Media Queries.
*
* Creates responsive media queries for eight different screen sizes.
* These are based on min-width which means if x is the size then your
* CSS will affect any device with screen width x and above.
*
* USAGE:
* @include r(240) { }
* @include r(320) { }
@ahmadawais
ahmadawais / VSCode_Node_Babel_Recipe.md
Last active November 1, 2022 11:31
VSCode Node + Babel Recipe | Solves: vscode debug unexpected token import

VSCode Node + Babel Recipe

Debug Modern JavaScript with VSCode. Part of VSCode Course.

1. init a module:

npm init -y
@ahmadawais
ahmadawais / OneDevMinute.md
Last active September 5, 2022 05:42
[OneDevMinute]: Delete a Git branch both locally and remotely [Shell aliases + functions]
title category date
Delete a Git branch both locally and remotely [Shell aliases + functions]
Shell, Git
2018-09-24

OneDevMinute

Deleting a git branch locally is pretty easy, just do a git branch -D branch_name and you're done. But when you have pushed that branch to remote, it becomes a bit more complex. You can't just delete the local branch and do a git push. Instead you have to do a git push origin --delete branch_name to delete it from the remote.

@ahmadawais
ahmadawais / .zshrc
Created April 24, 2016 19:52
WP CLI Plugin & Theme Install/Activate Aliases for ZSH/BASH
# WP Plugin: Install & Acticate
# Usage: wpp plugin-slug
alias wpp="wp plugin install $* --activate"
# WP Theme: Install
# Usage: wpt plugin-slug
alias wpt="wp theme install $* --activate"
# WP Theme: Activate
# Usage: wpta plugin-slug