Skip to content

Instantly share code, notes, and snippets.

@CameronGilroy
CameronGilroy / functions.php
Created May 13, 2018 00:31 — forked from stephanieleary/functions.php
Redirect private page 404 errors to the login screen with a message
<?php
add_action( 'wp', 'my_private_page_404' );
function my_private_page_404() {
$queried_object = get_queried_object();
if ( isset( $queried_object->post_status ) && 'private' == $queried_object->post_status && !is_user_logged_in() ) {
wp_safe_redirect( add_query_arg( 'private', '1', wp_login_url( $_SERVER['REQUEST_URI'] ) ) );
exit;
}
<a href="{{ shop.url }}">
<img
src="{{ 'logo.png' | asset_url }}"
alt="{{ shop.name }}"
data-retina-src="{{ 'logo.svg' | asset_url }}">
</a>
<script type="text/javascript">
Modernizr.addTest('retina', function () {
return (!!navigator.userAgent.match(/Macintosh|Mac|iPhone|iPad/i) && window.devicePixelRatio==2);
});

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading
@CameronGilroy
CameronGilroy / hack.sh
Created April 21, 2012 11:19 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@CameronGilroy
CameronGilroy / dabblet.css
Created March 13, 2012 08:31 — forked from schadeck/dabblet.css
design shack - Use Pseudo Elements to Create an Image Stack Illusion
/**
* design shack - Use Pseudo Elements to Create an Image Stack Illusion
*/
* { margin: 0; padding: 0; }
body {background: #ccd3d7;}
div[class*='stack'] {
float: left;
position: relative;
@CameronGilroy
CameronGilroy / dabblet.css
Created January 21, 2012 05:02 — forked from chriscoyier/dabblet.css
Oprah Thing
/* Oprah Thing
Saw some movie and there was some Oprah-related commerical before it and it had title things like this during it
*/
body { background: black; padding: 100px; margin: 0; }
h1 {
text-align: center;
color: white;
text-transform: uppercase;
@CameronGilroy
CameronGilroy / dabblet.css
Created January 21, 2012 05:02 — forked from chriscoyier/dabblet.css
Oprah Thing
/* Oprah Thing
Saw some movie and there was some Oprah-related commerical before it and it had title things like this during it
*/
body { background: black; padding: 100px; margin: 0; }
h1 {
text-align: center;
color: white;
text-transform: uppercase;
@CameronGilroy
CameronGilroy / php-cgi.rb
Created July 14, 2011 12:58 — forked from eston/php-cgi.rb
Homebrew Formula for PHP 5.2.14 as php-cgi (for nginx, etc.)
# Homebrew Formula for PHP 5.2.14 as php-cgi (for nginx, etc.)
require 'formula'
class PhpCgi <Formula
@url='http://www.php.net/get/php-5.2.14.tar.bz2/from/www.php.net/mirror'
@version='5.2.14'
@homepage='http://php.net/'
@md5='bfdfc0e62fe437020cc04078269d1414'
def mobile?
if session[:mobile_param]
session[:mobile_param] == "1"
else
request.user_agent =~ /Mobile|webOS/
end
end
helper_method :mobile?
#
# Supported browsers
#
modern_browser gecko 1.9;
# note that Safari related directives match
# Chrome, Mobile Safari, Palm Pre and other WebKit-based browsers here, too, thanks
# to all of them using almost identical User-Agent strings
modern_browser safari 3.0;