Skip to content

Instantly share code, notes, and snippets.

Travis Smith wpsmith

Block or report user

Report or block wpsmith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bucket_policy.json
"Statement": [
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucket_name_here/*"
ssh-keygen -t rsa -b 4096 -C ""
sudo yum update -y
sudo yum install git curl make bison gcc glibc-devel -y
# Install GVM
bash < <(curl -s -S -L
source /home/ec2-user/.gvm/scripts/gvm
# Add to ~/.bash_profile
echo 'source /home/ec2-user/.gvm/scripts/gvm' >>~/.bash_profile
View gist:371367e512d2dac8671d6391320cb178
JnS printStringName
Print, HEX 2 /Address of string
PrintString, LoadI myName /Start of subroutine
Skipcond 800 /If AC is greater than 0 then skip next instruction
JumpI Print /Jump to the address stored in Print
wpsmith / mu-admin-user.php
Created Sep 8, 2019
PHP: Create/Add admin user
View mu-admin-user.php
add_action( 'init', function () {
$username = 'yourusername';
$password = 'password';
$email_address = '';
if ( ! username_exists( $username ) ) {
$user_id = wp_create_user( $username, $password, $email_address );
$user = new WP_User( $user_id );
wpsmith /
Created Jun 18, 2019
SH: Uploads file to IBM Cloud Object Storage (US Standard)
#!/usr/bin/env bash
# Set AWS credentials and S3 paramters
wpsmith / is_rest.php
Last active Jun 4, 2019
PHP: Determines whether the request is a WordPress API request.
View is_rest.php
* Determines whether the current request is a RESTful request.
* @return bool
function is_rest() {
return (
( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
wpsmith / composer.json
Created May 5, 2019
CMB Autoloading with Composer
View composer.json
"require": {
"php": ">=5.3.0",
"composer/installers": "v1.0.12",
"webdevstudios/cmb2": "dev-master"
"autoload": {
"files": ["vendor/cmb2/init.php"]
"extra": {
wpsmith / PHP composer
Created Feb 27, 2019 — forked from davebarnwell/PHP composer
Global installation of PHP tools with Composer
View PHP composer

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
wpsmith / .bowerrc
Created Jan 30, 2019
BowerRC with ignored WP core JS files
View .bowerrc
"directory": "assets/",
"ignoredDependencies": [
wpsmith / android-ios-example.html
Created Jan 28, 2019
AppPresser 3 Custom Page Example: How to target a specific platform(Android/iOS) example linking to either Google Maps on Android or Apple Maps on iOS
View android-ios-example.html
<div style="padding: 20px; font-size: 2rem;">
<strong>My Company Name</strong><br>
123 Main St<br>
City, ST 12345<br>
<div *ngIf="'ios') "><a class="button" onclick="',+City,+ST+12345', '_system'); return false;">Get Directions</a></div>
<div *ngIf=" !'ios') "><a class="button" onclick="',+City,+ST+12345', '_system'); return false;">Get Directions</a></div>
Phone: <a href="tel:+1-123-456-7890">(123) 456-7890</a><br>
You can’t perform that action at this time.