Skip to content

Instantly share code, notes, and snippets.

SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE `customer_entity`;
TRUNCATE TABLE `customer_entity_datetime`;
TRUNCATE TABLE `customer_entity_decimal`;
TRUNCATE TABLE `customer_entity_int`;
TRUNCATE TABLE `customer_entity_text`;
TRUNCATE TABLE `customer_entity_varchar`;
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
@allrude
allrude / function.php
Created June 29, 2022 16:35 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@allrude
allrude / wp-head-clean.php
Created June 29, 2022 16:15 — forked from blacksaildivision/wp-head-clean.php
Remove all unnecessary stuff from WordPress <head> tag
<?php
/**
* Alter dns-prefetch links in <head>
*/
add_filter('wp_resource_hints', function (array $urls, string $relation): array {
// If the relation is different than dns-prefetch, leave the URLs intact
if ($relation !== 'dns-prefetch') {
return $urls;
}
@allrude
allrude / gist:18df6f94b821442cc2487af4e7f021d0
Created June 27, 2022 07:55 — forked from teja156/gist:8c35a05f43635da4cbd06b47c0d91e93
Commands for deploying wordpress website on AWS EC2 shown in my YouTube video
YouTube video link: https://youtu.be/8Uofkq718n8
All the commands that are executed in the above youtube video are mentioned in this gist.
1. Install Apache server on Ubuntu
sudo apt install apache2
2. Install php runtime and php mysql connector
sudo apt install php libapache2-mod-php php-mysql
3. Install MySQL server
@allrude
allrude / spinner.js
Created May 14, 2022 12:45 — forked from GrimLink/spinner.js
A simple spinner using an svg, smaller than using css.
/**
* Renders an spinner using an svg image
*
* @param color - the color for the svg
* @return String
*/
const Spinner = (color: "currentColor", speed: "1s") => {
const svg = (
<svg
xmlns="http://www.w3.org/2000/svg"
@allrude
allrude / toggle.js
Created May 14, 2022 12:43 — forked from GrimLink/toggle.js
Smart JS Toggle using document event listener
document.addEventListener('click', event => {
const clickTarget = '[data-toggle]';
// Make sure clicked element is our toggle
if (!event.target.closest(clickTarget)) return;
// Prevent default link behavior
event.preventDefault();
// Sample case for a toggle using the data attribute to get the element we want to toggle,
@allrude
allrude / node_nginx_ssl.md
Created September 29, 2019 09:06 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@allrude
allrude / test.html
Created August 16, 2018 11:13 — forked from srikat/test.html
Dummy Content for Gutenberg
<!-- wp:heading -->
<h2>Heading Block (H2)</h2>
<!-- /wp:heading -->
<!-- wp:heading -->
<h3>You are looking at one. (H3)</h3>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>Subhead Block</h2>
@allrude
allrude / 0_reuse_code.js
Created March 7, 2014 09:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console