Skip to content

Instantly share code, notes, and snippets.

@jackilyn
jackilyn / gist:3035120
Created July 2, 2012 19:24
Back to Top Animated Scroll
$(function() {
$('#back-top a').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});
@jackilyn
jackilyn / gist:3035109
Created July 2, 2012 19:23
Delete All Inline Style with jQuery
$("*[style]").attr("style", "");
@jackilyn
jackilyn / gist:3035100
Created July 2, 2012 19:21
Compass mixin for text color and proper contrast
@mixin fg-color($bg-color) {
@if lightness($bg-color) < 30% {
color: #eee;
} else {
color: #333;
}
}
@mixin readable($bg-color) {
background-color: $bg-color;
@jackilyn
jackilyn / gist:3001539
Last active August 2, 2022 13:18
favicons
<!-- Favicons and touch icons -->
<!-- For retina-display iPads -->
<link href="/assets/ico/[email protected]" rel="apple-touch-icon-precomposed" sizes="144x144" type="image/png"/>
<!-- For retina-display iPhones -->
<link href="/assets/ico/[email protected]" rel="apple-touch-icon-precomposed" sizes="114x114" type="image/png"/>
<!-- For iPad 1 -->
<link href="/assets/ico/Icon-iPad.png" rel="apple-touch-icon-precomposed" sizes="72x72" type="image/png"/>
<!-- For iPhone 3G, iPod Touch and Android -->
<link href="/assets/ico/Icon.png" rel="apple-touch-icon-precomposed" type="image/png"/>
<!-- For Nokia -->
@jackilyn
jackilyn / gist:2967635
Created June 21, 2012 18:33
CSS Text Shadows
/* Inset */
.inset {
text-shadow: 0px -2px 0px #333,
0px 2px 3px #666;
}
/* 3D */
.three-d {
text-shadow: 0 1px 0 #bbb,
0 2px 0 #bbb,
@jackilyn
jackilyn / gist:2932154
Created June 14, 2012 18:48
find files in dir but not in svn
# Find stuff that has not been committed
svn status
# Find files that have not been added
svn status | grep -e ^?
# Find files that have been modified
svn status | grep -e ^M
# Find and add files that have not been added
@jackilyn
jackilyn / gist:2599401
Created May 5, 2012 03:35
Equal Height Columns
/* equal height columns */
var colHeight = Math.max(
$('#main').height(),
$('#left').height(),
$('#right').height()
);
$('#main, #left, #right').height(colHeight);
@jackilyn
jackilyn / gist:2599386
Created May 5, 2012 03:32
Determine the dominant color of an image
//This code will be super useful for people managing images or photography website. With it, you can analyze any image and get its dominant color (R, G, or B).
$i = imagecreatefromjpeg("image.jpg");
for ($x=0;$x<imagesx($i);$x++) {
for ($y=0;$y<imagesy($i);$y++) {
$rgb = imagecolorat($i,$x,$y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> & 0xFF;
$b = $rgb & 0xFF;
@jackilyn
jackilyn / gist:2408477
Created April 17, 2012 19:34
git commands
# clone branch
git clone -b <branch> <remote_repo>
@jackilyn
jackilyn / style-guide.css
Created March 30, 2012 22:44
Comments Style Guide
/*
* Filename
* Description of the file and its contents. Sometimes followed by a
* table of contents.
*
* Maximum Line Length = 70 chars
*
* --------------------------------------------------------------- */
/* Section Heading