repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
sudarshan-1708/UserManagementAPI | src/main.ts | <filename>src/main.ts
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const config ... |
kevinfrei/media-core | src/media.ts | <reponame>kevinfrei/media-core<filename>src/media.ts
import { Type, TypeCheckPair } from '@freik/core-utils';
import {
Attributes,
AudioFileRegexPattern,
FullMetadata,
SimpleMetadata,
} from './schema.js';
// My "schema" for music that I use in other places:
const patterns: AudioFileRegexPattern[] = [
// va... |
kevinfrei/media-core | src/index.ts | <reponame>kevinfrei/media-core
export * as Metadata from './media.js';
export * from './schema.js';
|
kevinfrei/media-core | src/schema.ts | export type SongKey = string;
export type AlbumKey = string;
export type ArtistKey = string;
export type MediaKey = SongKey | ArtistKey | AlbumKey;
export type PlaylistName = string;
export type Playlist = SongKey[];
export type Song = {
key: SongKey;
track: number;
title: string;
albumId: AlbumKey;
artistId... |
kevinfrei/media-core | src/__tests__/media.test.ts | import { Attributes, Metadata } from '../index';
import { isAlbumKey, isArtistKey, isSongKey } from '../schema';
const log = false ? console.log : (a: unknown) => {};
it('Generic path', () => {
const filename = 'something/artist - 1983 - album/01 - title.m4a';
const md = Metadata.FromPath(filename);
expect(md).t... |
Shashankanshu/mmo_movement | assets/Script/socket/GameManager.ts |
import { _decorator, Prefab, instantiate, Vec3, EventKeyboard, systemEvent, SystemEvent, KeyCode, log, macro, Label, Vec2 } from 'cc';
import { Player } from '../Player';
import { Config } from './Config';
import { SocketConnection } from './SocketConnection';
const { ccclass, property } = _decorator;
const CE... |
Shashankanshu/mmo_movement | assets/Script/Player.ts |
import { _decorator, Component, Node, Vec3, log, macro, Label, CCObject, Vec2 } from 'cc';
import { Config } from './socket/Config';
const { ccclass, property } = _decorator;
@ccclass('Player')
export class Player extends Component {
livePos: Vec3 = new Vec3(0, 0);
positonQueue: Vec3[] = [];
... |
Shashankanshu/mmo_movement | temp/declarations/jsb.d.ts | /// <reference path="C:\CocosDashboard_1.0.14\resources\.editors\Creator\3.3.1\resources\resources\3d\engine\@types\jsb.d.ts"/>
|
Shashankanshu/mmo_movement | assets/Script/socket/SocketConnection.ts | <reponame>Shashankanshu/mmo_movement<gh_stars>0
import { Component, Primitive, TERRAIN_HEIGHT_BASE, _decorator } from 'cc';
import Colyseus from 'db://colyseus-sdk/colyseus.js';
import { Player } from '../Player';
const { ccclass, property } = _decorator;
@ccclass('SocketConnection')
export class SocketConnection ex... |
Shashankanshu/mmo_movement | temp/declarations/cc.d.ts |
/// <reference path="C:\CocosDashboard_1.0.14\resources\.editors\Creator\3.3.1\resources\resources\3d\engine\bin\.declarations\cc.d.ts"/>
/**
* @deprecated Global variable `cc` was dropped since 3.0. Use ES6 module syntax to import Cocos Creator APIs.
*/
declare const cc: never;
|
Shashankanshu/mmo_movement | temp/declarations/cc.env.d.ts | declare module "cc/env" {
export const EXPORT_TO_GLOBAL: boolean;
export const BUILD: boolean;
export const TEST: boolean;
export const EDITOR: boolean;
export const PREVIEW: boolean;
export const DEV: boolean;
export const DEBUG: boolean;
export const JSB: boolean;
export co... |
Shashankanshu/mmo_movement | assets/Script/socket/MiloManager.ts |
export var MiloManager = function () {
const users = [{
"userId": "mx-user-1",
"gameId": "86a01a92a84646e4ad33252f19b39385",
"roomId": "7d1b376b-0eee-4d53-bd91-3cda5de62b43-1625715627668",
"highestScore": 90,
"lastLevel": 0,
"gameMode": "score",
"isFirstOpen... |
Shashankanshu/mmo_movement | assets/Script/TouchController.ts |
import { _decorator, Component, Node, Vec2, EventHandler, EventTouch, Vec3, director, macro } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('TouchController')
export class TouchController extends Component {
startLoc: Vec2;
@property({
type: [EventHandler],
tooltip: 'Touch Ev... |
RCOSDP/GakuNinLMS-LTI-MC | pages/topics/index.tsx | <reponame>RCOSDP/GakuNinLMS-LTI-MC
import type { TopicSchema } from "$server/models/topic";
import { useRouter } from "next/router";
import TopicsTemplate from "$templates/Topics";
import { useSessionAtom } from "$store/session";
import { pagesPath } from "$utils/$path";
import useTopics from "$utils/useTopics";
const... |
RCOSDP/GakuNinLMS-LTI-MC | types/globalFetch.d.ts | // NOTE: openapi/runtime.ts にて TypeScript 3.6.2 で削除された GlobalFetch が参照されているため宣言
declare type GlobalFetch = WindowOrWorkerGlobalScope;
|
RCOSDP/GakuNinLMS-LTI-MC | utils/useBookNewHandlers.ts | <reponame>RCOSDP/GakuNinLMS-LTI-MC<gh_stars>1-10
import { useCallback } from "react";
import { useRouter } from "next/router";
import type { BookSchema } from "$server/models/book";
import type { BookPropsWithSubmitOptions } from "$types/bookPropsWithSubmitOptions";
import { pagesPath } from "./$path";
import { createB... |
RCOSDP/GakuNinLMS-LTI-MC | samples/user.ts | const user = {
id: 1,
ltiConsumerId: "test",
ltiUserId: "1",
name: "山田太郎",
};
export default user;
|
RCOSDP/GakuNinLMS-LTI-MC | openapi/models/InlineObject6.ts | <filename>openapi/models/InlineObject6.ts
/* tslint:disable */
/* eslint-disable */
/**
* chibichilo-server
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.1.0
*
*
* NOTE: This class is auto generated by Open... |
RCOSDP/GakuNinLMS-LTI-MC | pages/book/new.tsx | <reponame>RCOSDP/GakuNinLMS-LTI-MC
import { useRouter } from "next/router";
import BookNew from "$templates/BookNew";
import useBookNewHandlers from "$utils/useBookNewHandlers";
export type Query = { context?: "books" };
function New({ context }: Query) {
const handlers = useBookNewHandlers(context);
return <Boo... |
RCOSDP/GakuNinLMS-LTI-MC | server/config/routes/index.ts | import { FastifyInstance } from "fastify";
import * as lti from "./lti";
import * as user from "./user";
import * as book from "./book";
import * as books from "./books";
import * as topics from "./topics";
import * as topic from "./topic";
import * as resources from "./resources";
import * as resource from "./resource... |
RCOSDP/GakuNinLMS-LTI-MC | server/services/ltiCallback.ts | <reponame>RCOSDP/GakuNinLMS-LTI-MC
import { FastifyRequest } from "fastify";
import { outdent } from "outdent";
import { validateOrReject } from "class-validator";
import { SessionSchema } from "$server/models/session";
import { LtiLaunchPresentationSchema } from "$server/models/ltiLaunchPresentation";
import findClien... |
RCOSDP/GakuNinLMS-LTI-MC | server/validators/ltiLaunchBody.ts | import { LtiLaunchPresentationSchema } from "$server/models/ltiLaunchPresentation";
import { SessionSchema } from "$server/models/session";
import { IsNotEmpty, IsOptional, IsString } from "class-validator";
import { validationMetadatasToSchemas } from "class-validator-jsonschema";
/**
* LTI v1.1 起動時リクエスト
* @depreca... |
RCOSDP/GakuNinLMS-LTI-MC | openapi/models/index.ts | export * from './ApiV2BookBookIdSections';
export * from './ApiV2BookBookIdTopics';
export * from './ApiV2TopicTopicIdActivityTimeRanges';
export * from './ApiV2TopicTopicIdResource';
export * from './InlineObject';
export * from './InlineObject1';
export * from './InlineObject2';
export * from './InlineObject3';
expor... |
RCOSDP/GakuNinLMS-LTI-MC | openapi/models/InlineObject8.ts | <filename>openapi/models/InlineObject8.ts
/* tslint:disable */
/* eslint-disable */
/**
* chibichilo-server
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.1.0
*
*
* NOTE: This class is auto generated by Open... |
RCOSDP/GakuNinLMS-LTI-MC | components/organisms/AppBar.tsx | import { useState, forwardRef, ComponentProps, Ref } from "react";
import MuiAppBar from "@mui/material/AppBar";
import Toolbar from "@mui/material/Toolbar";
import Button from "@mui/material/Button";
import MenuBookOutlinedIcon from "@mui/icons-material/MenuBookOutlined";
import LibraryBooksOutlinedIcon from "@mui/ico... |
RCOSDP/GakuNinLMS-LTI-MC | utils/search/topicSearch.test.ts | <gh_stars>1-10
import topicSearch from "./topicSearch";
test("トピック名による絞り込み", () => {
const topic = {
id: 1,
resourceId: 1,
name: "Topic 1",
description: "",
language: "en",
timeRequired: 10,
shared: true,
license: "",
creator: { id: 1, name: "", ltiConsumerId: "", ltiUserId: "" },... |
gyumarin/contacts-server2-master | src/info/info.service.ts | import { Injectable } from '@nestjs/common';
import { PrismaService } from 'src/contacts/prisma.service';
import { Info } from '.prisma/client'
import { Prisma } from '@prisma/client';
@Injectable()
export class InfoService {
constructor(private prisma : PrismaService) {}
async get(id:number):Promise<... |
gyumarin/contacts-server2-master | src/info/info.controller.ts | import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common';
import { InfoService } from './info.service';
import { InfoDto } from './info.dto';
import { Prisma } from '@prisma/client';
@Controller('info')
export class InfoController {
constructor(private readonly infoService: InfoService){}
... |
gyumarin/contacts-server2-master | dist/info/info.module.d.ts | <reponame>gyumarin/contacts-server2-master
export declare class InfoModule {
}
|
gyumarin/contacts-server2-master | dist/info/info.service.d.ts | <filename>dist/info/info.service.d.ts<gh_stars>0
import { PrismaService } from 'src/contacts/prisma.service';
import { Info } from '.prisma/client';
import { Prisma } from '@prisma/client';
export declare class InfoService {
private prisma;
constructor(prisma: PrismaService);
get(id: number): Promise<Info>;... |
gyumarin/contacts-server2-master | src/app.module.ts | <reponame>gyumarin/contacts-server2-master<gh_stars>0
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { ContactsModule } from './contacts/contacts.module';
import { PrismaService } from './contacts/prisma.service';
import { In... |
gyumarin/contacts-server2-master | dist/info/info.dto.d.ts | export declare class InfoDto {
id: number;
name: string;
phone: string;
age: number;
desc: string;
}
|
gyumarin/contacts-server2-master | dist/info/info.controller.d.ts | import { InfoService } from './info.service';
import { Prisma } from '@prisma/client';
export declare class InfoController {
private readonly infoService;
constructor(infoService: InfoService);
getAll(): Promise<import(".prisma/client").Info[]>;
get(id: any): Promise<import(".prisma/client").Info>;
... |
gyumarin/contacts-server2-master | dist/contacts/contacts.controller.d.ts | import { ContactsService } from './contacts.service';
import { Contact } from '.prisma/client';
import { Prisma } from '@prisma/client';
export declare class ContactsController {
private readonly contactsService;
constructor(contactsService: ContactsService);
getAll(): Promise<Contact[]>;
get(id: any): ... |
dmytrobaida/Tezos-Farkle | tezos/src/Constants.ts | <reponame>dmytrobaida/Tezos-Farkle
export const GameState = {
Created: 0 as TNat,
PlayerJoined: 1 as TNat,
Started: 2 as TNat,
Finished: 3 as TNat,
};
export const BytesToNatMap: TMap<TBytes, TNat> = [
['0x00', 0],
['0x01', 1],
['0x02', 2],
['0x03', 3],
['0x04', 4],
['0x05', 5],... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/components/game/styled.ts | <filename>frontend/src/ui/components/game/styled.ts
import styled from "styled-components";
export const GameContainer = styled.div`
position: relative;
width: 100%;
height: 100%;
`;
|
dmytrobaida/Tezos-Farkle | frontend/src/game/dice.ts | <gh_stars>1-10
import Phaser from "phaser";
const random = new Phaser.Math.RandomDataGenerator();
export class Dice {
sprite: Phaser.Physics.Arcade.Sprite;
constructor(scene: Phaser.Scene, x: number, y: number, onClick: () => void) {
this.sprite = scene.physics.add.sprite(x, y, "dice");
this.sprite.setIn... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/pages/landing/index.tsx | import { observer } from "mobx-react-lite";
import { useLocation, useNavigate } from "react-router-dom";
import { useCallback, useEffect, useState } from "react";
import { Window, WindowContent, Cutout, Toolbar, WindowHeader } from "react95";
import Markdown from "markdown-to-jsx";
import { BaseButton } from "ui/compo... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/pages/main/styled.ts | import styled from "styled-components";
export const PageContainer = styled.div`
background-color: #282c34;
min-height: 100vh;
`;
export const ContentContainer = styled.div`
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 100vw;
height: 88vh;
`;
|
dmytrobaida/Tezos-Farkle | tezos/templates/FA2.contract.ts | <filename>tezos/templates/FA2.contract.ts<gh_stars>1-10
/**
* Type Definitions
*/
type TokenMetadata = TRecord<
{
token_id: TNat;
token_info: TMap<TString, TBytes>;
},
Layout.right_comb
>;
// Declare the storage type definition
interface FA2Storage {
config: {
admin: TAddress... |
dmytrobaida/Tezos-Farkle | frontend/src/declarations.d.ts | declare module "react95";
declare module "react95/dist/themes/original";
declare module "react95/dist/fonts/ms_sans_serif.woff2";
declare module "react95/dist/fonts/ms_sans_serif_bold.woff2";
declare module "*.md";
|
dmytrobaida/Tezos-Farkle | frontend/src/ui/components/game/index.tsx | import React, { useEffect } from "react";
import { GameContainer } from "./styled";
const gameWindowId = "gameWindow";
export const GameScene: React.FC<{
onStart(gameWindowId: string): void;
}> = ({ onStart }) => {
useEffect(() => {
onStart(gameWindowId);
// eslint-disable-next-line react-hooks/exhaustive... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/components/index.ts | export * from "./buttons";
export * from "./auth";
export * from "./game";
|
dmytrobaida/Tezos-Farkle | frontend/src/ui/pages/game/index.tsx | import { observer } from "mobx-react-lite";
import { useEffect, useMemo } from "react";
import { Navigate, useLocation, useNavigate } from "react-router-dom";
import {
Window,
WindowContent,
WindowHeader,
List,
ListItem,
Button,
Toolbar,
Bar,
} from "react95";
import { useAppStores } from "store";
impo... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/pages/main/index.tsx | <reponame>dmytrobaida/Tezos-Farkle<filename>frontend/src/ui/pages/main/index.tsx
import { observer } from "mobx-react-lite";
import { useCallback, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import {
Table,
TableBody,
TableHead,
TableRow,
TableHeadCell,
TableDataCell,
Window,... |
dmytrobaida/Tezos-Farkle | frontend/src/store/index.ts | <gh_stars>1-10
import { useContext, createContext } from "react";
import { GameStore } from "./gameStore";
import { TezosStore } from "./tezosStore";
const tezosStore: TezosStore = new TezosStore();
const gameStore: GameStore = new GameStore(tezosStore.getApi);
class RootStore {
tezosStore = tezosStore;
gameStor... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/index.tsx | import { createGlobalStyle, ThemeProvider } from "styled-components";
import { Route, Routes } from "react-router-dom";
import { styleReset } from "react95";
import original from "react95/dist/themes/original";
import ms_sans_serif from "react95/dist/fonts/ms_sans_serif.woff2";
import ms_sans_serif_bold from "react95/d... |
dmytrobaida/Tezos-Farkle | frontend/src/utils/api.ts | <reponame>dmytrobaida/Tezos-Farkle<filename>frontend/src/utils/api.ts<gh_stars>1-10
import {
ContractAbstraction,
SendParams,
TezosToolkit,
Wallet,
} from "@taquito/taquito";
import {
FarkleGameFactoryState,
FarkleGameState,
TezToMutezMultiplier,
} from "./types";
const factoryContractAddress = process.... |
dmytrobaida/Tezos-Farkle | frontend/src/utils/types.ts | <reponame>dmytrobaida/Tezos-Farkle
import { MichelsonMap } from "@taquito/taquito";
import { BigNumber } from "bignumber.js";
export interface FarkleGameState {
id: BigNumber;
address: string;
creator: string;
state: BigNumber;
seed: BigNumber;
currentPlayer: string;
moveStage: BigNumber;
movePoints: B... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/routes/index.ts | <gh_stars>1-10
import React from "react";
import { RouteProps } from "react-router-dom";
import { MainPage, GamePage, LandingPage } from "ui/pages";
import { AuthProtector } from "ui/components";
export const AppRoutes: RouteProps[] = [
{
path: "/",
element: React.createElement(LandingPage),
},
{
pa... |
dmytrobaida/Tezos-Farkle | tezos/src/Types.ts | <filename>tezos/src/Types.ts
export interface TFarkleGameStorage {
id: TNat;
creator: TOption<TAddress>;
state: TNat;
seed: TNat;
moveStage: TNat;
movePoints: TNat;
winner: TOption<TAddress>;
currentPlayerDices: TList<TNat>;
currentPlayerLeavedDices: TList<TNat>;
bet: TMutez;
... |
dmytrobaida/Tezos-Farkle | tezos/src/FarkleGame.contract.ts | import * as Constants from './Constants';
import type * as Types from './Types';
// Calculate game points based on Farkle game rules
//@ts-ignore
export const calculatePoints: TLambda<Types.CalculatePointsParams, TNat> = (
params: Types.CalculatePointsParams,
): TNat => {
if (params.size == 3) {
return... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/components/auth/index.tsx | import { observer } from "mobx-react-lite";
import { Navigate, useLocation } from "react-router-dom";
import { useAppStores } from "store";
export const AuthProtector: React.FC<{
children: JSX.Element;
}> = observer(({ children }) => {
const { tezosStore } = useAppStores();
const location = useLocation();
if... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/pages/index.ts | <filename>frontend/src/ui/pages/index.ts<gh_stars>1-10
export { default as MainPage } from "./main";
export { default as GamePage } from "./game";
export { default as LandingPage } from "./landing";
|
dmytrobaida/Tezos-Farkle | frontend/src/utils/index.ts | export function parseBalance(balance: number) {
if (!balance) {
return 0;
}
const decimals = 6;
let afterDecimal;
const tezString = balance.toString();
const trailingZeros = /0+$/u;
const beforeDecimal =
tezString.length > decimals
? tezString.slice(0, tezString.length - decimals)
: "... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/pages/game/styled.ts | import styled from "styled-components";
export const PageContainer = styled.div`
position: relative;
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: #cdcdcd;
`;
export const GameF... |
dmytrobaida/Tezos-Farkle | frontend/src/game/index.ts | import Phaser from "phaser";
import { Dice } from "./dice";
const onScenePreload = (scene: Phaser.Scene) => {
scene.load.spritesheet("dice", "./images/dice2.png", {
frameWidth: 96,
frameHeight: 96,
});
};
const createDices = (
scene: Phaser.Scene,
diceCount: number,
onClick: (index: number) => void
... |
dmytrobaida/Tezos-Farkle | frontend/src/store/gameStore.ts | import { makeAutoObservable, runInAction } from "mobx";
import { FarkleGame } from "game";
import { GameApi } from "utils/api";
import { FarkleGameState, GameState } from "utils/types";
type GetApiFn = () => GameApi;
export class GameStore {
game: FarkleGame = new FarkleGame();
allGames: FarkleGameState[] = [];
... |
dmytrobaida/Tezos-Farkle | frontend/src/ui/components/buttons.ts | <filename>frontend/src/ui/components/buttons.ts
import styled from "styled-components";
//@ts-ignore
import { Button } from "react95";
export const BaseButton = styled(Button)``;
|
dmytrobaida/Tezos-Farkle | frontend/src/store/tezosStore.ts | <filename>frontend/src/store/tezosStore.ts
import { makeAutoObservable, runInAction } from "mobx";
import { TempleWallet } from "@temple-wallet/dapp";
import { GameApi } from "utils/api";
const tezosRpcName = process.env.REACT_APP_TEZOS_RPC_NAME;
const tezosRpcUrl = process.env.REACT_APP_TEZOS_RPC_URL;
export class T... |
aj-stein-nist/saxer | src/constants.ts | export namespace ParserStrictness {
export const STRICT = true;
export const LAX = false;
}
|
aj-stein-nist/saxer | src/index.ts | <reponame>aj-stein-nist/saxer<filename>src/index.ts
import * as fs from 'fs';
import { createStream, SAXStream } from 'sax';
import { ParserStrictness } from './constants';
const format = (node: any): string => {
try {
return node?.name.toLowerCase();
} catch(err) {
console.error(err);
... |
oTkPoBeHuE/tindergram-bot | src/Pages/UserProfilePage/ProfilePage.tsx | <filename>src/Pages/UserProfilePage/ProfilePage.tsx
import React, { useState } from 'react';
import { useGetProfile } from '../../Common/api/requests/getProfile';
import { UserProfile } from '../../Components/UserProfile/UserProfile';
import { Button, ButtonGroup } from 'urban-bot';
export function UserProfilePage() {... |
oTkPoBeHuE/tindergram-bot | src/Common/api/helpers.ts | <reponame>oTkPoBeHuE/tindergram-bot<gh_stars>0
import { useCallback, useEffect, useState } from 'react';
type ApiGetFunction<ARG_TYPE, RESPONSE_TYPE> = (params: ARG_TYPE) => Promise<RESPONSE_TYPE>;
// TODO: Move to separate function
export function useApiFunctionHelper<RESPONSE_TYPE>() {
const [data, setData] = u... |
oTkPoBeHuE/tindergram-bot | src/Common/api/requests/moked/profile.ts | import faker from 'faker';
import { Profile } from '../getProfile';
export function getMockedProfile(id: string): Profile {
return {
id,
birthday: faker.date.between('1980', '2002'),
avatar: faker.image.avatar(),
description: faker.lorem.paragraph(),
name: `${faker.name.firs... |
oTkPoBeHuE/tindergram-bot | src/Pages/Main/Main.tsx | <reponame>oTkPoBeHuE/tindergram-bot
import React from 'react';
import { Text } from 'urban-bot';
export function Main() {
return (
<Text isNewMessageEveryRender>
Добро пожаловать в <i>Tindergram</i> <br />
<b>/profile</b> - Профиль
</Text>
);
}
|
oTkPoBeHuE/tindergram-bot | src/render/slack.tsx | <filename>src/render/slack.tsx
import React from 'react';
import { UrbanBotSlack } from 'urban-bot-slack';
import { render, Root } from 'urban-bot';
import dotenv from 'dotenv';
import { App } from '../App';
dotenv.config();
if (process.env.SLACK_SIGNING_SECRET === undefined) {
throw new Error(
'Provide S... |
oTkPoBeHuE/tindergram-bot | src/Common/api/requests/moked/DB.ts | <reponame>oTkPoBeHuE/tindergram-bot
import { Profile } from '../getProfile';
import { getMockedProfile } from './profile';
export const profiles = new Map<string, Profile>();
export function initializeMockedDB() {
for (let i = 0; i < 100; i++) {
const profile = getMockedProfile(String(i));
profile... |
oTkPoBeHuE/tindergram-bot | src/Common/api/requests/getProfile.ts | <filename>src/Common/api/requests/getProfile.ts
import { getApiHooksCreator } from '../helpers';
import { profiles } from './moked/DB';
export type Profile = {
id: string;
name: string;
birthday: Date;
description: string;
avatar: string;
};
export async function getProfile(id: string): Promise<Pr... |
oTkPoBeHuE/tindergram-bot | src/__test__/index.test.ts | <filename>src/__test__/index.test.ts<gh_stars>1-10
describe('urban-bot', () => {
it('test', () => {
expect(true).toBe(true);
});
});
|
oTkPoBeHuE/tindergram-bot | src/index.ts | <filename>src/index.ts<gh_stars>0
// Uncomment platform which you want to develop
import './render/telegram';
// import './render/slack';
|
oTkPoBeHuE/tindergram-bot | src/render/telegram.tsx | import React from 'react';
import { UrbanBotTelegram } from 'urban-bot-telegram';
import { render, Root } from 'urban-bot';
import dotenv from 'dotenv';
import { App } from '../App';
dotenv.config();
if (process.env.TELEGRAM_TOKEN === undefined) {
throw new Error('Provide TELEGRAM_TOKEN to .env https://core.teleg... |
oTkPoBeHuE/tindergram-bot | src/Components/UserProfile/UserProfile.tsx | import React from 'react';
import { Image } from 'urban-bot';
import { Profile } from '../../Common/api/requests/getProfile';
import { lang } from '../../Common/lang';
import { ButtonGroupProps } from 'urban-bot/dist/components/ButtonGroup';
type Props = {
profile: Profile;
buttons?: React.FunctionComponentEle... |
oTkPoBeHuE/tindergram-bot | src/Common/lang.ts | <filename>src/Common/lang.ts
export const lang = {
AGE: (birthday: Date): number => {
const now = new Date();
return now.getUTCFullYear() - birthday.getUTCFullYear();
},
};
|
oTkPoBeHuE/tindergram-bot | src/App.tsx | <reponame>oTkPoBeHuE/tindergram-bot
import React from 'react';
import { Route, Router } from 'urban-bot';
import { Main } from './Pages/Main/Main';
import { initializeMockedDB } from './Common/api/requests/moked/DB';
import { UserProfilePage } from './Pages/UserProfilePage/ProfilePage';
initializeMockedDB();
export f... |
murajun1978/example-nextjs-with-typescript | components/Title/__tests__/Title.test.tsx | import React from 'react';
import { render } from '@testing-library/react';
import { Title } from '../Title';
describe('Title', () => {
test('Styled Title component', () => {
const { container } = render(<Title>Test</Title>);
expect(container).toMatchSnapshot();
expect(container.firstChild).toHaveStyleRu... |
murajun1978/example-nextjs-with-typescript | components/Title/title.stories.tsx | <gh_stars>0
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Title } from './Title';
import { BlueTitle } from './BlueTitle';
const stories = storiesOf('Button', module);
stories.add('Default', () => <Title>Title</Title>);
stories.add('Blue Title', () => <BlueTitle>Title</BlueTitle>);... |
murajun1978/example-nextjs-with-typescript | components/Title/BlueTitle.tsx | <gh_stars>0
import styled from 'styled-components';
import { Title } from './Title';
export const BlueTitle = styled(Title)`
color: blue;
`;
|
murajun1978/example-nextjs-with-typescript | components/Title/__tests__/BlueTitle.test.tsx | import React from 'react';
import { render } from '@testing-library/react';
import { BlueTitle } from '../BlueTitle';
describe('BlueTitle', () => {
test('Styled BlueTitle component', () => {
const { container } = render(<BlueTitle>Test</BlueTitle>);
expect(container).toMatchSnapshot();
expect(container.f... |
murajun1978/example-nextjs-with-typescript | components/Title/Title.tsx | <filename>components/Title/Title.tsx
import styled from 'styled-components';
export const Title = styled.h1`
font-size: 50px;
`;
|
murajun1978/example-nextjs-with-typescript | pages/index.tsx | <reponame>murajun1978/example-nextjs-with-typescript
import React from 'react';
import { Title, BlueTitle } from '../components/Title';
const Home = () => (
<>
<Title>{process.env.WELCOME_MESSAGE}</Title>
<BlueTitle>{process.env.WELCOME_MESSAGE}</BlueTitle>
</>
);
export default Home;
|
murajun1978/example-nextjs-with-typescript | components/Title/index.ts | <filename>components/Title/index.ts<gh_stars>0
export * from './Title';
export * from './BlueTitle';
|
Shubhaankar-sharma/Collab-app | firebase_functions_node/functions/src/index.ts | import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
admin.initializeApp();
//const db = admin.firestore();
const fcm = admin.messaging();
export const sendToTopic = functions.firestore
.document('chatRoom/{roomId}/chats/{chatId}')
.onCreate(async snapshot => {
const chat =... |
LiajuX/GoStack-GoBarber | backend/src/services/UpdateUserAvatarService.ts | <filename>backend/src/services/UpdateUserAvatarService.ts<gh_stars>0
import { getRepository } from 'typeorm';
import path from 'path';
import fs from 'fs';
import AppError from '../errors/AppError';
import uploadConfig from '../config/upload';
import User from '../models/User';
interface Request {
user_id: string... |
TypeStrong/typedoc-auto-docs | src/check-versions.ts | #!/usr/bin/env env2rc
// env2rc is driven by the .env2rc file
/*
* This script does not do anything useful right now.
*
* However, I wanted to start writing down ideas for querying the npm API.
*
* Feel free to adapt or modify this script in any way.
*/
import fsExtra from 'fs-extra';
const { mkdirpSync, mkdtem... |
TypeStrong/typedoc-auto-docs | src/ts-entrypoint-resolver.ts | import ts from 'typescript';
import { join } from 'path';
// Ask the typescript compiler which file `import "module"` refers to
// Useful to ask the compiler, because we need the *types*, not the runtime .js.
// If we called `require.resolve` we would not get the types.
export function getPathToModuleEntrypoint(module... |
TypeStrong/typedoc-auto-docs | src/jsx-to-html-example.tsx | <reponame>TypeStrong/typedoc-auto-docs
// I always forget how to do this, so this stub is for my own reference.
// In work.ts I generate some index.html files, and it would be nice to
// do that with JSX.
import React from 'react';
import ReactDOMServer from 'react-dom/server';
ReactDOMServer.renderToStaticMarkup(<htm... |
TypeStrong/typedoc-auto-docs | src/targets.ts | export const libsToBuild = [
// comes from DefinitelyTyped
// TODO should not have @types here
// Scripts automatically figure out if we need to install from @types or not
'@types/lodash',
// DefinitelyTyped and has complex globals and ambient declarations
'@types/node',
'outdent',
'ts-node',
'type... |
TypeStrong/typedoc-auto-docs | src/db.ts | import fsExtra from 'fs-extra';
const { mkdtempSync, readFileSync, writeFileSync } = fsExtra;
import { join } from 'path';
import { $ } from 'zx';
import initSqlJs from 'sql.js';
/*
* Does it make any kind of sense to store state in a proper sqlite database?
* I don't know, but I threw this module together to find o... |
TypeStrong/typedoc-auto-docs | src/work.ts | <reponame>TypeStrong/typedoc-auto-docs
#!/usr/bin/env env2rc
// env2rc is driven by the .env2rc file
/*
* So far this script will:
* Install each library in targets.jsonc
* Naively attempt to render docs from the npm package. Very simple implementation.
* - all docs output into a temp directory
*
* It will *not... |
aerogear/graphql-mqtt-subscriptions | src/test/integration-tests.ts | import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import { connect } from 'mqtt';
import { MQTTPubSub } from '../mqtt-pubsub';
import { fail } from 'assert';
chai.use(chaiAsPromised);
const expect = chai.expect;
const assert = chai.assert;
const mqttClient = connect('mqtt://localhost... |
TVS-Motor-Company/streamlit-text-rating | template/streamlit_text_rating/frontend/src/index.tsx | <reponame>TVS-Motor-Company/streamlit-text-rating
import React from "react"
import ReactDOM from "react-dom"
import CustomTextRating from "./CustomTextRating"
ReactDOM.render(
<React.StrictMode>
<CustomTextRating/>
</React.StrictMode>,
document.getElementById("root")
)
|
TVS-Motor-Company/streamlit-text-rating | template/streamlit_text_rating/frontend/src/CustomTextRating.tsx | import { BaseProvider, LightTheme } from "baseui"
import React from "react"
import IconButton from "@material-ui/core/IconButton"
import ThumbUpIcon from '@mui/icons-material/ThumbUp';
import ThumbDownIcon from '@mui/icons-material/ThumbDown';
import {
withStreamlitConnection,
StreamlitComponentBase,
Streamlit,
... |
cheongan/Octa-JunggoNara-ScamBlock | src/scripts/contentScript.ts | <filename>src/scripts/contentScript.ts
import browser from 'webextension-polyfill';
const iframe = document.getElementById('cafe_main');
const title = document.title;
let count = 0;
iframe.onload = function() {
let body = iframeRef(iframe)
const BoardTitle = body.querySelector("#sub-tit > div.title_area > di... |
cheongan/Octa-JunggoNara-ScamBlock | src/scripts/background.ts | import browser from 'webextension-polyfill'; |
cheongan/Octa-JunggoNara-ScamBlock | src/scripts/popup.ts | <reponame>cheongan/Octa-JunggoNara-ScamBlock
import browser from 'webextension-polyfill';
document.addEventListener('DOMContentLoaded', async () => {
browser.storage.sync.get("blockUsers").then((user) => {
const array = user.blockUsers;
array.sort();
if(user.blockUsers && array.length > 0){
documen... |
typekev/react-mk | src/types.ts | <gh_stars>10-100
export type Action = string | number;
export type Range = [number, number];
|
typekev/react-mk | src/Keyboard.tsx | import React, { useEffect, useState } from 'react';
import { Action, Range } from './types';
import getTimer from './getTimer';
import useKeyboard from './useKeyboard';
import { defaultKeyPressDelay, defaultSentenceDelay } from './constants';
const initialState: string[] = [];
export const type = (...actions: Action[... |
typekev/react-mk | tests/getTimers.test.ts | import getTimers, {
getPreviousDelay,
accumulateDelays,
getDelays,
startTimers,
} from '../src/getTimers';
describe('getTimers function', () => {
it('should not throw an error when passed an empty array', () => {
expect(() => getTimers([], () => { })).not.toThrow();
});
it('should return 10', () => ... |
typekev/react-mk | src/index.ts | import Keyboard from './Keyboard';
import Cursor from './Cursor';
export { Cursor };
export default Keyboard;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.