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
<!doctype> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>CSS Grid and Flexbox Demo</title> | |
<meta name="Author" content="tb"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
/* These styles are the default for mobile and desktop */ |
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
// two ways to get a random integer between zero and another (e.g. between 0 and 100) | |
// method 1 | |
// Math.trunc (new ES6) truncates the floating point, converting the value to an integer. | |
const maxVal = 100; | |
const randomInt = Math.trunc(maxVal * Math.random()); | |
// method 2 | |
// the left shift operator (<<) |
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
# Setting Up to Use Git | |
Github > Settings > Branches > Default branch --> change to main | |
For your local Git install, there is a config option called init.DefaultBranch. Just set it and forget it. | |
__git config --global init.defaultBranch main__ | |
You're good going forward! |
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
function convertMilitaryToStandard(militaryTime) { | |
let hours = militaryTime.substring(0,2); | |
let minutes = militaryTime.substring(3,5); | |
let meridian = (hours >= 12) ? "PM" : "AM"; | |
let convertedTime = ((parseInt(hours) + 11) % 12 + 1) + ":" + minutes; | |
return convertedTime + " " + meridian; | |
}; |
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
/* From MDN */ | |
/* | |
* Clearing overlapping floats: | |
* To solve this problem is to use the value flow-root of the display property. | |
* This exists only to create a block formatting context (BFC) without using hacks — | |
* there will be no unintended consequences when you use it. | |
*/ | |
.wrapper { |
OlderNewer