Skip to content

Instantly share code, notes, and snippets.

View cameronscott137's full-sized avatar

Cameron Scott cameronscott137

View GitHub Profile
<link rel="apple-touch-icon" href="touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="76x76" href="touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="120x120" href="touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png">
@cameronscott137
cameronscott137 / gist:11115696
Created April 20, 2014 14:37
Standard .htaccess config
#Blocks access to config file.
<files wp-config.php>
order allow,deny
deny from all
</files>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!.readme.txt
!wp-content/
!db_backups/
# Ignore everything in the "wp-content" directory except specified
wp-content/*
!wp-content/plugins/
/* Overrides opacity */
#fullscreenBrowser .slideshow.strip .slide{
opacity: 1 !important;
}
/* Fixes caption to the left side of the page */
#fullscreenBrowser .slideshow.strip .image-detail-wrapper{
position: fixed !important;
left: 20px !important;
bottom: -2px !important;
@cameronscott137
cameronscott137 / gist:d5004d9824b82d76e5a7
Created August 26, 2014 12:38
Gravity Forms Optimization
/* Gravity Forms JS */
wp_deregister_script('jquery');
if(!is_admin()) {
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js','','',true);
wp_enqueue_script('jquery');
}
/* Gravity Forms Load JQuery in Footer*/
function init_scripts() {
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@cameronscott137
cameronscott137 / gist:d2abcce6af8250ec4083
Last active August 29, 2015 14:09
GF css class mods
/*http://www.jordancrown.com/multi-column-gravity-forms/*/
function gform_column_splits($content, $field, $value, $lead_id, $form_id) {
if(!IS_ADMIN) { // only perform on the front end
// target section breaks
if($field['type'] == 'section') {
$form = RGFormsModel::get_form_meta($form_id, true);
// check for the presence of multi-column form classes
$form_class = explode(' ', $form['cssClass']);
@cameronscott137
cameronscott137 / gist:b04a7c66f3b57097c68d
Last active August 29, 2015 14:10
Hack filter to add 'async' to WordPress script output
add_filter( 'clean_url', function( $url )
{
if ( FALSE === strpos( $url, '.js' ) )
{ // not our file
return $url;
}
return "$url' async";
}, 11, 1 );
@cameronscott137
cameronscott137 / .htaccess
Created March 26, 2015 14:25
Place this at the top of a file titled .htaccess in paragon-csi.com's root directory
Redirect 301 /b2b-edi http://getfoundational.com/
Redirect 301 /b2b-edi/managed-edi-service/ http://getfoundational.com/solutions/managed-edi-service/
Redirect 301 /b2b-edi/customer-enablement/ http://getfoundational.com/solutions/edi-e-business-consulting/
Redirect 301 /b2b-edi/supplier-enablement/ http://getfoundational.com/solutions/edi-e-business-consulting/
Redirect 301 /b2b-edi/partner-onboarding-services/ http://getfoundational.com/solutions/edi-e-business-consulting/
Redirect 301 /b2b-edi/b2b-edi-consulting/ http://getfoundational.com/solutions/edi-e-business-consulting/
Redirect 301 /b2b-edi/metals-industry-experts/ http://getfoundational.com/markets//steel-processing/