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 src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script src="http://code.jquery.com/jquery-git2.js"></script> | |
<title>bouncer</title> | |
</head> | |
<body> | |
<svg id="box" class="space" style="border: 1px solid; width: 400px; height: 400px" height="100%"></svg> |
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 src="http://cdnjs.cloudflare.com/ajax/libs/rxjs/2.3.22/rx.all.js"></script> | |
<title>bouncer</title> | |
</head> | |
<body> | |
<svg id="box" class="space" style="border: 1px solid; width: 400px; height: 400px" height="100%"></svg> | |
<script id="jsbin-javascript"> |
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 src="http://fb.me/react-with-addons-0.12.2.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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
/* | |
* based on https://gist.github.com/sebmarkbage/fac0830dbb13ccbff596 | |
* by Sebastian Markbåge | |
*/ | |
import React from 'react'; | |
const noop = () => {}; | |
const es6ify = (mixin) => { | |
if (typeof mixin === 'function') { |
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
HAI | |
CAN HAS STDIO? | |
I HAS A VAR | |
IM IN YR LOOP | |
UP VAR!!1 | |
VISIBLE VAR | |
IZ VAR BIGGER THAN 10? KTHXBYE | |
IM OUTTA YR LOOP | |
KTHXBYE |
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
//one statement - all on one line - good for short, similar purpose vars | |
var foo = [], bar = [], buzz = []; | |
//multiple var statements - good for large number or disperate purpose vars | |
var a = 12; | |
var collate = false; | |
var foo = [1,2,3,4]; | |
var circle = {radius: 2, color: blue}; | |
//one statement on multiple lines, no indent |
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
/* | |
* probably not good practice to attach event handlers to the <html> element but... | |
*/ | |
//IE < 9 throws operation not supported error just on property existence check (not function invocation) | |
typeof $('html')[0]; //"unknown" | |
$('html')[0].removeAttribute //throws operation not supported error | |
/************************************************/ |
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
Conditionals | |
( false :) | |
console.log "if" | |
:( true ) | |
console.log "else if" | |
:() | |
console.log "else" | |
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
/* | |
Iterates every Math function in random order, with random arguments, | |
then randomly adds or subtracts each result and rounds the grand total. | |
Typical output: | |
+ tan(9) | |
+ sqrt(0) | |
- sin(0) | |
+ random() |
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
main() { | |
print((function(x) => x + 1)(multiply(6, 6))); | |
} | |
var multiply = function(a, b) {return a * b;}; |