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
/* 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 { |
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
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 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 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 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 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> | |
<html> | |
<head> | |
<title>test</title> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<style> | |
/* Ideally, this stylesheet should be external and linked to this document. | |
it is embedded here to simplify the demo process */ | |
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
<!doctype html> | |
<html> | |
<head> | |
<title>test</title> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<!-- specialized typefaces can be added to a webpage from external sources --> | |
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
<table id="example" class="display" border="1"> | |
<!-- in HTML5 the summary, cellspacing, and cellpadding attributes are obsolete/deprecated --> | |
<caption> Global Employees Listing</caption> | |
<thead> | |
<tr> | |
<th scope="col">Name</th> | |
<th scope="col">Position</th> | |
<th scope="col">Office</th> |
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
<form id="res_form" action="" method="post" accept-charset="utf-8"> | |
<fieldset> | |
<legend>Guest Information<span>* Indicates required field</span></legend> | |
<label for="state">* State/Territory/Associations</label> | |
<select name="state" required title="Please select a state or territory."> | |
<option value="">select your location</option> | |
<optgroup label="US Territories"> | |
<option value="AS">American Samoa</option> | |
<option value="PR">Commonwealth of Puerto Rico</option> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Flexbox Demo</title> | |
<style> |
NewerOlder