Skip to content

Instantly share code, notes, and snippets.

View shawn-crigger's full-sized avatar

Shawn Crigger shawn-crigger

View GitHub Profile

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@shawn-crigger
shawn-crigger / webdev_tools.md
Created July 15, 2019 14:07 — forked from slow-is-fast/webdev_tools.md
Web Development Tools
@shawn-crigger
shawn-crigger / gist:6a6eaba39cae113eb8d767be1b99aa15
Created November 9, 2018 16:10 — forked from johnfmorton/gist:3abf28530a7c4ea15b62
Slightly modified version of http://detectmobilebrowsers.com/ JS script to detect mobile. This includes tablets
// returns true is browser is mobile
// added "|android|ipad|playbook|silk" to first regex to detect tablets
// This leaves 2 'android' tests in the first regex. One of the 'android' tests can be eliminated
// but left in so you can remove the "|android|ipad|playbook|silk" string easily.
function isMobile() {
var a = navigator.userAgent||navigator.vendor||window.opera;
if (/(android|bb\d+|meego|android|ipad|playbook|silk).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)
@shawn-crigger
shawn-crigger / fluid-ratio.scss
Created November 9, 2018 16:10 — forked from jakejscott/fluid-ratio.scss
Fluid Ratio images
// credit Rolf Timmermans
// http://voormedia.com/blog/2012/11/responsive-background-images-with-fixed-or-fluid-aspect-ratios
/* Calculate fluid ratio based on two dimensions (width/height) */
@mixin fluid-ratio($large-size, $small-size) {
$width-large: nth($large-size, 1);
$width-small: nth($small-size, 1);
$height-large: nth($large-size, 2);
$height-small: nth($small-size, 2);
$slope: ($height-large - $height-small) / ($width-large - $width-small);
@shawn-crigger
shawn-crigger / pds-remover.sh
Created November 9, 2018 16:10 — forked from strika/pds-remover.sh
Bash script for removing all PSD files from a repo history.
#!/bin/bash
set -o errexit
git filter-branch --tree-filter "git rm -r -f --ignore-unmatch *.psd" HEAD
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
@shawn-crigger
shawn-crigger / Marker.js
Created November 9, 2018 16:07 — forked from ttscoff/Marker.js
Bookmarklet for Markdownifying webpage selections
// Marker, a bookmarklet for Markdownifying webpage selections
// javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/8078727/raw/Marker.js?x="+(Math.random());})();
(function () {
function callback() {
(function ($) {
var raw, userSelection;
if (window.getSelection) {
// W3C Ranges
userSelection = window.getSelection ();
// Get the range:
@shawn-crigger
shawn-crigger / brew.install.quicklook.sh
Created January 6, 2018 18:42 — forked from N4M3Z/brew.install.quicklook.sh
Install Quick Look Plugins (OS X Caskroom)
#!/bin/sh
##
# Quick Look Plugins
# @url http://caskroom.io
# @brief Quick Look Plugins installed via Homebrew Cask
#
# For a comprehensive overview of Quick Look plugins look here: https://github.com/sindresorhus/quick-look-plugins
#
brew cask install qlcolorcode # Preview source code files with syntax highlighting
brew cask install qlstephen # Preview plain text files without a file extension. Example: README, CHANGELOG, etc.
@shawn-crigger
shawn-crigger / plugin-filter.php
Created July 16, 2017 08:38 — forked from carlodaniele/plugin-filter.php
A Must-use plugin to filter active plugins in on a per-page basis.
<?php
// returns the path of the request URI without the query string
// see http://php.net/manual/en/function.parse-url.php
// and http://php.net/manual/en/reserved.variables.server.php
// and http://php.net/manual/en/url.constants.php
$request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
$is_admin = strpos( $request_uri, '/wp-admin/' );
@shawn-crigger
shawn-crigger / README.md
Created March 17, 2017 17:45 — forked from pauloelias/README.md
Extended ExpressionEngine .htaccess/apache conf

ExpressionEngine .htaccess/Apache conf

Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.

This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.

This gist contains:

  • _EXTENDED.htaccess This is a general .htaccess file I rename and edit as needed for each site. Note: When I host a site on my prad/stage/dev servers I move most or all of these rules into the vhost.conf file
  • _SAMPLE.httpd.conf I use Ubuntu on my development, staging, and production servers so this is specific to Apache 2 on my setup. Essentially this file extends the apache2.conf (in my setup).
@shawn-crigger
shawn-crigger / README.md
Created March 17, 2017 17:45 — forked from pauloelias/README.md
Extended ExpressionEngine .htaccess/apache conf

ExpressionEngine .htaccess/Apache conf

Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.

This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.

This gist contains:

  • _EXTENDED.htaccess This is a general .htaccess file I rename and edit as needed for each site. Note: When I host a site on my prad/stage/dev servers I move most or all of these rules into the vhost.conf file
  • _SAMPLE.httpd.conf I use Ubuntu on my development, staging, and production servers so this is specific to Apache 2 on my setup. Essentially this file extends the apache2.conf (in my setup).