Skip to content
View programming-intro-4.js
// Driver
var driver = {
};
// enter
// turnKey
// fillTank
// Car
// start
View programming-intro-3.js
// review https://gist.github.com/lazywithclass/f42aab0ca8af0f17d5e8
// strings
// operations on strings
// given a string like this
// "1+2-5"
// use the above functions implemented in the exercise
// to provide the result
View programming-intro-ex1.js
// modellare le funzioni che riproducano
// + - * /
// modellare le funzioni che riproducano n^2 n^1/2
// utilizzando le funzioni sopra implementate
View programming-intro-2.js
// review programming-itro-1.js
// questions?
// no OOP, FP
// model a car
// break it up in units <-- !
// model a tyre
function spin(wheel) {
View programming-intro-1.js
// variables
// control flow
// functions
// lamp exercise
var on;
function turnOn() {
if (!isOn()) {
View Sample HAProxy conf with req.body logging
global
log 127.0.0.1 local0
user root
group root
daemon
defaults
log global
mode http
option httplog
View challenge.js
var async = require('async'),
request = require('request');
function traverse(start, token) {
var queue = [];
queue.unshift(start);
async.forever(function(next) {
if (queue.length === 0) next('no more items');
var item = queue.pop();
getAdjacents(item, token, function(err, adjacents) {
View remove-as-read.js
// these are to be pasted into the console
// remove by clicking on the up arrow
// the useful thing is that you remove comments and add the removed id to
// an array, so next time you know exactly what you've considered
// (use case might be monthly "Who is hiring?")
function remove(id) {
document.getElementById(id).parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.remove();
}
[].forEach.call(
View gist:099ef5ec61f870a07e56
{ [Error: SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed; shardFailures {[2sj2k_hAQWKeObWgAzBZhw][events][0]:
SearchParseException[[events][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"filtered":{"filter":{"geo_distance":{"distance":"1km",
"geopoint":{"lat":48.507351,"lon":-0.127758}}}}}]]]; nested: SearchParseException[[events][0]: from[-1],size[-1]: Parse Failure [No parser for elemen
t [filtered]]]; }]]
status: '400',
message: 'SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed; shardFailures {[2sj2k_hAQWKeObWgAzBZhw][events][0
]: SearchParseException[[events][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"filtered":{"filter":{"geo_distance":{"distance":"1km
","geopoint":{"lat":48.507351,"lon":-0.127758}}}}}]]]; nested: SearchParseException[[events][0]: from[-1],size[-1]: Parse Failure [No parser for elem
ent [filtered]]]; }]' }
View Describing Y Combinator
// the original Y Combinator is here: https://leanpub.com/javascript-allonge/read#y
// have a look at that soup of function and return
// I refactored it down to the below version
// I hope is correct, too tired now.
// used like this
var factorial = Y(
// next
function(fac) {
return function(n) {
Something went wrong with that request. Please try again.