A free, self-hosted alternative to Heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Transducer (architect astronaut speak): | |
// * a powerful and composable way to build algorithmic transformations | |
// | |
// Transducer (laymans speak): | |
// * a generic and composable way to operate on a collection of values, | |
// * producing a new value or a new collection of values. | |
// | |
// The word transducer itself can be split into two parts that reflect | |
// this definition. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log([0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((x) => x + 1)); | |
console.log([1, 2, 4, 5, 6, 7, 7, 8, 9, 10].filter((x) => x % 2 === 0)); | |
console.log([0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
.map((x) => x + 1) | |
.filter((x) => x % 2 === 0)); | |
const mapIncReducer = (result, input) => result.concat(input + 1); | |
console.log([0, 1, 2, 3, 4, 5, 6, 7, 8, 9].reduce(mapIncReducer, [])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Opened mongoose connection | |
Successfully created and inserted new records | |
--------- | |
Black 2016 BMW 135is | |
Silver 2016 BMW 335is | |
Red 2016 BMW 535is | |
Alpine White 2016 BMW M6 | |
--------- | |
UPDATED: | |
Japan Red 2016 BMW M6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
class Car { | |
constructor(year, make, model, convertible) { | |
this.year = year; | |
this.make = make; | |
this.model = model; | |
// default parameters, much? | |
if (typeof convertible === 'undefined') { | |
this.convertible = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> time node sandwich.js | |
-> making a burger for marc | |
-> making a pb&j for mike | |
-> making a reuben for shawn | |
<- shawn's reuben is ready in 1399ms | |
<- mike's pb&j is ready in 1478ms | |
<- marc's burger is ready in 3327ms | |
node sandwich.js 0.08s user 0.02s system 2% cpu 3.431 total | |
$> time node sandwich.js | |
-> making a burger for marc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var todos = ["Learn React", "Make a Cool Thing", "Retire Early"]; | |
// This is our top-level Component, we render this | |
const TodosComponent = props => { | |
const Todos = renderTodos(props.todos); | |
return ( | |
<ul> | |
{ Todos } | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RockScore | |
returns 0 for unpopular terms | |
returns 10 for popular terms | |
returns mediocre results for mediocre terms | |
does not divide by zero | |
ScoreCache | |
returns cached scores if they exist (FAILED - 1) | |
when the term is not cached | |
recomputes scores (FAILED - 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.infoq.com/presentations/Simple-Made-Easy | |
http://www.infoq.com/presentations/integration-tests-scam | |
http://blog.thecodewhisperer.com/2010/09/14/when-is-it-safe-to-introduce-test-doubles | |
http://youtu.be/yTkzNHF6rMs | |
http://pyvideo.org/video/1670/boundaries | |
http://skillsmatter.com/podcast/ajax-ria/enumerators | |
http://alistair.cockburn.us/Hexagonal+architecture | |
http://c2.com/cgi/wiki?PortsAndAdaptersArchitecture | |
http://www.confreaks.com/videos/977-goruco2012-hexagonal-rails | |
http://www.confreaks.com/videos/1255-rockymtnruby2012-to-mock-or-not-to-mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# $> runner.sh <lib> <spec> | |
# Demo: http://recordit.co/7eR5hp1BP1 | |
watch_dir=$1 | |
watch_dir2=$2 | |
dir_hashes () { | |
find $1 $2 -type f -exec md5 '{}' ';' | awk '{print $4}' |