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 parallelSync(arrOfSyncFunctions){ | |
return new Promise(async resolve =>{ | |
let numToResolve = arrOfSyncFunctions.length; | |
let numResolved = 0; | |
// call after each async function resolves | |
const resolveOne = () =>{ | |
numResolved++; | |
if(numResolved >= numToResolve){ | |
// all functions have resolved. Resolve finally | |
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
/* eslint-disable no-console */ | |
const webpack = require('webpack'); | |
const WebpackDevServer = require('webpack-dev-server'); | |
const ProgressBarPlugin = require('progress-bar-webpack-plugin'); | |
const LogPlugin = require('./webpack-plugins/bundling-lifecycle-log-plugin'); | |
const config = require('./webpack.config.js'); | |
const WEB_PORT = 7002; |
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 digitUppercase = function(n) { | |
var fraction = ['角', '分']; | |
var digit = [ | |
'零', '壹', '贰', '叁', '肆', | |
'伍', '陆', '柒', '捌', '玖' | |
]; | |
var unit = [ | |
['元', '万', '亿'], | |
['', '拾', '佰', '仟'] | |
]; |
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 () { | |
'use strict'; | |
angular | |
.module('q.race', []) | |
.config(function ($provide) { | |
$provide.decorator('$q', function ($delegate) { | |
$delegate.race = promises => $delegate((resolve, reject) => { | |
const bind = promise => { |
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
Here is a list of scopes to use in Sublime Text 2 snippets - | |
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CoffeeScript: source.coffee |