- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
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
// Find the right method, call on correct element | |
function launchFullscreen(element) { | |
if(element.requestFullscreen) { | |
element.requestFullscreen(); | |
} else if(element.mozRequestFullScreen) { | |
element.mozRequestFullScreen(); | |
} else if(element.webkitRequestFullscreen) { | |
element.webkitRequestFullscreen(); | |
} else if(element.msRequestFullscreen) { | |
element.msRequestFullscreen(); |
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
<div class="table-responsive"> | |
<table class="table table-hover"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Email</th> | |
<th>Published</th> | |
<th>Comment Date</th> | |
</tr> | |
</thead> |
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
<select name="user[time_zone]" id="user_time_zone"> | |
<option value="American Samoa">(GMT-11:00) American Samoa</option> | |
<option value="International Date Line West">(GMT-11:00) International Date Line West</option> | |
<option value="Midway Island">(GMT-11:00) Midway Island</option> | |
<option value="Hawaii">(GMT-10:00) Hawaii</option> | |
<option value="Alaska">(GMT-09:00) Alaska</option> | |
<option value="Pacific Time (US & Canada)">(GMT-08:00) Pacific Time (US & Canada)</option> | |
<option value="Tijuana">(GMT-08:00) Tijuana</option> | |
<option value="Arizona">(GMT-07:00) Arizona</option> | |
<option value="Chihuahua">(GMT-07:00) Chihuahua</option> |
- Terraform is a tool used for building, changing, and versioning infrastructure safely and efficiently
- It supports many service providers, likewise one could roll their own custom or in-house solutions
- IAC is defined using high-level languages
HCL
and good ol'JSON
- We'll start with
HCL
later on as it's more commonly used for these purposes
- We'll start with
- Sysadmins used to purchase hardware, set up servers with network and software, and also maintain/modify them manually
- Repetitive and time consuming
- By definition, IAC is the process of managing and provisioning infrastructure through code instead of physical hardware configuration and interactive configuration tools
This document assumes you already have Docker installed and likewise are familiar with its use-cases. In essence, Docker is used to package our applications as standardized executable components (containers) that combine application source code with all the operating system libraries and dependencies required to run the code in any (typically cloud) environment(s).
There are many benefits to this, and there are likewise many caveats. Refer to Google to learn more.
You should already know how to create a simple Node app with a single endpoint, but if you don't...
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
// ExchangeRate API Supported Currencies | |
const currencies = { | |
"AED": { | |
"FIELD2": "UAE Dirham", | |
"FIELD3": "United Arab Emirates" | |
}, | |
"AFN": { | |
"FIELD2": "Afghan Afghani", | |
"FIELD3": "Afghanistan" | |
}, |
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
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
guard let scene = (scene as? UIWindowScene) else { return } | |
let vc = ViewController() | |
let nc = UINavigationController(rootViewController: vc) | |
window = UIWindow(frame: scene.coordinateSpace.bounds) | |
window?.windowScene = scene | |
window?.rootViewController = nc | |
window?.makeKeyAndVisible() |
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
// UIViewController extension to get root VC | |
func getRootViewController(of nestedViewController: UIViewController) -> UIViewController? { | |
return nestedViewController.view.window?.rootViewController | |
} | |
// In use inside non-root VC | |
let vc = UINavigationController(rootViewController: CurrencySelectorViewController(type: type)) | |
vc.modalPresentationStyle = .overFullScreen | |
if let root = getRootViewController(of: self) { |
OlderNewer