Skip to content

Instantly share code, notes, and snippets.

View rhyolight's full-sized avatar

Matthew Taylor rhyolight

View GitHub Profile
// why does this print 'undefined' to the log instead of 'HELLO'?
YUI.add('foo', function(Y) {
Y.log(Y.bar);
});
YUI.add('bar', function(Y) {
Y.bar = "HELLO";
});
@rhyolight
rhyolight / js_slowdown.js
Created September 26, 2011 16:35
Slow down the JS runtime in client
SLOWDOWN = true;
window.onload = function() {
if (SLOWDOWN) {
setInterval(function() {
var body = document.getElementsByTagName('body')[0],
dummy = document.getElementById('dummy__');
if (! dummy) {
dummy = document.createElement('div');
dummy.setAttribute('id', 'dummy__');
"yui-base",
"get",
"features",
"rls",
"intl-base",
"yui-log",
"yui-later",
"yui-throttle",
"yui",
"oop",
@rhyolight
rhyolight / rhyolight_newnewTwitter.txt
Created December 14, 2011 20:22
new new twitter feature requests from Matthew Taylor
1. Keyboard shortcut to "expand all tweets"
"L" closes all tweets on the page, I would like to click "X" to expand on tweets on the page.
2. All dialogs are moveable (especially "new tweet" dialogs)
I used to move them all the time when I was composing a tweet in newTwitter, so I could see the whole twitter stream behind the dialog if I needed to. Facebook has never done this, and I always found myself trying to move the facebook dialogs because the twitter dialogs moved. It look crap when you try to drab a dialog and end up highlighting half the DOM with the mouse cursor.
@rhyolight
rhyolight / gist:1604766
Created January 13, 2012 05:03
what not to do
do {
if (parts[pathIndex + 2]) {
id = parts[pathIndex + 2];
type = parts[pathIndex + 1];
} else if (parts[pathIndex + 1]) {
// there is no id
type = parts[pathIndex + 1];
}
pathIndex += 2;
} while();
@rhyolight
rhyolight / gist:2238356
Created March 29, 2012 15:13
Response to recruiter
I am not interested in this position.
Also, here are a few pieces of advice for your career as a recruiter.
(1) To contact a potential candidate, choose one medium instead of
contacting me on LinkedIn, via email, and calling me all within 5 minutes.
If I'm interested, I'll respond to one contact method. Doing all of them
is annoying.
(2) Be sure to use your potential candidates name properly. You left me a
@rhyolight
rhyolight / gist:2569037
Created May 1, 2012 15:50
HTML for youtube custom thumbnail
<div id="image-overlay"></div>
<div id="video-placeholder">
You need Flash player 8+ and JavaScript enabled to view this video.
</div>
@rhyolight
rhyolight / gist:2569049
Created May 1, 2012 15:51
CSS for youtube thumbnail overlay
div#image-overlay {
background: url(img/video.jpg);
position: absolute;
margin: 0;
padding: 0;
width: 500px;
height: 500px;
}
@rhyolight
rhyolight / gist:2569053
Created May 1, 2012 15:52
JavaScript for youtube thumbnail overlay
(function() {
var $overlay = $('#image-overlay'),
// NYAN CAT!!
youtubeVideoId = 'QH2-TGUlwu4',
// id of the element the object embed will replace
playerPlaceholderId = 'video-placeholder',
// id we want to give to the new <object>
playerId = 'video-player',
// shockwave flash object params
params = {
@rhyolight
rhyolight / index.html
Created May 14, 2012 18:41
Example of D3js line chart with random adjacent paths
<html>
<head>
<title></title>
<style>
path {
fill: none;
stroke: cyan;
}
.id-0 path, .id-0 circle {
stroke: red;