{"action":"created","comment":{"url":"https://api.github.com/repos/TransforMap/transformap-api/pulls/comments/52685370","id":52685370,"diff_hunk":"@@ -0,0 +1,27 @@\n+const CONFIG = require('config')\n+const __ = CONFIG.universalPath\n+const _ = __.require('lib', 'utils')\n+const dbC = CONFIG.db\n+const fullUrl = `${dbC.protocol}://${dbC.username}:${dbC.password}@${dbC.host}:${dbC.port}`\n+const nano = require('nano-blue')(fullUrl)\n+\n+module.exports = function (dbName) {\n+  const db = nano.use(dbName)\n+\n+  return db.info()","path":"server/lib/db.js","position":11,"original_position":11,"commit_id":"1bdaaa851773294f111a136dcad9ccebb2bafd50","original_commit_id":"1bdaaa851773294f111a136dcad9ccebb2bafd50","user":{"login":"maxlath","id":1596934,"avatar_url":"https://avatars.githubusercontent.com/u/1596934?v=3","gravatar_id":"","url":"https://api.github.com/users/maxlath","html_url":"https://github.com/maxlath","followers_url":"https://api.github.com/users/maxlath/followers","following_url":"https://api.github.com/users/maxlath/following{/other_user}","gists_url":"https://api.github.com/users/maxlath/gists{/gist_id}","starred_url":"https://api.github.com/users/maxlath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxlath/subscriptions","organizations_url":"https://api.github.com/users/maxlath/orgs","repos_url":"https://api.github.com/users/maxlath/repos","events_url":"https://api.github.com/users/maxlath/events{/privacy}","received_events_url":"https://api.github.com/users/maxlath/received_events","type":"User","site_admin":false},"body":"An Higher order function is just a function that returns a function.\r\nFor instance:\r\n```javascript\r\nconst Hello = function(name){ console.log(`hello ${name}!`) }\r\nconst hello = Hello('Jon')\r\nhello()\r\n// => hello Jon!\r\n```\r\nHere, `Hello` is the higher order function. Usually, capitals are reserved to classes, but as I'm using very few of those, I tend to use them for Higher order functions.\r\nCf the [`inv-loggers`](http://github.com/inventaire/inv-loggers) module that gives access to `Log` and `log` functions, with the latter being just a wrapper for the first\r\n\r\n\r\nResources:\r\n* [Higher-order functions - Part 1 of Functional Programming in JavaScript](https://www.youtube.com/watch?v=BMUiFMZr7vk&index=1&list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84)\r\n* all [Crockford on JavaScript](https://www.youtube.com/watch?v=JxAXlJEmNMg&list=PL7664379246A246CB)","created_at":"2016-02-11T23:31:25Z","updated_at":"2016-02-11T23:31:25Z","html_url":"https://github.com/TransforMap/transformap-api/pull/7#discussion_r52685370","pull_request_url":"https://api.github.com/repos/TransforMap/transformap-api/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/TransforMap/transformap-api/pulls/comments/52685370"},"html":{"href":"https://github.com/TransforMap/transformap-api/pull/7#discussion_r52685370"},"pull_request":{"href":"https://api.github.com/repos/TransforMap/transformap-api/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/TransforMap/transformap-api/pulls/7","id":59110286,"html_url":"https://github.com/TransforMap/transformap-api/pull/7","diff_url":"https://github.com/TransforMap/transformap-api/pull/7.diff","patch_url":"https://github.com/TransforMap/transformap-api/pull/7.patch","issue_url":"https://api.github.com/repos/TransforMap/transformap-api/issues/7","number":7,"state":"open","locked":false,"title":"couchdb setup","user":{"login":"maxlath","id":1596934,"avatar_url":"https://avatars.githubusercontent.com/u/1596934?v=3","gravatar_id":"","url":"https://api.github.com/users/maxlath","html_url":"https://github.com/maxlath","followers_url":"https://api.github.com/users/maxlath/followers","following_url":"https://api.github.com/users/maxlath/following{/other_user}","gists_url":"https://api.github.com/users/maxlath/gists{/gist_id}","starred_url":"https://api.github.com/users/maxlath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxlath/subscriptions","organizations_url":"https://api.github.com/users/maxlath/orgs","repos_url":"https://api.github.com/users/maxlath/repos","events_url":"https://api.github.com/users/maxlath/events{/privacy}","received_events_url":"https://api.github.com/users/maxlath/received_events","type":"User","site_admin":false},"body":"setting up the basic tools to work with couchdb","created_at":"2016-02-11T23:17:08Z","updated_at":"2016-02-11T23:31:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fe25a6bb0f161fba6505cf1c0cde3c5349f742b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TransforMap/transformap-api/pulls/7/commits","review_comments_url":"https://api.github.com/repos/TransforMap/transformap-api/pulls/7/comments","review_comment_url":"https://api.github.com/repos/TransforMap/transformap-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TransforMap/transformap-api/issues/7/comments","statuses_url":"https://api.github.com/repos/TransforMap/transformap-api/statuses/1bdaaa851773294f111a136dcad9ccebb2bafd50","head":{"label":"TransforMap:couchdbSetup","ref":"couchdbSetup","sha":"1bdaaa851773294f111a136dcad9ccebb2bafd50","user":{"login":"TransforMap","id":9350555,"avatar_url":"https://avatars.githubusercontent.com/u/9350555?v=3","gravatar_id":"","url":"https://api.github.com/users/TransforMap","html_url":"https://github.com/TransforMap","followers_url":"https://api.github.com/users/TransforMap/followers","following_url":"https://api.github.com/users/TransforMap/following{/other_user}","gists_url":"https://api.github.com/users/TransforMap/gists{/gist_id}","starred_url":"https://api.github.com/users/TransforMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TransforMap/subscriptions","organizations_url":"https://api.github.com/users/TransforMap/orgs","repos_url":"https://api.github.com/users/TransforMap/repos","events_url":"https://api.github.com/users/TransforMap/events{/privacy}","received_events_url":"https://api.github.com/users/TransforMap/received_events","type":"Organization","site_admin":false},"repo":{"id":51460888,"name":"transformap-api","full_name":"TransforMap/transformap-api","owner":{"login":"TransforMap","id":9350555,"avatar_url":"https://avatars.githubusercontent.com/u/9350555?v=3","gravatar_id":"","url":"https://api.github.com/users/TransforMap","html_url":"https://github.com/TransforMap","followers_url":"https://api.github.com/users/TransforMap/followers","following_url":"https://api.github.com/users/TransforMap/following{/other_user}","gists_url":"https://api.github.com/users/TransforMap/gists{/gist_id}","starred_url":"https://api.github.com/users/TransforMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TransforMap/subscriptions","organizations_url":"https://api.github.com/users/TransforMap/orgs","repos_url":"https://api.github.com/users/TransforMap/repos","events_url":"https://api.github.com/users/TransforMap/events{/privacy}","received_events_url":"https://api.github.com/users/TransforMap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TransforMap/transformap-api","description":"","fork":false,"url":"https://api.github.com/repos/TransforMap/transformap-api","forks_url":"https://api.github.com/repos/TransforMap/transformap-api/forks","keys_url":"https://api.github.com/repos/TransforMap/transformap-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TransforMap/transformap-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TransforMap/transformap-api/teams","hooks_url":"https://api.github.com/repos/TransforMap/transformap-api/hooks","issue_events_url":"https://api.github.com/repos/TransforMap/transformap-api/issues/events{/number}","events_url":"https://api.github.com/repos/TransforMap/transformap-api/events","assignees_url":"https://api.github.com/repos/TransforMap/transformap-api/assignees{/user}","branches_url":"https://api.github.com/repos/TransforMap/transformap-api/branches{/branch}","tags_url":"https://api.github.com/repos/TransforMap/transformap-api/tags","blobs_url":"https://api.github.com/repos/TransforMap/transformap-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TransforMap/transformap-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TransforMap/transformap-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/TransforMap/transformap-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TransforMap/transformap-api/statuses/{sha}","languages_url":"https://api.github.com/repos/TransforMap/transformap-api/languages","stargazers_url":"https://api.github.com/repos/TransforMap/transformap-api/stargazers","contributors_url":"https://api.github.com/repos/TransforMap/transformap-api/contributors","subscribers_url":"https://api.github.com/repos/TransforMap/transformap-api/subscribers","subscription_url":"https://api.github.com/repos/TransforMap/transformap-api/subscription","commits_url":"https://api.github.com/repos/TransforMap/transformap-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/TransforMap/transformap-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/TransforMap/transformap-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/TransforMap/transformap-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/TransforMap/transformap-api/contents/{+path}","compare_url":"https://api.github.com/repos/TransforMap/transformap-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TransforMap/transformap-api/merges","archive_url":"https://api.github.com/repos/TransforMap/transformap-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TransforMap/transformap-api/downloads","issues_url":"https://api.github.com/repos/TransforMap/transformap-api/issues{/number}","pulls_url":"https://api.github.com/repos/TransforMap/transformap-api/pulls{/number}","milestones_url":"https://api.github.com/repos/TransforMap/transformap-api/milestones{/number}","notifications_url":"https://api.github.com/repos/TransforMap/transformap-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TransforMap/transformap-api/labels{/name}","releases_url":"https://api.github.com/repos/TransforMap/transformap-api/releases{/id}","deployments_url":"https://api.github.com/repos/TransforMap/transformap-api/deployments","created_at":"2016-02-10T18:14:45Z","updated_at":"2016-02-10T20:00:29Z","pushed_at":"2016-02-11T23:17:08Z","git_url":"git://github.com/TransforMap/transformap-api.git","ssh_url":"git@github.com:TransforMap/transformap-api.git","clone_url":"https://github.com/TransforMap/transformap-api.git","svn_url":"https://github.com/TransforMap/transformap-api","homepage":"https://api.transformap.co","size":20,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"TransforMap:master","ref":"master","sha":"7d6cb83164781e727896ccf220da1e641ef481d0","user":{"login":"TransforMap","id":9350555,"avatar_url":"https://avatars.githubusercontent.com/u/9350555?v=3","gravatar_id":"","url":"https://api.github.com/users/TransforMap","html_url":"https://github.com/TransforMap","followers_url":"https://api.github.com/users/TransforMap/followers","following_url":"https://api.github.com/users/TransforMap/following{/other_user}","gists_url":"https://api.github.com/users/TransforMap/gists{/gist_id}","starred_url":"https://api.github.com/users/TransforMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TransforMap/subscriptions","organizations_url":"https://api.github.com/users/TransforMap/orgs","repos_url":"https://api.github.com/users/TransforMap/repos","events_url":"https://api.github.com/users/TransforMap/events{/privacy}","received_events_url":"https://api.github.com/users/TransforMap/received_events","type":"Organization","site_admin":false},"repo":{"id":51460888,"name":"transformap-api","full_name":"TransforMap/transformap-api","owner":{"login":"TransforMap","id":9350555,"avatar_url":"https://avatars.githubusercontent.com/u/9350555?v=3","gravatar_id":"","url":"https://api.github.com/users/TransforMap","html_url":"https://github.com/TransforMap","followers_url":"https://api.github.com/users/TransforMap/followers","following_url":"https://api.github.com/users/TransforMap/following{/other_user}","gists_url":"https://api.github.com/users/TransforMap/gists{/gist_id}","starred_url":"https://api.github.com/users/TransforMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TransforMap/subscriptions","organizations_url":"https://api.github.com/users/TransforMap/orgs","repos_url":"https://api.github.com/users/TransforMap/repos","events_url":"https://api.github.com/users/TransforMap/events{/privacy}","received_events_url":"https://api.github.com/users/TransforMap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TransforMap/transformap-api","description":"","fork":false,"url":"https://api.github.com/repos/TransforMap/transformap-api","forks_url":"https://api.github.com/repos/TransforMap/transformap-api/forks","keys_url":"https://api.github.com/repos/TransforMap/transformap-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TransforMap/transformap-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TransforMap/transformap-api/teams","hooks_url":"https://api.github.com/repos/TransforMap/transformap-api/hooks","issue_events_url":"https://api.github.com/repos/TransforMap/transformap-api/issues/events{/number}","events_url":"https://api.github.com/repos/TransforMap/transformap-api/events","assignees_url":"https://api.github.com/repos/TransforMap/transformap-api/assignees{/user}","branches_url":"https://api.github.com/repos/TransforMap/transformap-api/branches{/branch}","tags_url":"https://api.github.com/repos/TransforMap/transformap-api/tags","blobs_url":"https://api.github.com/repos/TransforMap/transformap-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TransforMap/transformap-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TransforMap/transformap-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/TransforMap/transformap-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TransforMap/transformap-api/statuses/{sha}","languages_url":"https://api.github.com/repos/TransforMap/transformap-api/languages","stargazers_url":"https://api.github.com/repos/TransforMap/transformap-api/stargazers","contributors_url":"https://api.github.com/repos/TransforMap/transformap-api/contributors","subscribers_url":"https://api.github.com/repos/TransforMap/transformap-api/subscribers","subscription_url":"https://api.github.com/repos/TransforMap/transformap-api/subscription","commits_url":"https://api.github.com/repos/TransforMap/transformap-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/TransforMap/transformap-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/TransforMap/transformap-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/TransforMap/transformap-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/TransforMap/transformap-api/contents/{+path}","compare_url":"https://api.github.com/repos/TransforMap/transformap-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TransforMap/transformap-api/merges","archive_url":"https://api.github.com/repos/TransforMap/transformap-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TransforMap/transformap-api/downloads","issues_url":"https://api.github.com/repos/TransforMap/transformap-api/issues{/number}","pulls_url":"https://api.github.com/repos/TransforMap/transformap-api/pulls{/number}","milestones_url":"https://api.github.com/repos/TransforMap/transformap-api/milestones{/number}","notifications_url":"https://api.github.com/repos/TransforMap/transformap-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TransforMap/transformap-api/labels{/name}","releases_url":"https://api.github.com/repos/TransforMap/transformap-api/releases{/id}","deployments_url":"https://api.github.com/repos/TransforMap/transformap-api/deployments","created_at":"2016-02-10T18:14:45Z","updated_at":"2016-02-10T20:00:29Z","pushed_at":"2016-02-11T23:17:08Z","git_url":"git://github.com/TransforMap/transformap-api.git","ssh_url":"git@github.com:TransforMap/transformap-api.git","clone_url":"https://github.com/TransforMap/transformap-api.git","svn_url":"https://github.com/TransforMap/transformap-api","homepage":"https://api.transformap.co","size":20,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TransforMap/transformap-api/pulls/7"},"html":{"href":"https://github.com/TransforMap/transformap-api/pull/7"},"issue":{"href":"https://api.github.com/repos/TransforMap/transformap-api/issues/7"},"comments":{"href":"https://api.github.com/repos/TransforMap/transformap-api/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/TransforMap/transformap-api/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/TransforMap/transformap-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TransforMap/transformap-api/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/TransforMap/transformap-api/statuses/1bdaaa851773294f111a136dcad9ccebb2bafd50"}}}}