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
var setTimeout; | |
(function (setTimeout) { | |
function async(delay) { | |
return new Promise((resolve) => setTimeout(resolve, delay)); | |
} | |
setTimeout.async = async; | |
})(setTimeout || (setTimeout = {})); | |
async function getMessageDateGroupHtml($messageDateGroup) { | |
let lastLoadedMessageId = ""; | |
do { |
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
interface PromiseConstructor { | |
/** | |
* Creates a Promise that is resolved with the value of the first resolved Promise that matches the predicate or rejected if any of the Promises are rejected. | |
* @param promises An array of Promises. | |
* @param [predicate] Optional. A function that is called with the result of each Promise. If the function returns true, the Promise is considered to be resolved. If no predicate is provided, the first truthy resolved Promise is returned. | |
* @returns A new Promise which is resolved with the value of the first resolved Promise that matches the predicate. | |
*/ | |
raceTo<T extends readonly unknown[] | []>(promises: T, predicate?: (result: Awaited<T[number]>) => boolean): Promise<Awaited<T[number]> | undefined>; | |
} |
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
javascript:(function(){Array.from(document.querySelectorAll(`details[data-resolved=true].review-thread-component`)).forEach(({style}) => style.display = style.display === "none" ? "" : "none"); Array.from(document.querySelectorAll(`div.js-timeline-item .TimelineItem.js-comment-container`)).forEach(({style}) => style.display = style.display === "none" ? "" : "none")})() |
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
const WithTryCatch: MethodDecorator = function <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void { | |
const org = descriptor.value as (...args: any[]) => any; | |
if (typeof org !== "function") { return; } | |
descriptor.value = function () { | |
try { | |
console.debug(`withTryCatch: ${String(propertyKey)} trying...`); | |
let result = org.apply(target, Array.from(arguments)); | |
if (result instanceof Promise) { | |
return result | |
.then(r => { |
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 { Observer } from "./vue-helper"; | |
class MapObserver extends Observer { | |
constructor(value: unknown, shallow?: boolean, mock?: boolean) { | |
super(value, shallow, mock); | |
if (!shallow && value instanceof Map) { | |
this.observeArray(value); | |
} | |
} |
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 { StrategyModule } from "./strategy.module"; | |
(async () => { | |
try { | |
const moduleRef = await Test.createTestingModule({ | |
imports: [StrategyModule] | |
}).compile(); | |
const factory = moduleRef.get(StrategyFactoryService); | |
factory.getStrategy("strategy-1").execute(); |
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
(() => { | |
const org = history; | |
const keys = ["pushState", "replaceState"]; | |
keys.forEach(k => { | |
const desc = Object.getOwnPropertyDescriptor(history, k); | |
const value = desc.value; | |
delete desc.value; | |
delete desc.writable; | |
desc.get = function() { | |
debugger; |
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
// Type: Microsoft.AspNetCore.Hosting.Server.Features.IServerAddressesFeature | |
// Assembly: Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 | |
// using Microsoft.AspNetCore.Hosting.Server.Features; | |
public void Configure(IApplicationBuilder app) | |
{ | |
var address = app.ServerFeatures | |
.Select(i => i.Value) | |
.OfType<IServerAddressesFeature>() | |
.SelectMany(f => f.Addresses) |
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
{ | |
"Vue component scaffold": { | |
"prefix": "vue component scaffold", | |
"body": [ | |
"import { Component, Vue } from \"vue-property-decorator\";", | |
"", | |
"@Component", | |
"export default class ${1:${TM_FILENAME_BASE/([-]?)([a-z])([a-z]*)/${2:/upcase}${3}/g}} extends Vue {", | |
"\t${0}", | |
"}", |
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
{ | |
"scaffold multi-file": { | |
"prefix": "multi file scaffold (TS/SCSS)", | |
"body": [ | |
"<template>", | |
"\t${0}", | |
"</template>", | |
"", | |
"<script lang=\"ts\" src=\"./${1:$TM_FILENAME_BASE}.ts\"></script>", | |
"<style lang=\"scss\" src=\"./${1:$TM_FILENAME_BASE}.scss\"></style>", |