-
Write a function which takes 2 numbers and tells the user the result of the number's addition, subtraction, multiplication and division. The log should be formatted like: "For numbers {firstNumber} and {secondNumber}, the addition is {addition}, the subtraction is {subtraction}, the multiplication is {multiplication} and the division is {division}".
-
Write a function to log the grade of a student in an examination. The student will get A+ grade if the mark is in the range 90 - 100 (inclusive), A if the mark is in the range 80 - 89, B if the mark is in the range 70 - 79, C if the mark is in the range 60 - 69, D if the mark is in the range 50 - 59 and E if the mark is 49 or lower.
-
Write a function which takes an integer number and checks if it is within 20 digits of 100 or within 20 digits of 400.
-
Write a function which takes a city name and checks whether it is one of the Code Your Future cities (London, Glasgow, Manchester). If it is one of the CYF cities, log a succe
This file contains 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
# Filter containers by a given name, then tail the logs | |
# Example: `docker_logs client`, tails the logs within a container where the name contains "client" | |
function docker_logs() { | |
docker logs $(docker ps --filter "name=$1" -q) --tail 1 --follow | |
} | |
# Filter containers by a given name, then execute a command in that container | |
# Example: `docker_exec client npm test`, executes `npm test` within a container where the name contains "client" | |
function docker_exec() { | |
CONTAINER="$1"; shift; COMMAND="$@" |
This file contains 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
{ | |
"extends": "airbnb", | |
"parser": "babel-eslint", | |
"plugins": [ | |
"babel" | |
], | |
"rules": { | |
// Tabs, just because | |
"indent": [2, "tab"], |
This file contains 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
#!/usr/bin/env node | |
var npmCheck = require('npm-check') | |
npmCheck({ skipUnused: true }) | |
.then((state) => { | |
const missing = state.get('packages').filter((p) => p.notInstalled) | |
if (missing.length) { |
This file contains 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 from 'react' | |
import ReactDOM from 'react-dom' | |
class HelloWorld extends React.Component { | |
render() { | |
return <h1>Hello World</h1> | |
} | |
} | |
class HelloCodeYourFuture extends React.Component { |
This file contains 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
[ | |
{ | |
"title": "Mr", | |
"firstName": "John", | |
"surname": "Doe", | |
"email": "johndoe@doe.com", | |
"roomId": 2, | |
"checkInDate": "2017-11-21", | |
"checkOutDate": "2017-11-23" | |
}, |
This file contains 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
.figure { | |
border: 1px solid $grey-light-medium; | |
padding: 10px; | |
background: $white; | |
} | |
.figure-img { | |
padding-bottom: 5px; | |
border: none; | |
} |
This file contains 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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQINBFu7H3gBEADMwsszOxErzCY6ws/ME+dA1bSlpiKCib3/XePhIG9au2+2JrZ+ | |
T6YbwHZvbfVPekDA4hSFxPIIe8Lwp8Wq9ybedKCfq98tdZSG9PpPIKhWcUNY/D9Y | |
IsblFMHRaZxIRvT1k7g9mS4UOVgWGWHy5x0sgkN7FSvO2B7mlcIboAk9qhuJVBdZ | |
bFMsGNyB0BTo7fdRztj8/JArtcH8IbR09Py153mvhEQGjv68INcSx6CkA2LBbeTD | |
RmUP9VGb1nAIO02SX+Hx3HJSrQpECBo09QqnFc6dDOGdY1QX61CeObATT4AuYNXD | |
PIhtHC4iwKrTA9g22j1588Hr4dEmuhtGtBhvYVE5ufEN/EuHZPRhQ7L41za46HUI | |
8J+CamEhnMck7qn9SV+1NM9qPs4aI6XnwJ7x+Eod19uRuxbVyPXsdaC5lzMJ2WG7 | |
fxazE4QQ7FYSY1ssjfUw6VGA5lqAjsT/JadI5/uiCpA1HtkvPbRHBzUN1MzXogrg |
Create a form that:
- Has a dropdown to select an option from a list
- An input to type out a short sentence
- A longer textbox to write out a paragraph of text
- A submit button
- Has useful labels for each field
- Code that runs when the submit button is clicked
- Code to make a POST request containing the form data
- Code to check form validation
This file contains 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
/* | |
* Example 1 | |
*/ | |
function example1() { | |
return "Ali".ToUpperCase(); | |
} | |
console.log(example1()); | |
/* | |
* Example 2 |