text
stringlengths
3.08k
15.5k
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
<gh_stars>1-10 import express from "express"; import Redis from "ioredis"; import LRUCache from "lru-cache"; import type { Webhooks } from "@octokit/webhooks"; import type { Logger } from "pino"; import { ApplicationFunction } from "."; import { Context } from "./context"; import { getAuthenticatedOctokit } from "./o...
<reponame>gfeun/avr8js<filename>src/usart.ts import { CPU } from './cpu'; import { avrInterrupt } from './interrupt'; import { u8 } from './types'; export interface USARTConfig { rxCompleteInterrupt: u8; dataRegisterEmptyInterrupt: u8; txCompleteInterrupt: u8; UCSRA: u8; UCSRB: u8; UCSRC: u8; UBRRL: u8;...
<filename>libs/react-data-access/src/lib/urql-customizations/cache.ts import { Account, AddCartLineAccountMutation, AddCartLineAccountMutationVariables, AddCartLineMutation, BlankCartLineMutation, Cart, CartLine, CartsDocument, CartsQuery, DeleteCartLineAccountMutationVariables, ...
import { TypescriptCtx } from '../types'; import { NodeInfo, collect, CollectResult, CollectMappers } from '@d0/walker'; import { TSESTree } from '@typescript-eslint/types'; import { nodeStatement } from '../walker/typescript-walker'; type SubTypeSummary = { types: string[]; }; type AllTypeNodes = | TSESTree.Type...
<reponame>david-fong/capswalk<filename>src/client/screen/AllScreens.ts import { JsUtils } from ":defs/JsUtils"; import { BaseScreen } from "./BaseScreen"; import type { TopLevel } from "../TopLevel"; import { HomeScreen } from "./impl/Home/Screen"; import { LearningScreen } from "./impl/Learning"; import {...
<filename>packages/mesh-integration-tests/legacy/index.ts<gh_stars>100-1000 import { Mesh, OrderEvent, Verbosity } from '@0x/mesh-browser'; import { Order, orderHashUtils, signatureUtils } from '@0x/order-utils'; import { RPCSubprovider, Web3ProviderEngine } from '@0x/subproviders'; import { BigNumber } from '@0x/utils...
interface InterpolatorOptions { ease: EaseType; duration: number; from: number; to: number; } export class Interpolator { public options: InterpolatorOptions; private startTime: number = -Infinity; public isVirgin = true; constructor(options: InterpolatorOptions) { this.options...
/** * react-loadable taro MOD */ import Nerv from 'nervjs'; import { Component } from '@tarojs/taro-h5'; import keys from 'lodash/keys'; import assign from 'lodash/assign'; const ALL_INITIALIZERS: Function[] = []; const READY_INITIALIZERS: Function[] = []; declare const __webpack_modules__: { [key: string]: any...
import firebase from 'firebase/app' import 'firebase/auth' import 'firebase/messaging' import 'firebase/database' import 'firebase/firestore' import { config } from './config/firebase' import axios from 'axios' import actions from 'redux/actions' import { getState } from 'redux/core' import moment from 'moment/moment...
<filename>src/auth/refreshTokenClient.ts<gh_stars>0 import * as createDebug from 'debug'; import { FORBIDDEN, OK, UNAUTHORIZED } from 'http-status'; import * as request from 'request'; import { COAServiceError, DefaultTransporter } from '../transporters'; import ICredentials from './credentials'; const debug = create...
<reponame>ehtick/luma.gl // Inspired by https://github.com/austinEng/webgpu-samples // under MIT license, Copyright 2019 WebGPU Samples Contributors // @ts-nocheck import updateSprites from './update-sprites.wgsl?raw'; import sprites from './sprites.wgsl?raw'; import {Buffer, RenderPipelineParameters} from '@luma.gl/ap...
<filename>src/backend/transliterator/transliterator.ecstask.ts<gh_stars>0 import * as os from 'os'; import * as path from 'path'; import type { PromiseResult } from 'aws-sdk/lib/request'; import * as fs from 'fs-extra'; import * as docgen from 'jsii-docgen'; import type { TransliteratorInput } from '../payload-schema'...
import { useCallback, useEffect, useRef, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { TokenInfo } from "@airswap/types"; import { getEtherscanWalletURL } from "@airswap/utils"; import { formatUnits } from "ethers/lib/utils"; import { AnimatePresence, useReducedMotion } fr...
<gh_stars>0 import { mat4 } from 'gl-matrix'; import { initShaderProgram } from './Utilities'; import Mesh, { IUniformMatrix4fv } from './Mesh'; const positions = [ // Front face -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, // Back face -1.0, -1.0, -1.0, ...
import * as L from 'leaflet'; import WindCore, { Field, assign, defaultOptions, formatData, IOptions, isArray, createCanvas, } from 'wind-core'; const WindLayer = L.Layer.extend({ options: {}, initialize(id: string | number, data: any, options: any) { if (!id) { throw Error('layer id must ...
"use strict"; import Scene = require("../Scene"); import Vector2 = require("../../utils/Vector2"); import Sprite = require("./Sprite"); import lazyJSON = require("../../utils/lazyJSON"); /** * Actor class * * @date 13-aug-2017 */ interface Animation { frames:number[]; speed:number; } class Actor { ...
import { UserprofileComponent } from '../../user/userprofile/userprofile.component'; import { Injectable, NgZone } from '@angular/core'; import { Worker } from './worker'; import { User } from './user'; import { auth } from 'firebase/app'; import { AngularFireAuth } from '@angular/fire/auth'; import { AngularFirestore,...
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. import * as cp from "child_process"; import * as _ from "lodash"; import * as path from "path"; import * as vscode from "vscode"; import { UNSUPPORTED_CLASS_VERSION_ERROR } from "./anchor"; import { fetchPlatformSet...
<filename>src/tests/db/mockmysqldb.ts // eslint-disable-file no-case-declarations import * as mysql from 'mysql2/promise'; import * as sinon from 'sinon'; export const MOCK_POOL: mysql.ConnectionPool = { getConnection : () => { const mockConnection: mysql.Connection = { execute : mockExecute, ...
import { OphanComponentEvent } from './ophan'; import { ArticlesViewedSettings, UserCohort, Cta, SecondaryCta, Stage, Test, TickerSettings, Variant, WeeklyArticleHistory, tickerSettingsSchema, ctaSchema, Tracking, PageTracking, trackingSchema, secondaryCtaSche...
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import codebuild = require('@aws-cdk/aws-codebuild'); import codecommit = require('@aws-cdk/aws-codecommit'); import codepipeline = require('@aws-cdk/aws-codepipeline'); import codepipeline_actions = require('@aws-c...
import React, { ChangeEvent, useCallback, useRef, useState } from 'react'; import { FormHandles } from '@unform/core'; import { Form } from '@unform/web'; import { FiUser, FiPhone, FiCamera, FiType, FiMapPin } from 'react-icons/fi'; import * as Yup from 'yup'; import { useHistory, useLocation } from 'react-router-dom'...
<gh_stars>10-100 import { CommandLineAction, CommandLineFlagParameter, CommandLineStringParameter } from "@rushstack/ts-command-line"; import { LanguageGenerator } from "../languagedef/generator/LanguageGenerator"; import { EditorGenerator } from "../editordef/generator/EditorGenerator"; import { ReaderWrit...
/* eslint-disable max-statements */ import { promises as fs } from "fs" import { performance } from "perf_hooks" import { extname, relative, resolve } from "path" import chalk from "chalk" import figures from "figures" import prettier from "prettier" import stylelint from "stylelint" import { getEslintInstance } fro...
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ import { defaultIndexPattern } from '../../../default_index_pattern'; import ...
import { Meta } from "@storybook/react"; import { useRef, useState } from "react"; import { Button, Checkbox } from "../../../core/src"; import { Book, someBooks } from "../utils/example"; import { Utils } from "../utils/utils"; const meta: Meta = { title: "Components/Checkbox", component: Checkbox, argTypes: { c...
<filename>front/src/app/alarm-form/alarm-form.component.ts import { Component, OnInit } from '@angular/core'; import { Alarm } from '../models/alarm'; import { WebRadioService } from '../services/webradio.service'; import { Webradio } from '../models/webradio'; import { FormGroup, FormControl, ValidatorFn, Validators ...
import { outputFile, pathExists } from 'fs-extra'; import { getESModuleExport, Messages, Option, optional, packager } from '@foxpage/foxpage-shared'; import { ApplicationOption, FPPackage, FPPackageDependency, FPPackageEntrySource, FPPackageMeta, Logger, Package, PackageInstallOption, } from '@foxpage/...
<filename>packages/ui/src/components/ConfirmSecretPhrase.ts /* eslint-disable no-unused-vars */ /* eslint-disable no-var */ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable @typescript-eslint/ban-types */ import { FunctionalComponent } from 'preact'; import { html } from 'htm/preact'; import {...
import { system, compose, SystemConfig, ResponsiveValue, } from '@andideve/react-styled-system'; import CSS from 'csstype'; import { Space } from '../theme'; export interface MarginProps { m?: ResponsiveValue<Space | number | CSS.Properties['margin']>; margin?: ResponsiveValue<Space | number | CSS.Properti...
import { clearNext, clearPrev, clearRange, getLeftFormatIndex, getMaskDisplay, getRightFormatIndex, IMaskValue, insertString, parseMask } from './inputMask'; const inputMask = 'Phone number m\\ask: (999) 999 - 9999'; const values: IMaskValue[] = [ { value: '1', format: /[0-9]/, displayIndex: 20 },...
// CheckinsUnassignedSubview ------------------------------------------------- // Second-level view of Checkins, for currently unassigned mats. It offers // a two-part sequence to assign a Guest to a Checkin for an existing mat: // - Search for and select an existing Guest, or create and select a new one. // - Assign...
<gh_stars>100-1000 import { Mesh } from 'three' import { isStatic } from '../functions/StaticMode' import asyncTraverse from '../functions/asyncTraverse' import keysEqual from '../functions/keysEqual' import hashImage from '../functions/hashImage' import { collectUniqueMaterials } from '../functions/materials' import {...
/** * @file File for functions that didn't deserve their own helper file. Generally small functions */ import { Message, MessageEmbedOptions, TextChannel } from "discord.js"; import { MessageEmbed } from "discord.js"; import serversJS from "../servers"; import childprocess from "child_process"; import discord from ...
<reponame>atomist/sdm-pack-lifecycle-github /* * Copyright © 2020 Atomist, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * *...
/** * A simple DHCP server. * * It assigns IP inside a default subnet to local devices. * It can use to perform more advanced operations by moving local devices to other subnets. * * @license * Copyright 2022 <NAME> (<EMAIL>) * SPDX-License-Identifier: Apache-2.0 */ import arp from "@network-utils/arp-look...
// uses setup.createTownName, setup.townDemographics import { Biome, EconomicIdeology, PoliticalSource, RaceName, Seasons, Town, TownBasics, TownRolls, TownType } from '@lib' export const createTownBiome = (base: Partial<Town> = {}): TownBasics => { const type = lib.weightRandom(lib.townData.defaults.type) as TownT...
<filename>app/javascript/components/api/v1/ProjectsAPI.ts import fileDownload from "js-file-download"; import { ImportFileFormats } from "../../sites/dashboard/FileImportSite"; import { IFeature } from "../../types/IFeature"; import { IPlanIDS } from "../../types/IPlan"; import { IUserRole } from "../../types/IUserRole...
<gh_stars>0 import { BaseTask, Outcome, Task, TaskType } from './types'; const tasksByType: { recharge?: Task[], work?: Task[] } = {}; let room: Room; let assignations: { [name: string]: Task } = {}; export function resetTasks(theRoom: Room) { room = theRoom; assignations = {}; delete tasksByType.recharge; de...
/* eslint-disable react/no-access-state-in-setstate */ /* eslint-disable react/no-did-update-set-state */ /* eslint-disable react/destructuring-assignment */ import React from 'react'; import { Timeline } from '@models/timeline'; import TimelineChart from './TimelineChart'; import { formatAsOBject } from '../util/forma...
<filename>io-ngfront/src/app/shared/history/processhistory/processhistory.component.ts import { Component, OnInit, OnDestroy } from '@angular/core'; import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { ChartDataSets, ChartOptions } from 'chart.js'; import { Color, Label } from 'ng2-charts'; i...
/* import * as express from 'express' import * as http from 'http' import * as WebSocket from 'ws' const app = express() const server = http.createServer(app) const wss = new WebSocket.Server({ server }) wss.on('connection', (ws: WebSocket) => { ws.on('message', (message: String) => { console.log('received %s'...
import * as React from "react"; import CatalogLink from "./CatalogLink"; import BookCover from "./BookCover"; import BorrowButton from "./BorrowButton"; import DownloadButton from "./DownloadButton"; import { BookData, FulfillmentLink, BookMedium } from "../interfaces"; import { bookIsBorrowed, bookIsReserved, bo...
/* eslint no-unused-vars:0 */ // From is being used 'use strict'; import * as React from 'react'; import {connect} from 'react-redux'; import {action, getType} from 'typesafe-actions'; import * as inspectorActions from '../actions/inspectorActions'; import {PrimType} from '../constants/primTypes'; import {State} from ...
<reponame>f-space/rmmz-plugins<filename>plugins/Fs_test/M.test.ts import "./JestExt"; import Fs from "./Fs"; const { O, R, N, M } = Fs; type Meta = Fs.M.Meta; type Archetype = Fs.M.Archetype; const parse = <A extends Archetype>(meta: Meta, parser: A) => M.make(parser)(meta); const notationError = (expected: 'flag' ...
import { Store } from 'le5le-store'; import { Point } from './models/point'; import { Node } from './models/node'; export function pointInRect(point: Point, vertices: Point[]): boolean { if (vertices.length < 3) { return false; } let isIn = false; let last = vertices[vertices.length - 1]; for (const it...
// TODO: deprecate all places where we check if _.isPlainObject // TODO: deprecate getItemValue prop // TODO: deprecate getItemLabel prop // TODO: Add initialValue prop // TODO: consider deprecating renderCustomModal prop // TODO: deprecate onShow cause it's already supported by passing it in pickerModalProps import _ ...
"use strict"; /** * Script class * * @date 14-aug-2017 */ class Script { public url:string; public storyTree:XMLDocument; public commands: { [key:string]:Function }={}; public current:Element; // public next:Element; constructor(url?:string, public variables={}) { this.commands["p"] = (attrs:any...
<reponame>shadowmoose/Terra import * as PIXI from 'pixi.js' import {Viewport} from 'pixi-viewport' import { CULLER, ENTITY_LAYER, getForceCull, GRID_DIMENSIONS, GRID_TILE_PX, OVERLAY_LAYER, setForceCull, TERRAIN_LAYER, WORLD_SIZE_PX } from './ui-data/globals'; import * as GRID from './ui...
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; import {intlShape} from 'react-intl'; import {Alert, Text, View} from 'react-native'; import CookieManager from 'react-native-cookies'; import {SafeAreaView} from 'react-native-saf...
<filename>src/htmless/core.ts interface HLEventListener { type: string; callback: EventCallback; capture: boolean; } type EventCallback = (ev: Event) => void; class HLElement { classes: string[] = []; attrs: { [key: string]: any } = {}; inlineStyle: { [attr: string]: any } = {}; children: ...
import { isBigint, isDate, isInfinite, isMap, isNaNValue, isRegExp, isSet, isUndefined, isSymbol, isArray, } from './is'; import { ClassRegistry } from './class-registry'; import { SymbolRegistry } from './symbol-registry'; import { fromPairs, includes, entries, find } from 'lodash'; import { Custom...
import classNames from 'classnames'; import type { TextAreaProps as RcTextAreaProps } from 'rc-textarea'; import RcTextArea from 'rc-textarea'; import type ResizableTextArea from 'rc-textarea/lib/ResizableTextArea'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import omit from 'rc-util/lib/omit'; impo...
import './LocationBreadcrumb.scss'; import React from 'react'; import { Breadcrumb, DirectionalHint, IBreadcrumbItem, IComponentAsProps, IconButton, IDividerAsProps, } from '@fluentui/react'; import { useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import Loca...
<filename>src/store.ts import Vue from "vue"; import Vuex, { StoreOptions } from "vuex"; import { RootState } from "./types"; import { IQuestion, QuestionSelectBase, SurveyModel, PageModel, Survey } from "survey-vue"; Vue.use(Vuex); function addItemsInArray(val: any[]) { let total = 0; val.forEach(item ...
<filename>src/app/router.ts import { Vector } from './vector'; import * as jsgraphs from 'js-graph-algorithms'; import { BROADCAST_IP, OSPF_SIZE } from './constants'; import { Packet, PacketType } from './packet'; import { BaseDevice } from './base-device'; import { Device, Router, Link, Host, Interface, Route, isRoute...
import { carton_model } from "../connection"; import {} from "../models/Carton.model"; import { LoremIpsum } from "lorem-ipsum"; import mongoose from "mongoose"; const lorem = new LoremIpsum({ sentencesPerParagraph: { max: 6, min: 2, }, wordsPerSentence: { max: 16, min: 4, }, }); /** * Popula...
import { useReactiveVar } from '@apollo/client' import { Button } from 'antd' import { now } from 'lodash' import React from 'react' import styled from 'styled-components' import Web3 from 'web3' import { successClaimModalVar } from '../../graphql/variables/CollectiveBuying' import { accountVar, chainIdVar } from '../....
import { Client, Instance } from "butlerd"; import { actions } from "common/actions"; import { messages } from "common/butlerd"; import { makeButlerInstance } from "common/butlerd/make-butler-instance"; import env from "common/env"; import { Store } from "common/types"; import { ItchPromise } from "common/util/itch-pro...
<reponame>ChristianKurz/LaTeX-Workshop<filename>src/components/envpair.ts<gh_stars>1-10 import * as vscode from 'vscode' import * as utils from '../utils' import { Extension } from '../main' function regexpAllMatches(str: string, reg: RegExp) { const res: any[] = [] let m = reg.exec(str) while (m) { ...
import { action, storiesOf } from '@kadira/storybook'; import { storyDecorator, storyMediaProviderFactory } from '@atlaskit/editor-core/dist/es5/test-helper'; import InlineEdit from '@atlaskit/inline-edit'; import { defaultClientId, defaultServiceHost } from '@atlaskit/media-test-helpers/dist/es5/contextProvider'; impo...
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. import * as fse from "fs-extra"; import * as path from "path"; import { Disposable, QuickInputButtons, QuickPick, QuickPickItem, window } from "vscode"; import { getMavenLocalRepository, getPathToExtensionRoot } from "../.....
export interface Handler { (context, state?, event?) } export class Transition { constructor(public from, public event, public to, public final: boolean){ } } export interface Context { state?; nextState?; nextStateFinal?; prevState?; lastEvent?; finished?; [others: string]: an...
import React, { FunctionComponent, useState } from 'react'; import { Pressable, Text, ScrollView, View, RefreshControl, SafeAreaView, Platform, } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { StackNavigationProp } from '@react-navigation/stack'; import { tailwi...
<reponame>ShahzaibP/vscode-python<filename>src/client/pythonEnvironments/discovery/locators/services/virtualEnvironmentIdentifier.ts // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import * as fsapi from 'fs-extra'; import * as path from 'path'; import '../../../../commo...
<filename>p5-server/src/commands/buildCommand.ts import fs from 'fs'; import { rm as rmSync, writeFile } from 'fs/promises'; import minimatch from 'minimatch'; import open from 'open'; import { Sketch } from 'p5-analysis'; import path from 'path'; import { createDirectoryListing, defaultDirectoryExclusions } from '...
<filename>src/commands/lambda/constants.ts export const DD_LAMBDA_EXTENSION_LAYER_NAME = 'Datadog-Extension' export const EXTENSION_LAYER_KEY = 'extension' export const DOTNET_RUNTIME = 'dotnetcore3.1' export const LAYER_LOOKUP = { [EXTENSION_LAYER_KEY]: DD_LAMBDA_EXTENSION_LAYER_NAME, 'dotnetcore3.1': 'dd-trace-do...
import DataSourceRecord, {ReceiveDataOptions} from '../../../domain_objects/data_warehouse/import/data_source'; import ImportRepository from '../../../data_access_layer/repositories/data_warehouse/import/import_repository'; import DataStagingRepository from '../../../data_access_layer/repositories/data_warehouse/import...
import type { StackNavigationProp } from "@react-navigation/stack"; import { useMatomo } from "matomo-tracker-react-native"; import type { FC } from "react"; import * as React from "react"; // eslint-disable-next-line @typescript-eslint/no-duplicate-imports import { useCallback, useEffect, useRef, useState } from "reac...
<reponame>btakita/DefinitelyTyped import { IncomingMessage, ServerResponse } from 'http'; import { DeltaResult, Graph, Module, ReportableEvent, Server, TransformResult } from 'metro'; import { PostProcessBundleSourcemap, ExtraTransformOptions, GetTransformOptionsOpts, GetTransformOptions, Middleware...
<reponame>david0723/chobot import { BaseParamType } from './paramTypes/BaseParamType' import { buildParamDescriptors } from './paramTypes/buildParamDescriptors' import { ParamDescriptor } from './paramTypes/ParamDescriptor' import { match } from './utils/match' import { MatchingNode } from './utils/MatchingNode' import...
import { useEffect, useReducer, useRef } from 'react'; import { styled /*, keyframes*/ } from '~/theme/stitches.config'; import { ZINDEX_MODAL_BACKDROP } from '~/theme'; import { useLocationPending } from '~/components/router'; // const pulseAnimation = keyframes({ // '0%': { // transform: 'translateX(-20vw)', /...
<filename>src/ui/content/Detail/Detail.tsx import React, {useRef, useMemo, useState, useEffect} from 'react'; import _isArray from 'lodash/isArray'; import _orderBy from 'lodash/orderBy'; import {useComponents} from '../../../hooks'; import DetailItem, {IDetailItemProps} from './DetailItem'; import {IControlItem} from ...
import React, { useRef, useEffect, useState } from 'react' import mapboxgl, { GeoJSONSource, LngLatBoundsLike } from 'mapbox-gl' // eslint-disable-line import/no-webpack-loader-syntax import { bbox } from '@turf/turf' import { Box } from '@chakra-ui/react' import Gradient from 'javascript-color-gradient' import 'mapbox...
<gh_stars>1-10 'use strict'; import db = require('./db'); import log = require('./log'); import _ = require('underscore'); import Dictionary = _.Dictionary; export interface ISeat { id: number; row: string; number: string; x_coord: number; y_coord: number; inactive: boolean; } export interface ISection {...
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
<reponame>anatawa12/minecraft-server-start-test<gh_stars>0 import * as core from '@actions/core' import * as fs from 'fs-extra' import {ActionParameters, parseParameters} from './parameters' import {EOL} from 'os' import {GitHub} from '@actions/github/lib/utils' import {exec} from '@actions/exec' import fetch from 'nod...
import React, { useState, useEffect } from 'react'; import { FormattedMessage, useIntl } from 'umi'; import { Modal, Table, Row, Col, Pagination, Upload, Button, Popover, Form, Input, message } from 'antd'; import { ColumnProps } from 'antd/es/table'; import {isExternal} from '@/utils/validate'; import { getAjaxHeade...
<reponame>rxap-mirror/packages import { Observable, TeardownLogic, EMPTY, Subject } from 'rxjs'; import { BaseDefinition, BaseDefinitionMetadata, DefinitionMetadata, } from '@rxap/definition'; import { deepMerge, Constructor, clone } from '@rxap/utilities'; import { v4 as uuid } from 'uuid'; import { takeUntil, f...
import * as crypto from 'crypto'; function split(buffer: Buffer, delimiter: Buffer): Buffer[] { const arr = []; let cur = 0; let n = 0; while ((n = buffer.indexOf(delimiter, cur)) != -1) { arr.push(buffer.slice(cur, n)); cur = n + delimiter.length; } arr.push(buffer.slice(cur)); return arr; } ex...
<reponame>cspotcode/angl /// <reference path="../../typings/all.d.ts"/> "use strict"; // Install source-map support only when running in NodeJS var sourceMapSupport: any = require('source-map-support'); sourceMapSupport && sourceMapSupport.install(); import glob = require('glob'); import _ = require('lodash'); import...
import {Changes} from '../worker/changes'; import {WorkerService} from './worker.service'; import {OrmService} from './orm.service'; import {AdminChangeQueueInfo, IoRequest, RootStatus, WorkerRequestMode} from './io/io.types'; import {WorkerRequestParameters} from './worker/worker.types'; import {Inject, InRequestScope...
/** * Auth Middleware * * This module will read user token from * header(x-access-token) OR * req.body.token OR req.query.token * and will read user & groups from db */ import * as crypto from 'crypto'; import * as jsonwebtoken from 'jsonwebtoken'; import * as NodeCache from 'node-cache'; import { Request, Resp...
import _ from 'lodash'; import { Day, Lesson, Module, RawLesson, Semester, SemesterData, Time, WorkloadComponent, } from 'types/modules'; import config from 'config'; import { NBSP } from 'utils/react'; // Look for strings that look like module codes - eg. // ACC1010 - 3 chars, 4 digits, no suffix /...
import { Tag, Space } from 'antd'; import type { ProColumns, ActionType } from '@ant-design/pro-table'; import { dataList } from './service'; import type { TableListItem, TableListPagination } from './data'; import React, { useState, useRef } from 'react'; import ProTable from '@ant-design/pro-table'; import { Formatte...
const { ipcRenderer } = require('electron'); console.log('eoapi public api load'); // 可以加上条件判断,根据不同模块id哪些允许放出 const apiAccessRules = ipcRenderer.sendSync('eo-sync', { action: 'getApiAccessRules' }) || []; // 异步防止返回处理覆盖 const storageCallback = new Map(); ipcRenderer.on('storageCallback', (event, result) => { if (stor...
import { globals } from "./../common/globals"; import fs, { ReadStream } from "fs"; import { DB } from "./DB"; import { IReport, IBuildReport } from "./../common/interfaces"; // import { MAILGUN_TO, MAILGUN_FROM } from "../common/env"; import { logger } from "../utils/logger"; import { resolve } from "path"; import nod...
<filename>src/demo/test.ts<gh_stars>100-1000 import * as http from 'http'; import { BMP24 } from '../BMP24'; // gd-bmp import * as font from '../font'; /* 用PCtoLCD2002取字模 行列式扫描,正向取模(高位在前) */ const cnfonts: font.IFont = { // 自定义字模 w: 16, h: 16, fonts: '中国', data: [ [0x01, 0x01, 0x01, 0x01, 0x...
import { Uri, workspace } from 'coc.nvim'; import { EventEmitter } from 'events'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; import PicGo from 'picgo'; import { IImgInfo, IPlugin } from 'picgo/dist/src/utils/interfaces'; import { promisify } from 'util'; import { TextEdit } from '...
import { Component } from 'react'; import Modal from 'components/semantic/Modal'; import ModalRouteDecorator, { ModalRouteDecoratorChildProps } from 'decorators/ModalRouteDecorator'; import WebUserConstants from 'constants/WebUserConstants'; import AccessConstants from 'constants/AccessConstants'; import PermissionSe...
import { TestBed, fakeAsync } from '@angular/core/testing'; import { Observable } from 'rxjs/Observable'; import { TranslateService } from '@ngx-translate/core'; import { WalletService } from './wallet.service'; import { ApiService } from './api.service'; import { CipherProvider } from './cipher.provider'; import { Wa...
<gh_stars>1-10 import { Action, Middleware } from "redux"; import { Buffer, Channel, END, Predicate, SagaIterator, Task } from "@redux-saga/types"; import { ForkEffect } from "./effects"; export { Buffer, Channel, SagaIterator, Task }; type Saga0 = () => Iterator<any>; type Saga1<T1> = (arg1: T1) => Iterator<any>; ty...
<gh_stars>1-10 import * as glm from "gl-matrix"; import * as abr from "amber"; import * as a3d from "./a3d"; import * as view from "./view"; function main(param: g.GameMainParameterObject): void { const scene = new g.Scene({game: g.game, assetIds: [ // Obj, Material, Texture "Airplane_01", "Airplane_01_mtl", ...
import React, { useMemo, useState, useCallback } from "react"; import { GuessDiv, WordleDiv } from "@/app/utils/wordleStyles"; import WordleSolver from "@/app/solvers/wordle/wordleSolver"; import WordleGame from "@/app/games/wordle/wordleGame"; import { range } from "lodash"; import GuessRow from "@/app/components/word...
<reponame>akashic-games/game-driver<gh_stars>1-10 "use strict"; import * as g from "@akashic/akashic-engine"; import * as amf from "@akashic/amflow"; import * as pl from "@akashic/playlog"; import ExecutionMode from "./ExecutionMode"; import { Game } from "./Game"; import * as sf from "./StorageFunc"; import StorageOnT...
/* * Copyright 2021 Larder Software Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
// forked from https://github.com/WhaleEx/API/blob/master/sample/nodejs/whaleex-sign.js import { strict as assert } from 'assert'; import crypto from 'crypto'; import { EOS_QUANTITY_PRECISION } from 'eos-utils'; import { privateToPublic, sign, signHash } from 'eosjs-ecc'; import Long from 'long'; import { all, create }...
<reponame>Davies123/angular-mapbox-policeapp<gh_stars>1-10 import { Component,ViewEncapsulation, OnInit } from '@angular/core'; import { AngularFirestore, AngularFirestoreCollection } from '@angular/fire/firestore'; import { Observable } from 'rxjs'; import { AngularFireDatabase, AngularFireList } from '@angular/fire...
class RingButter { data: Array<any>; end: number; length: number; // current size of buffer overflow: any; size: number; // size of buffer start: number; constructor(size: number) { if (size <= 0) { throw new Error('Missing Argument: You must pass a valid buffer s...