Skip to content

Instantly share code, notes, and snippets.

View quinns's full-sized avatar

Quinn Supplee quinns

View GitHub Profile
@quinns
quinns / .htaccess
Created May 9, 2019 23:03
Boost rules for Drupal 7
### BOOST START ###
# Allow for alt paths to be set via htaccess rules; allows for cached variants (future mobile support)
RewriteRule .* - [E=boostpath:normal]
# Caching for anonymous users
# Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add|comment/reply))|(/(edit|user|user/(login|password|register))$) [OR]
RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
From 924fca618c5f2754c48bc76d8b9f87cc4e3adbd7 Mon Sep 17 00:00:00 2001
From: Mark Carver <[email protected]>
Date: Thu, 24 Jan 2019 13:15:35 -0600
Subject: [PATCH] Issue #3027569 by markcarver, just_like_good_vibes: Error:
Unsupported operand types during providers JSON discovery
---
includes/cdn.inc | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
@quinns
quinns / getUrlParams.js
Last active June 20, 2018 22:47
Get URL parameters in JavaScript
/**
* JavaScript Get URL Parameter via https://www.kevinleary.net/javascript-get-url-parameters/
*
* @param String prop The specific URL parameter you want to retreive the value for
* @return String|Object If prop is provided a string value is returned, otherwise an object of all properties is returned
*/
function getUrlParams( prop ) {
var params = {};
var search = decodeURIComponent( window.location.href.slice( window.location.href.indexOf( '?' ) + 1 ) );
@quinns
quinns / template.php
Created March 20, 2018 19:38
Fix Drupal's Bootstrap theme not working properly with dpm() or dsm() devel function
<?php
// fix for broken dpm() output with bootstrap.
// see https://www.drupal.org/node/2824578#comment-12075185
function THEMENAME_status_messages($variables){
$display = $variables['display'];
$output = '';
$status_heading = array(
'status' => t('Status message'),
'error' => t('Error message'),
'warning' => t('Warning message'),
@quinns
quinns / 0_reuse_code.js
Created May 10, 2017 19:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@quinns
quinns / gist:3724c0184b7d63a9a1f0425f98aa1ce6
Created April 13, 2017 21:28
Absolutely Responsive Full-Screen Background Images
Copied from https://www.webdesign.org/absolutely-responsive-full-screen-background-images.22549.html
The HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Absolutely Responsive Background Image Demo</title>
</head>
@quinns
quinns / httpd.conf
Created January 25, 2017 19:24
Security headers
### Following are security enhancements. See https://securityheaders.com/
# Header always append X-Frame-Options SAMEORIGIN
Header always append X-Content-Type-Options: nosniff
Header always append X-XSS-Protection: 1
Header always append X-Permitted-Cross-Domain-Policies: master-only
###
Header set ServerName "{MY SERVER NAME}"
Header set X-Frame-Options "SAMEORIGIN"
RequestHeader unset Proxy early
@quinns
quinns / fonts.css
Created November 4, 2016 16:13
Default system fonts for web sites, inspired by GitHub
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
@quinns
quinns / httpd.conf
Created October 27, 2016 20:05
protect wp-login.php with http basic auth
<Files "wp-login.php">
Order Deny,Allow
Deny from All
# allow certain whitelisted IPs
Allow from localhost 123.456.789
AuthName "Authentication required!”
AuthType Basic
AuthUserFile /path/to/passwd-file
require valid-user
# Allow password-less access for allowed IPs
@quinns
quinns / config.rb
Created October 18, 2016 03:38
Example config.rb for Compass
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
# You can select your preferred output style here (can be overridden via the command line):