repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
leyanlo/gatsby-starter-strict | src/pages/index.tsx | <filename>src/pages/index.tsx
import React from 'react';
import { Layout } from '../components/Layout';
export default function IndexPage(): JSX.Element {
return (
<Layout>
<p>Hello, world!</p>
</Layout>
);
}
|
kata-ai/tslint-config-kata | src/config/baseConfig.ts | <filename>src/config/baseConfig.ts
// Base Config
// Overrides default TSLint configs according to Kata Platform Development Standard.
export default {
rules: {
// extended rules for tslint-config-airbnb + kata exceptions
align: [true, 'statements'], // 7.15 exception
ban: false,
eofline: false, // 1... |
kata-ai/tslint-config-kata | src/index.ts | import reactConfig from './config/reactConfig';
import baseConfig from './config/baseConfig';
export const base = {
extends: ['tslint-config-airbnb'],
rules: {
...baseConfig.rules,
},
};
export const react = {
extends: ['tslint-config-airbnb', 'tslint-react'],
rules: {
...baseConfig.rules,
...re... |
kata-ai/tslint-config-kata | src/utils/getRuleDirectory.ts | <reponame>kata-ai/tslint-config-kata
import * as path from 'path';
/**
* Workaround to use proper module resolution for custom rules.
* https://github.com/palantir/tslint/issues/3436
*
* @param {string} name The module name.
* @param {string} [directory] The path to the rules directory.
*/
const getRuleDirectory... |
kata-ai/tslint-config-kata | src/config/reactConfig.ts | // tslint-react
// Lint rules related to React & JSX for TSLint.
// Reference https://github.com/palantir/tslint-react
export default {
rules: {
'jsx-alignment': true,
'jsx-ban-props': false,
'jsx-boolean-value': [true, 'never'],
'jsx-curly-spacing': ['never'],
'jsx-equals-spacing': ['never'],
... |
jerrySTK/NativescriptTestingApp | src/app/screen-orientation/screen-orientation.component.ts | <gh_stars>0
import { Component, OnInit, NgZone } from '@angular/core';
import * as orientation from 'nativescript-orientation-free';
import { DeviceOrientation } from 'tns-core-modules/ui/enums';
import { Page } from "tns-core-modules/ui/page/page";
import * as application from 'tns-core-modules/application';
import { ... |
jerrySTK/NativescriptTestingApp | src/app/challenges/edit-challenge-status/edit-challenge-status.component.ts | import { Component, OnInit, Output, EventEmitter, Input, OnChanges, SimpleChanges } from '@angular/core';
import * as Status from '../models/day.interface';
import { createSkipSelf } from '@angular/compiler/src/core';
@Component({
selector: 'ns-edit-challenge-status',
templateUrl: './edit-challenge-status.comp... |
jerrySTK/NativescriptTestingApp | src/app/challenges/challenge-edit/challenge-edit.module.ts | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { ChallengeEditComponent } from "./challenge-edit.component";
import { NativeScriptCommonModule, NativeScriptRouterModule, NativeScriptFormsModule } from "nativescript-angular";
import { AppSharedModule } from "~/app/shared/modules/app-shared.module";
... |
jerrySTK/NativescriptTestingApp | src/app/challenges/challenges.module.ts | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { DayModalComponent } from "./day-modal/day-modal.component";
import { ChallengeTabsComponent } from "./challenge-tabs/challenge-tabs.component";
import { TodayComponent } from "./today/today.component";
import { CurrentChallengeComponent } from "./curr... |
jerrySTK/NativescriptTestingApp | src/app/challenges/today/today.component.ts | import { Component, OnInit } from '@angular/core';
import { Challenge } from '../models/challenge';
import { ChallengesService } from '../challenges.service';
import { Observable } from 'rxjs';
import { DayStatus, IDay } from '../models/day.interface';
import { take } from 'rxjs/operators';
@Component({
selector: '... |
jerrySTK/NativescriptTestingApp | src/app/challenges/day-modal/day-modal.component.ts | import { Component, OnInit } from '@angular/core';
import { ModalDialogParams } from 'nativescript-angular';
import { dateProperty } from 'tns-core-modules/ui/date-picker/date-picker';
import { ChallengesService } from '../challenges.service';
import { DayStatus } from '../models/day.interface';
@Component({
selecto... |
jerrySTK/NativescriptTestingApp | src/app/auth/auth.component.ts | import { Component, OnInit } from '@angular/core';
import { RouterExtensions } from 'nativescript-angular';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { AuthService } from './auth.service';
@Component({
selector: 'ns-auth',
templateUrl: './auth.component.html',
styleUrls: [... |
jerrySTK/NativescriptTestingApp | src/app/challenges/current-challenge/current-challenge.component.ts | import { Component, Input, ViewContainerRef, OnInit, OnDestroy } from "@angular/core";
import { RouterExtensions, ModalDialogService } from "nativescript-angular";
import { DayModalComponent } from "../day-modal/day-modal.component";
import { UIService } from "~/app/shared/services/ui.service";
import { ChallengesServi... |
jerrySTK/NativescriptTestingApp | src/app/challenges/models/day.interface.ts | <reponame>jerrySTK/NativescriptTestingApp
export interface IDay {
dayInMonth: number;
dayInWeek: number;
date: Date;
rowPos: number;
status: DayStatus;
}
export enum DayStatus {
Open,
Completed,
Failed,
Cancel,
Reset
}
|
jerrySTK/NativescriptTestingApp | src/app/auth/auth.module.ts | import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { NativeScriptCommonModule } from 'nativescript-angular/common';
import { AuthComponent } from './auth.component';
import { ReactiveFormsModule } from '@angular/forms';
import { AppSharedModule } from '../shared/modules/app-shared.module';
import { Nati... |
jerrySTK/NativescriptTestingApp | src/app/challenges/challenge-tabs/challenge-tabs.component.ts | <reponame>jerrySTK/NativescriptTestingApp<filename>src/app/challenges/challenge-tabs/challenge-tabs.component.ts
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { RouterExtensions } from 'nativescript-angular';
import { Page } from 'tns-core-modules/ui/page/pa... |
jerrySTK/NativescriptTestingApp | src/app/challenges/challenges.service.ts | import { Injectable, OnDestroy } from '@angular/core';
import { BehaviorSubject, Observable, throwError, of, Subscription } from 'rxjs';
import { take, map, switchMap } from 'rxjs/operators';
import { Challenge } from './models/challenge';
import { DayStatus, IDay } from './models/day.interface';
import { HttpClient } ... |
jerrySTK/NativescriptTestingApp | src/app/shared/modules/app-shared.module.ts | <gh_stars>0
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { ActionBarComponent } from '../ui/action-bar/action-bar.component';
import { NativeScriptCommonModule, NativeScriptRouterModule } from "nativescript-angular";
@NgModule({
imports: [NativeScriptCommonModule,
NativeScriptRouterMo... |
jerrySTK/NativescriptTestingApp | src/app/app.component.ts | <reponame>jerrySTK/NativescriptTestingApp<filename>src/app/app.component.ts<gh_stars>0
import { Component, OnInit, ViewChild, OnDestroy, AfterViewInit, ChangeDetectorRef, ViewContainerRef } from "@angular/core";
import { UIService } from "./shared/services/ui.service";
import { Subscription } from "rxjs";
import { RadS... |
jerrySTK/NativescriptTestingApp | src/app/challenges/models/challenge.ts | <filename>src/app/challenges/models/challenge.ts<gh_stars>0
import { IDay, DayStatus } from "./day.interface";
export class Challenge {
constructor(public title: string = '',
public description: string = '',
public year: number = null,
public month: number = null,
... |
jerrySTK/NativescriptTestingApp | src/app/camera/camera.component.ts | import { Component, OnInit, NgZone } from '@angular/core';
import * as camera from "nativescript-camera";
import { ImageAsset } from 'tns-core-modules/image-asset/image-asset';
@Component({
selector: 'ns-camera',
templateUrl: './camera.component.html',
styleUrls: ['./camera.component.css']
})
export class ... |
jerrySTK/NativescriptTestingApp | src/app/shared/ui/action-bar/action-bar.component.ts | <reponame>jerrySTK/NativescriptTestingApp<filename>src/app/shared/ui/action-bar/action-bar.component.ts
import { Component, OnInit, Input } from '@angular/core';
import { Frame} from 'tns-core-modules/ui/frame/frame';
import { Page } from "tns-core-modules/ui/page/page";
import { isAndroid } from 'tns-core-modules/plat... |
jerrySTK/NativescriptTestingApp | src/app/challenges/challenge-edit/challenge-edit.component.ts | <reponame>jerrySTK/NativescriptTestingApp<gh_stars>0
import { Component, OnInit } from "@angular/core";
import { RouterExtensions, PageRoute } from "nativescript-angular";
import { ActivatedRoute, Params, ParamMap } from "@angular/router";
import { ChallengesService } from "../challenges.service";
import { borderTopRig... |
jerrySTK/NativescriptTestingApp | src/app/shared/services/ui.service.ts | <gh_stars>0
import { Injectable, ViewContainerRef } from "@angular/core";
import { Subject } from "rxjs";
@Injectable({
providedIn: 'root'
})
export class UIService {
private toggleDrawer: Subject<boolean> = new Subject<boolean>();
private _rootVCRef: ViewContainerRef;
constructor() {
}
get ... |
jerrySTK/NativescriptTestingApp | src/app/auth/auth-reponse.model.ts | export class AuthResponse {
constructor(public idToken: string = null,
public email: string = null,
public refreshToken: string = null,
public expiresIn: string = null,
public localId: string = null){
}
}
export class AuthLoginResponse extends Au... |
jerrySTK/NativescriptTestingApp | src/app/auth/auth.service.ts | <filename>src/app/auth/auth.service.ts
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of, throwError, BehaviorSubject } from 'rxjs';
import { tap, catchError } from 'rxjs/operators';
import { alert } from 'tns-core-modules/ui/dialogs';
import { User }... |
chandu0101/redux-demo | src/App/index.tsx | import React, {
useState,
ChangeEvent,
FormEvent,
useEffect,
useRef
} from "react";
import { Todo } from "../type";
//css
import "./App.css";
import { useDispatch, useSelector } from "react-redux";
import {
State,
createTodoActionCreator,
selectedTodoActionCreator
} from "../redux-og";
type AppProps ... |
chandu0101/redux-demo | src/redux-og.ts | import { Todo } from "./type";
import { v1 as uuid } from "uuid";
import { combineReducers, createStore, applyMiddleware } from "redux";
import thunk from "redux-thunk";
import logger from "redux-logger";
import { composeWithDevTools } from "redux-devtools-extension";
//Constants
const CREATE_TODO = "CREATE_TODO";
co... |
butttons/pg-functions-sync | src/utils/cli/init-config.ts | <reponame>butttons/pg-functions-sync<filename>src/utils/cli/init-config.ts<gh_stars>1-10
import fs from 'fs-extra';
import path from 'path';
import signale from 'signale';
import { fullConfigPath } from '../config';
const emptyConfig = {
pg: {
user: '',
host: '',
database: '',
passw... |
butttons/pg-functions-sync | src/cli.ts | #!/usr/bin/env node
import cli from 'commander';
import { initConfig } from './utils/cli/init-config';
import { syncFunctions } from './utils/cli/sync-functions';
export const configFileName = 'pgfunctions.json';
cli.version('0.1.0')
.description('Develop and maintain postgres functions in a sane way.')
.opti... |
butttons/pg-functions-sync | src/utils/pg.ts | import { Client, ClientConfig } from 'pg';
import signale from 'signale';
import { readFile } from 'fs-extra';
import { resolve } from 'path';
import { PgFnConfig } from './config';
export const pgClientFactory = async (config: ClientConfig) => {
let client: boolean | Client = new Client(config);
await client.... |
butttons/pg-functions-sync | src/utils/config.ts | <reponame>butttons/pg-functions-sync<filename>src/utils/config.ts<gh_stars>1-10
import fs from 'fs-extra';
import { resolve, parse } from 'path';
import { configFileName } from '../cli';
import { ClientConfig } from 'pg';
export interface PgFnConfig {
pg: ClientConfig;
dir: string;
}
export const fullConfigPa... |
butttons/pg-functions-sync | src/utils/cli/sync-functions.ts | import { CommanderStatic } from 'commander';
import signale from 'signale';
import chokidar from 'chokidar';
import { resolve } from 'path';
import { hasConfig, configFile, hasFunctionDir, functionFiles, functionDirPath, PgFnConfig, getFileName } from '../config';
import { pgClientFactory, runQuery } from '../pg';
co... |
nkolytschew/spring-cloud-and-aws | 01.aws.core/src/main/resources/frontend.client/src/app/home/home.component.ts | <gh_stars>0
import {Component, OnInit} from '@angular/core';
import {Http, Response} from "@angular/http";
import "rxjs/add/operator/map";
import {ApiService} from "../services/api.service";
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export cl... |
nkolytschew/spring-cloud-and-aws | 01.aws.core/src/main/resources/frontend.client/src/app/services/api.service.ts | <filename>01.aws.core/src/main/resources/frontend.client/src/app/services/api.service.ts
import {Injectable} from '@angular/core';
import {Headers} from "@angular/http";
import {CredentialsModel} from "../model/credentials.model";
@Injectable()
export class ApiService {
private loginHeaders: Headers;
constructor... |
nkolytschew/spring-cloud-and-aws | 01.aws.core/src/main/resources/frontend.client/src/app/login/login.component.ts | <reponame>nkolytschew/spring-cloud-and-aws
import {Component, OnInit} from '@angular/core';
import {LoginService} from "../services/login.service";
import {Router} from "@angular/router";
import {CredentialsModel} from "../model/credentials.model";
@Component({
selector: 'app-login',
templateUrl: './login.componen... |
nkolytschew/spring-cloud-and-aws | 01.aws.core/src/main/resources/frontend.client/src/app/navigation/navigation.component.ts | <gh_stars>0
import {Component, OnInit} from '@angular/core';
import {LoginService} from "../services/login.service";
import {Router} from "@angular/router";
@Component({
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.scss']
})
export class NavigationCo... |
nkolytschew/spring-cloud-and-aws | 01.aws.core/src/main/resources/frontend.client/src/app/services/login.service.ts | import {Injectable} from '@angular/core';
import {Http, Response, Headers} from "@angular/http";
import {Observable} from "rxjs/Observable";
import "rxjs/add/operator/catch";
import "rxjs/add/observable/throw";
import {ApiService} from "./api.service";
import {CredentialsModel} from "../model/credentials.model";
@Inje... |
nkolytschew/spring-cloud-and-aws | 01.aws.core/src/main/resources/frontend.client/src/app/model/credentials.model.ts |
export class CredentialsModel {
username: string = "";
password: string = "";
constructor(username: string, password: string) {
this.username = username;
this.password = password;
}
toString(): string {
return "{\"username\":\"" + this.username +
"\",\n\"password\":\"" + this.password +... |
phvictorino/scheduler-api | src/collections/schedule.ts | <reponame>phvictorino/scheduler-api
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
@Schema()
export class Schedule extends Document {
@Prop()
description: string;
@Prop()
clerkName: string;
}
export const ScheduleSchema = SchemaFactory.createForClass(Sche... |
phvictorino/scheduler-api | src/containers/schedules/schedules.controller.ts | <reponame>phvictorino/scheduler-api
import { Body, Controller, Get, Post } from '@nestjs/common';
import { SchedulesService } from './schedules.service';
import { Schedule } from '../../collections/schedule';
import { CreateScheduleDTO } from './dtos/create-schedule.dto';
@Controller('schedules')
export class Schedule... |
phvictorino/scheduler-api | src/containers/schedules/schedules.service.ts | import { Injectable } from '@nestjs/common';
import { Schedule } from '../../collections/schedule';
import { CreateScheduleDTO } from './dtos/create-schedule.dto';
import { SchedulesRepository } from './schedules.repository';
@Injectable()
export class SchedulesService {
constructor(private schedulesRepository: Sche... |
phvictorino/scheduler-api | src/containers/schedules/schedules.repository.ts | <reponame>phvictorino/scheduler-api
import { BadRequestException, Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Schedule } from '../../collections/schedule';
import { Model } from 'mongoose';
import { CreateScheduleDTO } from './dtos/create-schedule.dto';
@Injectable()
ex... |
phvictorino/scheduler-api | src/containers/schedules/schedules.module.ts | import { Module } from '@nestjs/common';
import { SchedulesController } from './schedules.controller';
import { SchedulesService } from './schedules.service';
import { MongooseModule } from '@nestjs/mongoose';
import { Schedule, ScheduleSchema } from '../../collections/schedule';
import { SchedulesRepository } from './... |
phvictorino/scheduler-api | src/containers/schedules/schedules.service.spec.ts | <gh_stars>0
import { Test, TestingModule } from '@nestjs/testing';
import { SchedulesService } from './schedules.service';
import { getModelToken } from '@nestjs/mongoose';
import { Schedule } from '../../collections/schedule';
import { SchedulesRepository } from './schedules.repository';
describe('SchedulesService', ... |
phvictorino/scheduler-api | src/containers/schedules/dtos/create-schedule.dto.ts | <gh_stars>0
import { IsNotEmpty } from 'class-validator';
export class CreateScheduleDTO {
@IsNotEmpty()
description: string;
@IsNotEmpty()
clerkName: string;
}
|
OGProgrammer/terraform-aws-github-ci | modules/status/lambda/src/index.ts | /*
* Copyright (c) 2017-2018 <NAME> <<EMAIL>>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merg... |
mrmlnc/vscode-remark-format | src/extension.ts | import * as vscode from 'vscode'
import * as remark from 'remark'
import type {VFileContents} from 'vfile'
import type {Plugin} from 'unified'
import {resolveMany} from 'npm-module-path'
import {getWorkspaceConfig} from './utils/workspace'
let output: vscode.OutputChannel
interface IPlugin {
name: string
package... |
mrmlnc/vscode-remark-format | src/test/suite/workspace.test.ts | 'use strict'
import * as path from 'path'
import * as vscode from 'vscode'
import {after, before} from 'mocha'
import * as chai from 'chai'
import * as check from 'check-types'
import * as workspace from '../../utils/workspace'
const expect = chai.expect
suite('Extension Test Suite', () => {
before(() => {
vsc... |
mrmlnc/vscode-remark-format | src/utils/workspace.ts | <filename>src/utils/workspace.ts<gh_stars>0
import {promises as fs} from 'fs'
import * as vscode from 'vscode'
import * as yaml from 'yaml'
export async function getWorkspaceConfig() {
const files = await vscode.workspace.findFiles(
'**/*remarkrc*',
'**/node_modules/**'
)
return parseWorkspaceConfig(file... |
UIM-Community/orders | index.d.ts | <reponame>UIM-Community/orders<filename>index.d.ts<gh_stars>0
declare namespace Orders {
interface Env {
port: number;
db_host: string;
db_password: string;
db_database: string;
db_user: string;
}
}
export as namespace Orders;
export = Orders;
|
rafabruno/clean-node-api | src/modules/user/useCases/CreateUser/index.ts | <reponame>rafabruno/clean-node-api
import { MailtrapMailProvider } from '../../providers/implementations/MailtrapMailProvider'
import { UsersRepository } from '../../repositories/implementations/UsersRepository'
import { CreateUserController } from './CreateUserController'
import { CreateUserUseCase } from './CreateUse... |
rafabruno/clean-node-api | src/modules/user/providers/implementations/MailtrapMailProvider.ts | import { IMailProvider, IMessage } from '../IMailProvider'
import nodemailer from 'nodemailer'
import Mail from 'nodemailer/lib/mailer'
export class MailtrapMailProvider implements IMailProvider {
private transporter: Mail
constructor() {
this.transporter = nodemailer.createTransport({
host: 'smtp.mailt... |
rafabruno/clean-node-api | src/modules/user/models/User.ts | <reponame>rafabruno/clean-node-api<gh_stars>0
import { v4 as uuidv4 } from 'uuid'
export class User {
id?: string
name: string
email: string
password: string
constructor(props: Omit<User, 'id'>, id?: string) {
Object.assign(props, this)
if (!id) {
this.id = uuidv4()
}
}
}
|
rafabruno/clean-node-api | src/modules/user/providers/IMailProvider.ts | export interface IAddress {
address: string
name: string
}
export interface IMessage {
to: IAddress
from: IAddress
subject: string
html: string
}
export interface IMailProvider {
sendMail(message: IMessage): Promise<void>
}
|
rafabruno/clean-node-api | src/modules/user/useCases/CreateUser/CreateUserUseCase.ts | import { User } from '../../models/User'
import { IMailProvider } from '../../providers/IMailProvider'
import { IUsersRepository } from '../../repositories/IUsersRepository'
import { ICreateUserDTO } from './ICreateUserDTO'
export class CreateUserUseCase {
constructor(
private usersRepository: IUsersRepository,
... |
LukasAlius/rn-tourguide | src/components/ConnectedStep.tsx | <filename>src/components/ConnectedStep.tsx
import * as React from 'react'
import { BorderRadiusObject, Shape } from '../types'
import { ITourGuideContext } from './TourGuideContext'
declare var __TEST__: boolean
interface Props {
name: string
text: string
title?: string
order: number
active?: boolean
shap... |
weyert/opentelemetry-ext-js | packages/instrumentation-typeorm/src/version.ts | <reponame>weyert/opentelemetry-ext-js
// this is autogenerated file, see scripts/version-update.js
export const VERSION = '0.24.1';
|
weyert/opentelemetry-ext-js | packages/instrumentation-aws-sdk/src/version.ts | // this is autogenerated file, see scripts/version-update.js
export const VERSION = '0.24.2';
|
skonves/cqd-node | src/commands/load/sql-writer.ts | <filename>src/commands/load/sql-writer.ts
import { Writable } from 'stream';
import { Database } from 'sqlite3';
import { Commit, File } from './git-parser';
import { DbBase } from '../../db';
export class SqliteWriterStream extends Writable {
constructor(db: Database) {
super({ objectMode: true });
this.sql... |
skonves/cqd-node | src/commands/load/git-parser.tests.ts | <reponame>skonves/cqd-node
import { expect } from 'chai';
import { GitParser, Commit } from './git-parser';
describe('GitParser', () => {
describe('parse', () => {
it('parses new-line terminated chunk', () => {
// ARRANGE
const chunk =
'[aaaaaaa] <NAME> 2808-12-01 13:37:00 +0000 Initial commi... |
skonves/cqd-node | src/commands/load/git-log.ts | import { Readable } from 'stream';
import { spawn } from 'child_process';
export type GitParserOptions = {
before?: string;
after?: string;
number?: number;
ignoreSpaceChange?: boolean;
};
export function gitLog(path: string, options?: GitParserOptions): Readable {
let optionsString = '';
if (options && ... |
skonves/cqd-node | src/commands/load/git-show.ts | import { Readable } from 'stream';
import { spawn } from 'child_process';
export function gitShow(
path: string,
hash: string,
fileName: string,
): Readable {
return spawn(`bash`, [
'-c',
`git --git-dir=${path} show ${hash}:"${fileName}"`,
]).stdout;
}
export async function isDeleted(
path: string... |
skonves/cqd-node | src/commands/load/file-parser.ts | <reponame>skonves/cqd-node
import { Writable } from 'stream';
export class FileParserStream extends Writable {
private readonly fileParser = new FileParser();
_write(chunk: Buffer, encoding: string, callback: () => void): void {
this.fileParser.parse(chunk.toString());
callback();
}
getStats(): LineS... |
skonves/cqd-node | src/commands/load/utils.ts | import { LineStats, FileParserStream } from './file-parser';
import { gitShow, isDeleted } from './git-show';
export async function getLineStats(
gitPath: string,
hash: string,
fileName: string,
): Promise<LineStats> {
return new Promise<LineStats>(async (resolve, reject) => {
const fileParserStream = new ... |
skonves/cqd-node | src/utils.tests.ts | import { expect } from 'chai';
import * as path from 'path';
import * as utils from './utils';
const s = path.sep;
describe('utils', () => {
describe('isGitDir', () => {
it('returns false when the final directory is not ".git"', () => {
// ARRANGE
const dir = path.join('the', 'dir', 'to', 'evaluate'... |
skonves/cqd-node | src/commands/load/line-stats-reader.ts | <reponame>skonves/cqd-node
import { Transform, TransformCallback } from 'stream';
import { Commit, File } from './git-parser';
import { getLineStats } from './utils';
export class LineStatsReader extends Transform {
constructor(private readonly gitPath: string) {
super({ objectMode: true });
}
_transform(
... |
skonves/cqd-node | src/db.ts | import { Database, RunResult } from 'sqlite3';
export async function open(location: string): Promise<Database> {
console.log(`Opening database at ${location}`);
return new Promise<Database>((resolve, reject) => {
const db = new Database(location, err => (err ? reject(err) : resolve(db)));
}).then(init);
}
... |
skonves/cqd-node | src/utils.ts | <reponame>skonves/cqd-node
import * as path from 'path';
export function isGitDir(dir: string): boolean {
return dir.split(path.sep).slice(-1)[0] === '.git';
}
export function addGitDir(dir: string): string {
if (isGitDir(dir)) return dir;
return (
(dir.startsWith(path.sep) ? path.sep : '') +
path.join... |
skonves/cqd-node | src/cli.ts | #!/usr/bin/env node
import { run as runLoad } from './commands/load';
const command = process.argv[2];
switch (command) {
case 'load': {
runLoad();
break;
}
case undefined:
case '-h':
case '--help': {
console.log('HALP!');
break;
}
case '-v':
case '--version': {
console.log('the v... |
skonves/cqd-node | src/commands/load/file-parser.tests.ts | <reponame>skonves/cqd-node
import { expect } from 'chai';
import { FileParser } from './file-parser';
describe('FileParser', () => {
describe('lineCount', () => {
it('counts content followed by a new-line (\\n) as a line', () => {
// ARRANGE
const sut = new FileParser();
// ACT
sut.pars... |
skonves/cqd-node | src/commands/load/git-parser.ts | <reponame>skonves/cqd-node<filename>src/commands/load/git-parser.ts
import { Transform, TransformCallback } from 'stream';
import { LineStats } from './file-parser';
const commitRegex = /^\[([0-9a-f]+)\]\s(.*?)\s([0-9]{4}-[0-9]{2}-[0-9]{2}\s[0-9]{2}:[0-9]{2}:[0-9]{2}\s[-+][0-9]{4})\s(.*?)$/;
const fileRegex = /^([0-9]... |
skonves/cqd-node | src/commands/load/index.ts | <filename>src/commands/load/index.ts
import { create, validators } from 'posix-argv-parser';
import * as path from 'path';
import { SqliteWriterStream } from './sql-writer';
import { gitLog, GitParserOptions } from './git-log';
import { GitParserStream } from './git-parser';
import { Database } from 'sqlite3';
import ... |
skonves/cqd-node | src/commands/load/sql-writer.tests.ts | <reponame>skonves/cqd-node
import { open } from '../../db';
import { SqliteWriter } from './sql-writer';
import { Commit } from './git-parser';
describe('SqlWriter', () => {
it('works', async () => {
// ARRANGE
const db = await open(':memory:');
const sqlWriter = new SqliteWriter(db);
const commitA... |
skonves/cqd-node | src/db.tests.ts | import { open } from './db';
describe('db', () => {
it('works', async () => {
// ARRANGE
const file = ':memory:';
// ACT
const db = await open(file);
// ASSERT
});
});
|
harryli0088/vue-rust-counter | client/src/utils/constants.ts | <reponame>harryli0088/vue-rust-counter
export const SERVER_URL = process.env.VUE_APP_SERVER_URL || "http://localhost:8080" |
harryli0088/vue-rust-counter | client/src/utils/handleResponse.ts | export default async function handleResponse(res: Response) {
if(!res.ok) {
throw new Error(await res.text())
}
return res
} |
TheSoftwareHouse/Kakunin | src/web/performance/JSON-performance-report-parser.helper.spec.ts | <gh_stars>100-1000
import JSONPerformanceReportParser from './JSON-performance-report-parser.helper';
const parser = new JSONPerformanceReportParser('src/tests/reports/performance');
describe('JSON performance report parser', () => {
it('returns found objects with TTFB and URL values', () => {
const fileName = ... |
msanguineti/svelte-fa | src/index.d.ts | <reponame>msanguineti/svelte-fa<gh_stars>0
import { SvelteComponent } from "svelte"
declare class Fa extends SvelteComponent {
constructor(options: any)
$$prop_def: {
class?: string
id?: string
style?: string
icon: { icon: any }
fw?: boolean
flip?: string
pull?: string
rotate?: nu... |
nutawud/web-admin-basic | src/app/views/table/table-routing.module.ts | <gh_stars>0
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PaginationComponent } from './pagination/pagination.component';
import { TableComponent } from './table.component';
const routes: Routes = [
{
path: '',
data: {
title: 'Table'
},
... |
Hopding/png.js | src/png.ts | import pako from 'pako';
export type ColorSpace = 'DeviceGray' | 'DeviceRGB';
export default class PNG {
static load = (data: Uint8Array) => new PNG(data);
palette: number[];
imgData: Uint8Array;
transparency: {
indexed?: number[];
grayscale?: number;
rgb?: number[];
};
text: { [key: string]:... |
marksherman/pml-font-explorer | src/math/backends/webgl/reverse_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/mnist_eager/data.ts | <reponame>marksherman/pml-font-explorer<filename>demos/mnist_eager/data.ts
import * as dl from 'deeplearn';
const math = dl.ENV.math;
const TRAIN_TEST_RATIO = 5 / 6;
const mnistConfig: dl.XhrDatasetConfig = {
'data': [
{
'name': 'images',
'path': 'https://storage.googleapis.com/learnjs-data/model-b... |
marksherman/pml-font-explorer | src/math/math_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/concat_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/logicalop_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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
marksherman/pml-font-explorer | src/math/concat_util.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/mnist_eager/ui.ts | import * as dl from 'deeplearn';
const math = dl.ENV.math;
const statusElement = document.getElementById('status');
const messageElement = document.getElementById('message');
const imagesElement = document.getElementById('images');
export function isTraining() {
statusElement.innerText = 'Training...';
}
export fu... |
marksherman/pml-font-explorer | src/math/conv2d_transpose_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/graph/optimizers/adagrad_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/math/optimizers/sgd_optimizer_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/optimizers/sgd_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/math/backends/backend_engine.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/imagenet/imagenet_util.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/variable_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/ops/convolution.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/slice_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/backends/types/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/LICENSE-2.0
*
* Unless required by a... |
marksherman/pml-font-explorer | demos/benchmarks/benchmark_util.ts | <reponame>marksherman/pml-font-explorer
import {NDArray, NDArrayMath} from 'deeplearn';
export async function warmupAndBenchmarkGPU(
math: NDArrayMath, benchmark: () => NDArray): Promise<number> {
// Warmup.
const out = benchmark();
await out.data();
out.dispose();
// Real timing.
return math.time(ben... |
marksherman/pml-font-explorer | src/math/backends/backend.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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.