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
| #!/bin/bash | |
| multipass launch \ | |
| --cpus 8 \ | |
| --disk 50G \ | |
| --memory 16G \ | |
| --name charm-dev \ | |
| --mount ~/multipass-scripts \ | |
| --mount ~/repos \ | |
| 24.04 |
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
| import Foundation | |
| let args = CommandLine.arguments | |
| print(args.joined(separator: " ")) | |
| if (args.count != 4) { | |
| print("Usage: download.swift <video-url> <audio-url> <file-name>") | |
| exit(1) | |
| } | |
| let videoURL = args[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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "strconv" | |
| "strings" | |
| "sync" | |
| // "runtime" |
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
| repeat 10 times | |
| tell application "Microsoft Edge" | |
| activate | |
| set query to (random number from 1 to 9999) as text | |
| set link to "https://www.bing.com/search?pglt=41&q=" & query & ....... | |
| open location link | |
| end tell | |
| end repeat |
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
| import { expect } from "@playwright/test" | |
| module.exports = { | |
| toBeContainedIn(got: any, expected: any[]) { | |
| const assertionName = 'toBeContainedIn' | |
| let pass: boolean | |
| let matcherResult: any | |
| // We use the default expect as basis for our assertion | |
| try { |
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
| /** | |
| * | |
| * @param {string} value a string containing a number | |
| * @returns {Number} the converted number | |
| * @warning This function cannot parse an ambiguous string such as '150.000' | |
| */ | |
| export function convertToNumber(value, decimalPositions = 2) { | |
| function englishFormat(value) { | |
| // English format number e.g. 1,234.56 |
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
| import path from "path"; | |
| const unzip = require("extract-zip") | |
| const zipPath = path.resolve('path', 'to', `archive.zip`) | |
| const unzipPath = path.resolve('directory', `to`, `extract`) | |
| /** Create a directory to be used as target for the unzip */ | |
| if (process.platform == 'win32') { | |
| await execShellCommand(`if not exist ${unzipPath} mkdir ${unzipPath}`) | |
| } else { |
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
| import fs from 'fs'; | |
| import path from 'path'; | |
| import { FullConfig, FullResult, Reporter, Suite, TestCase, TestResult, TestStep, TestStatus } from '@playwright/test/reporter'; | |
| import { execSync as exec } from 'child_process'; | |
| function ms(ms: number): string { | |
| if (!isFinite(ms)) | |
| return '-'; | |
| if (ms === 0) |