Skip to content

Instantly share code, notes, and snippets.

Luke Barton lukebarton

  • United Kingdom
View GitHub Profile
@lukebarton
lukebarton / lifebit.js
Created Mar 20, 2018
If I were to make improvements, I'd sort out the interface and return values around the resolve and getConflicts functions - they could probably use new names too.
View lifebit.js
module.exports = {
makeRelationshipSet: () => ({
required: {},
conflicting: {}
}),
dependsOn: (package, requiredDependency, ruleSet) => {
initPackage(package, ruleSet);
initPackage(requiredDependency, ruleSet);
ruleSet.required[package].push(requiredDependency);
@lukebarton
lukebarton / lifebit.js
Created Mar 20, 2018
If I were to make improvements, I'd sort out the interface and return values around the resolve and getConflicts functions - they could probably use new names too.
View lifebit.js
module.exports = {
makeRelationshipSet: () => ({
required: {},
conflicting: {}
}),
dependsOn: (package, requiredDependency, ruleSet) => {
initPackage(package, ruleSet);
initPackage(requiredDependency, ruleSet);
ruleSet.required[package].push(requiredDependency);
View keybase.md

Keybase proof

I hereby claim:

  • I am lukebarton on github.
  • I am lukebarton (https://keybase.io/lukebarton) on keybase.
  • I have a public key whose fingerprint is CA37 954D 2064 4E28 72AC C953 0A3B B4D4 AB34 FAF5

To claim this, I am signing this object:

View default_parameters_bug.js
'use strict'
/**
* I'm using node 5.10.1 --harmony_default_parameters reporting v8 '4.6.85.31'
*
* [Bug] Default Parameters referring to class names do not work with Fat Arrow functions
* So I figured, maybe it's just a difference between Fat Arrow Functions and Full Functions,
* but then I realised that by declaring a Full Function referencing the class,
* it caused the Fat Arrow Function to execute fine. This tells me it's a bonafide bug.
*/
View gist:2227067
<?php
// Don't touch these
$elementLevel = array(
0 => 'zero',
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
5 => 'five',
6 => 'six',
@lukebarton
lukebarton / example.js
Created Jan 24, 2011
Underscore Example
View example.js
_.map([1, 2, 3], function(n){ return n * 2; });
_([1, 2, 3]).map(function(n){ return n * 2; });
You can’t perform that action at this time.