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
2022-05-29 15:42:31 |
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 Promise from 'bluebird'; | |
import request from 'request-promise'; | |
import { config, extractParam } from '../../../utils'; | |
export async function login(solution, systemAccount) { | |
return Promise.resolve().then(async () => { | |
const $loginFailedException = new Error('Login failed'); | |
let authForm = buildAuthForm(solution, systemAccount); | |
let authEndpoint = getEndpoint('/cgi-bin/new-judge'); |
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 request from 'request-promise'; | |
import cheerio from 'cheerio'; | |
import { config } from "../../../utils"; | |
import { getClearedSolutionId } from "./getVerdict"; | |
const ACM_SOLUTIONS_ENDPOINT = '/cgi-bin/new-judge'; | |
export async function getCompilationError(systemAccount, contextRow) { | |
let { jar, sid } = systemAccount; | |
let { solutionId } = contextRow; |
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
declare const NegativeKey: unique symbol; | |
declare const PositiveKey: unique symbol; | |
type Negative<T extends number> = T & { [NegativeKey]?: true }; | |
type Positive<T extends number> = T & { [PositiveKey]?: true }; | |
type IsNegative<T> = keyof NonNullable<T> extends keyof Omit<NonNullable<T>, typeof NegativeKey> ? false : true; | |
type IsPositive<T> = keyof NonNullable<T> extends keyof Omit<NonNullable<T>, typeof PositiveKey> ? false : true; | |
type ToNumber<T extends number> = T extends infer N & { [NegativeKey]?: true } |
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
type CapitalLetters = | |
| 'A' | |
| 'B' | |
| 'C' | |
| 'D' | |
| 'E' | |
| 'F' | |
| 'G' | |
| 'H' | |
| 'I' |
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 ObjectConstructor { | |
keys<T>(o: T): ObjectKeys<T> | |
} | |
type ObjectKeys<T> = | |
T extends object ? (keyof T)[] : | |
T extends number ? [] : | |
T extends Array<any> | string ? string[] : | |
never; |
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 { withNaming } from '@bem-react/classname'; | |
// mg-sticky шифруется aab, | |
// чтобы сгенерированный класс совпадал с css — хардкодим целиком | |
export const cls = withNaming({ e: '__' })('mg-sticky'); |
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 { withNaming } from '@bem-react/classname'; | |
// mg-sticky шифруется aab, | |
// чтобы сгенерированный класс совпадал с css — хардкодим целиком | |
export const cls = withNaming({ e: '__' })('mg-sticky'); |
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 SSID = 'alexander'; | |
const PASSWORD = '12341234'; | |
const button = require('@amperka/button').connect(P7, { holdTime: 0.6 }); | |
const led = require('@amperka/led').connect(P6); | |
const memory = require('@amperka/card-reader').connect(P8); | |
const http = require('http'); | |
const wifi = require('@amperka/wifi').setup((err) => { | |
if (err) { |
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 SSID = 'alexander'; | |
const PASSWORD = '12341234'; | |
const NAME = 'my-temperature'; | |
const button = require('@amperka/button').connect(P7, { holdTime: 0.6 }); | |
const led = require('@amperka/led').connect(P6); | |
const dweet = require('@amperka/dweetio').connect(NAME); | |
const memory = require('@amperka/card-reader').connect(P8); | |
const server = require('@amperka/server').create(); |
NewerOlder