Skip to content

Instantly share code, notes, and snippets.

View cobbweb's full-sized avatar

Andrew Bucknall cobbweb

  • QLD, Australia
  • 02:13 (UTC +10:00)
View GitHub Profile
@cobbweb
cobbweb / flatMap.ts
Created November 23, 2018 04:15 — forked from kakajika/flatMap.ts
Array.prototype.flatMap method in TypeScript.
interface Array<T> {
flatMap<E>(callback: (t: T) => Array<E>): Array<E>
}
Object.defineProperty(Array.prototype, 'flatMap', {
value: function(f: Function) {
return this.reduce((ys: any, x: any) => {
return ys.concat(f.call(this, x))
}, [])
},
@cobbweb
cobbweb / backbone.collectioncache.js
Created November 8, 2012 23:38 — forked from tbranyen/backbone.collectioncache.js
Backbone.Collection caching by URL
/*!
* backbone.collectioncache.js v0.0.2
* Copyright 2012, Tim Branyen (@tbranyen)
* backbone.collectioncache.js may be freely distributed under the MIT license.
*/
(function(window) {
"use strict";
// Dependencies
@cobbweb
cobbweb / index.html
Created April 19, 2012 04:06 — forked from anonymous/css
jacksons
<!DOCTYPE HTML>
<html>
<head>
<!-- Head is the container for all of the head elements -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>QUT Video Gaming Society</title>
<!-- The title is what is shown in the window of the browser or in the tab of the browser -->
<meta name="description" content="Come join us play Video Games at QUT" />
<!-- This is the meta tag for the description of the website which will be given to search engines -->
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
@cobbweb
cobbweb / jQuery.support-transition.js
Created February 19, 2012 23:26 — forked from jonraasch/jQuery.support-transition.js
Extends the jQuery.support object to CSS3 transition
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function(){
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
return support;
})();