Skip to content

Instantly share code, notes, and snippets.

View joshuaadrian's full-sized avatar

Joshua Adrian joshuaadrian

View GitHub Profile
AddDefaultCharset UTF-8
Options +FollowSymLinks
RewriteEngine On
# Add Font mime types
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
<?php
/* ABSOLUTE PATH */
if ( !defined( 'ABSPATH' ) ) :
define('ABSPATH', dirname(__FILE__) . '/');
endif;
/* DB CREDS */
if ( file_exists( ABSPATH . 'wp-config.local.php' ) ) :
require_once( 'wp-config.local.php' );
// LOGGING FUNCTION
if ( !function_exists('_log') ) {
function _log( $message ) {
if ( WP_DEBUG === true ){
if ( is_array( $message ) || is_object( $message ) ) {
error_log( print_r( $message, true ) );
} else {
error_log( $message );
}
Clone Scotch Box [email protected]:scotch-io/scotch-box.git
Clone project into public
ssh into server install
sudo apt-get install libpq-dev
go into psql
sudo -u postgres psql
create vagrant user
CREATE USER vagrant WITH SUPERUSER;
bind rails server to scotchbox ip
rails server -b 192.168.33.10
@joshuaadrian
joshuaadrian / utilities.js
Last active July 7, 2021 19:23
My vanilla js utilities library
/*
* These are supported IE9+
* /
/*
* Initialization variables and functions
*/
var jsPresent = 'querySelector' in document && 'addEventListener' in window && "classList" in document.createElement("_") ? true : false;
#Redirect Non-WWW to WWW with SSL
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [NC,R=301,L]
#Redirect Non-WWW to WWW
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
#Redirect alternative domains
RewriteCond %{HTTP_HOST} ^domain.com.php53-13.dfw1-1.websitetestlink.com$ [NC,OR]