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
| from typing import Callable, Generic, TypeVar | |
| T = TypeVar("T") | |
| class Option(Generic[T]): | |
| def __init__(self, value: T) -> None: | |
| self._value: T = value | |
| self._binds: list[Callable] = [] |
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
| Add-Type –AssemblyName UIAutomationClient | |
| Add-Type –AssemblyName UIAutomationTypes | |
| Write-Output "===== UI automation and accessibility test =====" | |
| # start an instance of Microsoft Edge and wait for it to load | |
| Write-Output "Starting an instance of Microsoft Edge" | |
| Start-Process msedge "-inprivate https://en.wikipedia.org/wiki/Main_Page" | |
| Start-Sleep –s 2 |
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
| from typing import Any, Iterator | |
| def yield_unique_in_order(array: list) -> Iterator[tuple[Any, int]]: | |
| """Yields unique value and their respective indices in order. | |
| Args: | |
| array: Array of values. | |
| Returns: | |
| Iterator over unique values and their indices. |
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
| using System; | |
| using System.IO; | |
| using System.Net; | |
| using System.Diagnostics; | |
| using System.IO.Compression; | |
| using System.Collections.Generic; | |
| using System.Runtime.InteropServices; | |
| namespace ScreenRec | |
| { |
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
| using System; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using System.Collections.Generic; | |
| using System.Collections.Concurrent; | |
| namespace dotnetpad | |
| { | |
| class Program | |
| { |
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 (window) { | |
| /* reference exposed api based on browser */ | |
| const API = window.chrome || window.browser; | |
| /* IP address used for calls */ | |
| let IPAddress = "0.0.0.0"; | |
| /* polling period in miliseconds */ |
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
| float A = -2.337, | |
| B = -2.337, | |
| C = 0.2553, | |
| D = 1.378, | |
| dx = 0.1, | |
| dy = 0.1; | |
| float X() { | |
| return A * sin(dx * A) - sin(dy * D); | |
| } |
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 ch.bildspur.postfx.builder.*; | |
| import ch.bildspur.postfx.pass.*; | |
| import ch.bildspur.postfx.*; | |
| /** | |
| * varaibles | |
| */ | |
| float | |
| cx, | |
| cy, |
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 React, { unstable_Profiler as Profiler } from "react"; | |
| /** | |
| * Profiles storage. | |
| */ | |
| const profiles = {}; | |
| /** | |
| * Calculate weighted average. | |
| * @param {number} time - time passed |
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
| /** | |
| * Check if cached record is valid. | |
| * @param {object} cachedValue - cache record | |
| * @param {number} cacheTime - time to cache | |
| * @returns {bool} | |
| */ | |
| const isCached = (cachedValue, cacheTime) => | |
| (new Date() - cachedValue.at) / 1000 < cacheTime; | |
| /** |