This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Routine to try and identify device | |
sub devicedetect { | |
unset req.http.X-UA-Device; | |
set req.http.X-UA-Device = "pc"; | |
# Handle that a cookie may override the detection alltogether. | |
if (req.http.Cookie ~ "(?i)X-UA-Device-force") { | |
# ;?? means zero or one ;, non-greedy to match the first. | |
set req.http.X-UA-Device = regsub(req.http.Cookie, "(?i).*X-UA-Device-force=([^;]+);??.*", "\1"); | |
# Clean up our mess in the cookie header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add URL rewrite to recognize the pagination. | |
add_action( 'init', function () { | |
add_rewrite_rule( '(.?.+?)/page/?([0-9]{1,})/?$', 'index.php?pagename=$matches[1]&paged=$matches[2]', 'top' ); | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################## | |
# Set Your System and Wordpress Config Preferences | |
############################################################## | |
export SYSTEM_USER=nginx # User PHP-FPM runs under | |
export SYSTEM_GROUP=www # User PHP-FPM runs under | |
########################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Statement": [ | |
{ | |
"Sid": "AllowPublicRead", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::bucket_name_here/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" | |
sudo yum update -y | |
sudo yum install git curl make bison gcc glibc-devel -y | |
# Install GVM | |
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) | |
source /home/ec2-user/.gvm/scripts/gvm | |
# Add to ~/.bash_profile | |
echo 'source /home/ec2-user/.gvm/scripts/gvm' >>~/.bash_profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JnS printStringName | |
Halt | |
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 | |
Output | |
Clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', function () { | |
$username = 'yourusername'; | |
$password = 'password'; | |
$email_address = 'email@example.com'; | |
if ( ! username_exists( $username ) ) { | |
$user_id = wp_create_user( $username, $password, $email_address ); | |
$user = new WP_User( $user_id ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Set AWS credentials and S3 paramters | |
S3_KEY="YOUR_KEY_GOES_HERE" | |
S3_SECRET="YOUR_SECRET_GOES_HERE" | |
S3_BUCKET="YOUR_BUCKET_NAME_GOES_HERE" | |
S3_BUCKET_PATH="/" | |
S3_ACL="x-amz-acl:public-read" | |
S3_URL="https://s3.us.cloud-object-storage.appdomain.cloud/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Determines whether the current request is a RESTful request. | |
* | |
* @return bool | |
*/ | |
function is_rest() { | |
return ( | |
( defined( 'REST_REQUEST' ) && REST_REQUEST ) || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"php": ">=5.3.0", | |
"composer/installers": "v1.0.12", | |
"webdevstudios/cmb2": "dev-master" | |
}, | |
"autoload": { | |
"files": ["vendor/cmb2/init.php"] | |
}, | |
"extra": { |