Bitwise in 1010 seconds.
Return 1 where both are 1:
bin dec
| enum CharacterClassifications { | |
| None = 0, | |
| Digit = 1, | |
| Upper = 2, | |
| Lower = 4, | |
| Space = 8, | |
| Control = 16, | |
| SymbolOrPunctuation = Upper | Lower, | |
| AlphaOrDigit = Digit | Upper | Lower | Space | |
| } |
| const UnicodeMap = new Map<string, [number, number]>([ | |
| ["Basic Latin", [32, 127]], | |
| ["Latin-1 Supplement", [160, 255]], | |
| ["Latin Extended-A", [256, 383]], | |
| ["Latin Extended-B", [384, 591]], | |
| ["IPA Extensions", [592, 687]], | |
| ["Spacing Modifier Letters", [688, 767]], | |
| ["Combining Diacritical Marks", [768, 879]], | |
| ["Greek and Coptic", [880, 1023]], | |
| ["Cyrillic", [1024, 1279]], |
| function inheritTimeFrom(source, target) { | |
| var sourceDateTime = new Date(source) | |
| var targetDateTime = new Date(target) | |
| targetDateTime.setHours(sourceDateTime.getHours()) | |
| targetDateTime.setMinutes(sourceDateTime.getMinutes()) | |
| targetDateTime.setSeconds(sourceDateTime.getSeconds()) | |
| targetDateTime.setSeconds(sourceDateTime.getMilliseconds()) | |
| return targetDateTime | |
| } |
| export interface IFile { | |
| name: string | |
| size?: number | |
| type?: string | |
| lastModified?: number | |
| data?: string|ArrayBuffer | |
| } | |
| export enum ReadFileReturnTypes { | |
| Text = "text", |
| const slug = s => s | |
| .toString() // ensure string | |
| .normalize("NFD") // convert to unicode normalization form using (N)normalization (F)form canonical (D)decomposition | |
| // aka. remove accent and leave base | |
| .replace(/[\u0300-\u036f]/g, "") // remove range combining grave accent to combining lating small letter x | |
| .toLowerCase() // lower chars | |
| .trim() // trim whitespace | |
| .replace(/\s+/g, '-') // replace space(s) with dash | |
| .replace(/[^\w-]+/g, "") // remove things not a-z A-Z 0-9 or - | |
| .replace(/--+/g, '-') // replace double dash with single dash |
| :root { | |
| font-size:24px; | |
| --backgroundColor: rgba(255, 255, 255); | |
| --squareColor: rgba(100, 100, 100, .5); | |
| --squareSize: 2em; | |
| } | |
| @media (prefers-color-scheme: dark) { | |
| :root { | |
| --backgroundColor: rgb(0, 0, 0); |
| /// <summary> | |
| /// Executes a list of functions, in parallel managed by a semaphore. | |
| /// </summary> | |
| /// <typeparam name="T"></typeparam> | |
| /// <param name="values">The values to act on.</param> | |
| /// <param name="maxDegreeOfParallelism">Maximum degree of parallelism when executing functions.</param> | |
| /// <param name="fn">Function to call using value.</param> | |
| /// <returns></returns> | |
| public static async Task ManagedForEachAsync<T>(this IEnumerable<T> values, int maxDegreeOfParallelism, Func<T, Task> fn) | |
| { |
| # Nuget packaging thing | |
| # | |
| # Use this guy to pack and push .nupkg from your .csproj | |
| # | |
| # Note: nuget.exe pack will assume a .nuspec file already exist | |
| # if not then create one yourself: nuget.exe spec. | |
| # This is not done automatically, as you probably wan't to | |
| # customize this your self, before running this. | |
| # | |
| # This will check if the assembly version on given project |
| var isTrue = function (value) { | |
| if ('string' === typeof (value)) value = value.toLowerCase().trim(); | |
| return ['true', '1', 'on', 'yes', 1].indexOf(value) > -1; | |
| }; |