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 | |
PREFIX=$1 | |
EXECUTE=false | |
if [ -z "$1" ]; then | |
echo "Please supply a stack name prefix" | |
exit 1 | |
fi |
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
logs_help () { | |
echo "Usage:" | |
echo "logs <container name> <jq expression>" | |
} | |
CONTAINER=$1 | |
FILTER="$2" | |
if [ ! $# -eq 1 ]; then | |
logs_help |
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
more file.json | grep expression | awk -F ' ' '{ gsub(",", ""); gsub("\"", ""); print $2}' | datamash max 1 min 1 mode 1 median 1 |
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
// https://github.com/CodeYourFuture/JavaScript-Core-2-Homework/blob/master/Week-1/InClass/D-methods/exercise-4.js | |
/* | |
Alice has a list of good friends. | |
Define a method "makeFriend" to add a new friend to her list. | |
*/ | |
let person = { | |
name: "Alice", | |
friends: ["John", "Nina"], |
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
// https://github.com/CodeYourFuture/JavaScript-Core-2-Homework/blob/master/Week-1/InClass/D-methods/exercise-3.js | |
/* | |
The following code contains syntax errors - try and fix them! | |
Once you fix them, run this file, it should output the correct values! | |
*/ | |
let person = { | |
name: "Alice", | |
age: 25, | |
currentAddress: "Glasgow", |
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
//https://github.com/CodeYourFuture/JavaScript-Core-2-Homework/blob/master/Week-1/InClass/D-methods/exercise-2.js | |
/* | |
A person named Alice is defined below. | |
Add a method "sayName" so this person can say their own name. | |
Hint: use 'this' keyword to access the name property. | |
*/ | |
let person = { | |
name: "Alice", |
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
// https://github.com/CodeYourFuture/JavaScript-Core-2-Homework/blob/master/Week-1/InClass/D-methods/exercise-1.js | |
/* | |
A person named Alice is defined below. | |
Add a method "greet" so this person can say hello. | |
*/ | |
let person = { | |
name: "Alice", | |
age: 25, |
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
//https://github.com/CodeYourFuture/JavaScript-Core-2-Homework/blob/master/Week-1/InClass/C-more-complex-objects/exercise-1.js | |
/* | |
Given the following house - follow the instructions below. | |
Make sure you run the file after and it outputs the correct results. | |
*/ | |
let house = { | |
address: "1 Kinning Park", | |
previousOwners: ["Claire M.", "John A."], | |
currentOwner: { |
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
https://github.com/CodeYourFuture/JavaScript-Core-2-Homework/blob/master/Week-1/InClass/C-more-complex-objects/exercise-2.js | |
/* | |
Given the same "house" object again | |
Follow the instructions below and then run the file and make sure it outputs the correct results | |
*/ | |
let house = { | |
address: "1 Kinning Park", | |
previousOwners: ["Claire M.", "John A."], | |
currentOwner: { |
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
// https://github.com/CodeYourFuture/JavaScript-Core-2-Homework/blob/master/Week-1/InClass/D-methods/exercise-5.js | |
/* | |
A coffee machine is defined below. | |
One can buy three different coffees. | |
Complete the methods "insertMoney" and "getCoffee" to match the expected result. | |
insertMoney takes an amount in parameter to add money in the coffee machine. | |
getCoffee takes a coffee type in parameter and dispends the selected coffee | |
only if the inserted amount is greater or equal than the price of the coffee! | |
*/ |
NewerOlder