- good for nearly sorted lists
- look at consecutive pairs
- passes over entire list
- everytime do a pass, the largest card in first pair not in correct position will be moved into correct position
- each pass one card is guaranteed to be moved to correct position
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
// HOC and context | |
// provide context with HOC | |
import App from './components/App'; | |
import ProvideContext from './containers/ProvideContext'; | |
const transportationTypes = [ | |
'armored car', | |
'fire engine', | |
'golf cart', |
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 transportationList = ( | |
<ul> | |
<li>Armored Car</li> | |
<li className="active">Hyperloop</li> | |
</ul> | |
); | |
ReactDOM.render( | |
transportationList, | |
document.getElementById(‘app’) |
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 ls-remote https://github.com/docker/compose | grep refs/tag | grep -o "[0-9]\.[0-9]\{1,2\}\.[0-9]\{1,2\}$" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1 |
- $0 - The name of the Bash script.
- $1 - $9 - The first 9 arguments to the Bash script. (As mentioned above.)
- $# - How many arguments were passed to the Bash script.
- $@ - All the arguments supplied to the Bash script.
- $* - All the arguments supplied to the Bash script seperated by the IFS.
- $? - The exit status of the most recently run process.
- $$ - The process ID of the current script.
- $USER - The username of the user running the script.
- $HOSTNAME - The hostname of the machine the script is running on.
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
[{ | |
"_id": "58c761f1364d84385f960739", | |
"sn_number": "", | |
"w_number": "w0001", | |
"stage": "Busbar Welding", | |
"status": "WIP", | |
"type": "Dev", | |
"active": true, | |
"url": "string", | |
"__v": 0, |
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
import React, {createClass} from 'react'; | |
import {assign} from 'lodash'; | |
import hoistNonReactStatics from 'hoist-non-react-statics'; | |
function createComponent(Component, dataBindings) { | |
const displayName = `ProvideContextComponent(${Component.displayName || Component.name})`; | |
const ProvideContextComponent = createClass({ | |
displayName, |
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
docker images | |
docker search <name*> | |
docker inspect <image_name> | |
docker pull <name:tag,name,id> | |
docker ps # what is running | |
docker ps -a # what containers ran in the past | |
docker run -it # interactive, terminal | |
docker run -d # run in background | |
docker run -d <some_cmd> -e <some_script> # execute | |
docker attach <container_name> # attach to process of running container |
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
<script> | |
window.Promise || document.write('<script src="https://unpkg.com/[email protected]/dist/es6-promise.min.js"><\/script>'); | |
window.fetch || document.write('<script src="https://unpkg.com/[email protected]/fetch.js"|script src="https://unpkg.com/[email protected]/fetch.js"><\/script>'); | |
</script> |
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 urls = `/home/anti-depressants/xanax | |
/home/heart/lipitor | |
/home/heart/atorvastatin | |
/home/heart/aspirin | |
/drugs/nasal/flonase | |
/drugs/topical | |
/drugs/routes/oral/tablets | |
/drugs/routes/nasal/flonase`; | |
const parseUrl = (url) => { |