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
-- https://github.com/MassTransit/MassTransit/discussions/4847 | |
CREATE TABLE inbox_state | |
( | |
id bigint GENERATED BY DEFAULT AS IDENTITY, | |
message_id uuid NOT NULL, | |
consumer_id uuid NOT NULL, | |
lock_id uuid NOT NULL, | |
row_version bytea, | |
received timestamp with time zone NOT NULL, | |
receive_count integer NOT NULL, |
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
-- https://github.com/MassTransit/MassTransit/discussions/4847 | |
CREATE TABLE [InboxState] ( | |
[Id] bigint NOT NULL IDENTITY, | |
[MessageId] uniqueidentifier NOT NULL, | |
[ConsumerId] uniqueidentifier NOT NULL, | |
[LockId] uniqueidentifier NOT NULL, | |
[RowVersion] rowversion NULL, | |
[Received] datetime2 NOT NULL, | |
[ReceiveCount] int NOT NULL, | |
[ExpirationTime] datetime2 NULL, |
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
using System.Text.RegularExpressions; | |
using NLua; | |
Dictionary<string, Cell> Spreadsheet = new(); | |
Spreadsheet["EngineeringHours"] = new StaticCell(200); | |
Spreadsheet["QAMultiplier"] = new StaticCell(0.4); | |
Spreadsheet["QAHours"] = new FormulaCell("EngineeringHours * QAMultiplier"); | |
Spreadsheet["EngineeringRate"] = new StaticCell(130); | |
Spreadsheet["QARate"] = new StaticCell(100); | |
Spreadsheet["TotalCost"] = new FormulaCell("(EngineeringHours * EngineeringRate + QAHours * QARate) * 1.2"); |
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
<html> | |
<head> | |
<script type="text/javascript" src="https://jstest.authorize.net/v1/Accept.js"></script> | |
<script type="text/javascript"> | |
(function () { | |
/** | |
* @param {SecureData} data | |
*/ | |
function send(data) { | |
console.log('send', 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
export type LoadingStatus = 'idle' | 'loading' | 'fulfilled' | 'rejected'; | |
export type LoadingState<T, E = Error> = | |
| { state: 'idle' } | |
| { state: 'loading' } | |
| { state: 'fulfilled'; data: T } | |
| { state: 'rejected'; error: E }; | |
export const LoadingStates = { | |
idle<T, E = Error>() { | |
return { state: 'idle' } as LoadingState<T, E>; |
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
/** | |
* Provides a cache of look up data | |
* | |
* consumers can subscribe or use async-pipe to get the list of lookup values in each category | |
* | |
* shareReplay(1) will make it so that each subscriber gets the last emitted value rather than making | |
* another API call | |
* take(1) is just a convenience for the consumers in case they forget to unsubscribe it will | |
* only emit once and then complete, to avoid a memory leak | |
*/ |
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
/** | |
* rxjs operator to convert a observable to an obserable of Results | |
*/ | |
export function wrapResult<T>(): UnaryFunction<Observable<T>, Observable<Result<T, Error>>> { | |
return pipe( | |
map<T, Ok<T, Error>>((emitted) => new Ok<T, Error>(emitted)), | |
catchError((error: Error) => of(new Err<T, Error>(error))) | |
); | |
} |
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
Clear-Host | |
Echo "Keep-alive with Scroll Lock..." | |
$WShell = New-Object -com "Wscript.Shell" | |
while ($true) | |
{ | |
$WShell.sendkeys("{SCROLLLOCK}") | |
Start-Sleep -Milliseconds 100 | |
$WShell.sendkeys("{SCROLLLOCK}") |
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 function debug<T>(label: string) { | |
return tap<T>( | |
next => console.log(`[${label}]`, next), | |
err => console.error(`[${label} -- ERR]`, err), | |
() => console.log(`[${label}]`, 'complete') | |
); | |
} | |
/* | |
Use: |
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
{ | |
"singleQuote": true, | |
"printWidth": 120, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"trailingComma": "es5", | |
"bracketSpacing": true | |
} |
NewerOlder