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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="chart"></div> |
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
function importNode(node, allChildren, doc) { | |
var a, i, il; | |
doc = doc || document; | |
try { | |
return doc.importNode(node, allChildren); | |
} catch (e) { | |
switch (node.nodeType) { | |
case document.ELEMENT_NODE: | |
var newNode = doc.createElementNS(node.namespaceURI, node.nodeName); | |
if (node.attributes && node.attributes.length > 0) { |
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
function isAnimatedGif(src, cb) { | |
var request = new XMLHttpRequest(); | |
request.open('GET', src, true); | |
request.responseType = 'arraybuffer'; | |
request.addEventListener('load', function () { | |
var arr = new Uint8Array(request.response), | |
i, len, length = arr.length, frames = 0; | |
// make sure it's a gif (GIF8) | |
if (arr[0] !== 0x47 || arr[1] !== 0x49 || |
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
// @author Rob W http://stackoverflow.com/users/938089/rob-w | |
// @name getTextBoundingRect | |
// @param input Required HTMLElement with `value` attribute | |
// @param selectionStart Optional number: Start offset. Default 0 | |
// @param selectionEnd Optional number: End offset. Default selectionStart | |
// @param debug Optional boolean. If true, the created test layer | |
// will not be removed. | |
function getTextBoundingRect(input, selectionStart, selectionEnd, debug) { | |
// Basic parameter validation | |
if(!input || !('value' in input)) return input; |
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
// include https://github.com/camupod/CSSMatrix/blob/browserified/CSSMatrix.js | |
// create a matrix from a CSS matrix transform string | |
var matrix1 = new CSSMatrix('matrix(1, 2, 3, 4, 5, 6)'); | |
var matrix2 = new CSSMatrix('matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)'); | |
// create a matrix from matrix values | |
var matrix3 = new CSSMatrix(1, 2, 3, 4, 5, 6); | |
var matrix4 = new CSSMatrix(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Teledraw Canvas Example</title> | |
<style type="text/css"> | |
html, body { | |
background: #888; | |
} |
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
#!/bin/bash | |
emcc helloworld.cpp -o helloworld.js \ | |
-s EXPORTED_FUNCTIONS="['_HW_constructor','_HW_destructor','_HW_setX','_HW_getX']" | |
cat helloworld-proxy.js >> helloworld.js |
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
/* ... */ | |
.crocodoc-page-svg { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
top: 0; | |
left: 0; | |
} |
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
/* ... */ | |
.page-transitions .page-layer { | |
/* cheating a bit and adding a transition to "all" properties */ | |
transition: all 0.3s; | |
} | |
.page-layer:first-child, | |
.page-exploded .page-layer { | |
background: rgba(255,255,255,0.03); |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Demo</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="CSSMatrix.js"></script> | |
<style> | |
body { | |
background-color: #282828; |
NewerOlder