View .log
0 info it worked if it ends with ok
1 verbose cli [ '/Users/jamullig/.nvm/versions/node/v8.5.0/bin/node',
1 verbose cli '/Users/jamullig/.nvm/versions/node/v8.5.0/bin/npm',
1 verbose cli 'start' ]
2 info using npm@5.3.0
3 info using node@v8.5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle bench-lru@1.1.0~prestart: bench-lru@1.1.0
6 info lifecycle bench-lru@1.1.0~start: bench-lru@1.1.0
7 verbose lifecycle bench-lru@1.1.0~start: unsafe-perm in lifecycle true
View .json
{
"name": "bench-lru",
"version": "1.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"abstract-object": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/abstract-object/-/abstract-object-2.1.9.tgz",
"integrity": "sha1-+p/IiI7MzELD2mxPYbnOqhoaGhQ=",
View bot_routing.js
/**
* @param {IConversationContext} context
* @returns void | Promise<void> nothing or a promise if an async operation is involved
*/
module.exports.Feedback_beforeResponse = function (context) {
if (context.global.missCount === void 0) {
context.global.missCount = 0;
}
context.global.missCount++;
View slack_button.js
'/slack': (req, res) => {
if (req.query.code !== void 0) {
let form = new FormData();
form.append('code', req.query.code);
form.append('client_id', config.slack.client_id);
form.append('client_secret', config.slack.client_secret);
fetch('https://slack.com/api/oauth.access', {method: 'POST', body: form, headers: form.getHeaders()}).then(res => res.json()).then(data => {
if (data.ok) {
View curry.js
function curry (fn, ...x) {
const lfn = fn.apply(fn, x);
return function (...y) {
return lfn.apply(lfn, y);
};
}
View script.sh
// run from an administrator powershell
npm install --global --production windows-build-tools
View .eslintrc
{
"env": {
"browser": true,
"node": true,
"es6": true,
"amd": false
},
"ecmaFeatures": {
"jsx": true,
"superInFunctions": false,
View example.js
// imagine there's tab controllers & routes
angular.module('app', ['ionic', 'controllers']).run($rootScope => {
// Override the ionic function 'cause really the state stack is overly complex for what the browser already does
$rootScope.$ionicGoBack = () => {
window.history.back();
};
}).module('controllers', []).controller('AboutCtrl', $scope => {
// Secret sauce for forcing the button to render on a tab where it wouldn't normally render
$scope.$on('$ionicView.beforeEnter', (event, viewData) => {
viewData.enableBack = true;
View test.js
'use strict';
const Application = require('spectron').Application,
path = require('path'),
fs = require('fs'),
mkdirp = require('mkdirp'),
app = new Application(require(path.join(__dirname, 'modules', 'defaults.js'))),
folder = path.join(__dirname, 'tests'),
screenshots = path.join(__dirname, 'screenshots'),
js = /\.js$/,
View bin2dec.js
function bin2dec (arg) {
let output = 0;
arg.split("").reverse().forEach((i, idx) => {
let v = Number(i);
if (v > 0) {
output += idx > 0 ? Math.pow(2, idx) : 1;
}
});