repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
marksherman/pml-font-explorer | src/math/conv2d_test.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/math/backends/webgl/resize_bilinear_gpu.ts | <filename>src/math/backends/webgl/resize_bilinear_gpu.ts
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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.a... |
marksherman/pml-font-explorer | src/math/pool_test.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/math/backends/webgl/reduce_gpu.ts | <filename>src/math/backends/webgl/reduce_gpu.ts
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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... |
marksherman/pml-font-explorer | src/math/concat_util_test.ts | <reponame>marksherman/pml-font-explorer
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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/license... |
marksherman/pml-font-explorer | src/math/arithmetic_test.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/graph/optimizers/momentum_optimizer.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/graph/ops/divide_test.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/math/backends/types/logical.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/math/compareop_test.ts | <reponame>marksherman/pml-font-explorer<filename>src/math/compareop_test.ts
/**
* @license
* Copyright 2018 Google Inc. All Rights Reserved.
* 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... |
marksherman/pml-font-explorer | src/math/backends/backend_webgl_test.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/graph/optimizers/adamax_optimizer.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 ... |
marksherman/pml-font-explorer | src/math/pad_test.ts | <filename>src/math/pad_test.ts
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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... |
marksherman/pml-font-explorer | src/graph/ops/concat.ts | <filename>src/graph/ops/concat.ts
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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/LICE... |
marksherman/pml-font-explorer | demos/mnist_eager/model.ts | import * as dl from 'deeplearn';
import {MnistData} from './data';
// Hyperparameters.
const LEARNING_RATE = .05;
const BATCH_SIZE = 64;
const TRAIN_STEPS = 100;
// Data constants.
const IMAGE_SIZE = 784;
const LABELS_SIZE = 10;
const math = dl.ENV.math;
const optimizer = new dl.SGDOptimizer(LEARNING_RATE);
// Set... |
marksherman/pml-font-explorer | demos/nn-art/cppn.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/math/backends/types/minmax.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/graph/graph_runner_test.ts | <reponame>marksherman/pml-font-explorer<filename>src/graph/graph_runner_test.ts
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 Licens... |
marksherman/pml-font-explorer | src/math/lstm_test.ts | <gh_stars>0
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 r... |
marksherman/pml-font-explorer | demos/benchmarks/conv_benchmarks.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/graph/ops/linear_combination_test.ts | <gh_stars>0
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 r... |
marksherman/pml-font-explorer | src/math/backends/webgl/pad_gpu.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | demos/game_of_life/game_of_life.ts | <gh_stars>0
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 r... |
marksherman/pml-font-explorer | demos/nn-art/nn_art_util.ts | <gh_stars>1-10
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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
*
* Unles... |
marksherman/pml-font-explorer | src/graph/ops/matmul.ts | <reponame>marksherman/pml-font-explorer<filename>src/graph/ops/matmul.ts
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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
*... |
marksherman/pml-font-explorer | src/math/backends/types/slice.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/math/backends/webgl/render_ndarray_gpu_util_test.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/data/dataset_test.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
marksherman/pml-font-explorer | src/math/backends/types/unary.ts | <filename>src/math/backends/types/unary.ts<gh_stars>0
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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.apac... |
marksherman/pml-font-explorer | demos/nn-art/nn-art.ts | <reponame>marksherman/pml-font-explorer<filename>demos/nn-art/nn-art.ts<gh_stars>1-10
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 ... |
marksherman/pml-font-explorer | src/math/reverse_test.ts | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* 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 a... |
hpetru/datadog-lambda-js | src/trace/span-wrapper.ts | export type SpanWrapperOptions = {
isAsync?: boolean;
};
export class SpanWrapper {
span: any;
public options: SpanWrapperOptions;
constructor(span: any, options: SpanWrapperOptions) {
this.span = span;
this.options = options;
}
public isAsync(): boolean {
return this.options.isAsync || false... |
hpetru/datadog-lambda-js | src/index.ts | import { Context, Handler } from "aws-lambda";
import {
incrementErrorsMetric,
incrementInvocationsMetric,
KMSService,
MetricsConfig,
MetricsListener,
} from "./metrics";
import { TraceConfig, TraceHeaders, TraceListener } from "./trace";
import {
logDebug,
logError,
Logger,
LogLevel,
promisifiedHan... |
hpetru/datadog-lambda-js | src/runtime/index.ts | <reponame>hpetru/datadog-lambda-js
export { load } from "./user-function";
|
hpetru/datadog-lambda-js | src/trace/trigger.ts | import {
Context,
APIGatewayEvent,
APIGatewayProxyEventV2,
ALBEvent,
CloudWatchLogsEvent,
ScheduledEvent,
CloudFrontRequestEvent,
DynamoDBStreamEvent,
KinesisStreamEvent,
S3Event,
SNSEvent,
SQSEvent,
EventBridgeEvent,
} from "aws-lambda";
import * as eventType from "../utils/event-type-guards"... |
hpetru/datadog-lambda-js | src/trace/trigger.spec.ts | <filename>src/trace/trigger.spec.ts
import { parseEventSource, parseEventSourceARN, extractTriggerTags, extractHTTPStatusCodeTag } from "./trigger";
import { readFileSync } from "fs";
import { Context } from "aws-lambda";
const mockARN = "arn:aws:lambda:us-east-1:123456789012:function:test-nodejs-lambda";
const mockC... |
hpetru/datadog-lambda-js | src/trace/listener.ts | <filename>src/trace/listener.ts
import { Context } from "aws-lambda";
import {
addLambdaFunctionTagsToXray,
TraceContext,
readStepFunctionContextFromEvent,
StepFunctionContext,
} from "./context";
import { patchHttp, unpatchHttp } from "./patch-http";
import { TraceContextService } from "./trace-context-servic... |
matamatanot/react-query | src/react/types.ts | import { RetryValue, RetryDelayValue } from '../core/retryer'
import {
InfiniteQueryObserverOptions,
InfiniteQueryObserverResult,
MutationObserverResult,
MutationKey,
QueryObserverOptions,
QueryObserverResult,
QueryKey,
MutationFunction,
MutateOptions,
MutationMeta,
} from '../core/types'
export in... |
matamatanot/react-query | src/core/queryObserver.ts | import { RefetchQueryFilters } from './types'
import {
isServer,
isValidTimeout,
noop,
replaceEqualDeep,
shallowEqualObjects,
timeUntilStale,
} from './utils'
import { notifyManager } from './notifyManager'
import type {
PlaceholderDataFunction,
QueryKey,
QueryObserverBaseResult,
QueryObserverOption... |
matamatanot/react-query | src/core/tests/focusManager.test.tsx | <filename>src/core/tests/focusManager.test.tsx<gh_stars>1-10
import { sleep } from '../utils'
import { focusManager } from '../focusManager'
describe('focusManager', () => {
afterEach(() => {
// Reset removeEventListener private property to avoid side effects between tests
focusManager['removeEventListener']... |
matamatanot/react-query | src/core/tests/onlineManager.test.tsx | import { onlineManager } from '../onlineManager'
import { sleep } from '../utils'
describe('onlineManager', () => {
afterEach(() => {
// Reset removeEventListener private property to avoid side effects between tests
onlineManager['removeEventListener'] = undefined
})
test('isOnline should return true if... |
mattbho/node-deepstackai-trigger | src/types/ITriggerJson.ts | <filename>src/types/ITriggerJson.ts<gh_stars>0
/*---------------------------------------------------------------------------------------------
* Copyright (c) <NAME>. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*-----------------------------------... |
mattbho/node-deepstackai-trigger | src/TriggerManager.ts | <gh_stars>0
/*---------------------------------------------------------------------------------------------
* Copyright (c) <NAME>. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*----------------------------------------------------------------------... |
mattbho/node-deepstackai-trigger | src/Log.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) <NAME>. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*----------------------------------------------------------------------------------... |
mattbho/node-deepstackai-trigger | src/schemaValidator.ts | <reponame>mattbho/node-deepstackai-trigger
/*---------------------------------------------------------------------------------------------
* Copyright (c) <NAME>. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*---------------------------------------... |
mattbho/node-deepstackai-trigger | src/main.ts | <reponame>mattbho/node-deepstackai-trigger
/*---------------------------------------------------------------------------------------------
* Copyright (c) <NAME>. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*---------------------------------------... |
vinodsr/amplify-cli | packages/amplify-provider-awscloudformation/src/root-stack-builder/root-stack-builder.ts | /* eslint-disable max-classes-per-file */
import * as cdk from '@aws-cdk/core';
import * as s3 from '@aws-cdk/aws-s3';
import * as iam from '@aws-cdk/aws-iam';
import { AmplifyRootStackTemplate } from '@aws-amplify/cli-extensibility-helper';
import { IStackSynthesizer, ISynthesisSession } from '@aws-cdk/core';
import {... |
vinodsr/amplify-cli | packages/amplify-appsync-simulator/src/__tests__/utils/graphql-runner/subscription.test.ts | <reponame>vinodsr/amplify-cli
import { GraphQLSchema, parse } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { AmplifyAppSyncSimulatorAuthenticationType } from '../../../type-definition';
import { AppSyncGraphQLExecutionContext } from '../../../utils/graphql-runner';
import { runQu... |
vinodsr/amplify-cli | packages/amplify-prompts/src/prompter.ts | <filename>packages/amplify-prompts/src/prompter.ts
import { prompt } from 'enquirer';
// enquirer actions are not part of the TS types, but they are the recommended way to override enquirer behavior
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import * as actions from 'enquirer/lib/combos... |
vinodsr/amplify-cli | packages/amplify-appsync-simulator/src/schema/index.ts | import { buildASTSchema, concatAST, DocumentNode, GraphQLObjectType, parse, Source } from 'graphql';
import { makeExecutableSchema } from '@graphql-tools/schema';
import { AmplifyAppSyncSimulator } from '..';
import { AppSyncSimulatorPipelineResolverConfig, AppSyncSimulatorUnitResolverConfig } from '../type-definition'... |
Tarrowren/visual-npm | src/visualNPM.ts | <filename>src/visualNPM.ts<gh_stars>0
import { TreeDataProvider, TreeItem, EventEmitter, ProviderResult, TreeItemCollapsibleState, commands } from "vscode";
import { spawn } from "child_process";
import { getRootPath, handlingErrors } from "./util";
import { NPMErr, NPMErrType } from "./npmErr";
export class VisualNPM... |
Tarrowren/visual-npm | src/extension.ts | import * as vscode from 'vscode';
import { VisualNPMProvider, NPM, NodeModule } from './visualNPM';
export function activate(context: vscode.ExtensionContext) {
const localVisualNPMProvider = new VisualNPMProvider(NPM.Local);
vscode.window.registerTreeDataProvider("visual-npm-local", localVisualNPMProvider);
vscode... |
Tarrowren/visual-npm | src/util.ts | import { workspace, window } from "vscode";
import { NPMErr, NPMErrType } from "./npmErr";
export function getRootPath(): string {
let folders = workspace.workspaceFolders;
if (folders === undefined || folders.length === 0) {
throw new NPMErr(NPMErrType.Info, "Please open a folder");
}
let edit... |
Tarrowren/visual-npm | src/npmErr.ts | export class NPMErr extends Error {
public readonly type: NPMErrType;
constructor(type: NPMErrType, message: string) {
super(message);
this.type = type;
}
}
export enum NPMErrType {
Error,
Warning,
Info
}
|
mason-fish/brim | src/js/zql/toZql.ts | <reponame>mason-fish/brim
import {zng} from "zealot"
import isString from "lodash/isString"
export function toZql(object: unknown): string {
if (object instanceof zng.Primitive) return toZqlZngPrimitive(object)
if (isString(object)) return toZqlString(object)
if (object instanceof Date) return toZqlDate(object)
... |
mason-fish/brim | src/js/state/migrations/202005151706_addZeekRunnerPref.test.ts | <filename>src/js/state/migrations/202005151706_addZeekRunnerPref.test.ts
import Prefs from "../Prefs"
import getTestState, {getAllStates} from "../../test/helpers/getTestState"
import migrate from "./202005151706_addZeekRunnerPref"
test("migrating 202005151706_addZeekRunnerPref", () => {
const prev = getTestState("v... |
mason-fish/brim | src/js/components/LogCell/SingleField.tsx | import React, {useEffect, useRef, useState} from "react"
import classNames from "classnames"
import {$Menu} from "../../electron/menu"
import {showContextMenu} from "../../lib/System"
import FieldCell from "../FieldCell"
import lib from "../../lib"
import {zng} from "zealot"
type Props = {
field: zng.Field
record... |
mason-fish/brim | zealot/api/pcaps.ts | import {PcapsGetArgs, PcapsPostArgs} from "../types"
export default {
get(args: PcapsGetArgs) {
const params = new URLSearchParams()
params.set("ts_sec", args.ts_sec.toString())
params.set("ts_ns", args.ts_ns.toString())
params.set("duration_sec", args.duration_sec.toString())
params.set("duratio... |
mason-fish/brim | zealot/zql.ts | <filename>zealot/zql.ts
// This is where we depend on a script buried in a zq
// node module in the root directory to parse zql.
// @ts-ignore
import zql from "zq/zql/zql"
// @ts-ignore
export const parse = zql.parse
|
mason-fish/brim | src/js/components/Login.tsx | import React, {useEffect, useRef, useState} from "react"
import {toast} from "react-hot-toast"
import {useDispatch} from "react-redux"
import styled from "styled-components"
import {BrimWorkspace} from "../brim"
import {activateWorkspace} from "../flows/workspace/activateWorkspace"
import {login} from "../flows/workspa... |
mason-fish/brim | src/js/state/Prefs/test.ts | import Prefs from "./"
import initTestStore from "../../test/initTestStore"
let store
beforeEach(() => {
store = initTestStore()
})
test("the default json type config", () => {
const state = store.getState()
expect(Prefs.getJSONTypeConfig(state)).toBe("")
})
test("set the json types config", () => {
const s... |
mason-fish/brim | zealot/ndjson/pipe_json.ts | <reponame>mason-fish/brim
import {parse} from "./parse"
export const NEW_LINE = "\n\n\n"
export async function* pipeJson(iterator: AsyncGenerator<string>) {
let leftover = ""
for await (let value of iterator) {
let start = 0
let end = 0
let chunk = (leftover += value)
while ((end = chunk.indexOf... |
mason-fish/brim | src/js/lib/columnKey.ts | <gh_stars>0
import {Column} from "../types"
export default (col: Column) => {
return `${col.name}:${col.type}`
}
|
mason-fish/brim | zealot/zng/types/array.ts | import * as zjson from "../../zjson"
import {constructType} from "../construct"
import {Type, ZngClass} from "../ts_types"
export class ZArray implements ZngClass<Type[] | null> {
constructor(
readonly type: zjson.Type,
readonly value: zjson.Value[] | null
) {}
isSet() {
return this.value !== null
... |
mason-fish/brim | src/js/icons/StarNoFillIcon.tsx | import React from "react"
import StarNoFillSvg from "../../static/icons/star-no-fill.svg"
export default function StarNoFillIcon(props: any) {
return <StarNoFillSvg {...props} />
}
|
mason-fish/brim | src/js/state/LogDetails/selectors.ts | <filename>src/js/state/LogDetails/selectors.ts
import {createSelector} from "reselect"
import {State} from "../types"
import {TabState} from "../Tab/types"
import {LogDetailHistory, toHistory} from "./reducer"
import activeTabSelect from "../Tab/activeTabSelect"
import {LogDetailsState} from "./types"
import {SearchSt... |
mason-fish/brim | src/js/state/Last/index.ts | /*
Used to keep track of the "last" value something was.
For example, what was the last search that was submitted.
*/
import * as actions from "./actions"
import reducer from "./reducer"
import * as selectors from "./selectors"
export default {
...actions,
...selectors,
reducer
}
|
mason-fish/brim | itest/lib/appStep/api/takeScreenshot.ts | import {writeFileSync} from "fs-extra"
import {Application} from "spectron"
import crypto from "crypto"
import path from "path"
import {LOG} from "../../log"
import {itestDir} from "../../env"
export default async (app: Application) => {
try {
const image = await app.browserWindow.capturePage()
const fileP... |
mason-fish/brim | src/js/state/Columns/actions.ts | <filename>src/js/state/Columns/actions.ts
import {
COLUMNS_HIDE_ALL,
COLUMNS_SHOW_ALL,
COLUMNS_UPDATE,
ColumnUpdates
} from "./types"
import {Column} from "../../types"
import columnKey from "../../lib/columnKey"
function updateColumns(
tableId: string,
updates: ColumnUpdates
): COLUMNS_UPDATE {
return {... |
mason-fish/brim | src/js/electron/tron/index.ts | <reponame>mason-fish/brim
import migrations from "./migrations"
import session from "./session"
import window from "./window"
import windowManager from "./windowManager"
export type Session = ReturnType<typeof session>
export default {
window,
windowManager,
session,
migrations
}
|
mason-fish/brim | src/js/flows/ingestFiles.test.ts | <filename>src/js/flows/ingestFiles.test.ts
import {createZealotMock} from "zealot"
import Workspaces from "../state/Workspaces"
import Current from "../state/Current"
import Prefs from "../state/Prefs"
import Spaces from "../state/Spaces"
import Tab from "../state/Tab"
import fixtures from "../test/fixtures"
import in... |
mason-fish/brim | src/js/components/Span/TimeButton.tsx | <reponame>mason-fish/brim
import {isEqual} from "lodash"
import * as React from "react"
import {useEffect, useState} from "react"
import classNames from "classnames"
import {TimeArg} from "../../state/Search/types"
import {isString} from "../../lib/is"
import Animate from "../Animate"
import MenuBarButton from "../Men... |
mason-fish/brim | src/js/components/Tables/Table.tsx | import React from "react"
import {Column} from "../../types"
import FieldCell from "../FieldCell"
import {zng} from "zealot"
export default function Table({className, ...props}: any) {
return <table className={`table ${className}`} {...props} />
}
export function TableHeader({column}: {column: Column}) {
return ... |
mason-fish/brim | src/js/components/Preferences/TimeFormat.tsx | <reponame>mason-fish/brim<filename>src/js/components/Preferences/TimeFormat.tsx
import React from "react"
import {FormFieldConfig} from "../../brim/form"
import InputLabel from "../common/forms/InputLabel"
import Link from "../common/Link"
import TextInput from "../common/forms/TextInput"
type Props = {config: FormFi... |
mason-fish/brim | src/js/searches/programs.test.ts | <reponame>mason-fish/brim
import {zng} from "zealot"
import {connCorrelation} from "./programs"
test("conn correlation", () => {
const conn: zng.SerializedRecord = {
type: {
type: "record",
of: [
{name: "_path", type: "string"},
{name: "ts", type: "time"},
{name: "uid", type: ... |
mason-fish/brim | src/js/brim/cell.test.ts | <gh_stars>0
import {zng} from "zealot"
import {createCell} from "./cell"
test("null does not quote", () => {
const data = new zng.Primitive("string", null)
const f = createCell(new zng.Field("service", data))
expect(f.queryableValue()).toEqual("null")
})
test("string does quote", () => {
const data = new zng... |
mason-fish/brim | itest/lib/env.ts | <reponame>mason-fish/brim
import path from "path"
export const isCI = (): boolean => process.env.GITHUB_ACTIONS === "true"
export const repoDir = (): string =>
path.resolve(path.join(__dirname, "..", ".."))
export const itestDir = (): string =>
path.join(process.env.WORKSPACE || "run", "itest")
export const tes... |
mason-fish/brim | zealot/zng/construct.ts | <filename>zealot/zng/construct.ts
import * as zjson from "../zjson"
import {Type} from "./ts_types"
import {Record} from "./types/record"
import {Primitive} from "./types/primitive"
import {ZArray} from "./types/array"
import {Union} from "./types/union"
import {Set} from "./types/set"
export function constructType(t:... |
mason-fish/brim | itest/lib/jest.ts | import {Application} from "spectron"
import appStep from "./appStep/api"
import {selectors} from "../../src/js/test/integration"
import {LOG} from "./log"
export const TestTimeout = 300000
// https://jestjs.io/docs/en/troubleshooting#unresolved-promises
// https://jestjs.io/docs/en/jest-object#jestsettimeouttimeout
j... |
mason-fish/brim | src/js/state/Workspaces/reducer.ts | import {WorkspaceAction, WorkspacesState} from "./types"
import produce from "immer"
const init = (): WorkspacesState => {
return {}
}
export default produce((draft: WorkspacesState, action: WorkspaceAction) => {
switch (action.type) {
case "$WORKSPACE_ADD":
draft[action.workspace.id] = action.workspace... |
mason-fish/brim | app/tile/table-skeleton.tsx | <reponame>mason-fish/brim
import React from "react"
import styled, {keyframes} from "styled-components"
const loading = keyframes`
0% { background-position: -500px 0; }
100% { background-position: 500px 0; }
`
const BG = styled.div`
animation: fadein 200ms;
padding: 12px;
`
const Row = styled.div`
height: ... |
mason-fish/brim | itest/setup.ts | <gh_stars>0
// Taken from
// https://github.com/facebook/jest/issues/3126#issuecomment-345949328 to allow
// async / await in tests.
import "regenerator-runtime/runtime"
// This signals the path setup in main.js to not override the userData
// directory it sees on startup, so that we can store complete application
//... |
mason-fish/brim | src/js/electron/main.ts | import {appPathSetup} from "./appPathSetup"
import userTasks from "./userTasks"
// app path and log setup should happen before other imports.
appPathSetup()
import {app} from "electron"
import log from "electron-log"
import "regenerator-runtime/runtime"
import {setupAutoUpdater} from "./autoUpdater"
import {Brim} fro... |
mason-fish/brim | src/js/flows/submitSearch/save.ts | <gh_stars>0
import {SearchRecord} from "../../types"
import {Thunk} from "../../state/types"
import History from "../../state/History"
import Investigation from "../../state/Investigation"
import brim from "../../brim"
export type SaveOpts = {history: boolean; investigation: boolean}
export function saveToHistory(
... |
mason-fish/brim | src/js/state/Layout/selectors.ts | import activeTabSelect from "../Tab/activeTabSelect"
import {TabState} from "../Tab/types"
export default {
getMainView: activeTabSelect((state: TabState) => state.layout.mainView),
getSidebarSections: activeTabSelect(
(state: TabState) => state.layout.sidebarSections
),
getRightSidebarWidth: activeTabSe... |
mason-fish/brim | src/js/components/FieldCell.tsx | <reponame>mason-fish/brim<filename>src/js/components/FieldCell.tsx
import React from "react"
import classNames from "classnames"
import {createCell} from "../brim/cell"
import {zng} from "zealot"
type Props = {field: zng.Field; record: zng.Record}
function getBackground(field, record) {
if (field.name === "event_t... |
mason-fish/brim | src/js/components/WorkspaceModals/NewWorkspaceModal.tsx | import React from "react"
import {Content, SmallTitle} from "../ModalDialog/ModalDialog"
import WorkspaceForm from "./WorkspaceForm"
const NewWorkspaceModal = ({onClose}) => {
return (
<Content>
<SmallTitle>New Workspace</SmallTitle>
<WorkspaceForm onClose={onClose} />
</Content>
)
}
export def... |
mason-fish/brim | src/js/lib/transaction.ts | <filename>src/js/lib/transaction.ts
/*
TRANSACTION
This function accepts an array of "steps". A step is an object with two
function properties called "do" (required) and "undo" (optional).
Example:
const step = {
do: () => "hello world",
undo: () => "goodbye world"
}
RETURN VALUES
The transaction loops through ea... |
mason-fish/brim | src/js/state/Queries/actions.ts | import {
Group,
Item,
QUERIES_ADD_ITEM,
QUERIES_EDIT_ITEM,
QUERIES_MOVE_ITEMS,
QUERIES_REMOVE_ITEMS,
QUERIES_SET_ALL
} from "./types"
export default {
setAll: (rootGroup: Group): QUERIES_SET_ALL => ({
type: "$QUERIES_SET_ALL",
rootGroup
}),
addItem: (item: Item, parentGroup: Group): QUERIES... |
mason-fish/brim | ppl/import/LoadFilesInput.tsx | import React, {ChangeEvent, MouseEvent} from "react"
import classNames from "classnames"
import useCallbackRef from "src/js/components/hooks/useCallbackRef"
import useDropzone from "src/js/components/hooks/useDropzone"
import ToolbarButton from "app/toolbar/button"
import Folder from "src/js/icons/Folder"
import {react... |
mason-fish/brim | zealot/enhancers/zngToZeek_test.ts | import {replaceTypes} from "./zngToZeek"
import * as zjson from "../zjson"
function assertConversion(from: zjson.Type, to: zjson.Type) {
expect(replaceTypes(from)).toEqual(to)
}
test("convert to int", () => {
assertConversion(
{
type: "record",
of: [
{name: "one", type: "byte"},
{n... |
mason-fish/brim | src/js/components/Investigation/FindingCard.test.tsx | import React from "react"
import FindingCard from "./FindingCard"
import brim from "../../brim"
import loginTo from "../../test/helpers/loginTo"
import provide from "../../test/helpers/provide"
import {Finding} from "src/js/state/Investigation/types"
let store
beforeEach(async () => {
const setup = await loginTo("w... |
mason-fish/brim | itest/lib/appStep/api/savePcap.ts | import {Application} from "spectron"
import {retryUntil} from "../../control"
import {waitForClickableButtonAndClick} from "./click"
import logStep from "../util/logStep"
import {selectors} from "../../../../src/js/test/integration"
export default async (app: Application) => {
await waitForClickableButtonAndClick(a... |
mason-fish/brim | src/js/state/Tabs/selectors.ts | import {createSelector} from "reselect"
import {State} from "../types"
import {TabState} from "../Tab/types"
import {TabsState} from "./types"
const getData = (state: State) => state.tabs.data
const getActive = (state: State) => state.tabs.active
const getCount = (state: State) => state.tabs.data.length
const getAct... |
mason-fish/brim | zealot/fetcher/fetcher.ts | import {url} from "../util/utils"
import {parseContentType} from "./contentType"
import {Enhancer, ZealotPayload, ZReponse} from "../types"
import {createIterator} from "./iterator"
import {createStream} from "./stream"
import {createError} from "../util/error"
import {createPushableIterator} from "./pushable_iterator"... |
mason-fish/brim | src/js/electron/brim.ts | <filename>src/js/electron/brim.ts
import {app} from "electron"
import keytar from "keytar"
import url from "url"
import os from "os"
import path from "path"
import {ZQD} from "ppl/zqd/zqd"
import {Store} from "redux"
import {
deserializeState,
toAccessTokenKey,
toRefreshTokenKey
} from "../auth0/utils"
import cre... |
mason-fish/brim | ppl/summary/number.tsx | <gh_stars>0
import React from "react"
import {createCell} from "src/js/brim/cell"
import styled from "styled-components"
const Num = styled.div`
font-size: 24px;
font-weight: 700;
color: var(--slate);
text-align: center;
display: flex;
justify-content: center;
align-items: center;
height: calc(100% - 2... |
mason-fish/brim | src/js/test/helpers/loginTo.ts | import {createZealotMock, ZealotMock} from "zealot"
import {initSpace} from "../../flows/initSpace"
import Workspaces from "../../state/Workspaces"
import Current from "../../state/Current"
import Spaces from "../../state/Spaces"
import fixtures from "../fixtures"
import initTestStore, {TestStore} from "../initTestSto... |
mason-fish/brim | src/js/lib/open.ts | "use strict"
require("regenerator-runtime/runtime")
const isWsl = require("is-wsl")
const {promisify} = require("util")
const childProcess = require("child_process")
const path = require("path")
const pExecFile = promisify(childProcess.execFile)
// Convert a path from WSL format to Windows format:
// `/mnt/c/Progr... |
mason-fish/brim | src/js/electron/tron/formatSessionState.ts | <filename>src/js/electron/tron/formatSessionState.ts
import {GlobalState} from "../../state/globalReducer"
import {SerializedWindow} from "./windowManager"
export type SessionState = {
order: string[]
windows: {
[id: string]: {
name: string
position: [number, number]
size: [number, number]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.