This file contains hidden or 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
| window.onload = init; | |
| function init(){ | |
| var ImageLoader = function(args, callback){ | |
| // Usage: new ImageLoader({ | |
| // 'img1':'/url/to/img1', | |
| // 'img2':'/url/to/img2',}, cb); | |
| // Returns: {'img1': [Image], 'img2': [Image]} | |
This file contains hidden or 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
| window.onload = init; | |
| function init(){ | |
| var canvas = document.createElement('canvas'); | |
| document.body.appendChild(canvas); | |
| canvas.width = 400; | |
| canvas.height = 400; | |
| var ctx = canvas.getContext('2d'); | |
This file contains hidden or 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
| <audio autoplay loop> | |
| <source src="https://dl.dropboxusercontent.com/u/18982788/starwars.mp3" /> | |
| </audio> |
This file contains hidden or 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
| p{ | |
| font-family: verdana; | |
| font-size: 12px; | |
| } |
This file contains hidden or 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
| window.onload = init; | |
| function init(){ | |
| // -- Sprite Management Api -- // | |
| var rectangular_intersection = function(r1, r2){ | |
| var t1 = [r1[0], r1[0] + r1[2], r1[1], r1[1] + r1[3]]; | |
| var t2 = [r2[0], r2[0] + r2[2], r2[1], r2[1] + r2[3]]; | |
| return !(t2[0] > t1[1] || | |
| t2[1] < t1[0] || | |
| t2[2] > t1[3] || |
This file contains hidden or 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
| <div id="qunit"></div> | |
| <div id="qunit-fixture"></div> |
This file contains hidden or 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
| import operator | |
| import collections | |
| class Rule(object): | |
| def __init__(self, logic, left=None, right=None, op=None, inv=False): | |
| self.logic = logic | |
| self.left = left | |
| self.right = right | |
| self.op = op | |
| self.inv = inv |
This file contains hidden or 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> | |
| <title>Sup</title> | |
| <script src="http://d3js.org/d3.v3.min.js"></script> | |
| <script type="text/javascript"> | |
| window.onload = function(){ | |
| var schema = { | |
| fields: [ | |
| {name: 'first_name', type: 'text', display: 'First Name'}, |
This file contains hidden or 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> | |
| <title>Reddit JSON</title> | |
| <style> | |
| body{ background-color: #C6C6C6; } | |
| #content div { | |
| border: 1px solid #000000; | |
| margin: 5px; | |
| padding: 5px; |
This file contains hidden or 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
| class Entity(object): | |
| def __init__(self, name): | |
| self.name = name | |
| class Powered(object): | |
| def is_on(self): | |
| return self.state == 'on' | |
| class Machine(Entity, Powered): | |
| def __init__(self, name, state): |