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
| #!/bin/bash | |
| # shell script to create a simple mongodb replica set (tested on osx) | |
| set -euo pipefail | |
| base_path="/System/Volumes/Data/data" | |
| red=$(tput setaf 1) | |
| green=$(tput setaf 2) | |
| yellow=$(tput setaf 3) |
This file has been truncated, but you can view the full file.
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
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 |
This file has been truncated, but you can view the full file.
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
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 | |
| column1,column2 |
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 isElementInViewport = (elem, animateSveralTimes) => { | |
| let $elem = $(elem); | |
| // Get the scroll position of the page. | |
| let scrollElem = ((navigator.userAgent.toLowerCase().indexOf('webkit') != -1) ? 'body' : 'html'); | |
| let viewportTop = $(scrollElem).scrollTop(); | |
| let viewportBottom = viewportTop + $(window).height(); | |
| // Get the position of the element on the page. | |
| let elemTop = Math.round($elem.offset().top); |
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
| function drawNestedSetsTree(data, node) { | |
| const isEmpty = arr => arr.length === 0 ? true : false; | |
| if (!Array.isArray(data) || isEmpty(data) || | |
| !node || node === null) { | |
| return; | |
| } | |
| // | |
| let dataCopy = data.slice(); | |
| const listContainer = 'ul'; |
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
| git reset --soft HEAD~1 // reset pushed commit | |
| git init // create | |
| git add . // add files | |
| git status | |
| git log | |
| git commit -m "first commit" | |
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
| function drawNestedSetsTree(data, node) { | |
| function isEmpty(obj) { | |
| if (obj == null) return true; | |
| if (obj.length > 0) return false; | |
| if (obj.length === 0) return true; | |
| if (typeof obj !== "object") return true; | |
| for (var key in obj) { | |
| if (hasOwnProperty.call(obj, key)) return false; | |
| } | |
| return true; |