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 Storage = require('@google-cloud/storage'); | |
function getPrefixes(cred, bucketName, queryParams = {}) { | |
return new Promise((resolve, reject) => { | |
new Storage(cred) | |
.bucket(bucketName) | |
.request({ | |
uri: '/o', | |
qs: { | |
delimiter: queryParams.delimiter || '/', |
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 repl = require('repl'); | |
const babel = require('babel-core'); | |
function preprocess(input) { | |
const awaitMatcher = /^(?:\s*(?:(?:let|var|const)\s)?\s*([^=]+)=\s*|^\s*)(await\s[\s\S]*)/; | |
const asyncWrapper = (code, binder) => { | |
let assign = binder ? `global.${binder} = ` : ''; | |
return `(function(){ async function _wrap() { return ${assign}${code} } return _wrap();})()`; | |
}; |
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
/* | |
three sgnificant figures for large numbers expressed using power of ten suffixes "k", "M" and "B". Ex: 12.3k, 1.45m, 534k | |
For sub 1000 and > 0 numbers, use 4 significant figures - ex: 12.34, 1.234, 123.4 | |
For numbers above 10B, use scientific notation of the form 1.23x10^11 | |
For numbers < 0.001, use scientific notation of the form 1.23x10^-5 | |
For numbers in range 0.001 < n < 1.0, use 3 decimal places - ex: 0.123 | |
*/ |
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
-- Toggle Debug.log | |
-- For non production use only | |
import Debug exposing(log) | |
-- (1) with |> | |
1 + 1 |> log "Addition" -- prints "Addition: 2" and returns 2 | |
-- turn off logging | |
1 + 1 -- |> log "Addition" |
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
defmodule Enum.Query.CompileError do | |
@moduledoc ~S""" | |
Raise compile time error while building query | |
""" | |
defexception [:message] | |
end | |
defmodule Enum.Query do | |
@moduledoc ~S""" |
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 through = require('through2'); | |
var moduleWrapper = through.obj(function (chunk, enc, cb) { | |
var content = chunk._contents.toString(); | |
var newContent = content.replace(/angular\s*\.\s*module\s*\(\s*['"]([^'"]+)['"]\s*,\s*\[([^\]]*)\][^)]*\)/mg, function(match, mod, deps) { | |
// ignore ngHtml2Js templates module name | |
// if(mod === 'app.templates') { return match; } | |
return "((function () {\n try {\n return angular.module('" + mod + "');\n } catch (e) {\n return angular.module('" + mod + "', [" + deps + "]);\n }\n})())"; | |
}); | |
chunk._contents = new Buffer(newContent); |



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 ngAttrHint = require('ng-attr-hint'); | |
var gutil = require('gulp-util'); | |
gulp.task('ng-attr-hint', function() { | |
ngAttrHint({ files: ['./*.html'] }) | |
.then(function(res) { | |
res.forEach(function(row) { | |
//Use ngAttrHint.format(row) for default formatting | |
gutil.log("[", gutil.colors.bold.green(row.file), ":", gutil.colors.magenta(row.line), |