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
import {get} from "https" | |
import {once} from "events"; | |
export async function stream(url) { | |
const [inbound] = await once(get(url), 'response'); | |
const completed = once(inbound, 'end'); | |
async function* request() { | |
const [line] = await Promise.race([ | |
once(inbound, 'data'), |
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
import {get} from "https" | |
import {once} from "events"; | |
export async function stream(url) { | |
const [inbound] = await once(get(url), 'response'); | |
async function* request(completed) { | |
const raceList = await Promise.race([ | |
once(inbound, 'data'), | |
completed, |
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
param( | |
[Parameter(Mandatory=$True, Position=0, ValueFromPipeline=$False)] | |
[System.String] | |
$PATH_ADD | |
) | |
$TARGET = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($PATH_ADD) | |
$PATH = (Get-ItemProperty -Path ‘Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment’ -Name PATH).path | |
$PATH_DIR = $PATH.split(";"); |
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
# run this with an argument to install a nerdfont on windows | |
# run this with no arguments to install all fonts | |
# font name, as seen on https://www.nerdfonts.com/font-downloads | |
param( | |
[Parameter(Mandatory=$False, Position=0, ValueFromPipeline=$false)] | |
[System.String] | |
$fontTarget="*" | |
) | |
# build temp directory for git clone |
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
const routes = //.....\\\\ | |
@NgModule({ | |
declarations: [ | |
AllComponentsThatPersistAlways | |
], | |
imports: [BrowserModule, FormsModule, HttpModule, RouterModule.forRoot(routes)], | |
providers: [ | |
{ | |
provide: RouteReuseStrategy, |
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
import {DefaultRouteReuseStrategy} from '@angular/router/src/router'; | |
import {ActivatedRouteSnapshot} from '@angular/router'; | |
export class CustomRouteReuseStrategy extends DefaultRouteReuseStrategy { | |
shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean { | |
let name = future.component && (<any>future.component).name; | |
return super.shouldReuseRoute(future, curr) && name !== 'ThisWouldBeAComponentThatShouldReload'; | |
} | |
} |
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
$BIN = ("C:\Program Files\Jetbrains","$env:LOCALAPPDATA\Jetbrains") | |
$TOOL = Get-Childitem ` | |
-Recurse ` | |
–Path $BIN ` | |
-Filter webstorm64.exe ` | |
| Select-Object -first 1 ` | |
| %{$_.FullName} | |
if (!$TOOL) { | |
Write-Output "This script could not find webstorm " |
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
package com.wosome.sc; | |
import com.wosome.woda.WO; | |
import com.wosome.woda.WOCore; | |
import com.wosome.woda.WOFlag; | |
import java.util.HashMap; | |
public class Core extends WOCore implements WOCore.WOCoreOnLaunch { |