Skip to content

Instantly share code, notes, and snippets.


Nate Finch n8finch

View GitHub Profile
poing /
Last active Jun 19, 2022
Laravel Facades

Understanding Facades in Laravel

What's a Facade?

The Laravel explination, shown below is confusing.

Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.

Many examples use Cache::get('key') to demonstrate how a Facade works. Comparing the following code to the utility that a Facade provides.

exAspArk /
Last active May 30, 2022
Test CORS with cURL
curl -I -X OPTIONS \
-H "Origin: http://EXAMPLE.COM" \
-H 'Access-Control-Request-Method: GET' \
http://EXAMPLE.COM/SOMETHING 2>&1 | grep 'Access-Control-Allow-Origin'
stephenharris / import-venues.php
Created Mar 21, 2017
A WP-CLI command to import a CSV of venues
View import-venues.php
Plugin Name: Import Venues WP CLI command
Plugin URI:
Description: Adds `wp eo venue import <path-to-file>` command.
Author: Stephen Harris
Version: 0.1
// Exit if accessed directly
View Create Base Site - WP-CLI Demo Script
wp core download --version=4.5
wp core config --dbname=$1 --dbuser=root --dbhost=
wp db create
wp core install --skip-email --title="$1" --admin_user="shawn" --admin_password="shawn" --url=
wp theme install simone --activate
wp plugin delete hello
wp plugin install any-ipsum;
wp plugin install advanced-custom-fields --version=4.4.0 --activate
wp plugin install tinymce-advanced --activate
eiskalteschatten /
Created Oct 2, 2016
Update WordPress with a Bash script using WP CLI
function updateWordPress {
cd $1
wp core update
wp plugin update --all
wp theme update --all
View force-css-js-to-go-live-immediately.php
// Version CSS file in a theme
get_stylesheet_directory_uri() . '/style.css',
filemtime( get_stylesheet_directory() . '/style.css' )
chrissimpkins / gist:5bf5686bae86b8129bee
Last active Aug 9, 2022
Atom Editor Cheat Sheet: macOS
View gist:5bf5686bae86b8129bee

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
ericandrewlewis / gist:95239573dc97c0e86714
Last active May 11, 2022
Setting up a WordPress site on AWS
View gist:95239573dc97c0e86714

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

View admin.css
.yoast-settings {
display: none;
tomazzaman /
Last active Jul 11, 2022
Gulp workflow for WordPress theme development

Gulp workflow for WordPress theme development


In order for Livereload to work, you need a Firefox or Chrome extension as Gulp doesn't inset it automatically. Alternatively, you can also manually put the livereload script in footer.php, just make sure to insert it only on development environment:

<script>document.write('<script src="http://' + ( || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>