The initial source comes from sdcuike/issueBlog#4
https://github.com/PacktPublishing free to download books code by Packet
https://github.com/EbookFoundation/free-programming-books Very immense
# 1. Build our Angular app | |
FROM node:alpine as builder | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
ENV CI=1 | |
RUN npm ci | |
COPY . . | |
RUN npm run build -- --prod --output-path=/dist |
type State = { | |
added: boolean; | |
interval: false | ReturnType<typeof setInterval>; | |
inFrame: boolean; | |
callbacks: Array<SetFocusedCallback>; | |
}; | |
type EnrichedHTMLIFrameElement = HTMLIFrameElement & { ___onWindowFocusHandled: boolean }; | |
type SetFocusedCallback = (focused?: boolean) => void; |
// import fetch from 'isomorphic-unfetch'; | |
const RETRIES = 5; | |
/** | |
* Example: | |
* global.fetch = fetchWithRetry; | |
*/ | |
function fetchWithRetry(url, options) { |
sudo rm -Rf ~/Library/Caches/com.microsoft.VSCode.ShipIt | |
sudo rm -Rf ~/Library/Caches/com.microsoft.VSCodeInsiders.ShipIt |
https://github.com/PacktPublishing free to download books code by Packet
https://github.com/EbookFoundation/free-programming-books Very immense
Over the years there’s been a steadily increasing ecosystem of JavaScript components to choose from. The sheer amount of choices is fantastic, but this also infamously presents a difficulty when components are mixed-and-matched. And it doesn’t take too long for budding developers to find out that not all components are built to play nicely together.
To address these issues, the competing module specs AMD and CommonJS have appeared on the scene, allowing developers to write their code in an agreed-upon sandboxed and modularized way, so as not to “pollute the ecosystem”.
Asynchronous Module Definition (AMD) has gained traction on the frontend, with RequireJS being the most popular implementation.
Here’s module foo
with a single dependency on jquery
:
This document is written to help JavaScript developers to understand JavaScript's weird parts deeply and to prepare for interviews, the following resources was really helpful to write this document:
// Forked from https://codepen.io/gapcode/pen/vEJNZN | |
// Get IE or Edge browser version | |
var version = detectIE(); | |
if (version === false) { | |
document.getElementById('result').innerHTML = '<s>IE/Edge</s>'; | |
} else if (version >= 12) { | |
document.getElementById('result').innerHTML = 'Edge ' + version; | |
} else { |
#!/bin/bash | |
# Immediately exits if any error occurs during the script | |
# execution. If not set, an error could occur and the | |
# script would continue its execution. | |
set -o errexit | |
# Creating an array that defines the environment variables | |
# that must be set. This can be consumed later via arrray |