-
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
- Delete all untagged images
docker rmi $( docker images -q -f dangling=true) |
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
var reverseString = function(stringToReverse) { | |
var finalString = []; // I prefer to use arrays instead of strings. | |
// loop through the string, starting at the end. | |
for (var i = stringToReverse.length; i > 0; i--) { | |
// push the character at the current index into the finalString array | |
finalString.push(stringToReverse[i]); | |
} | |
// Join the characters in the array into a string and return the string. | |
return finalString.join(''); | |
} |
var reverseString = function(stringToReverse) { | |
var finalString = []; // I prefer to use arrays instead of strings. | |
// loop through the string, starting at the end. | |
// push the character at the current index into the finalString array | |
// Join the characters in the array into a string and return the string. | |
} |
var reverseString = function(stringToReverse) { | |
var finalString = ""; | |
// Our code to reverse the string goes here. | |
return finalString; | |
} |
// We create the "Animal" function first. | |
function Animal() { | |
this.species = "None"; | |
this.getSpecies() { | |
return this.species; | |
} | |
} | |
// Now, we create a "dog" function. Notice that there is no indication of inheritance. | |
function Dog() { |
class Animal { | |
private String mSpecies = "None"; | |
public void talk() { | |
printf(""); | |
} | |
public String getSpecies() { | |
return mSpecies; | |
} | |
} |
mkdir test | |
cd test | |
echo "# test_repo" >> README.md | |
cat README.md | |
ls | |
git init | |
ls -la | |
git status | |
git add README.md | |
git commit -m "initial commit" |
/** | |
* Back button listener. | |
* Will close the application if the back button pressed twice. | |
*/ | |
@Override | |
public void onBackPressed() | |
{ | |
if(backButtonCount >= 1) | |
{ | |
Intent intent = new Intent(Intent.ACTION_MAIN); |
this.collidesWith = function(otherObject) { | |
var width = 2*this.radius; | |
var height = 2*this.radius; | |
var translatedX = this.x - radius; | |
var translatedY = this.y - radius; | |
if (translatedX < otherObject.x + otherObject.width && | |
translatedX + width > otherObject.x && | |
translatedY < otherObject.y + otherObject.height && | |
height + translatedY > otherObject.y) { |