This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Now the CSS*/ | |
* {margin: 0; padding: 0;} | |
.tree ul { | |
padding-top: 20px; | |
position: relative; | |
transition: all 0.5s; | |
-webkit-transition: all 0.5s; | |
-moz-transition: all 0.5s; | |
} | |
.tree li { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* grid */ | |
.clearfix{*zoom:1} | |
.clearfix::before,.clearfix::after{display:table;content:""} | |
.clearfix::after{clear:both} | |
[class*="span"]{float:left; margin-left:20px} | |
.span1{width:60px}.offset1{margin-left:100px} | |
.span2{width:140px}.offset2{margin-left:180px} | |
.span3{width:220px}.offset3{margin-left:260px} | |
.span4{width:300px}.offset4{margin-left:340px} | |
.span5{width:380px}.offset5{margin-left:420px} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = '<div class="foo" id="bar"></div>'; | |
text.replace(/"[^"]*"/g, '"…"'); | |
// output: '<div class="…" id="…"></div>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/1622287 | |
// @module sprite grid helper | |
// default route to the image directory | |
$spriteGridBasePath: '/images' !default | |
// default grid size | |
$spriteGridSize: 16 !default | |
$spriteGridSizeY: 16 !default | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @link http://www.nczonline.net/blog/2012/01/03/css-media-queries-in-javascript-part-1/ | |
* media query detection like this | |
* if (isMedia("screen and (max-width:800px)") { | |
* //do something for the screen | |
* } | |
* | |
* if (isMedia("all and (orientation:portrait)")) { | |
* //react to portrait mode | |
* } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// var nestedArr = ['a', 'b', 'c', {'foo': 'bar'}]; | |
// convertArrayToHash(nestedArr); // output: {a: 'b', c: {'foo': 'bar'}} | |
function convertArrayToHash (array) { | |
var hash = {}, key = ''; | |
$(array).each(function (index, value) { | |
if (index % 2) { | |
hash[key] = value; | |
} else { | |
key = value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SmoothScroll = function () { | |
'use strict'; | |
var self = this, | |
$topReference = $('html, body'), | |
$window = $(window) | |
; | |
function targetPosition(targetHash) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -lir "text you want to find" * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table { | |
width: 100%; | |
font-family: Helvetica, Arial, sans-serif | |
} | |
table th { font-weight: bold } | |
table th, | |
table td { | |
border: 1px solid #333; | |
padding: 2px 4px; | |
-moz-transition: padding .3s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table { | |
width: 100%; | |
font-family: Helvetica, Arial, sans-serif | |
} | |
table th { font-weight: bold } | |
table th, | |
table td { | |
border: 1px solid #333; | |
padding: 2px 4px; | |
} |