Skip to content

Instantly share code, notes, and snippets.

View tomstorms's full-sized avatar

Tom Storms tomstorms

View GitHub Profile
#-----------------------------------------------------
# Update ubuntu
#
# Note: Use at your own risk. Always make a full backup before you start.
#
apt-get update
apt-get upgrade
#-----------------------------------------------------
#-----------------------------------------------------
# Reset a user's password
#
# Get phpMyAdmin access and run the following command.
# Replace 'pass' with your password
# Replace 'user' with the username of the account
#
update txp_users set pass=password(lower('pass')) where name='user';
#-----------------------------------------------------
# SCSS Comments:
// This comment won't be included in the CSS.
/* But this comment will, except in compressed mode. */
/* It can also contain interpolation:
* 1 + 1 = #{1 + 1} */
#-----------------------------------------------------
# Error: "Loading chunk node_modules_next_dist_client_dev_noop_js failed"
# Solution: delete the .next folder at the root of your project
#
#-----------------------------------------------------
# Building a sitemap.xml and robots.txt
- Create a new component under pages/sitemap.xml.tsx and pages/robots.txt.tsx
- Setup a script: https://mmazzarolo.com/blog/2021-04-27-nextjs-robots-txt/
#-----------------------------------------------------
# Create Strapi project
#
# As a repo setup: /backend + /frontend - separate folders
#
# Install Strapi
npx create-strapi-app backend --quickstart
#-----------------------------------------------------
# Lets Encrypt with Cloudflare
#
# To import Lets Encrypt certificates to Cloudflare.
# See: https://community.letsencrypt.org/t/integrating-letsencrypt-with-cloudflare-on-manually-possible/77046/2
#
#-----------------------------------------------------
# cPanel AutoSSL + CloudFlare
#-----------------------------------------------------
# Easily start a PHP project
# Install PHP CLI using HomeBrew
brew install php
# Start server from current directory
php -S localhost:8000
#-----------------------------------------------------
#-----------------------------------------------------
# Setup Node on fish:
See: https://github.com/jorgebucaran/nvm.fish
#-----------------------------------------------------
# Setup Node on fish:
#
# Make sure you are not running npm as sudo
# Fix permissions:
#-----------------------------------------------------
# Updating Drupal Core
#
# Note: Use at your own risk. Always make a full backup before you start.
#
- put the site in maintenance mode
rm includes/ -rf
rm misc/ -rf
#-----------------------------------------------------
# Abort an AJAX request:
var xhr = false;
function fetchEvents() {
// Abort any existing AJAX request
if (xhr) xhr.abort();