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
<?php | |
# Show source of this file in .txt extension if it exists | |
call_user_func(function() { | |
$txt = __FILE__ . '.txt'; | |
if ( ! file_exists($txt)) | |
return; | |
# update (cache at least 5-min) | |
if (300 < time() - filemtime($txt)) | |
file_put_contents($txt, file_get_contents(__FILE__)); |
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
table.untabulate, | |
.untabulate table, | |
.untabulate thead, | |
.untabulate tbody, | |
.untabulate tfoot, | |
.untabulate th, | |
.untabulate td, | |
.untabulate tr { display:block; } | |
.untabulate tr + tr { margin-top:1em; } |
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
<?php | |
namespace demo; | |
/** | |
* Get or set data. | |
* @param mixed $key | |
* @param mixed $val | |
* @return mixed | |
*/ | |
function data($key = null, $val = null) { |
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
//gist.github.com/ryanve/6153436 | |
(function(anchors, url, i, a) { | |
while ((a = anchors[i++]) && a.classList) | |
a.href === url && a.classList.add('current'); | |
}(document.getElementsByTagName('a'), location.href, 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
figure[id] > a[href^="#"]:after { | |
content:attr(href); display:table; | |
position:relative; top:-1.4em; bottom:-1.4em; | |
font-weight:bold; text-decoration:none; | |
line-height:1; padding:.2em; margin-bottom:-1.4em; | |
background:#fff; color:#222; | |
} |
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
::-webkit-input-placeholder { color:inherit; } | |
:-moz-placeholder { color:inherit; } /* FF 4-18 */ | |
::-moz-placeholder { color:inherit; } /* FF 19+ */ | |
:-ms-input-placeholder { color:inherit; } /* IE 10+ */ |
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
(function(root, name, make) { | |
if (typeof module != 'undefined' && module['exports']) module['exports'] = make(); | |
else root[name] = make(); | |
}(this, 'breakpoint', function() { | |
/** | |
* @link http://gist.github.com/ryanve/7924792 | |
* @param {string} feature range feature name e.g. "width" | |
* @param {string=} unit CSS unit for feature e.g. "em" | |
* @param {number=} init initial guess |
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
// gist.github.com/ryanve/8703402 | |
// Play only one track at a time. | |
(function(doc, tags) { | |
var listen = 'addEventListener', some = tags.some, pause = function(e) { | |
this !== e && !this.ended && !this.paused && !e.ended && !e.paused && e.pause(); | |
}; | |
some && listen in doc && tags.some(function(tag) { | |
var live = doc.getElementsByTagName(tag), solo = function() { | |
some.call(live, pause, this); | |
}; |
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
[alias] | |
co = checkout | |
ci = commit | |
ca = commit --amend | |
cia = commit -a | |
can = commit --amend --no-edit | |
com = checkout master | |
st = status | |
s = status --short | |
b = branch |
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
document.addEventListener('keyup', function(e) { | |
9 != e.keyCode || e.metaKey || e.ctrlKey || console.log(document.activeElement) | |
}, false) |
OlderNewer