Instantly share code, notes, and snippets.


VSCode Node + Babel Recipe

Debug Modern JavaScript with VSCode. Part of VSCode Course.

1. init a module:

npm init -y

Show and Edit User Meta in WordPress


This simple procedure will allow you to:

  1. Display user meta fields under in the user list as additional columsn (Users > All Users).
  2. Display these fields on user profiles.
  3. Edit these fields under user edit.

This method works completely without plugins and involves just some functions and hooks in functions.php. Plugins like "User Meta Display" achieve this to some level, but treat custom meta fiedlds completely different from the regular fields. They are shown and edited in seperate environment and fail to show the meta data is a table list. This method integrates custom user meta along with regular user (meta).


Connect to your server

First SSH into your server:

ssh -p 7822 (the 7822 is the port number and may be different on your server)

Go to the directory when you want to have the GitLab repo deployed to. Next get the GitLab ssh url from the GibLab project it will be like

To clone the repo type


Composer Deploy

You can use different vendor folders on dev and prod servers.

// Autoloader for localhost and production.
if ( file_exists( dirname( __FILE__ ) . '/vendor/autoload.php' ) ) {
	require_once dirname( __FILE__ ) . '/vendor/autoload.php';
} else {
View flat-rounded.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View sample_ipstack.json
"ip": "",
"hostname": "",
"type": "ipv4",
"continent_code": "AS",
"continent_name": "Asia",
"country_code": "PK",
"country_name": "Pakistan",
"region_code": "IS",
"region_name": "Islamabad",
View image-ai.js
* Get Image Alt Recognition with Computer Vision
* using Azure Cognitive Services.
var WPAPI = require('wpapi');
var wp = new WPAPI({
endpoint: ''
View modeSchema.js
* Model: Sale
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
// Sale Schema.
const saleSchema = new mongoose.Schema({
sale_gross: Number,
earnings: Number,
View index.js
* Azure Function: Sale.
* Gets data from (which in turn gets data
* from WordPress) and processes the data, creates a
* finalData object and saves it in MongoDB Atlas.
* @param context To pass data between function to / from runtime.
* @param req HTTP Request sent to the Azure function by Paddle.