Skip to content

Instantly share code, notes, and snippets.

View benjie's full-sized avatar

Benjie benjie

View GitHub Profile
@benjie
benjie / ruby2coffee.vim
Last active December 16, 2015 15:39
Do the grunt work of converting Ruby to CoffeeScript (specifically to translate gocardless-ruby)
" This file is designed to translate GoCardless' Ruby code into some
" semblance of CoffeeScript to make manual translation faster.
"
" (c) 2013 Benjie Gillam (@Benjie)
" Requires (at least):
" - vim
" - http://github.com/michaeljsmith/vim-indent-object
set nosmartcase
###
fix-stylus-css.coffee
(c) Benjie Gillam 2013
Fix an issue related to stylus' nested media query handling.
Converts broken CSS like this:
@media all and (min-height: 501px) {
.scrollHead,
@benjie
benjie / tigpull
Last active December 19, 2015 05:58
Tig Pull - perform a `git pull` and then have `tig` open with the changes ready for review
alias 'tigpull'='RANGE=$(git -c color.ui=on pull | tee /dev/tty | grep "^Updating .*\.\." | sed "s/Updating //"); if [ "$RANGE" != "" ]; then tig $RANGE; fi'
@benjie
benjie / Entry-Proposal.md
Last active January 3, 2016 05:29
The purpose of this document is to specify who should be able to let themselves into the space and when. It does not specify the technical method use to implement the access restrictions - think of it as a specification the Door Entry System should comply to.

Benjie's Space Entry Proposal

Purpose

The purpose of this document is to specify who should be able to let themselves into the space and when. It does not specify the technical method use to implement the access restrictions - think of it as a specification the Door Entry System should comply to.

@benjie
benjie / README.md
Last active August 29, 2015 13:56
Mocha uncaughtException workaround

Workaround Mocha's Assertion Catching

(For Node.js only.)

To protect mocha tests (and before and after commands) from uncaught exceptions, in each test file:

{protect} = require './test_helper'
protect()
@benjie
benjie / README.md
Created March 6, 2014 10:51
Source map support for running CoffeeScript with `coffee`

DIY CoffeeScript source map support

CoffeeScript already has source map support via the -m flag, but you have to compile the .coffee first and then run the .js with node for it to be effective. Running the .coffee directly with coffee seems to have no source map support.

This hack recalculates (and caches in memory) the source map on the fly so it can be imported into the excellent source-map-support module. It's disabled if you run the compiled JS file directly (as you would in production) because it assumes the source maps will already have been generated.

@benjie
benjie / Storage.md
Last active August 29, 2015 13:57
Storage of Personal Stuff

Storage Proposal

NOTE: in this proposal I use the term "users" to refer to "So Make It Members" and the newly proposed "Friends of So Make It", or, more specifically, "Supporters" since they need to pay a monthly subscription. Friends may have to jump a few more hoops to store their stuff here (e.g. have turned up a few time and thus become known to the community) but are treated basically equivalently to Members.

The space can provide storage for it's users, but storage is at a premium. Users' items should be stored only inside authorised storage boxes.

How much can I store?

The amount a user can store is based on their subscription level (and available space). The first £15/mo covers basic usage of the space (no storage), above this the allowance is allocated as follows:

@benjie
benjie / Jof_Checklist.md
Last active August 29, 2015 14:01
A checklist for Jof for when shit ain't workin'

Try these before contacting Benjie... :)

Frontend

  • git status to ensure local changes aren't breaking things (don't forget to check the untracked files too)
  • npm install
  • Restart grunt ensuring all old nodemon instances are well and truly dead

API

About Us

A non-profit friendly and inclusive place for people who like making things (physical, digital or otherwise) to share knowledge, experience and tools.

The interests of the current membership focus on subjets of wood- and metal-work, costume and prop design, photography, 3D printing, microcontrollers, robotics, home automation and programming. We have a wide array of tools available to facilitate these activities and are constantly looking to expand our offering.

@benjie
benjie / presentation.md
Created July 3, 2014 20:40
Southampton Shed Presentation

Southampton Makerspace

A brief introduction by Benjie Gillam

What is a Makerspace?

  • Community Workshop
  • Friendly