Skip to content

Instantly share code, notes, and snippets.

@killroy42
killroy42 / gist:8278e9ae5d44e56ec4bd
Last active August 29, 2015 14:20
Error output from blank Chrom://downloads page issue with damaged profile
Uncaught Error: Assertion failed
assert @ assert.js:24
ItemView.getStatusText_ @ item_view.js:355
ItemView.update @ item_view.js:24
1Item.render @ item.js:46
Manager.updateAll @ manager.js:58
Manager.updateAll @ manager.js:206
(anonymous function) @ VM2125:1
@killroy42
killroy42 / Basic WebRtc Video.markdown
Last active August 29, 2015 09:47
Basic WebRtc Video
@killroy42
killroy42 / index.html
Last active October 26, 2015 11:31
Classic Leekspin
<html><head><script>
var loituma_ogg, audio, frame1, frame2, frame3, frame4, playButtonHtml, bodyCss, playing = false;
var imgUrls = new Array(4);
var frames = new Array(4);
document.addEventListener('DOMContentLoaded', function() {
document.body.parentNode.style.height = '100%';
document.body.style.cssText = bodyCss;
var i = frames.length; while (i--) {
frames[i] = new Image();
<html><head><script>
var map = Array.prototype.map;
var toArray = [].slice.apply.bind([].slice);
var p = Promise.resolve();
var htmlStyle = 'height: 100%; background: #000;';
var bodyStyle =
'height: 100%; margin: 0;'+
'text-align: center;'+
'color: grey;'+
'background-repeat: no-repeat;'+
function fetchRemoteImage(id) {
console.log('fetchRemoteImage(%s);', id);
var card = cards[id];
if(card === undefined) throw new Error('Card "'+id+'" not found.');
var url = 'http://hearthstone.gamepedia.com/'+encodeURIComponent(card.name.replace(/ /g, '_'));
return fetch(url)
.then(function(body) {
var m = body.toString('utf8').match(/<img alt="" src="([^"]+)" width="[^"]+" height="[^"]+" class="thumbimage"/);
var url = m[1].replace(/(\?.*)/, '');
m = url.match(/\.(png|jpg)$/);
@killroy42
killroy42 / Music player for streaming.markdown
Last active December 27, 2015 13:33
Music player for streaming
<html>
<style>
/*
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,300,400,700);
body {
font-family: 'Open Sans', sans-serif;
}
*/
body {
margin: 0;
function extrudeProfileOnPath(profileVs, outlineVs, sharedUVs) {
/*
TODO:
- if sharedUVs == false, create multiple UV layers
- Smooth according to edge angles
- Accept Shapes/CurvePaths directly
- Don't scale UVs along profile. Reuse reference profile
*/
var upVector = new THREE.Vector3(0, 1, 0);
var backVector = new THREE.Vector3(0, 0, -1);