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 promptYesNo ($title, $question) { | |
$choices = '&Yes', '&No' | |
$decision = $Host.UI.PromptForChoice($title, $question, $choices, 1) | |
$decision -eq 0 | |
} | |
function Convert-GithubVersion($githubVersionString) { | |
[System.Version]$githubVersionString.Substring(1) | |
} |
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
"use strict" | |
// The following are equivalent (functionally) | |
// Async await | |
async function simple() { | |
await setTimeout(() => console.log("hello, world!"), 1000); | |
} | |
// Promises | |
function simple_promise() { |
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
// Case 1: accidentally capturing an outer object in a lambda | |
class Foo { | |
constructor(arr) { | |
this.sayHellos = []; | |
for (const languageData of arr) { | |
this.sayHellos.push(() => { | |
console.log(languageData.hello); // oops, languageData is captured, even though it is not needed after this call | |
}); | |
}; | |
} |
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
{ | |
"version": "0.8.0-dev.1479-aa1c78056", | |
"description": "General-purpose programming language designed for robustness, optimality, and maintainability.", | |
"homepage": "https://ziglang.org/", | |
"license": "MIT", | |
"suggest": { | |
"vcredist": "extras/vcredist2019" | |
}, | |
"architecture": { | |
"64bit": { |
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
const chalk = require("chalk"); | |
// Credit to evanw himself: https://github.com/evanw/esbuild/issues/619 | |
const makeAllPackagesExternalPlugin = { | |
name: "make-all-packages-external", | |
setup(build) { | |
const filter = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/; // Must not start with "/" or "./" or "../" | |
build.onResolve({ filter }, args => ({ | |
path: args.path, | |
external: true, |
OlderNewer