This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {transform} = require('babel-core') | |
| const src = ` | |
| const a = 1 | |
| const b = 2 | |
| let c, d, e | |
| c = 1 * 2 + 3 + 4 * 2 | |
| console.log(c) | |
| ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {transform} = require('babel-core') | |
| const babylon = require('babylon') | |
| const WasCreated = Symbol('WasCreated') | |
| const source = ` | |
| let b = 0 | |
| console.log(b) | |
| b = b + 2 | |
| console.log(b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {transform} = require('babel-core') | |
| const WasCreated = Symbol('WasCreated') | |
| const src = ` | |
| class Integer { | |
| value: number | |
| constructor(value: number) { | |
| this.value = Math.floor(value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const babylon = require('babylon') | |
| const parse = (source) => { | |
| try { | |
| const ast = babylon.parse(source) | |
| delete ast.tokens | |
| return {ast} | |
| } catch (err) { | |
| return {error: err} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Dog { | |
| voice() { | |
| return 'wanwan' | |
| } | |
| } | |
| class Cat { | |
| voice() { | |
| return 'nya-n' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env node | |
| const path = require('path') | |
| const express = require('express') | |
| const browserify = require('browserify') | |
| const app = express() | |
| const sourcePath = path.resolve(process.argv.length <= 2 ? './' : process.argv[2]) | |
| app.use((req, res, next) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ObservableTest { | |
| times: number | |
| resolve: any | |
| constructor() { | |
| this.times = 2 | |
| this.resolve = null | |
| } | |
| then(resolve?) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env coffee | |
| request = require 'request' | |
| fs = require 'fs' | |
| id = process.env['ID'] | |
| password = process.env['PASSWORD'] | |
| reCookieNicosid = /^nicosid=([0-9]+\.[0-9]+)/ | |
| reCookieSession = /^user_session=(user_session_[0-9]+_[0-9a-fA-F]+);/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env coffee | |
| fs = require 'fs' | |
| sprintf = require 'sprintf' | |
| _snapshot = undefined | |
| fmtKMGT = (n) -> | |
| arr = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env coffee | |
| fs = require 'fs' | |
| Rx = require 'rx' | |
| sprintf = require 'sprintf' | |
| _snapshot = undefined | |
| fmtKMGT = (n) -> | |
| arr = [] |