- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Service Registration:
- Centralized locking can be based on this K/V store.
View index.js
This file contains 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
'use strict'; | |
/** | |
* Get Scores of the amount of space the occurring words take up in a comment. | |
* | |
* @param {Array} comments Comments Collection | |
* @param {Object} categories Categories to Score | |
* | |
* @return {void} |
View sort.js
This file contains 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
// Sort Arr by Ranking | |
function sortByRanking(arr) { | |
let compare = function (a,b) { | |
if (a.ranking < b.ranking) { | |
return -1; | |
} else if (a.ranking > b.ranking) { | |
return 1; | |
} else { | |
return 0; | |
} |
View gist:acb29ca94263b2db8eefddcc87d2ab6f
View gist:2c60a1fe894936e8de21
This file contains 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
docker rmi $(docker images -q -f dangling=true) |
View activeingredient.json
This file contains 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
{ | |
"_id": "55ee9d3faf18e05d4ce2f540", | |
"active_ingredient_interaction": "Currently updating...", | |
"breast_feeding_advisory": "Manufacturer advises that the drug should be avoided during breastfeeding as there is no adequate information on safety of the drug to the child", | |
"contra_indications": "Severe ulcer, gastrointestinal bleeding, and hypersensitivity", | |
"dosage": "100mg BD", | |
"generic": "", | |
"indication": "Inflammation and pain in rheumatoid arthritis, osteoarthritis and alkylosing spondylitis.", | |
"name": "Aceclofenac", | |
"picture_url": "", |
View gist:8c74da455cce3d36eb68
via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)
zf#j
creates a fold from the cursor down # lines.zf/string
creates a fold from the cursor to string .zj
moves the cursor to the next fold.zk
moves the cursor to the previous fold.zo
opens a fold at the cursor.zO
opens all folds at the cursor.zm
increases the foldlevel by one.zM
closes all open folds.
View gist:426b251c3cf68c2c7b42
This file contains 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
@media only screen and (max-width: 480px) and (min-width: 320px) { | |
/*========================================== | |
Get rid of the H6 it is not necessary. | |
Giving the heading some whitespace provides | |
a good visual view. | |
=========================================*/ | |
.heading h2 { | |
font-size: 1.1em; | |
width: 100%; | |
padding: 5px; |
View jsbin.losab.css
This file contains 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
#canvas { | |
border: 1px solid #ccc; | |
} |
View gist:cc02e429400463b45e88
This file contains 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 cruncher(fn, context){ | |
if(typeof fn !== 'function'){ | |
return new Error('Expected ' + fn + ' to be a function'); | |
} | |
var _slice = [].slice, | |
memo = []; | |
function ingest(){ | |
memo.push(fn.apply(context || null, _slice.call(arguments))); |
View gist:5f7e4fa3794db843a999
This file contains 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 func(fn, beforeFn, afterFn /*, thisArgs*/){ | |
var context = arguments.length === 4 ? arguments[3] : null; | |
var queue = [beforeFn, fn, afterFn]; | |
return function(){ | |
var args = [].slice.call(arguments); | |
queue.forEach(function(fn, index){ | |
index === 1 ? fn.apply(context,args) : fn.apply(context); | |
}); | |
}; |