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
# Might not work before Powershell 7 (`$PSVersionTable`) | |
# Might not work before Posh-Git v1 (https://github.com/dahlbyk/posh-git#installing-posh-git-via-powershellget-on-linux-macos-and-windows) | |
# | |
# Find this file's path by running `$Profile` | |
Import-Module posh-git | |
$begin = (Get-Date) | |
function Prefix { |
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
/* adapted from recommended but unmaintained and archived | |
smol/declaration-bundler-webpack-plugin. Rather than maintaining a fork, let's | |
just see how far we can get by rolling it in */ | |
module.exports = class DeclarationBundlerPlugin | |
{ | |
out /* :string */; | |
moduleName /* :string */; | |
mode /* :string */; |
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
#nowarn "40" | |
open System | |
// Complete Monadic Parsing "Library" | |
type Parser<'r> = Parser of (char list -> ('r*char list) list) | |
let parse (Parser p) = p | |
let (>>=) p f = Parser(fun cs -> | |
List.concat [for (r,cs') in parse p cs -> parse (f r) cs']) |
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
/** | |
* DSL for specifying graphs of nodes and edges. | |
* Graphs are immutable and create a new graph object for each operation. | |
* Graphs are stateful about a subject node and a subject edge for purposes of | |
* creating new edges and adding attributes to the subject node or subject edge. | |
* From the perspective of a user DSL code listing, the last _mentioned_ node is the | |
* subject node to which new edges or attributes are added and the last mentioned | |
* edge is the subject edge to which attributes are added. | |
*/ | |
namespace Raph { |
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 ILiteEvent<T> { | |
on(handler: T extends void | |
? { (): void } | |
: { (data: T): void }): void; | |
off(handler: T extends void | |
? { (): void } | |
: { (data: T): void }): void; | |
} | |
class LiteEvent<T> implements ILiteEvent<T> { |
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
export interface LockStep<T = void> { | |
edge : Promise<T>; | |
} | |
export class LockStepper<T = void> implements LockStep<T> { | |
private _edge! : Promise<T>; | |
private _resolve! : (value?: T | PromiseLike<T> | undefined) => void; | |
constructor () { | |
this.rearm(); |
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
git remote get-url origin | |
git remote set-url origin https://... |
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
Get-ChildItem -r C:\Repos\... | | |
Select-String -Pattern '^\s*import\s+((?:[^\s{]+)|(?:\*\sas\s[^\s]+))\s+from\s+[''"](\.[^''"]*)[''"];?\s*$' -AllMatches | | |
Foreach-Object { "import $($_.Matches.Groups[1].Value) from '$([System.IO.Path]::GetFullPath([System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($_.Path), $_.Matches.Groups[2].Value.replace("/", "\"))))'" } | |
Get-Unique |
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
dir -Recurse -Filter "*.js" -Exclude ".git" | rename-item -NewName {$_.name -replace "\.js",".ts"} |
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
window.addEventListener('load', function(e) { | |
var pieces = [ | |
[ 28, 6 ], | |
[ 28, 14 ], | |
[ 21, 18 ], | |
[ 10, 7 ], | |
[ 32, 11 ], | |
[ 14, 4 ], | |
[ 28, 7 ], | |
[ 21, 14 ], |
NewerOlder