Skip to content

Instantly share code, notes, and snippets.

View benjie's full-sized avatar

Benjie benjie

View GitHub Profile
@benjie
benjie / keybase.md
Created September 23, 2014 08:26
Proof that I am me.

Keybase proof

I hereby claim:

  • I am Benjie on github.
  • I am benjie (https://keybase.io/benjie) on keybase.
  • I have a public key whose fingerprint is 0AB7 7AB7 64BA A5D3 7A75 8820 42C2 D0EA 4A63 0ED6

To claim this, I am signing this object:

@benjie
benjie / LEDs.md
Last active August 29, 2015 14:07
LEDs for Dalek

Under Skirt Lights:

Left & Right R, G, B

7-8 LEDs in series depending on colour

  • 6x CC @ 50mA, 24V

Left & Right white LED lamp

@benjie
benjie / README.md
Last active January 17, 2023 15:16
Long Live CoffeeScript and Long Live ES6

Long Live CoffeeScript and Long Live ES6

Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to use these cool features now. I was reading [Replace CoffeeScript with ES6][replace coffeescript] by [Blake Williams][] and thought it was a great summary of how ES6 solves many of the same problems that CoffeeScript solves; however I'd like to comment on a few of Blake's points and talk about why I'll be sticking with CoffeeScript.

Classes

Classes in ES6 (like many of the syntax changes in ES6) are very similar to the CoffeeScript equivalent. To support browsers that are not fully ES5 compliant (e.g. IE8-), however, we still can't really use getters/setters, so ignoring these the comparison is:

@benjie
benjie / .asoundrc
Created February 15, 2015 14:24
Dalek Audio
pcm.ladspa {
type ladspa
slave.pcm "plughw:1,0"
path "/usr/lib/ladspa"
capture_plugins [
{
label lsFilter
input {
controls [ 1 2200 ]
@benjie
benjie / storage.dot
Last active August 29, 2015 14:17
So Make It "Big Project" storage flowchart
digraph G {
overnight [label="So you want to\nstore something\novernight?", color="green", style="filled"];
nope [label="Look at some\nother diagram\nthen!", shape="box"];
are_you_a_member [label="Are you a member?", color="green", style="filled"];
does_it_fit [label="Does it\nfit in your\nmember box?", color="green", style="filled"];
non_member [label="Talk to a\nkeyholder/trustee", shape="box"];
get_a_box [label="Talk to a trustee\nabout getting a\nmember box", shape="box", color="green", style="filled"];
put_in_box [label="Stick it in then,\nall's good", color="green", style="filled", shape="box"];
how_long [label="How long would\nyou like to\nstore it for?"];
couple_nights [label="Ask a Keyholder"];
@benjie
benjie / README.md
Created April 2, 2015 21:20
DOOR NOTES

Notes on installing the door-controller

DO NOT FOLLOW THESE NOTES, THEY ARE HACKS!

Do not install node from apt, install v0.10.x (x = 28)

Use gpio-admin from pull request #6 romilly/quick2wire-gpio-admin#6

Make similar changes to pi-gpio node module

@benjie
benjie / something_like_this.sh
Created April 17, 2015 20:49
Members Area rough instructions
git clone https://github.com/somakeit/somakeit-members-area.git
cd somakeit-members-area
npm install
./node_modules/.bin/members migrate
./node_modules/.bin/members seed
npm start
@benjie
benjie / dalek
Last active August 29, 2015 14:20
Dalek Notes
#!/bin/sh
### BEGIN INIT INFO
# Provides: dalek
# Required-Start: $local_fs $syslog $bluetooth
# Required-Stop: $local_fs $syslog $bluetooth
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Description: Dalek control software
### END INIT INFO
@benjie
benjie / CoffeeScriptReasons.md
Last active November 4, 2016 15:43
Reasons CoffeeScript is still relevant for me

I'm often asked why I still use CoffeeScript rather than ES6/7. Well, in truth I use both, but I do still prefer CoffeeScript for the following reasons:

  • Correctly trimmed multiline strings (ES6 includes the indentation because it doesn't have significant whitespace)
  • Existential operator (a?.b; b?(); a?.b?() and of course a ? b)
    • a ? b is more appropriate than a || b if "" or 0 are values of a you wish to persist
    • (a && a.b && typeof a.b === 'function') ? a.b() : undefined doesn't quite have the same ring to it as a?.b?()
  • Significant whitespace
    • (a personal preference, but since you already lay your code out sensibly why do you need the additional visual distraction of braces?)
  • Convenient shorthand for common things (-> (regular non-bound function), @ (this.), :: (.prototype.))
  • in to check if something in a list
@benjie
benjie / npm-shrinkwrap.json
Created February 25, 2016 08:28
Members Area shrinkwrap
{
"name": "members-area",
"version": "0.4.0",
"dependencies": {
"addressparser": {
"version": "0.3.2",
"from": "addressparser@>=0.3.2 <0.4.0",
"resolved": "https://registry.npmjs.org/addressparser/-/addressparser-0.3.2.tgz"
},
"amdefine": {