Write string reverse function using recursion.
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
addDays: date-fns at 4669306 ops/sec (9.84x faster than Moment.js) | |
addHours: date-fns at 4434109 ops/sec (4.99x faster than Moment.js) | |
addISOYears: date-fns had no peers for comparison at 38962 ops/sec | |
addMilliseconds: date-fns at 4316611 ops/sec (4.86x faster than Moment.js) | |
addMinutes: date-fns at 4409582 ops/sec (5.07x faster than Moment.js) | |
addMonths: Moment.js at 249379 ops/sec (1.71x faster than date-fns) | |
addQuarters: Moment.js at 242896 ops/sec (1.30x faster than date-fns) | |
addSeconds: date-fns at 4383032 ops/sec (5.10x faster than Moment.js) | |
addWeeks: date-fns at 4278915 ops/sec (10.54x faster than Moment.js) | |
addYears: Moment.js at 318328 ops/sec (1.41x faster than date-fns) |
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
// When shrinkwrap is used npm install won't update git dependencies. | |
// The hack removes outdated dependencies. | |
// | |
// See https://github.com/npm/npm/issues/12718 for more details about the bug. | |
const path = require('path') | |
const fs = require('fs') | |
const {spawn} = require('child_process') | |
let shrinkwrapJSON |
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
module Reverse (..) where | |
import Html exposing (Html, text) | |
import String | |
reverse : List Char -> List Char | |
reverse str = | |
case str of | |
[] -> |
Given code:
const bowerJSONPath = path.join(process.cwd(), 'bower.json')
const packageJSONPath = path.join(process.cwd(), 'package.json')
[bowerJSONPath, packageJSONPath].forEach((packagePath) => {/* */})
… generates such output:
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 noLocationStr = function(origin) { | |
return !!origin.get('location_str'); | |
}; | |
var withStatus = function(foreignKey, statuses, origin) { | |
return origin | |
.set('status', statuses.find(s => s.get(foreignKey) == origin.get('id'))); | |
}; | |
var withLocation = function(locations, locationStr, origin) { |
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 csp = require('js-csp'); | |
var Github = require('./github'); | |
var GoogleMaps = require('./google_maps'); | |
var TEAM = process.env.GITHUB_TEAM; | |
csp.go(function*() { | |
var team = yield csp.take(Github.getTeamMembers(TEAM)); | |
for (var i = 0; i < team.length; i++) { |