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
@grayghostvisuals
grayghostvisuals / gemfinder.rb
Last active December 10, 2015 21:58
GemFinder
#takes you to your ruby dir
#if you're using ruby version manager
cd $(rvm gemdir)
#then type
ls
#you'll see the gems folder then type
gem list
@grayghostvisuals
grayghostvisuals / screenshots
Created January 9, 2013 07:55
Copy/Paste Screenshots Directly Into Photoshop
#Reference
#http://esbueno.noahstokes.com/post/40039075291/copy-paste-screenshots-directly-into-photoshop
#Selection Cursor: Copies to Desktop
Use built in Mac OS screenshot tool (Command + Shift + 4)
#Selection Cursor: Copies to Clipboard for Photoshop
Use built in Mac OS screenshot tool (Command + Control + Shift +4)
@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
@grayghostvisuals
grayghostvisuals / Contract Killer 3.md
Created November 7, 2012 13:31
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 / Fluidize
Created November 7, 2012 01:25
Sass function to return our responsive formula
@function responsive($target, $context) {
@return ($target / $context) * 100%;
}
@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 / 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 / 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 / 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 / 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))
}