Skip to content

Instantly share code, notes, and snippets.

View brianarn's full-sized avatar

Brian Sinclair brianarn

View GitHub Profile
@brianarn
brianarn / Cube-of-Cubes.markdown
Created January 11, 2015 21:18
Cube of Cubes

Cube of Cubes

I attended this event and the talk was pretty great! Based on the talk and a little poking at documentation / Stack Overflow, I was able to easily put together this cube of cubes.

A Pen by Brian Arnold on CodePen.

License.

/**
* MooCrash
* A MooTools plugin to crash IE6
* v0.0.1
*
* Licensed under MIT license, so, y'know, feel free to take it
* http://www.opensource.org/licenses/mit-license.php
* Inspired by jQuery Crash, written because @jsconf asked for it
*
* Extending Browser, since that seems to be the right place for it.
@brianarn
brianarn / blinkify.js
Created May 10, 2010 17:57
Bringin' blinkin' back
(function () {
var blinktags = document.getElementsByTagName('blink'), len = blinktags.length, vis = 'hidden', i;
if (len > 0) {
setInterval(function () {
for (i = 0; i < len; i++) blinktags[i].style.visibility = vis;
vis = vis === 'visible' ? 'hidden' : 'visible';
}, 500);
}
})();
@brianarn
brianarn / gist:1463450
Created December 11, 2011 23:22 — forked from padolsey/gist:1463408
`given(d).define(m)` - an alternative to `define(d,m)`
function given(dependencies) {
return {
define: function(id, module) {
if (!module) {
// Assume the first arg is the module
module = id;
id = undefined;
}
return define(id, dependencies, module);
}
@brianarn
brianarn / django_settings.py
Created January 31, 2012 17:43 — forked from jcroft/django_settings.py
Preventing comment spam
COMMENTS_SECRET = 'any_old_string_you_like'
@brianarn
brianarn / gist:2726190
Created May 18, 2012 16:21
Cleanup tweak for Ben
(function(){
document.write('<iframe src="http://www.yourwebsite.com/path/embed.html" width="100%" border="0" frameBorder="0" style="border:0;" id="the-embed-id"><' + '/iframe>');
var the_iframe = document.getElementById('the-embed-id'),
offsetWidth = the_iframe.offsetWidth, newHeight = '60px';
if (offsetWidth < 300) {
newHeight = '600px';
} else if (offsetWidth < 400) {
newHeight = '300px';
} else if (offsetWidth < 600) {
@brianarn
brianarn / underscore_conditionals.js
Created May 4, 2010 22:37
Conditionals with underscore.js
// A means of using underscore.js to do templates with conditionals
// Inside of underscore's template, it returns a function that uses
// 'with' on a variable named obj, and you can touch into that using
// inline JS and <% %> wrappers
// A template with conditional display of last names:
var good = _.template("Hello: <%= name %> <% if (obj.lastname) { %> <%= lastname %> <% } %>");
// A template that tries to do that, but fails:
var bad = _.template("Hello: <%= name %> <% if (lastname) { %> <%= lastname %> <% } %>");
@brianarn
brianarn / EsriLoader.js
Last active December 16, 2015 01:39 — forked from stdavis/EsriLoader.js
define(function () {
// summary:
// A dojo loader plugin for loading esri modules so that
// they get ignored by the build system.
return {
load: function (id, require, callback) {
// id: String
// esri module id
// require: Function
// AMD require; usually a context-sensitive require bound to the module making the plugin request
@brianarn
brianarn / MyStore.js
Last active December 17, 2015 13:10
Extended dojo/store/JsonRest with ability to mutate the server response
define([
"dojo/_base/declare",
"dojo/store/JsonRest",
"dojo/store/util/QueryResults"
], function(declare, JsonRest, QueryResults){
return declare(JsonRest, {
query: function(query, queryOptions){
// Issue original query
var results = this.inherited(arguments);
@brianarn
brianarn / commit.log
Created July 15, 2013 04:48
Biggest commit ever
<snip thousands of file names>
Transmitting file data .........................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................