Skip to content

Instantly share code, notes, and snippets.

View gavinblair's full-sized avatar

Gavin Blair gavinblair

View GitHub Profile
@gavinblair
gavinblair / index.md
Last active December 15, 2015 04:29
Gavin Blair
@gavinblair
gavinblair / hero.md
Last active December 15, 2015 04:50
Do You Want to be a Hero?

March 20, 2013 - That’s a silly question. Of course you do. Who doesn’t?

Explode Code

WELL, here’s your chance. This Friday, March 22nd, you have the opportunity to rescue some of London’s best and brightest developers from a pizza-less Hello World! You can even wear a cape.

And that’s not all. The Explode Code team is looking for ongoing sponsorship for 2 event streams, which each run on a quarterly basis. The awesome people at Big Viking Games have kindly offered up their sweet space for all of our events, but we still need some help feeding bellies while we’re feeding minds. We’re looking for a generous sponsor (or group of sponsors) who can help us continue our series and build a stronger, more collaborative and more innovative developer community here in London.

Here’s the breakdown:

@gavinblair
gavinblair / numfader.js
Last active December 15, 2015 04:59
Object Oriented Javascript Example
/*
*
* numfader
* by Gavin Blair
* http://github.com/gavinblair
*
* usage:
* //create a new numfader object on an element
* var myfader = new numfader(document.getElementById("mydiv"));
*
@gavinblair
gavinblair / grunt.md
Last active December 15, 2015 07:39
My Grunt Setup

March 22, 2013 - I've been learning Grunt. It's awesome - I created a setup that watches your javascript files. Every time you update a file, it lints everything with JSHint, minifies, and runs your QUnit tests.

Check it out!

gav

Comments?

@gavinblair
gavinblair / .htaccess
Created May 9, 2013 15:53
Having trouble using svg files as background-images in css? Add these lines to your .htaccess file.
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
@gavinblair
gavinblair / fors.js
Created June 13, 2013 19:16
I have a bunch of loops, for different arrays. I just need some counters. When I do this, jshint says my variables k and l are already defined. Should I move on to other letters of the alphabet? Is there a better way?
for(var k in myarray){
for(var l in myarray[k]){
//do something with myarray[k][l]
}
}
for(var k in someotherarray){
for(var l in someotherarray[k]){
//do something with someotherarray[k][l]
}
You are surrounded by many doors. Each door has a sign on it.
$ ls
You are surrounded by many doors. Each door has a sign on it:
..
websites
documents
desktop
$ ssh [email protected]
<enter password>
# cd ~
# curl -sS http://getcomposer.org/installer | php
# php ~/composer.phar
# cd /websites
# php ~/composer.phar create-project laravel/laravel your-project-name
# cd your-project-name
# php ~/composer.phar install
@gavinblair
gavinblair / gist:6212885
Last active December 20, 2015 23:29
Open Council Strike Force

Open Council

Are you interested in bringing transparency to our city council?

The Project

When it comes to voting time, the only information most people have to help make their decision is what the politicians say about themselves and each other. This is not ideal, because the average citizen neither trusts politicians, nor has access to the information that they can use to make informed decisions.

Open Council will make council proceedings readily available to citizens, hopefully moving them to contact city council members with their thoughts, and make more informed choices when voting in municipal elections. This includes:

@gavinblair
gavinblair / gruntfile.js
Created October 3, 2013 19:01
gruntfile.js so far
module.exports = function(grunt){
var theme = 'mytheme';
var timestamp = grunt.template.today("yyyymmddhMMss");
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today() %> */\n'
},
build: {