- Get the container's name (this is different from
tag
orid
)
docker ps
- Run the command
docker exec -it NAME_OF_CONTAINER sh
- ???
- Profit
tag
or id
)docker ps
docker exec -it NAME_OF_CONTAINER sh
.layout > :not(:last-child) { | |
margin-bottom: 10px; | |
margin-right: 10px; | |
} | |
/* or */ | |
.layout > * + * { | |
margin-bottom: 10px; | |
margin-right: 10px; |
You have an array. Its sort order doesn't matter. You want to remove an item from this array.
The obvious thing to do would be to use splice
:
function remove(array, item) {
const index = array.indexOf(item);
array.splice(index, 1);
}
const AWS = require("aws-sdk"); | |
const {link} = require("linkfs"); | |
const mock = require('mock-require'); | |
const fs = require('fs'); | |
const tmpDir = require('os').tmpdir(); | |
exports.handler = (event, context) => { | |
rewriteFs(); | |
invokeGatsby(context); | |
} |
COUNT=0 | |
for arg in $(ls); do | |
rm -rfv $arg | |
COUNT=$(($COUNT + 1)) | |
if [$COUNT -ge 10]; then | |
break | |
fi | |
done | |
// taken from https://jsperf.com/array-remove-by-index | |
// splice: 6,957,292 ops/sec | |
// swap: 85,501,603 ops/sec (NB. changes order) | |
// shift: 70,903,814 ops/sec | |
// btw. don't actually modify the Array prototype. Create a separate function instead. | |
Array.prototype.mySwapDelete = function arrayMySwapDelete(index) { | |
this[index] = this[this.length - 1]; | |
this.pop(); | |
}; |
echo '> Updating packages' | |
sudo yum update -y | |
echo '> Installing Git' | |
sudo yum install git -y | |
echo '> Installing Docker' | |
sudo amazon-linux-extras install docker | |
sudo usermod -a -G docker ec2-user | |
sudo chkconfig docker on |
web: yarn micro -l tcp://0.0.0.0:${PORT-3000}