These files goes into your user profile folder, which can be found at about:profiles
.
The user.js
file goes into the root of the profile directory, and userChrome.css
and userContent.css
goes into a subfolder called chrome
.
Param( | |
[Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
$InputObject | |
) | |
begin { | |
$tempfile = [System.IO.Path]::GetTempFileName(); | |
$collection = @(); | |
} | |
process { |
#requires -version 5 | |
<# | |
.Synopsis | |
Processes a path | |
.Description | |
This is a template for creating Powershell functions that processes paths | |
.Parameter Path | |
The path(s) to process | |
.Inputs | |
System.IO.DirectoryInfo |
class Guid { | |
public static newGuid(): Guid { | |
return new Guid(crypto.randomUUID()); | |
// Old IE supported way: | |
/*return new Guid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { | |
const r = Math.random() * 16 | 0; | |
const v = (c == 'x') ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}));*/ |
DELIMITER | | |
CREATE FUNCTION uuid_from_bin(b BINARY(16)) | |
RETURNS CHAR(36) DETERMINISTIC | |
BEGIN | |
DECLARE hex CHAR(32); | |
SET hex = HEX(b); | |
RETURN CONCAT(LEFT(hex, 8), '-', MID(hex, 9,4), '-', MID(hex, 13,4), '-', MID(hex, 17,4), '-', RIGHT(hex, 12)); | |
END | |
| |
These files goes into your user profile folder, which can be found at about:profiles
.
The user.js
file goes into the root of the profile directory, and userChrome.css
and userContent.css
goes into a subfolder called chrome
.
<Query Kind="Program"> | |
<NuGetReference>Newtonsoft.Json</NuGetReference> | |
<Namespace>Newtonsoft.Json</Namespace> | |
<Namespace>System.Globalization</Namespace> | |
</Query> | |
void Main() | |
{ | |
// Write code to test your extensions here. Press F5 to compile and run. | |
} |
interface Disposable { | |
dispose(): void; | |
} | |
function using<T extends Disposable>(instance: T, fn: (instance: T) => any) { | |
try { | |
fn(instance); | |
} finally { | |
instance.dispose(); | |
} | |
} |
<# | |
.Synopsis | |
Reads a file, and beeps on 0 or 1. | |
.Description | |
Reads a textfile, beeps once for every 0 and twice for 1 it finds in the text. | |
.Parameter Path | |
The file to read | |
.Inputs | |
System.IO.FileInfo | |
.Example |
/** | |
* Reads a object at runtime and serializes it into metadata. | |
* Need serious improvements, but does some of the work. | |
* @returns metadata. | |
* @returns typescript definition text. | |
*/ | |
function (targetvar){ | |
// TODO: Find a way to recognize a class from a function. | |
// TODO: Find out how to detect arrays (should be easy). | |
// TODO: Create separate interfaces instead of a nested interface. |
/** | |
* Removes ReadOnly from all properties on an interface. | |
*/ | |
type Mutable<T> = { | |
-readonly [P in keyof T]: T[P] extends ReadonlyArray<infer U> ? Mutable<U>[] : Mutable<T[P]> | |
}; |