Skip to content

Instantly share code, notes, and snippets.

View timothyarmstrong's full-sized avatar

Timothy Armstrong timothyarmstrong

View GitHub Profile
@timothyarmstrong
timothyarmstrong / delete-videos-from-playlist.js
Created April 11, 2014 21:08
Delete all videos in YouTube Playlist
(function() {
var i = window.setInterval(function() {
var closeButton = document.querySelector('.pl-video-edit-remove');
if (closeButton) {
closeButton.click();
} else {
window.clearInterval(i);
}
}, 500);
})();
@timothyarmstrong
timothyarmstrong / toChars.js
Created May 15, 2011 01:11
Convert a string to a function call that puts together that string form character codes
/**
* Convert a string to a function call that puts together that string form character codes.
* Useful when you are trying to avoid using quotation characters in JavaScript (because they
* are being escaped) but you still want to use a string.
*
* @author Timothy Armstrong
* @param str String The string you want to convert
* @return String The JavaScript code that can replace your string
*/
@timothyarmstrong
timothyarmstrong / webfontsmoothing.snippet.css
Created April 26, 2011 18:10
Web Font Smoothing (at least for Chrome on Windows)
#selector {
text-shadow: transparent 0 0 1px;
}
var cx = oo.canvas().width/2;
var cy = oo.canvas().height/2;
var img_w = 271;
var img_h = 365;
var img = oo.image({src:'./img/face_271x365.png',
x:cx - img_w/2,
y:cy - img_h/2,
axis:{x:img_w/2,
y:img_h/2,
coord:'local',