Sunday, September 27, 2015

AppNexus meetup

AppNexus meetup
2009

akka model

other concurency models
thread
process
futures (no state)
CSP(channels)

actor is persistent (exist even dont do anything )
has internal state
create actors
receive messages and do something
send message
process 1 message at a time (has inbox queue)

w: mutex (lock)
w: race conditions

'Best effort' delivery
at-most-once delivery
message can take arbitrary long time to deliver
no message order garantee

Has address
indentifies an actor or balancer
may represent  proxy forwarder or actor
location transperency
address can be remote
actor can have many addresses

supervision - monitors state of actor (usually other actor)

Supervision tree
address dont change on restart
mailbox is persistent outside of actor
you can kill actor and inbox will be persistent

use cases:
processing pipeline
streaming data
multi-user concurrency
system hight uptime requirements (ericson)
apps with shared state

breaking up the work for many actors

anti-use cases:
performance critical applications
non concurrent
synchronous and stateless










Coding standards globaldev

globaldev/standards · GitHub:


Monday, September 7, 2015

ES6 - Next Javascript

1. Proper tail call (recursion without using caller scope)
tail call - last instruction should be a fun without using caller scope
close call
tail position
max recursion number ~10,000 in ES5

2. Temporal Temp Zone- trows error

3. google traceur-compiler
https://google.github.io/traceur-compiler/demo/repl.html#
there is cmd tool

4. Rest parameters
fun (a, b, ...rest) {
}

4. Spead operator

5. Distructing object
let {name, age} = obj;
fun({name, age}) {}

5.1 Refutable pattern:
let {name:firstName = 'Unknown', age, ?phone} = user;
let ?{name, age, pone} = user;

#irefutable/refutable  - undeclared, undefined

let ?{x:a=1} = undefined
let {?x:a=1} = {}

5.2 Destructing array
in method signature:  fun([a, b, ...rest]) {}
var [a, b, ?c] = [1,2];
var ?[a, c] = [];

6. Arrow functions 


Laravel vagrant laravel/homestead (ssh issue)

Issue: 
trying to ssh, ssh timeout, password was not set for vagrant username

cred: vagrant@vagrant

config.ssh.username = 'vagrant'
config.ssh.password = 'vagrant'
config.ssh.insert_key = 'true'  #this will insert public ssh key to authorized_hosts

https://laracasts.com/discuss/channels/general-discussion/fortgot-vagrant-password
http://stackoverflow.com/questions/25758737/vagrant-login-as-root-by-default