Skip to content

Instantly share code, notes, and snippets.

View pads's full-sized avatar

Ben Paddock pads

View GitHub Profile
@pads
pads / key-value-stats.sh
Created August 14, 2020 12:33
Getting stats from a JSON file
more file.json | grep expression | awk -F ' ' '{ gsub(",", ""); gsub("\"", ""); print $2}' | datamash max 1 min 1 mode 1 median 1
// 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"],
// 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",
//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",
// 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,
//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: {
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: {
// 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!
*/
// https://github.com/CodeYourFuture/JavaScript-Core-2-Homework/blob/master/Week-1/InClass/C-more-complex-objects/exercise-3.js
/*
Given the same "house" object again
Write the code for the functions as per the description above them
*/
let kinningParkHouse = {
address: "1 Kinning Park",
price: 180000,
currentOwner: {
@pads
pads / keybase.md
Created February 27, 2016 22:33
Proof of GitHub account ownership

Keybase proof

I hereby claim:

  • I am pads on github.
  • I am pads (https://keybase.io/pads) on keybase.
  • I have a public key ASAMRTsoYKHrT860S21K4fwb52UDFu3BD2JT_imEx_mYgQo

To claim this, I am signing this object: