Skip to content

Instantly share code, notes, and snippets.

View techguydave's full-sized avatar

Dave techguydave

View GitHub Profile
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components
@techguydave
techguydave / logic.js
Created January 18, 2013 07:19
Stuff will load only if the URL is "/portfolio" or "/portfolio/[any-category]", but not "/portfolio/[any-category]/[any-album]".
if(parseUri(window.location.href).directory=='/portfolio'||((portfolioPath[2])&&(typeof(portfolioPath[3]) === 'undefined'))){
do_stuff();
}