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
/* | |
Here are some short exercises to give you extra practice writing SCSS, and especially with refactoring regular CSS into SCSS. | |
You can double-check your SCSS by plugging it into Sassmeister, and see if the compiled CSS matches the starting point code: | |
http://www.sassmeister.com/ | |
The Sass documentation is a great resource and can be found here: http://sass-lang.com/documentation/ | |
*/ | |
/* | |
Example - Write the following CSS using nested rules: |
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
// Returns an array of dates between the two dates | |
function getDates (startDate, endDate) { | |
const dates = [] | |
let currentDate = startDate | |
const addDays = function (days) { | |
const date = new Date(this.valueOf()) | |
date.setDate(date.getDate() + days) | |
return date | |
} | |
while (currentDate <= endDate) { |
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
/** | |
* usage | |
* DIR='public/js' node directory-size.js | |
* => "size of public/js is: 12,432 | |
*/ | |
var fs = require('fs'), | |
_ = require('./underscore'); // requires underscore for _.flatten() | |
function format(n) { |