repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
hyoshioka0128/azure-samples-js-management
samples/sql/sql_server_examples.ts
<reponame>hyoshioka0128/azure-samples-js-management import { DefaultAzureCredential } from "@azure/identity"; import { ExtendedServerBlobAuditingPolicy, ServerAzureADAdministrator, ServerBlobAuditingPolicy, ServerSecurityAlertPolicy, SqlManagementClient, VirtualNetworkRule, } from "@azure/arm-sql"; import {...
hyoshioka0128/azure-samples-js-management
samples/policy/policy_example.ts
<reponame>hyoshioka0128/azure-samples-js-management import { DefaultAzureCredential } from "@azure/identity"; // eslint-disable-next-line import/no-unresolved import { ManagementGroupsAPI } from "azure-arm-managementgroups"; import { PolicyClient, PolicyDefinition, PolicySetDefinition, } from "@azure/arm-policy";...
hyoshioka0128/azure-samples-js-management
samples/storage/storage_example.ts
<gh_stars>1-10 import { BlobContainer, BlobContainersExtendImmutabilityPolicyOptionalParams, BlobContainersLeaseOptionalParams, BlobServiceProperties, EncryptionScope, FileServiceProperties, LegalHold, ManagementPolicy, PrivateEndpointConnection, StorageAccountCheckNameAvailabilityParamete...
hyoshioka0128/azure-samples-js-management
samples/network/network-load-balancer_example.ts
<filename>samples/network/network-load-balancer_example.ts import { DefaultAzureCredential } from "@azure/identity"; import { InboundNatRule, LoadBalancer, NetworkManagementClient, PublicIPAddress, } from "@azure/arm-network"; const subscriptionId = process.env.subscriptionId; const credential = new DefaultAzu...
hyoshioka0128/azure-samples-js-management
samples/compute/availabilitySets_example.ts
<filename>samples/compute/availabilitySets_example.ts<gh_stars>1-10 import { AvailabilitySet, AvailabilitySetUpdate, ComputeManagementClient, } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = process.env.subscriptionId; const credential = new De...
hyoshioka0128/azure-samples-js-management
samples/features/features_example.ts
<reponame>hyoshioka0128/azure-samples-js-management import { DefaultAzureCredential } from "@azure/identity"; import { FeatureClient } from "@azure/arm-features"; const subscriptionId = process.env.subscriptionId; const credential = new DefaultAzureCredential(); let client: FeatureClient; //--FeaturesExamples-- //fe...
hyoshioka0128/azure-samples-js-management
samples/compute/dedicatedHosts_groups_example.ts
import { ComputeManagementClient, DedicatedHost, DedicatedHostGroup, DedicatedHostGroupUpdate, DedicatedHostUpdate, } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = process.env.subscriptionId; const credential = new DefaultAzureCredential...
hyoshioka0128/azure-samples-js-management
samples/keyvault/keyvault-examples.ts
<filename>samples/keyvault/keyvault-examples.ts import { DefaultAzureCredential } from "@azure/identity"; import { KeyVaultManagementClient, VaultAccessPolicyParameters, VaultCreateOrUpdateParameters, VaultPatchParameters, } from "@azure/arm-keyvault"; const subscriptionId = process.env.subscriptionId; const c...
hyoshioka0128/azure-samples-js-management
samples/web/webApp_examples.ts
<reponame>hyoshioka0128/azure-samples-js-management<gh_stars>1-10 import { AppServicePlan, Site, SiteConfigResource, SitePatchResource, SiteSourceControl, WebSiteManagementClient, } from "@azure/arm-appservice"; import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = process.env.su...
hyoshioka0128/azure-samples-js-management
samples/managedapplications/managedapplications_example.ts
import { ApplicationClient } from "@azure/arm-managedapplications"; import { DefaultAzureCredential } from "@azure/identity"; import { ResourceManagementClient } from "@azure/arm-resources"; const subscriptionId = process.env.subscriptionId; const credential = new DefaultAzureCredential(); const applicationName = "jsa...
hyoshioka0128/azure-samples-js-management
samples/compute/compute_vm_example.ts
import { ComputeManagementClient, RunCommandInput, VirtualMachine, VirtualMachineExtension, VirtualMachineExtensionUpdate, VirtualMachineUpdate, } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; import { NetworkInterface, NetworkManagementClient, Subnet...
hyoshioka0128/azure-samples-js-management
samples/compute/disks_example.ts
import { ComputeManagementClient, Disk, DiskUpdate, GrantAccessData, Image, ImageUpdate, Snapshot, } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; import { ResourceManagementClient } from "@azure/arm-resources"; const subscriptionId = process.env.subscri...
hyoshioka0128/azure-samples-js-management
samples/web/staticSite_examples.ts
<reponame>hyoshioka0128/azure-samples-js-management<filename>samples/web/staticSite_examples.ts import { DefaultAzureCredential } from "@azure/identity"; import { StaticSiteARMResource, WebSiteManagementClient, } from "@azure/arm-appservice"; const subscriptionId = process.env.subscriptionId; const token = process...
hyoshioka0128/azure-samples-js-management
samples/compute/compute_vmss_example.ts
import { ComputeManagementClient, RunCommandInput, VirtualMachineScaleSet, VirtualMachineScaleSetExtension, VirtualMachineScaleSetExtensionUpdate, VirtualMachineScaleSetUpdate, VirtualMachineScaleSetVM, VirtualMachineScaleSetVMInstanceRequiredIDs, } from "@azure/arm-compute"; import { DefaultA...
hyoshioka0128/azure-samples-js-management
samples/network/network_base_example.ts
<filename>samples/network/network_base_example.ts<gh_stars>1-10 import { ConnectionSharedKey, LocalNetworkGateway, NetworkManagementClient, PublicIPAddress, PublicIPPrefix, Subnet, VirtualNetwork, VirtualNetworkGateway, VirtualNetworkGatewayConnection, VirtualNetworkPeering, } from "@azur...
hyoshioka0128/azure-samples-js-management
samples/web/certificates_examples.ts
<filename>samples/web/certificates_examples.ts import { Certificate, WebSiteManagementClient } from "@azure/arm-appservice"; import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = process.env.subscriptionId; const token = process.env.GITHUB_TOKEN_FOR_APPSERVICE; const credential = new Default...
hyoshioka0128/azure-samples-js-management
samples/network/network-watcher_example.ts
import { ComputeManagementClient, VirtualMachine, VirtualMachineExtension, } from "@azure/arm-compute"; import { DefaultAzureCredential } from "@azure/identity"; import { NetworkManagementClient, PublicIPAddress, TroubleshootingParameters, VerificationIPFlowParameters, VirtualNetworkGateway, ...
hyoshioka0128/azure-samples-js-management
samples/sql/sql_database_examples.ts
<reponame>hyoshioka0128/azure-samples-js-management import { BackupShortTermRetentionPolicy, CreateDatabaseRestorePointDefinition, Database, DatabaseBlobAuditingPolicy, DatabaseUpdate, LongTermRetentionPolicy, ResourceMoveDefinition, Server, SqlManagementClient, WorkloadGroup, } from "@azure/arm-sql...
hyoshioka0128/azure-samples-js-management
samples/web/appservicePlan_examples.ts
<filename>samples/web/appservicePlan_examples.ts import { AppServicePlan, WebSiteManagementClient } from "@azure/arm-appservice"; import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = process.env.subscriptionId; const token = process.env.GITHUB_TOKEN_FOR_APPSERVICE; const credential = new De...
hyoshioka0128/azure-samples-js-management
samples/links/links_example.ts
<reponame>hyoshioka0128/azure-samples-js-management<filename>samples/links/links_example.ts import { DefaultAzureCredential } from "@azure/identity"; import { ManagementLinkClient } from "@azure/arm-links"; import { ResourceManagementClient } from "@azure/arm-resources"; const subscriptionId = process.env.subscription...
hyoshioka0128/azure-samples-js-management
samples/network/network_ipAddress_example.ts
import { DefaultAzureCredential } from "@azure/identity"; import { NetworkManagementClient, PublicIPPrefix } from "@azure/arm-network"; const subscriptionId = process.env.subscriptionId; const credential = new DefaultAzureCredential(); const resourceGroup = "myjstest"; const publicIpPrefixName = "publicipprefixyyy"; c...
hyoshioka0128/azure-samples-js-management
samples/network/network_ip_example.ts
<reponame>hyoshioka0128/azure-samples-js-management import { DefaultAzureCredential } from "@azure/identity"; import { IpGroup, NetworkManagementClient } from "@azure/arm-network"; const subscriptionId = process.env.subscriptionId; const credential = new DefaultAzureCredential(); const resourceGroup = "myjstest"; cons...
likern/react-native-vision-camera
src/TemporaryFile.ts
/** * Represents a temporary file in the local filesystem. */ export type TemporaryFile = Readonly<{ /** * The path of the file. This file might get deleted once the app closes because it lives in the temp directory. */ path: string; }>;
likern/react-native-vision-camera
src/Code.ts
/** * Available code types */ export type CodeType = | 'cat-body' | 'dog-body' | 'human-body' | 'salient-object' | 'aztec' | 'code-128' | 'code-39' | 'code-39-mod-43' | 'code-93' | 'data-matrix' | 'ean-13' | 'ean-8' | 'face' | 'interleaved-2-of-5' | 'itf-14' | 'pdf-417' | 'qr' | 'u...
likern/react-native-vision-camera
example/src/hooks/useIsScreenFocused.ts
<reponame>likern/react-native-vision-camera import { useEffect, useMemo, useReducer } from 'react'; import { Navigation } from 'react-native-navigation'; type Action = | { action: 'push'; componentId: string; } | { action: 'pop'; componentId: string; }; const reducer = (stack: stri...
likern/react-native-vision-camera
example/index.tsx
<gh_stars>0 import 'react-native-gesture-handler'; import { Navigation } from 'react-native-navigation'; import { gestureHandlerRootHOC } from 'react-native-gesture-handler'; import { App } from './src/App'; import { Settings } from './src/Settings'; import { Splash } from './src/Splash'; import { Media } from './src/M...
likern/react-native-vision-camera
example/src/state/atoms.ts
import { atom } from 'pipestate'; interface FormatSettings { fps: number; } export const FormatSettingsAtom = atom<FormatSettings>({ default: { fps: 60, }, });
likern/react-native-vision-camera
src/VideoFile.ts
// /** // * not yet implemented. // */ // declare interface RecordVideoOptions<TCodec extends CameraVideoCodec> { // /** // * Specify the video codec to use. To get a list of available video codecs use the `getAvailableVideoCodecs()` function. // * // * @default undefined // */ // videoCodec?: TCodec;...
likern/react-native-vision-camera
example/src/Settings.tsx
import React, { useCallback } from 'react'; import { StyleSheet, View, Text, Linking } from 'react-native'; import { Navigation, NavigationFunctionComponent } from 'react-native-navigation'; import Slider from '@react-native-community/slider'; import { useState } from 'react'; import { useEffect } from 'react'; import ...
likern/react-native-vision-camera
src/CameraCodec.ts
<reponame>likern/react-native-vision-camera /** * Available Video Codec types used for recording a video. * * * `"hevc"`: The HEVC video codec. _(iOS 11.0+)_ * * `"h264"`: The H.264 (`avc1`) video codec. _(iOS 11.0+)_ * * `"jpeg"`: The JPEG (`jpeg`) video codec. _(iOS 11.0+)_ * * `"pro-res-4444"`: The Apple ProRe...
likern/react-native-vision-camera
example/src/state/selectors.ts
<reponame>likern/react-native-vision-camera<gh_stars>1-10 import { selector } from 'pipestate'; import { FormatSettingsAtom } from './atoms'; export const FpsSelector = selector<number, []>({ get: ({ get }) => { return get(FormatSettingsAtom).fps; }, set: ({ set, get }, newFps) => { const formatSettings ...
likern/react-native-vision-camera
example/src/hooks/useCachedState.ts
import { useCallback, useRef, useState } from 'react'; /** * Same as `useState`, but swallow all calls to `setState` if the value didn't change (uses `===` comparator per default) * @param initialValue The initial state * @param comparator A custom comparator, useful if you want to only round numbers or use string ...
rochaa/crud-auth-api-nestjs
src/modules/adm/churches/church.model.ts
import { Schema, Document } from 'mongoose'; export interface Church extends Document { name: string, cnpj: string, churchRoot: string, isCongregation: boolean } export const ChurchSchema = new Schema({ name: String, cnpj: String, churchRoot: { type: Schema.Types.ObjectId, ref: 'Church', r...
rochaa/crud-auth-api-nestjs
src/modules/adm/accounts/accounts.service.ts
<reponame>rochaa/crud-auth-api-nestjs<filename>src/modules/adm/accounts/accounts.service.ts import { Injectable, UnauthorizedException } from '@nestjs/common'; import { Md5 } from "md5-typescript"; import { AuthService } from '../../../shared/auth/auth.service'; import { Guid } from 'guid-typescript'; import { UsersSer...
rochaa/crud-auth-api-nestjs
src/utils/password.ts
<reponame>rochaa/crud-auth-api-nestjs<filename>src/utils/password.ts import { Md5 } from "md5-typescript"; export class Password { public static encriptyPassword(password: string) { return Md5.init(`${password}${process.env.GIDU_JWT_KEY}`); } }
rochaa/crud-auth-api-nestjs
src/modules/adm/users/user.model.ts
<filename>src/modules/adm/users/user.model.ts import { Schema, Document } from 'mongoose'; export interface User extends Document { email: string, password: string, roles: string[], status: string, } export const UserSchema = new Schema({ email: { type: String, index: { unique: true } }, passw...
rochaa/crud-auth-api-nestjs
src/modules/adm/churches/churches.controller.ts
import { Controller, Post, Body, HttpStatus, Put, Param, HttpCode, NotFoundException, Get, UseGuards, Query } from '@nestjs/common'; import { ApiUseTags } from '@nestjs/swagger'; import { CreateChurchDto } from './dto/create-church.dto'; import { ChurchesService } from './churches.service'; import { ResultDto }...
rochaa/crud-auth-api-nestjs
src/utils/cnpj.ts
import { registerDecorator, ValidationOptions, ValidationArguments } from "class-validator"; export function isCnpjValid(validationOptions?: ValidationOptions) { return function (object: Object, propertyName: string) { registerDecorator({ name: "isCnpjValid", target: object.construc...
rochaa/crud-auth-api-nestjs
src/modules/adm/users/dto/update-user.dto.ts
import { IsEnum } from 'class-validator'; import { UserRole } from '../users.enum'; export class UpdateUserDto { @IsEnum(UserRole, { each: true, message: 'Perfil não encontrado' }) readonly roles: string[]; }
rochaa/crud-auth-api-nestjs
src/shared/auth/auth.guard.ts
<filename>src/shared/auth/auth.guard.ts<gh_stars>0 import { ExecutionContext, Injectable, UnauthorizedException, ForbiddenException } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { ResultExceptionDto } from '../result/result-exception.dto'; import { Reflector } from '@nestjs/core'; @Inje...
rochaa/crud-auth-api-nestjs
src/modules/adm/accounts/accounts.controller.ts
import { Controller, Post, Req, Body, HttpStatus, HttpCode, NotFoundException, UseGuards } from '@nestjs/common'; import { ApiUseTags } from '@nestjs/swagger'; import { AccountsService } from './accounts.service'; import { AuthService } from '../../../shared/auth/auth.service'; import { ResultDto } from '../../...
rochaa/crud-auth-api-nestjs
src/modules/adm/users/users.controller.ts
<gh_stars>0 import { Controller, Post, Body, HttpStatus, Put, Param, HttpCode, NotFoundException, Delete, Get, UseGuards } from '@nestjs/common'; import { ApiUseTags } from '@nestjs/swagger'; import { CreateUserDto } from './dto/create-user.dto'; import { UsersService } from './users.service'; import { ResultDt...
rochaa/crud-auth-api-nestjs
src/modules/adm/adm.module.ts
import { Module, CacheModule, HttpModule } from '@nestjs/common'; import { PassportModule } from '@nestjs/passport'; import { MongooseModule } from '@nestjs/mongoose'; import { JwtModule } from '@nestjs/jwt'; import { JwtStrategy } from '../../shared/auth/jwt.strategy'; import { AuthService } from '../../shared/auth/a...
rochaa/crud-auth-api-nestjs
src/modules/adm/churches/dto/create-church.dto.ts
import { Length } from 'class-validator'; import { isCnpjValid } from '../../../../utils/cnpj'; export class CreateChurchDto { @Length(5, 80, { message: 'Nome da igreja precisa ser entre 5 e 80 caracteres' }) readonly name: string; @isCnpjValid({ message: 'Cnpj da igreja inválido' }) readonly cnpj: st...
rochaa/crud-auth-api-nestjs
src/modules/adm/churches/churches.service.ts
import { Model } from 'mongoose'; import { Injectable, BadRequestException } from '@nestjs/common'; import { InjectModel } from '@nestjs/mongoose'; import { Church } from './church.model'; import { CreateChurchDto } from './dto/create-church.dto'; import { UpdateChurchDto } from './dto/update-church.dto'; import { isNu...
rochaa/crud-auth-api-nestjs
src/modules/adm/users/dto/create-user.dto.ts
<reponame>rochaa/crud-auth-api-nestjs import { IsEmail, MinLength, IsEnum } from 'class-validator'; import { UserRole } from '../users.enum'; export class CreateUserDto { @IsEmail({}, { message: 'E-mail inválido' }) readonly email: string; @MinLength(6, { message: 'Senha com menos de 6 caracteres' }) ...
rochaa/crud-auth-api-nestjs
src/main.ts
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; import { CustomLogger } from './shared/logger/logger.service'; import * as compression from 'compression'; import { ValidationCustomPipe } from './shared/pipes/validati...
rochaa/crud-auth-api-nestjs
src/shared/filters/all-exceptions.filter.ts
<reponame>rochaa/crud-auth-api-nestjs import { ExceptionFilter, Catch, ArgumentsHost, HttpException, HttpStatus } from '@nestjs/common'; import { Request, Response } from 'express'; import { ResultDto } from '../result/result.dto'; @Catch() export class AllExceptionsFilter implements ExceptionFilter { catch(except...
rochaa/crud-auth-api-nestjs
src/shared/auth/auth.service.ts
import { JwtService } from '@nestjs/jwt'; import { Injectable } from '@nestjs/common'; import { JwtPayload } from './jwt-payload.interface'; @Injectable() export class AuthService { constructor( private readonly jwtService: JwtService ) { } async createToken(email: any, roles: string[]) { ...
rochaa/crud-auth-api-nestjs
src/modules/adm/accounts/dto/authenticate.dto.ts
<reponame>rochaa/crud-auth-api-nestjs import { IsEmail, MinLength } from 'class-validator'; export class AuthenticateDto { @IsEmail({}, { message: 'Email inválido' }) readonly email: string; @MinLength(6, { message: 'Senha com menos de 6 caracteres' }) readonly password: string; }
rochaa/crud-auth-api-nestjs
src/modules/adm/users/users.service.ts
<gh_stars>0 import { Model } from 'mongoose'; import { Injectable, BadRequestException } from '@nestjs/common'; import { InjectModel } from '@nestjs/mongoose'; import { UserStatus } from './users.enum'; import { User } from './user.model'; import { CreateUserDto } from './dto/create-user.dto'; import { UpdateUserDto } ...
rochaa/crud-auth-api-nestjs
src/modules/adm/accounts/dto/change-password.dto.ts
<reponame>rochaa/crud-auth-api-nestjs import { MinLength } from 'class-validator'; export class ChangePasswordDto { @MinLength(6, { message: 'Senha com menos de 6 caracteres' }) readonly password: string; @MinLength(6, { message: 'Senha com menos de 6 caracteres' }) readonly newPassword: string; }
rochaa/crud-auth-api-nestjs
src/modules/adm/users/users.enum.ts
export enum UserRole { Administrador = "Administrador", Diacono = "Diácono", Secretaria = "Secretária", Membro = "Membro" } export enum UserStatus { Ativo = "Ativo", Inativo = "Inativo" }
rochaa/crud-auth-api-nestjs
src/modules/adm/users/dto/changePassword-user.ts
import { IsEmail, MinLength } from 'class-validator'; export class ChangePasswordUserDto { @IsEmail({}, { message: 'E-mail inválido' }) readonly email: string; @MinLength(6, { message: 'Senha com menos de 6 caracteres' }) readonly password: string; }
Todilo/react-360-product-viewer
src/components/AnimationImage/AnimationImage.tsx
<gh_stars>1-10 import React from "react"; import styled from "styled-components"; interface ImageProps { src: string; isVisible: boolean; width: number; height: number; } interface StyledImageProps {} const StyledImage = styled.img<StyledImageProps>` user-select: none; touch-action: none; cursor: inheri...
Todilo/react-360-product-viewer
src/components/React360Viewer/index.ts
<gh_stars>1-10 export * from "./React360Viewer";
Todilo/react-360-product-viewer
src/components/React360Viewer/React360Viewer.tsx
<filename>src/components/React360Viewer/React360Viewer.tsx import React, { useEffect, useRef, useState } from "react"; import styled, { css } from "styled-components"; import AnimationImage from "../AnimationImage/AnimationImage"; import StyledRotateIcon from "../icons/StyledRotateIcon"; // The regular % can return ne...
Todilo/react-360-product-viewer
src/index.ts
export * from "./components/React360Viewer";
Todilo/react-360-product-viewer
src/stories/React360Viewer.stories.tsx
<gh_stars>1-10 import { ComponentMeta, ComponentStory } from "@storybook/react"; import React from "react"; import { React360Viewer, React360ViewerProps, } from "../components/React360Viewer"; export default { title: "React360Viewer", component: React360Viewer, argTypes: { notifyOnPointerDown: { action:...
Todilo/react-360-product-viewer
src/components/icons/RotateIcon.tsx
<filename>src/components/icons/RotateIcon.tsx import React from "react"; function Icon({ className }: { className?: string }) { return ( <svg className={className} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" > <path d="M12 6C6.3 6 2 8.15 2 11c0 2.45 3.19 4.38 7.71 4.88l-.42...
Todilo/react-360-product-viewer
src/components/icons/StyledRotateIcon.tsx
<gh_stars>1-10 import styled, { css, StyledProps } from "styled-components"; import RotateIcon from "./RotateIcon"; type StyledRotateIconProps = StyledProps<{ widthInEm: number; isReverse: boolean; }>; const StyledRotateIcon = styled(RotateIcon)<StyledRotateIconProps>` position: absolute; fill: #eee; text-...
roopkt/barrelsby
test/barrel.ts
import * as alphabetats from "test/alpha/beta"; import * as etats from "test/eta"; import * as gammadeltaepsilonts from "test/gamma/delta/epsilon"; export const alpha = { beta: alphabetats, }; export {etats as eta}; export const gamma = { delta: { epsilon: gammadeltaepsilonts, }, };
roopkt/barrelsby
src/builder.test.ts
<reponame>roopkt/barrelsby import {assert} from "chai"; import * as fs from "fs"; import * as MockFs from "mock-fs"; import * as Sinon from "sinon"; import * as Builder from "./builder"; import * as FileSystem from "./builders/fileSystem"; import * as Flat from "./builders/flat"; import * as Modules from "./modules"; ...
roopkt/barrelsby
src/options.test.ts
import {assert} from "chai"; import * as Yargs from "yargs"; import * as Options from "./options"; describe("options module has a", () => { describe("getOptions function that", () => { it("should load the configuration options", () => { Yargs([ "--delete", "--dir...
seanmay/bombscrubber
src/site/tasks/reroll-button.tsx
import React, { FC } from "react"; const rerollStyle = { cursor: "pointer", fontSize: "var(--size-lg)" }; const RerollButton: FC<{ onReset: () => void }> = ({ onReset }) => <button onClick={onReset} style={rerollStyle}> 🔄 </button>; export default RerollButton;
seanmay/bombscrubber
src/site/info/getting-started.info.tsx
<filename>src/site/info/getting-started.info.tsx import React from "react"; import Title from "../../design-components/title"; import Text from "../../design-components/text"; const Page = () => { return ( <section> <header> <Title level={2}>Getting Started</Title> </header> <section> ...
seanmay/bombscrubber
src/site/tasks/02.bounds-checking.task.tsx
<gh_stars>0 import React, { useState } from "react"; import Title from "../../design-components/title"; import Text from "../../design-components/text"; import type { BoardWidth, BoardHeight } from "../../game/core.types"; import { createBoard, isInBounds } from "../../game/services/game-board.service"; import TestSu...
seanmay/bombscrubber
src/design-components/nav-item.tsx
<gh_stars>0 import "./nav-item.css"; import React, { FC } from "react"; type NavItemProps = { active: boolean; onSelect: () => void; } & React.HTMLAttributes<HTMLButtonElement>; const NavItem: FC<NavItemProps> = ({ children, active, onSelect, ...attrs }) => ( <button className={`ph2 pv1 fs2 lh1 NavItem`} {...attrs} ...
seanmay/bombscrubber
src/site/info/intro.info.tsx
<filename>src/site/info/intro.info.tsx import React from "react"; import Title from "../../design-components/title"; import Text from "../../design-components/text"; const Page = () => { return ( <section> <header> <Title level={2}>Introduction</Title> </header> <Text className={"pv2 l...
seanmay/bombscrubber
src/site/core.types.ts
export type PageMetaDescriptor = { title: string; url: URL["href"]; };
seanmay/bombscrubber
src/site/tasks/test-suite.tsx
<gh_stars>0 import React, { FC, Fragment } from "react"; import TestAssertion from "./test-assertion"; type Test = { expression: string; output: string; passed: boolean; }; type TestSuiteProps = { tests: Test[] }; const TestSuite: FC<TestSuiteProps> = ({ tests }) => <pre className="lh4"> {tests.map(tes...
seanmay/bombscrubber
src/design-components/title.tsx
<reponame>seanmay/bombscrubber import React, { FC } from "react"; type TitleLevel = 1 | 2 | 3 | 4 | 5 | 6; type HeaderLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; type TitleProps = { level: TitleLevel } & React.HTMLAttributes<HTMLHeadingElement>; const Title: FC<TitleProps> = ({ level, children, className = "", ....
seanmay/bombscrubber
src/site/tasks/01.populate-2d-grid.task.tsx
<reponame>seanmay/bombscrubber<gh_stars>0 import React, { useState } from "react"; import Title from "../../design-components/title"; import Text from "../../design-components/text"; import type { BoardWidth, BoardHeight } from "../../game/core.types"; import { createBoard } from "../../game/services/game-board.servi...
seanmay/bombscrubber
src/design-components/text.tsx
import React, { FC } from "react"; type TextComponentProps = {} & React.HTMLAttributes<HTMLParagraphElement>; const TextComponent: FC<TextComponentProps> = ({ children, ...attrs }) => <p {...attrs}>{children}</p>; export default TextComponent;
seanmay/bombscrubber
src/game/core.types.ts
export type BaseCell = { selected: boolean; flagged: boolean; }; export type BombCell = { type: "bomb"; } & BaseCell; export type SafeCell = { type: "safe"; adjacentBombs: number; } & BaseCell; export type GameCell = BombCell | SafeCell; export type BoardSize = 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ...
seanmay/bombscrubber
src/site/tasks/test-assertion.tsx
<reponame>seanmay/bombscrubber import React, { FC } from "react"; type TestAssertionProps = { expression: string; output: string; passed: boolean; }; const TestAssertion: FC<TestAssertionProps> = ({ expression, output, passed }) => <span style={{ display: "inline-block", color: "var(--theme-subdued)" }}> ...
seanmay/bombscrubber
src/site/tasks/task-list.ts
import type { PageMetaDescriptor } from "../core.types"; const taskList: PageMetaDescriptor[] = [ { title: "01. Populate a Grid", url: "/_dist_/site/tasks/01.populate-2d-grid.task.js" }, { title: "02. Bounds Checking", url: "/_dist_/site/tasks/02.bounds-checking.task.js" } ]; export default ta...
seanmay/bombscrubber
src/App.tsx
<reponame>seanmay/bombscrubber<gh_stars>0 import "./reset-styles.css"; import "./base-styles.css"; import React, { useState, lazy, Suspense } from 'react'; import Title from "./design-components/title"; import NavItem from "./design-components/nav-item"; import infoList from "./site/info/info-list"; import taskList f...
seanmay/bombscrubber
src/site/info/info-list.ts
import type { PageMetaDescriptor } from "../core.types"; const infoList: PageMetaDescriptor[] = [ { title: "Intro", url: "/_dist_/site/info/intro.info.js" }, { title: "Getting Started", url: "/_dist_/site/info/getting-started.info.js" } ]; export default infoList;
seanmay/bombscrubber
src/game/services/game-board.service.ts
<filename>src/game/services/game-board.service.ts<gh_stars>0 import type { BoardWidth, BoardHeight, GameBoard, GameCell } from "../core.types"; export const createBoard = <Width extends BoardWidth, Height extends BoardHeight>(width: Width, height: Height): GameBoard<Width, Height> => { return { width, height: 0, min...
addyvm22/vantageProject1
src/server/db/models/hall.model.ts
/**** * * @author: Adwait * myfirstproject * * */ import mongoose = require('mongoose'); let Schema = mongoose.Schema; export interface IHall{ name:string; location: string; city: string; country: string; no_of_seats: Number; //ratings: Number; imageUrl: string; } export class ...
addyvm22/vantageProject1
src/server/app/services/user.service.ts
"use strict"; import * as express from 'express'; import { IUser, User, UserDocument, Users } from '../../db/models/user.model'; import { UserResponseDTO } from '../DTO/UserResponseDTO'; const BASE_URI = '/user'; export class UserService { constructor() { // assignment of variables; } //gives...
addyvm22/vantageProject1
src/client/app/booking/index.ts
export * from './booking.module';
addyvm22/vantageProject1
src/client/app/DatePicker/datepicker-popup.ts
<reponame>addyvm22/vantageProject1 import {Component} from '@angular/core'; @Component({ selector: 'ngbd-datepicker-popup', templateUrl: './datepicker-popup.html' }) export class NgbdDatepickerPopup { model; }
addyvm22/vantageProject1
src/server/app/controllers/auth.controller.ts
<filename>src/server/app/controllers/auth.controller.ts 'use strict'; import * as express from 'express'; // Load `User` `interfaces`, `class`, and `model` import { IUser, User, UserDocument, Users } from '../../db/models/user.model'; import { AuthService } from '../services/auth.service'; import { ErrorDTO } from '../...
addyvm22/vantageProject1
src/server/db/models/booking.model.ts
<filename>src/server/db/models/booking.model.ts /**** * * @author: Adwait * * */ import mongoose = require('mongoose'); let Schema = mongoose.Schema; export interface IBooking{ hallId : number; userId: number; startDateTime: Date; endDateTime: Date; status : boolean; } //new change exp...
addyvm22/vantageProject1
src/client/app/shared/components/index.ts
<filename>src/client/app/shared/components/index.ts import { MainHeader } from './headers/main-header.component'; export * from './headers/main-header.component'; export const SHARED_APP_COMPONENTS = [ MainHeader ];
addyvm22/vantageProject1
src/client/app/searchEvent/searchEvent.pip.ts
import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ name: 'searchEvent' }) export class SearchEventPipe implements PipeTransform{ transform(value: any, filterString: string, column: string , no_seats:string, nos:string, startD: string, start_date, endD: str...
addyvm22/vantageProject1
src/server/app/controllers/hall.controller.ts
<reponame>addyvm22/vantageProject1 /**** * * @author: Adwait * * */ import * as express from 'express'; import {IHall, Hall, HallDocument, Halls} from '../../db/models/hall.model'; import Controller from '../config/controller.config'; import { HallService } from '../services/hall.service'; import { ErrorDTO } fro...
addyvm22/vantageProject1
src/server/app/services/hall.service.ts
"use strict" import * as express from 'express'; import {Hall, HallDocument, Halls} from '../../db/models/hall.model' const BASE_URI = 'hall'; export class HallService{ constructor(){ } public saveHall(newHall: any): any{ return new Promise( function(resolve, reject){ consol...
addyvm22/vantageProject1
src/client/app/event/form.model.ts
export class FormModel { /* constructor( public name: String, public location: String, public city: String, public country: String, public no_of_seats: String, public imageUrl: String ){}*/ }
addyvm22/vantageProject1
src/client/app/shared/components/headers/main-header.component.ts
import { Component, OnInit } from '@angular/core'; import { AppState } from '../../../app.service'; import { AuthService } from '../../services'; @Component({ selector: 'main-header', templateUrl: './main-header.component.html' }) export class MainHeader implements OnInit { public appLogo = '/assets/img/m...
addyvm22/vantageProject1
src/client/app/shared/services/in-memory-data.service.ts
import {InMemoryDbService} from 'angular-in-memory-web-api'; //import {HttpClientModule} from '@angular/common/http'; export class InMemoryDataService implements InMemoryDbService{ createDb() { const booking = [ {id: 11, username:'jaggu', Hall: "abc hall", ...
addyvm22/vantageProject1
src/client/app/searchEvent/index.ts
<filename>src/client/app/searchEvent/index.ts export * from './searchEvent.component';
addyvm22/vantageProject1
src/client/app/event/event.model.ts
export class Event { public name: string; public description: string; /* constructor( public name: String, public location: String, public city: String, public country: String, public no_of_seats: String, public imageUrl: String ){}*/ }
addyvm22/vantageProject1
src/client/app/searchEvent/searchEvent.component.ts
import { Component } from "@angular/core"; import { SearchEventService} from './searchEvent.service'; import { LocalStorageService } from '../shared/services/localStorage.service'; import { AppState } from '../app.service'; //import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BookingModel } fro...
addyvm22/vantageProject1
src/client/app/booking/record.pip.ts
<filename>src/client/app/booking/record.pip.ts import { Pipe, PipeTransform } from "@angular/core"; import { AppState } from '../app.service'; @Pipe({ name: "filterName" //,pure: false }) export class Record implements PipeTransform{ /*transfer(value: any) { return }*/ construct...
addyvm22/vantageProject1
src/server/app/services/booking.service.ts
<gh_stars>0 "use strict" import * as express from 'express'; import {Booking, BookingDocument, Bookings} from '../../db/models/booking.model' import {Halls} from '../../db/models/hall.model'; const BASE_URI = 'booking' export class BookingService{ constructor(){ } // public book1(hallId:any, userId:...
addyvm22/vantageProject1
src/server/app/controllers/validation.controller.ts
'use strict'; import * as express from 'express'; // Load `User` `interfaces`, `class`, and `model` import { IUser, User, UserDocument, Users } from '../../db/models/user.model'; import Controller from '../config/controller.config'; import { ErrorDTO } from '../DTO/ErrorDTO'; import { ValidationService } from '../serv...
addyvm22/vantageProject1
src/client/app/searchEvent/booking.model.ts
export class BookingModel{ constructor( public _id : string, public username: string, public Hall: string, public start_date_time: string, public end_date_time: string ){ } }