Skip to content

Instantly share code, notes, and snippets.

@Andyccs
Andyccs / gist:0bb32b6622293f0f26eb
Last active August 29, 2015 14:27
Folder structure for medium blog post
es6_first_try
|-- src
|---- app.js
|---- rectangle.js
|-- Gruntfile.js
|-- package.json
@Andyccs
Andyccs / package.json
Last active November 19, 2015 14:32
Medium post
{
"name": "es6_first_try",
"version": "1.0.0",
"description": "",
"main": "main.js",
"dependencies": {},
"devDependencies": {
"babel-core": "^5.8.22",
"grunt": "^0.4.5",
"grunt-babel": "^5.0.1"
@Andyccs
Andyccs / rectangle.js
Last active November 19, 2015 14:32
Medium post
export class Rectangle {
constructor (width, height) {
this.width = width
this.height = height
}
set width (width) { this._width = width }
get width () { return this._width }
set height (height) { this._height = height }
get height () { return this._height }
get area () { return this.width * this.height }
@Andyccs
Andyccs / app.js
Last active November 19, 2015 14:32
Medium post
import {Rectangle} from "./rectangle.js"
var r = new Rectangle(50, 20)
console.log(r.area === 1000)
@Andyccs
Andyccs / Gruntfile.js
Last active November 19, 2015 14:33
Medium Post
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
"babel": {
options: {
sourceMap: true
},
dist: {
files: {