Skip to content

Instantly share code, notes, and snippets.

View brianarn's full-sized avatar

Brian Sinclair brianarn

View GitHub Profile
@brianarn
brianarn / README.md
Created August 22, 2016 17:09
Random Docker things

As I learn about Docker and put together some things, I want to capture things in a place I can easily find later.

@brianarn
brianarn / keybase.md
Created April 15, 2016 20:36
keybase.md

Keybase proof

I hereby claim:

  • I am brianarn on github.
  • I am brianarn (https://keybase.io/brianarn) on keybase.
  • I have a public key whose fingerprint is D9E1 393A 2377 36EC 5BE5 6361 2662 4B1A 2AF3 B2AA

To claim this, I am signing this object:

@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.

@brianarn
brianarn / maths.js
Last active July 6, 2020 22:08
Module to wrap `console.group` around all methods
// A simple object with some methods,
// which throw errors when bad arguments are passed.
var maths = {
square : function (value) {
// Validity checking
if (arguments.length !== 1) {
throw new Error('square: Requires one and only one argument');
}
if (typeof value !== 'number') {
throw new Error('square: Requires numeric argument');
@brianarn
brianarn / oneweirdtrick.md
Last active October 22, 2020 23:04
One Weird Trick to never missing a console.log's output

One Weird Trick to never missing a console.log's output

Friends! Have you ever been developing, littered your code with console statements, and then realized you couldn't find what you were looking for? Have you ever wondered, "How can I make this console.log statement stand out in a crowd?"

WONDER NO MORE!

You can provide a special %c prefix to your logged string, and then all magical and printf-like, you can then provide some CSS to style up that line!

Here's a couple of examples that I was JUST using!

@brianarn
brianarn / commit.log
Created July 15, 2013 04:48
Biggest commit ever
<snip thousands of file names>
Transmitting file data .........................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
................................................................................
@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 / 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 / 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 / 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'