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
interface Client { | |
pay(): void; | |
} | |
interface VIP extends Client { | |
fastPay(): void; | |
} | |
interface Cashier { | |
handleAnyClient(client: Client): void; // wider and narrower Clients allowed |
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
// to be run in the browser | |
// at https://www.youtube.com/playlist?list=WL | |
// might need a few reruns based on the number of items | |
function removeWatchLaterItems() { | |
const items = Array.from(document.querySelector("div.ytd-playlist-video-list-renderer:nth-child(3)").children); | |
for (let i = 0; i < items.length; i++) { | |
const item = items[i]; | |
setTimeout(() => { |
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
module.exports = function (_wallaby) { | |
return { | |
files: ['src/**/*.ts', '!src/**/*spec.ts'], | |
tests: ['src/**/*spec.ts'], | |
testFramework: 'jest', | |
env: { | |
type: 'node', |
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
const withDefaults = ( | |
{ | |
a = 'a default', | |
b | |
}: { | |
a?: string; | |
b?: number; | |
} | |
) => console.log(a, b); |
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
dpkg --print-architecture | |
# amd64 | |
uname -m | |
# x86_64 |
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
const nested = { a: { b: { c: { d: 1 } } } }; | |
// { a: { b: { c: [Object] } } } | |
console.log(nested); | |
// { | |
// a: { b: { c: { d: 1 } } } | |
// } | |
console.log( | |
util.inspect(nested, { depth: null, colors: true }) |
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
type ReadonlyRecord<Record> = { | |
readonly [Key in keyof Record]: ReadonlyRecord<Record[Key]> | |
} |
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
#!/usr/bin/env bash | |
# Script adapted from https://golangcode.com/updating-go-on-ubuntu/ | |
set -o errexit | |
main () { | |
if ! [[ -z "$1" ]] | |
then | |
printf "❕ To update Go to the latest version, you do not need to provide any arguments.\nAlternatively, provide just the name of the specific Linux archive, e.g. go1.19.linux-amd64.tar.gz\n\n" |
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
describe('Assertions with expected value alias', () => { | |
it('reports the failure with a meaningul message', async () => { | |
expect(7).toBe(42, 'The Answer to the Ultimate Question of Life, the Universe, and Everything'); | |
}); | |
it('given no custom value alias, it reports the failure with the standard message', async () => { | |
expect(7).toBe(42); | |
}); | |
}); |
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
version: '2.4' | |
services: | |
postgres: | |
image: postgres:12.4 | |
restart: always | |
command: [ | |
"postgres", | |
"-c", | |
"log_statement=all", | |
"-c", |
NewerOlder