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
| async function sleep(ms) { | |
| return new Promise(r => setTimeout(r, ms)) | |
| } | |
| async function foo() { console.log('s foo'); await sleep(2000); console.log('d foo'); return 'foo'; } | |
| async function bar() { console.log('s bar'); await sleep(1000); console.log('d bar'); return 'bar'; } | |
| async function baz() { console.log('s baz'); await sleep(2000); console.log('d baz'); return 'baz'; } | |
| async function run() { | |
| console.log('start') |
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
| export function ngBridged(name, deps) { | |
| return ngBridge(angular.module(name, deps)) | |
| } | |
| export function ngBridge(ngModule) { | |
| const register = (type, ...args) => ngBridge(ngModule[type](...args)) | |
| const injectable = type => (name, injectableFunc) => register(type, name, ngInject(injectableFunc)) | |
| const pass = type => (...args) => register(type, ...args) |
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
| export default class SayingHelloComponent { | |
| static ngInject() { | |
| return [] // register your dependencies here (Angular 1 style, with string names) | |
| } | |
| static ddo() { | |
| return { | |
| bind: { | |
| person: '@' | |
| }, | |
| name: 'sayingHello', // component's name |
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
| import ngInject from './ngInject' | |
| export default function ngDirective(directive) { | |
| let func = function(...injectedArgs) { | |
| let link = (...directiveArgs) => new directive(...injectedArgs, ...directiveArgs) | |
| return {...directive.ddo(), link} | |
| } | |
| func.$inject = ngInject(directive).$inject |
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
| // ngInject.js | |
| function ngInject(func) { | |
| if (func.ngInject)) { | |
| func.$inject = func.ngInject() | |
| } | |
| return func | |
| } | |
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
| function sleep(ms = 0) { | |
| return new Promise(r => setTimeout(r, ms)) | |
| } | |
| async function run() { | |
| await sleep(2000) | |
| console.log('2s later') | |
| } | |
| run() |
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
| var gulp = require('gulp'); | |
| var sourcemaps = require('gulp-sourcemaps'); | |
| var source = require('vinyl-source-stream'); | |
| var buffer = require('vinyl-buffer'); | |
| var browserify = require('browserify'); | |
| var watchify = require('watchify'); | |
| var babel = require('babelify'); | |
| function compile(watch) { | |
| var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
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 CANCEL = Symbol(); | |
| class CancellationToken { | |
| constructor() { | |
| this.cancelled = false; | |
| } | |
| throwIfCancelled() { | |
| if (this.isCancelled()) { |
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
| <?php | |
| class TimeZones { | |
| /** | |
| * @return array | |
| */ | |
| public function generate() | |
| { | |
| $identifiers = DateTimeZone::listIdentifiers(); |
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
| machine: | |
| php: | |
| version: 5.6.5 | |
| dependencies: | |
| cache_directories: | |
| - vendor | |
| - node_modules | |
| pre: | |
| - sudo pip install awscli |