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
{ | |
"name": "Acheron Project Doddle60", | |
"vendorId": "0x4150", | |
"productId": "0x4436", | |
"matrix": {"rows": 5, "cols": 14}, | |
"lighting": "none", | |
"layouts": { | |
"labels": [ | |
"Split backspace", | |
"Stepped Caps Lock", |
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
{"lastUpload":"2020-01-17T12:24:26.067Z","extensionVersion":"v3.4.3"} |
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
// | |
// `GetTokenAsync` usage | |
// | |
protected override async Task<HttpResponseMessage> SendAsync( | |
HttpRequestMessage request, | |
CancellationToken cancellationToken) | |
{ | |
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _httpContextAccessor.HttpContext.GetTokenAsync("access_token").Result); |
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 { ThunkAction, ThunkDispatch } from 'redux-thunk' | |
import { AnyAction, Action, Dispatch } from 'redux' | |
export type PayloadCallback<State, Actions extends AnyAction, Payload> = ( | |
dispatch: ThunkDispatch<State, undefined, Actions>, | |
payload: Payload /*, getState: () => State */ | |
) => Promise<Action> | |
export type Callback<State, Actions extends AnyAction> = ( | |
dispatch: ThunkDispatch<State, undefined, Actions> /*, getState: () => State */ |
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 StringBool = "true" | "false"; | |
interface AnyNumber { prev?: any, isZero: StringBool }; | |
interface PositiveNumber { prev: any, isZero: "false" }; | |
type IsZero<TNumber extends AnyNumber> = TNumber["isZero"]; | |
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" }; | |
type Prev<TNumber extends PositiveNumber> = TNumber["prev"]; | |
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
function foo<T = undefined>(...args: OptionalSpread<T>){ | |
const arg = args[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
var foo = function () { | |
var args = []; | |
for (var _i = 0; _i < arguments.length; _i++) { | |
args[_i] = arguments[_i]; | |
} | |
var arg = args[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
function foo(...args: [number, string, boolean]): void; | |
function foo(args_0: number, args_1: string, args_2: boolean): void; |
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 OptionalSpread<T> = | |
T extends undefined | |
? [] | |
: [T] | |
function foo<T = undefined>(...args: OptionalSpread<T>){ | |
const arg = args[0] // Type of: T = undefined | |
if (arg === undefined) | |
doThis() |
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
function foo<T>(arg: T) { | |
if (arg === undefined) | |
doThis() | |
else | |
doThat(arg) | |
} | |
// number | |
foo<number>(42) // OK | |
foo<number>() // ERROR: 1 argument expected |
NewerOlder