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
@mixin for-phone-only { | |
@media (max-width: 599px) { @content; } | |
} | |
@mixin for-tablet-portrait-up { | |
@media (min-width: 600px) { @content; } | |
} | |
@mixin for-tablet-landscape-up { | |
@media (min-width: 900px) { @content; } | |
} | |
@mixin for-desktop-up { |
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
const something = ()=>{ | |
console.log(this | |
} |
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
{ | |
"name": "my-app", | |
"version": "1.0.0", | |
"description": "My test app", | |
"main": "src/js/index.js", | |
"scripts": { | |
"jshint:dist": "jshint src/js/*.js", | |
"jshint": "npm run jshint:dist", | |
"jscs": "jscs src/*.js", | |
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js", |
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
const endpoint = 'https://www.gov.uk/bank-holidays.json'; | |
const ul = document.getElementById('holidays') | |
let bankHolidays; | |
let england; | |
fetch(endpoint) | |
.then(blob => blob.json()) | |
.then(data => handleDates(data)); | |
function handleDates(data) { | |
bankHolidays = data; |
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
var elementsInsideBody = [...document.body.getElementsByTagName('*')]; | |
// This makes an array of everything inside the body tag | |
//a function that loops through every single item | |
function findAndReplace(){ | |
elementsInsideBody.forEach(element =>{ | |
element.childNodes.forEach(child =>{ | |
if(child.nodeType === 3){ | |
replaceText(child); |
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
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |
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
rm -rf node_modules && npm install | |
//ERROR: | |
//ReferenceError: internalBinding is not defined at fs.js:25:1 | |
// SOLUTION: | |
// When you update node you need to run rm -rf node_modules && npm install | |
//to rebuild/reinstall your native modules against your new node version. |
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
// GitHub: git clone someone else's repository & git push to your own repository | |
// Create a new repository at github.com. (this is your repository) | |
// Give it the same name as the other repository. | |
// Don't initialize it with a README, .gitignore, or license. | |
// Clone the other repository to your local machine. (if you haven't done so already) | |
// git clone https://github.com/other-account/other-repository.git | |
// Rename the local repository's current 'origin' to 'upstream'. |
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
const order = [ | |
{ | |
width: 8, | |
height: 9, | |
depth: 7, | |
}, | |
{ | |
width: 18, | |
height: 29, | |
depth: 37, |
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
class Parcel { | |
constructor(dimensions) { | |
this.dimensions = dimensions; | |
this.parcelSize = Parcel.returnParcelSize(dimensions); | |
this.price = Parcel.calculatePrice(dimensions); | |
} | |
static get prices() { | |
return { |
OlderNewer