Skip to content

Instantly share code, notes, and snippets.

View angus-c's full-sized avatar

angus croll angus-c

View GitHub Profile
<!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>
<!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">
<!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">
/*
* 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') {
@angus-c
angus-c / I_can_haz_10.lol
Created April 28, 2011 18:32
I can haz 10?
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
@angus-c
angus-c / variables.js
Created May 21, 2011 16:51
variable decalration
//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
@angus-c
angus-c / jqueryBug.js
Created June 1, 2011 03:15
adding event handler to the <html> element in IE<9 will crash jquery 1.5.2
/*
* 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
/************************************************/
@angus-c
angus-c / gist:1081818
Created July 14, 2011 02:08 — forked from max-mapper/gist:1007605
BS ≈ BreakfastScript
Conditionals
( false :)
console.log "if"
:( true )
console.log "else if"
:()
console.log "else"
@angus-c
angus-c / wackyRandomizer.js
Created July 20, 2011 06:12
Wacky Randomizer
/*
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()
@angus-c
angus-c / firstClass.dart
Created October 10, 2011 18:30
first class functions in dart
main() {
print((function(x) => x + 1)(multiply(6, 6)));
}
var multiply = function(a, b) {return a * b;};