Skip to content

Instantly share code, notes, and snippets.

@jeffreytierney
jeffreytierney / gist:2769555
Created May 22, 2012 14:53
throttle back canvas drawing on drag / mousemove events
var last_draw;
function draw(e) {
var this_draw = +(new Date());
if(!last_draw || this_draw - last_draw > 20) {
last_draw = this_draw;
// window.reqAnimFrame is defined elsewhere to provide cross-browser
// requestAnimationFrame support with setTimeout fallback
window.reqAnimFrame(function() {
// draw logic
@jeffreytierney
jeffreytierney / tooltip_talk_bubble.css
Created June 22, 2011 21:00
single element tooltips and talk bubbles with pure css
.tooltip {
position: absolute;
text-align: center;
display: inline-block;
background: #FFF;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
-ms-border-radius: 5px;
border-radius: 5px;
{
"embeds": [
],
"provider_url": "http://www.hulu.com/",
"description": "Video description: Station manager Arthur Carlson comes up with a big idea for a unique holiday promotion involving live turkeys and a helicopter.",
"original_url": "http://www.hulu.com/watch/322/wkrp-in-cincinnati-turkeys-away",
"url": "http://www.hulu.com/watch/322/wkrp-in-cincinnati-turkeys-away",
"images": [
{
this is a gist
this is a gist
this is a gist
this is a gist
this is a gist
this is a gist
this is a gist
this is a gist
this is a gist
this is a gist