Skip to content

Instantly share code, notes, and snippets.

View grayghostvisuals's full-sized avatar
🐢
I may be slow to respond.

GRAY GHOST grayghostvisuals

🐢
I may be slow to respond.
View GitHub Profile
CACHE MANIFEST
#
# Version Control
# v0.0.0 00-00-0000
#
# Handy Dandy Developer Tools
# CHROME chrome://appcache-internals
# FIREFOX about:cache
# Charles - Web Debugging Proxy App
# http://charlesproxy.com
@grayghostvisuals
grayghostvisuals / Super Smoothie
Created September 6, 2012 23:51
Morning Super Smoothie for everyone in the house...
1 Peach
1/2 Apple
1 Slice of fresh pineapple
6 Red grapes
2 TBSP Plain Yogurt unsweetened
1 1/2 cup of organic soy milk
1 tsp chia seeds
4 capsules Bee Pollen NSP
1 scoop Love and Peas protein powder (optional) or Syner Protein powder for Mexico clients.
1 TBSP RawPumpkin Seeds (soaked overnight)
@grayghostvisuals
grayghostvisuals / window.devicePixelRatio Detection
Created October 13, 2012 01:23
Detect hi-dpi screens using Javascript with a fallback to a matchMedia query on Firefox
// Ala Thomas Fuchs : retinafy
function retinaDevice() {
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && !matchMedia("(-moz-device-pixel-ratio:1.0)").matches))
}
@grayghostvisuals
grayghostvisuals / WordPress Title Filter A
Created October 17, 2012 18:41
There are many ways to skin a cat when it comes to implementing wp_title() - http://ziadrahhal.com/2012/05/recommended-wp_title-filter-in-wordpress
// http://ziadrahhal.com/2012/05/recommended-wp_title-filter-in-wordpress
// http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_title
// http://codex.wordpress.org/Function_Reference/wp_title
// Title tag filter
// required for themes
// a custom callback function that displays a meaningful title
// depending on the page being rendered
function wp_flex_title_filter( $title, $sep, $sep_location ) {
@grayghostvisuals
grayghostvisuals / WordPress Title Filter B
Created October 17, 2012 18:44
This approach was posted via theme reviewers mailing list and unanimously agreed upon as the correct implementation.
function wpflex_filter_wp_title( $title ) {
global $wp_query, $s, $paged, $page;
if ( !is_feed() ) {
$sep = __('»');
$new_title = get_bloginfo('name').' ';
$bloginfo_description = get_bloginfo('description');
if ((is_home () || is_front_page()) && !empty($bloginfo_description) && !$paged && !$page) {
$new_title .= $sep.' '.$bloginfo_description;
}
@grayghostvisuals
grayghostvisuals / Respond To Sass Mixin
Created October 23, 2012 03:20
Handy mixin for Sass that helps to ease the pain of writing media queries
_mixin.scss
@mixin respond($media-type, $value) {
@media ($media-type: $value) {
@content
}
}
@grayghostvisuals
grayghostvisuals / Updating Brew
Created October 30, 2012 22:28
Fix for Cannot "brew update" anymore - fails to git pull formulas
[https://github.com/mxcl/homebrew/issues/11448](https://github.com/mxcl/homebrew/issues/11448)
cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master
@grayghostvisuals
grayghostvisuals / Fluidize
Created November 7, 2012 01:25
Sass function to return our responsive formula
@function responsive($target, $context) {
@return ($target / $context) * 100%;
}
@grayghostvisuals
grayghostvisuals / Contract Killer 3.md
Created November 7, 2012 13:31 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@grayghostvisuals
grayghostvisuals / .htaccess
Created January 6, 2013 05:55
Prevent Hotlinking of Web Fonts
#http://www.fontshop.com/blog/newsletters/pdf/webfontfontuserguide.pdf
RewriteEngine On
RewriteCond %{HTTP:Origin} !^$|http(s)?://(www\.)?example\.com$ [NC]
RewriteRule \.(woff|eot)$ - [NC,L]
RewriteCond %{HTTP_REFERER} !.
RewriteRule \.(woff|eot)$ - [F,NC,L]
Options -Indexes