Skip to content

Instantly share code, notes, and snippets.

View leobalter's full-sized avatar
💭
status

Leo Balter leobalter

💭
status
  • GitHub Staff
  • Bay Area, CA
View GitHub Profile
  • 19.1.1 The Object Constructor

The Object constructor is designed to be subclassable. It may be used as the value of an extends clause of a class definition.

  • 19.2.1 The Function Constructor

(...) When Function is called as a function rather than as a constructor, it creates and initializes a new Function object. Thus the function call Function(…) is equivalent to the object creation expression new Function(…) with the same arguments.

The Function constructor is designed to be subclassable. It may be used as the value of an extends clause of a class definition. Subclass constructors that intend to inherit the specified Function behaviour must include a super call to the Function constructor to create and initialize a subclass instances with the internal slots necessary for built-in function behaviour. All ECMAScript syntactic forms for defining function objects create instances of Function. There is no syntactic means to create instances of Function subclasses except for the built-in Generator Fun

@leobalter
leobalter / karma.conf.js
Created November 12, 2015 23:01 — forked from frederickfogerty/karma.conf.js
Coverage + tests with webpack, babel, karma, mocha, and istanbul
var webpack = require('webpack')
module.exports = function (config) {
config.set({
browsers: [ 'Chrome' ], //run in Chrome
browserNoActivityTimeout: 60000,
singleRun: true, //just run once by default
frameworks: [ 'mocha' ], //use the mocha test framework
files: [
//'src/**/*.{jsx,js}',

Anotações da palestra feita pelo Leo Balter na QCon do Rio em 2015 sobre o Ecossistema de produção e lançamento de novidades e especificações do JavaScript.

  • Functions are first-class citizens, syntax resembles Java, inheritance is prototypal, and (+””) equals zero.
  • O JavaScript foi criado em 10 dias pelo Brendan Eich em 1995.
  • Quando falamos sobre o JS, nós falamos sobre muitas outras coisas que orbitam em volta da linguagem em si. Como o DOM, NodeJS ou o asm.js
  • Hoje ele passa por um caminho de evolução. Hoje ele ainda é feito por um grupo chamado Ecma. Que é como o ISO, onde eles criam padrões e o JS é feito se baseando nessa padronização.
  • O ES6 vem com muitas novidades. Algumas coisas principais: promises, generators, proxies, reflect, arrow functions, rest parameters, default parameters, class, Template
  • O ES7 vai trazer outras funcionalidades como async, SIMD, async generators
  • O ES7 pode desembarcar em 2016. Não vai ser tão agressivo quanto o ES6, mas a ideia é trazer as novidades em uma velo
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
var sensor = new five.Sensor({
pin: "A1",
freq: 100
});
var led = new five.Led(13);
var stored = 0;
Temperature: { celsius: 85, fahrenheit: 185, kelvin: 358.15 }
Temperature: { celsius: 33, fahrenheit: 91.4, kelvin: 306.15 }
Temperature: { celsius: 82, fahrenheit: 179.6, kelvin: 355.15 }
Temperature: { celsius: 40, fahrenheit: 104, kelvin: 313.15 }
Temperature: { celsius: 70, fahrenheit: 158, kelvin: 343.15 }
Temperature: { celsius: 81, fahrenheit: 177.8, kelvin: 354.15 }
Temperature: { celsius: 33, fahrenheit: 91.4, kelvin: 306.15 }
Temperature: { celsius: 81, fahrenheit: 177.8, kelvin: 354.15 }
Temperature: { celsius: 40, fahrenheit: 104, kelvin: 313.15 }
Temperature: { celsius: 87, fahrenheit: 188.6, kelvin: 360.15 }
@leobalter
leobalter / _css_dropdown_menu.markdown
Last active August 29, 2015 14:21 — forked from anonymous/index.html
CSS Dropdown Menu

CSS Dropdown Menu

('-' * 6)

A Pen by Leo Balter on CodePen.

License

Copyright (c) 2015 by Leonardo Balter
[~/dev/bocoup/stitchfix.github.io] (bocoup)
$ aws --profile bocoup s3 cp _site/ s3://stitchfix.bocoup.com --recursive --include \'*\' --acl \'public-read\'
usage: aws [options] <command> <subcommand> [parameters]
aws: error: argument --acl: Invalid choice, valid choices are:
private | public-read
public-read-write | authenticated-read
bucket-owner-read | bucket-owner-full-control
log-delivery-write
@leobalter
leobalter / gecko-spidermonkey.md
Last active February 26, 2016 04:15
v8 build on Mac/Linux

Follow instructions on Mozilla Wiki or TL;DR:

$ hg clone http://hg.mozilla.org/mozilla-central spidermonkey

Or use git from the GitHub mirror.

The following command avoid clonning the whole repo, but the last commit reference and the HEAD branch

$ d8 --help
SSE3=1 SSE4_1=1 SAHF=1 AVX=1 FMA3=1 ATOM=0
Usage:
shell [options] -e string
execute string in V8
shell [options] file1 file2 ... filek
run JavaScript scripts in file1, file2, ..., filek
shell [options]
shell [options] --shell [file1 file2 ... filek]
run an interactive JavaScript shell

The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).

In a nutshell,

  1. nginx is used to serve static files (css, js, images, etc.)
  2. node serves all the "dynamic" stuff.

So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.

  1. nginx listens on port 80.