Skip to content

Instantly share code, notes, and snippets.

View lightyrs's full-sized avatar
🌒
ლ(▀̿̿Ĺ̯̿̿▀̿ლ)

Harris Novick lightyrs

🌒
ლ(▀̿̿Ĺ̯̿̿▀̿ლ)
View GitHub Profile
@lightyrs
lightyrs / cookies_pattern.js
Created May 27, 2011 14:56
Basic pattern for displaying content once per user
/* Basic pattern for displaying content once per user
using http://code.google.com/p/cookies/ plugin.
*/
$(function(){
var lightbox_cookie = $.cookies.get('lightbox_shown');
var $lightbox = $('iframe#warriors_lightbox, div#warriors_overlay');
if (lightbox_cookie == null) {
$lightbox.fadeIn(300, function(){
$.cookies.set( 'lightbox_shown', 'true' );
@lightyrs
lightyrs / 8_font_stacks.css
Created May 27, 2011 14:56
The 8 Definitive Web Font Stacks
/*The Times New Roman-based serif stack:*/
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/*A modern Georgia-based serif stack:*/
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
/*A more traditional Garamond-based serif stack:*/
font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;
/*The Helvetica/Arial-based sans serif stack:*/
@lightyrs
lightyrs / log_available_vars.js
Created May 27, 2011 14:56
Log All Available Vars And Functions
for(var b in window) {
if(window.hasOwnProperty(b)) console.log(b);
}
@lightyrs
lightyrs / animate_dom_build.js
Created May 27, 2011 14:56
Animate DOM-Building
(function n(e){e.eq(0).fadeIn(99,function(){n(e.slice(1))})})($(":visible").hide())
@lightyrs
lightyrs / detect_duplicate_ids.js
Created May 27, 2011 14:56
Detect Duplicated #ID Names and Warn
$('[id]').each(function(){
var ids = $('[id='+this.id+']');
if(ids.length>1 && ids[0]==this)
console.warn('Multiple IDs #'+this.id);
});
@lightyrs
lightyrs / defaults.css
Created May 27, 2011 22:40
Sensible CSS Defaults
/*
html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark
html5doctor.com/html-5-reset-stylesheet/
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
@lightyrs
lightyrs / perfect_buttons.css
Created May 28, 2011 03:37
active_admin CSS3 Buttons
.button a {
box-shadow: 0 1px 2px #aaaaaa;
-moz-box-shadow: 0 1px 2px #aaaaaa;
-webkit-box-shadow: 0 1px 2px #aaaaaa;
background: #838a90;
background: -webkit-gradient(linear, left top, left bottom, from(#838a90), to(#414549));
background: -moz-linear-gradient(-90deg, #838a90, #414549);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#838a90, endColorstr=#414549);
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#838a90, endColorstr=#414549);
-webkit-border-radius: 200px;
@lightyrs
lightyrs / shiny_buttons.css
Created June 8, 2011 17:39
Normalize CSS3 Buttons
.button:hover, .button:focus, .button:active {
text-decoration: none;
color: white;
background: #569107;
}
.button:active {
}
@lightyrs
lightyrs / normalize.css
Created June 8, 2011 17:46
Normalize CSS
/* =============================================================================
HTML5 element display
========================================================================== */
/*
* Add display for block-level HTML5 elements
* Addresses display not defined in IE6/7/8/9 & FF3
*/
article,
@lightyrs
lightyrs / hex.js
Created June 13, 2011 16:32
Generate Hex Useable Hex Code
var char = "✓";
"&#x" + char.charCodeAt(0).toString(16) + ";";