This file contains 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
export PATH=/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php/php5.3.6/bin/:/opt/local/bin:/opt/local/sbin:$PATH | |
# coloring the terminal | |
# turn on colors | |
export CLICOLOR=1 | |
# change colors | |
# http://www.macosxhints.com/article.php?story=20031025162727485 |
This file contains 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
// jQuery.support.transition | |
// to verify that CSS3 transition is supported (or any of its browser-specific implementations) | |
$.support.transition = (function(){ | |
var thisBody = document.body || document.documentElement, | |
thisStyle = thisBody.style, | |
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined; | |
return support; | |
})(); |
This file contains 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
// disable :hover on touch devices | |
// based on https://gist.github.com/4404503 | |
// via https://twitter.com/javan/status/284873379062890496 | |
// + https://twitter.com/pennig/status/285790598642946048 | |
// re http://retrogamecrunch.com/tmp/hover | |
if ('createTouch' in document) | |
{ | |
try | |
{ |
This file contains 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
/** | |
* Switch-style checkboxes. | |
* Inspired by Espresso’s “Tools” switch | |
*/ | |
input[type="checkbox"]:not(:checked), | |
input[type="checkbox"]:checked { /* :checked here acting as a filter for older browsers */ | |
position: absolute; | |
opacity: 0; | |
} |
This file contains 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
/* | |
* CSS gradients prefix test | |
*/ | |
div { | |
min-height: 10em; | |
background-color: #ccc; | |
margin: 0.5em 0; | |
} |
This file contains 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
/* Copyright (c) 2011 Aza Raskin | |
| | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
| documentation files (the "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is furnished to do so, subject | |
| to the following conditions: | |
| | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions | |
| of the Software. |
This file contains 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
# turn on colors | |
export CLICOLOR=1 | |
export LSCOLORS=gxBxhxDxfxhxhxhxhxGxGx | |
# used to get the current git branch | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
# add autocompletion for git |
This file contains 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
// throttle - http://ejohn.org/blog/learning-from-twitter/ | |
// be sure to cache selector | |
var elem = $(".details"), | |
scrolled = false; | |
$(window).on('scroll', function() { | |
scrolled = true; | |
}); | |
// $(window).on('resize', function() { resized = true; }); |
This file contains 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
// http://ejohn.org/blog/getboundingclientrect-is-awesome/ | |
// http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport/7557433#7557433 | |
function visible_viewport(el, offset) { | |
var r, html; | |
offset = typeof offset !== 'undefined' ? offset : 200; | |
if ( !el || 1 !== el.nodeType ) { return false; } | |
html = document.documentElement; | |
r = el.getBoundingClientRect(); | |
return ( !!r && r.bottom >= offset && r.right >= offset && r.top <= (html.clientHeight+offset) && r.left <= (html.clientWidth+offset) ); |
This file contains 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
/* | |
* // to set options per instance | |
* $('#elem').classlider({ message: 'Goodbye World!' }); | |
* // to instantiate with simple Javascript | |
* var instance = new Classlider( | |
* document.getElementById('elem'), | |
* { message: 'Goodbye World!' } | |
* ).init(); |