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
// requires Q | |
const NUMBER_OF_PLACEMENTS_REQUIRED = 1; | |
const MS_TO_WAIT = 7000; | |
const selectors = ['.wibble', '.bleuch', '.foo']; | |
function checkElement(selector, observer) { | |
var elementFound = document.querySelector(selector) !== null; | |
console.log(`el ${selector} = found : ${elementFound}`); | |
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
// requires Q | |
const NUMBER_OF_PLACEMENTS_REQUIRED = 1; | |
const MS_TO_WAIT = 7000; | |
const selectors = ['.wibble', '.bleuch', '.foo']; | |
function checkElement(selector, observer) { | |
var elementFound = document.querySelector(selector) !== null; | |
console.log(`el ${selector} = found : ${elementFound}`); | |
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
// requires RX.js | |
const NUMBER_OF_PLACEMENTS_REQUIRED = 1; | |
const MS_TO_WAIT = 7000; | |
const selectors = ['.wibble', '.bleuch']; | |
function checkElement(selector, observer) { | |
var elementFound = document.querySelector(selector) !== null; | |
console.log(`el ${selector} = found : ${elementFound}`); | |
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
// requires RX.js | |
const NUMBER_OF_PLACEMENTS_REQUIRED = 1; | |
const MS_TO_WAIT = 7000; | |
const selectors = ['.wibble', '.bleuch']; | |
function checkElement(selector, observer) { | |
var elementFound = document.querySelector(selector) !== null; | |
console.log(`el ${selector} = found : ${elementFound}`); | |
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
var weWantToMeet = _.chain(smrDevs) | |
.filter(function isAwesome(smrDev) { | |
return smrDev.isAwesome; | |
}) | |
.filter(function isEnthusiastic(smrDev) { | |
return smrDev.enthusiasmLevel === 'high'; | |
}) | |
.filter(function pingPongProficiency(smrDev) { | |
// not really :D | |
return smrDev.pingPongSkillz === 'badass'; |
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
<element extends="div" is="x-nyandiv"> | |
<template> | |
<img src="http://www.nyan.cat/cats/skrillex.gif" | |
alt="wub"> | |
</img> | |
<content select=".boring"></content> | |
</template> | |
</element> | |
<div is="x-nyandiv"> |
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
// using webgl-utils.js for *everything* | |
// and assuming you have a global called gl | |
// that's pointed to the webgl canvas context | |
// based on learningwebgl.com <3 | |
function initTextureWith(videoUrl) { | |
var vidElement = document.createElement('video'); | |
vidElement.onload = function () { | |
var texture = makeTextureFrom(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
// using webgl-utils.js for *everything* | |
// and assuming you have a global called gl | |
// that's pointed to the webgl canvas context | |
// based on learningwebgl.com <3 | |
function initTextureWith(imgUrl) { | |
var imgElement = new Image(); | |
imgElement.onload = function () { | |
var texture = makeTextureFrom(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
// the NPOT fix is taken from : | |
// http://www.khronos.org/webgl/wiki/WebGL_and_OpenGL_Differences | |
function makeSuitableForTexture(srcElement) { | |
srcElement.crossOrigin = ''; | |
// it probs should be image.width not image.videoWidth or clientWidth but doesn't work with <video> | |
// TODO fixme | |
if (srcElement.tagName === 'IMG') { | |
var width = srcElement.width; |
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
ytVideoUrlMatcher = r'url_encoded_fmt_stream_map=url=([^&]*)&' | |
ytVideoInfoUrlBase = 'http://www.youtube.com/get_video_info?html5=1&video_id=' | |
def getHTML5VideoFileFromYouTube(videoId): | |
videoInfoUrl = ytVideoInfoUrlBase + videoId | |
videoInfoFile = urllib2.urlopen(videoInfoUrl) | |
videoInfo = urllib2.unquote(videoInfoFile.read()) | |
vidMatch = re.search(ytVideoUrlMatcher, videoInfo) | |
videoUrl = vidMatch.groups(0)[0] |