Skip to content

Instantly share code, notes, and snippets.

View skwid138's full-sized avatar
🐅
Tiger Style

Hunter Rancourt skwid138

🐅
Tiger Style
View GitHub Profile

Helpful Composer Commands

Verbose Flag composer update -vvv composer update [package name] -vvv

Update Autoloaded class map

This is helpful if you've changed the file structure. I beleive this also occurs when running composer update

<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Seventeen
/****************
***** FONT ******
***************/
body {
font-family: proxima-nova, Helvetica Neue, Helvetica, Arial, sans-serif !important;
font-size: 1rem !important;
font-weight: 300;
line-height: 1.5;
color: #83ACD8 !important;
}

Vim Setup

Vim Package Manager

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

note: You may be able to skip curling the file as the config should automatically download it for you

Vim/Vi Commands

Delete an entire line dd (cannot be in Insert mode)

Enter Insert mode to edit the file i

Exit Insert mode esc

Save and Exit Vim :wq (cannot be in Insert mode)

PHP Memory Limit

In PHP Script

  • Specified ammount of memeory ini_set('memory_limit','2048M');
  • Unlimited memory ini_set('memory_limit', '-1');

In WordPress

# Run Go Access
# When prompted select the first format,NCSA combined (press space) then hit enter
goaccess -f /var/log/apache2/id.log -c
# List only directories in the current location
ls -d */
# List files and directories with permissions and dates
ls -lh
# Remove white-sapce (tabs, spaces, and new lines)
sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g' -e 's/[\t ]//g;/^$/d'
# Apache logs location on Ubuntu
cd /var/log/apache2
# Apache logs location on my local macOS
cd ~/Sites/logs
# Tail Logs, only show rows with specific info (like my ip address)
tail -f /var/log/apache2/[site].log | grep [search term]
# Search through zipped log files for some piece of data (ip/email etc.)