Skip to content

Instantly share code, notes, and snippets.

View alanshaw's full-sized avatar
🌶️
https://storacha.network

ash alanshaw

🌶️
https://storacha.network
View GitHub Profile
@alanshaw
alanshaw / mad.md
Last active March 7, 2018 15:42
Mad science ideas
  • Hack breach to support compile to JS languages "natively" <script type="text/coffeescript"/>
  • Trumpet for jade
  • Semantic tag - semantically depend on tagged git repos
  • Install firmata - node module to install firmata on arduino
  • iotscript - javascript subset compiles to C
  • js media queries media ('width < 500px') => {} Modernizr.mq
  • Integration testing with tape & jquery - tape-head
  • browserify cdn on IPFS
  • CSX - CSS that compiles into HTML
$ node
> function foo () {return this}
undefined
> foo.call(9)
{}
> foo.call("bar")
{ '0': 'b',
  '1': 'a',
 '2': 'r' }
@alanshaw
alanshaw / exercises.js
Created October 7, 2014 08:41
Exercise questions covering arguments, arrays, functions, call, apply and closures
/*
Create a module that logs out arguments to a function on separate lines.
I should be able to call the module as follows:
*/
var argLogger = require('./arg-logger');
argLogger('foo', 3, {}, function () {});
// Expected output:
// foo
@alanshaw
alanshaw / ln-subl.sh
Created November 11, 2014 11:10
Sublime from command line
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
@alanshaw
alanshaw / mf2t.md
Last active August 29, 2015 14:11
Slides for Meat Fighter 2 Turbo talk - Meteor London December 2014

Alan Shaw
@_alanshaw
tableflip.io


An experiment with meteor and websockets.

I wanted to see if I could build a game with Meteor.


@alanshaw
alanshaw / lasercat.js
Created June 27, 2015 16:20
lasercat + xbox controller
var five = require('johnny-five')
var XboxController = require('xbox-controller')
var xbox = new XboxController()
var board = new five.Board()
board.on('ready', function () {
console.log('board ready')
var pan = new five.Servo(9)
var tilt = new five.Servo(13)
@alanshaw
alanshaw / dependency-jockey.js
Created August 19, 2015 15:35
The most simple dependency injector
// mod.js
module.exports = function (dep1, dep2, rest) {
/* ... */
}
// main.js
var dj = require('dependency-jockey')()
@alanshaw
alanshaw / the-platform-ideas.md
Created September 1, 2015 10:48
Ideas for "the platform"

the-platform-ideas

Ideas for "the platform"

What do we want?

A solution for customers that want a simple website, on a tight budget, but still want to be able to change content when they like.

  • Dumb servers serving static html
  • Fancy client side app with a super simple interface
  • Built using tech we're familar with
@alanshaw
alanshaw / going-live.md
Last active October 26, 2015 19:39
Things to look for and do when going live

Before deploy checklist

  • Has the client setup a direct debit for the ongoing hosting costs?
  • Do we have a SSL certificate and do we need it to be a wildcard?
  • Is the SSL certificate in the 1password vault?
  • Do we have administrative DNS logins, and are they saved in the 1password vault?
  • Have we created accounts for email (mandrill), uploads (uploadcare), payments (stripe) etc.
  • Are the site configuration files in the 1password vault?
  • Do we have a google analytics key & is it in the 1password vault?
  • Is there an infrastructure project?
  • Does the infrastructure project have configurations for "dev", "next" and "production"?
@alanshaw
alanshaw / adventure.md
Last active October 27, 2015 07:45
The JavaScript adventure

JavaScript adventure

It begins.

Your adventure starts with a HTTP GET http://...


"RAAA! I am the Lord of the conch! Hit me with your rhythm stick."

You have a piece of the conch.