On Github EvilFaeton / solab-talk
Created by Sergey Efremov / @evilfaeton
Better Career Decision.
Wat by Destroyallsoftware
Write once, run everywhere
It's coffee, everyone loves coffee
Thanks to DHH. Ruby Drama
#Coffeescript
a = (test) ->
for t in test
t.toUpperCase() unless t?
#Javascript
var a;
a = function(test) {
var t, _i, _len, _results;
_results = [];
for (_i = 0, _len = test.length; _i < _len; _i++) {
t = test[_i];
if (t == null) {
_results.push(t.toUpperCase());
} else {
_results.push(void 0);
}
}
return _results;
};
class A
constructor: ->
@options =
twitter: 'ok'
lead: (b) ->
jQuery.drop( (event, ui) =>
console.log @options
)
class B extends A
lead: (a, b) ->
console.log "Ok"
var A, B,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
A = (function() {
function A() {
this.options = {
twitter: 'ok'
};
}
A.prototype.lead = function(b) {
var _this = this;
return jQuery.drop(function(event, ui) {
return console.log(_this.options);
});
};
return A;
})();
B = (function(_super) {
__extends(B, _super);
function B() {
return B.__super__.constructor.apply(this, arguments);
}
B.prototype.lead = function(a, b) {
return console.log("Ok");
};
Still Javascript...but with Ruby/Python
# Assignment: number = 42 opposite = true # Conditions: number = -42 if opposite # Functions: square = (x) -> x * x # Arrays: list = [1, 2, 3, 4, 5] # Objects: math = root: Math.sqrt square: square cube: (x) -> x * square x # Splats: race = (winner, runners...) -> print winner, runners # Existence: alert "I knew it!" if elvis? # Array comprehensions: cubes = (math.cube num for num in list)
Frameworks, Templating — that's not our work
Sprokets
bind = (ctrl) => -> ctrl.updateScrollbar() if ctrl.updateScrollbar
And it's more simple — write less do more
jQuery isn't about it
Created by Ekaterina Bulatova / @KathieKiwi
Sad But True
Created by Ekaterina Bulatova / @KathieKiwi