Skip to content

Instantly share code, notes, and snippets.

@lvivier
lvivier / index.js
Last active May 17, 2017 08:04
requirebin sketch
const html = require('choo/html')
const choo = require('choo')
function Body(state, emit) {
return html`
<body>
<ul>
${state.todos.map(todo => (
html`<li>${todo.label}</li>`
))}
@lvivier
lvivier / retsmd.patch
Created July 19, 2016 22:23
Use RETS MD with a recent PHP (such as 5.6) with no warnings
commit 8dc0d08fb1979a6b6de39dbab514a0478cc7a844
Author: Luke Vivier <luke@vivier.ca>
Date: Tue Jul 19 15:20:50 2016 -0700
php 5.6 fixes
diff --git a/index.php b/index.php
index bd3fa0b..023be50 100644
--- a/index.php
+++ b/index.php
@lvivier
lvivier / keybase.md
Created February 9, 2016 19:07
keybase.md

Keybase proof

I hereby claim:

  • I am lvivier on github.
  • I am lvivier (https://keybase.io/lvivier) on keybase.
  • I have a public key ASAfU8QG9nHVM63j78ZJw9Q5i9jrPigB8-dBXlBw7yCd9Ao

To claim this, I am signing this object:

Property land use code values:

landUseGeneral Description
AG Agricultural
AP Apartment Building
CD Condominium
CI Commercial & Industrial
CM Commercial
CP Cooperative
@lvivier
lvivier / .jscsrc
Created August 27, 2015 17:30
hint files
{
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowMultipleSpaces": true,
"disallowMultipleVarDecl": {
"allExcept": ["undefined"]
},
"disallowNewlineBeforeBlockStatements": true,
"disallowOperatorBeforeLineBreak": ["."],
"disallowPaddingNewlinesInBlocks": true,
@lvivier
lvivier / lighthouse.md
Last active August 29, 2015 14:17
node.js intro notes for Lighthouse Labs

node intro

Some node stuff for Lighthouse Labs.

big ideas

  • javascript everywhere
  • modules
  • callbacks
  • events
@lvivier
lvivier / home.ejs
Last active August 29, 2015 14:15
Using EJS with express instead of jade
<!DOCTYPE html>
<h1><%= title %></h1>
@lvivier
lvivier / builder-stylus.js
Created May 29, 2014 21:32
A stupid Stylus plugin for component/builder2.js
var stylus = require('stylus')
module.exports = function (opts) {
return function (file, done) {
if (file.extension !== 'styl') return done()
file.read(function (err, str) {
if (err) return done(err)
stylus(str, opts)
.set('filename', file.filename)
@lvivier
lvivier / README.md
Last active August 29, 2015 13:56
Talking about TDD with the team

Test-driven development

Test-driven development (TDD) is a concept from [Extreme Programming][xp] and a cornerstone of most agile development methodologies. TDD describes a very short development cycle, which is repeated many times over the development of a module:

  1. write a failing test case
  2. make the test case pass
  3. refactor
  4. repeat

The goal of TDD is to produce modules that are easy to use and understand and which are fully documented by a suite of unit tests.

@lvivier
lvivier / avatar.js
Last active December 20, 2015 17:09
Return an avatar from a FirebaseSimpleLogin user object.
/**
* Only CommonJS is cool
*/
module.exports = avatar
/**
* Example:
* var avatar = require('avatar')
* var auth = new FirebaseSimpleLogin(db, function (err, user) {
* user.avatar = avatar(user)