$ crontab -e
stop vim from saving tmp files temporarily for crontab
:set backupskip=/tmp/*,/private/tmp/*
0 22 * * * bash -c 'source /Users/sent-hil/.rvm/scripts/rvm && /usr/bin/env ruby /Users/sent-hil/Documents/play/single/twitter_status.rb'
vim /var/mail/sent-hil
> number++
15
> number
16
Expressions is small parts of a sentence: 1 + 2
Statement is full sentence: puts 1
Everything evaluates to a value in Ruby, so everything is an expression.
> h = function() { return 1};
> h
[Function] // ?
> function y () { return 1 };
> y
[Function: y]
In JS 4
is implemented as a primitive. When you do (4).toString(), it's temporarily put in a box that provides ability to call functions on it, like toString().
See: https://gist.github.com/3259846
function New(F) {
var o = {};
o.__proto__ = F.prototype;
return function () {
F.apply(o, arguments);
return o;
}
}
function Student (name) {
this.name = name;
};
Student.prototype.greet = function () {
console.log("Hi, ", this.name);
};
var nick = New (Student)("Nick");
nick.name; // Nick
nick.greet(); // Hi, Nick
var dave = new Student("Dave");
dave.name; // Dave
dave.greet(); // Hi, Dave