repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
areai51/nitro3
libs/components/src/product-tile/product-tile.spec.tsx
<gh_stars>0 import React from 'react'; import { render } from '@testing-library/react'; import ProductTile from './product-tile'; describe('ProductTile', () => { it('should render successfully', () => { const { baseElement } = render(<ProductTile />); expect(baseElement).toBeTruthy(); }); });
areai51/nitro3
libs/ui-kit/src/lib/ui-kit.tsx
<reponame>areai51/nitro3 import React from 'react'; import styled from '@emotion/styled'; /* eslint-disable-next-line */ export interface UiKitProps {} const StyledUiKit = styled.div` color: pink; `; export const UiKit = (props: UiKitProps) => { return ( <StyledUiKit> <h1>Welcome to ui-kit!</h1> <...
Code4Pizza/react-native-chime-sdk
example/src/App.tsx
<reponame>Code4Pizza/react-native-chime-sdk import * as React from 'react'; import { useEffect, useRef, useState } from 'react'; }, []); const join = () => { joinMeeting({ meetingUrl: 'http://6dffed99a61f.ngrok.io/', meetingId: 'klplpsssp', attendeeName: '<NAME>', }); }; const leave...
Code4Pizza/react-native-chime-sdk
src/index.tsx
import React from 'react'; import { NativeModules, requireNativeComponent, NativeEventEmitter, } from 'react-native'; const { ChimeSdk } = NativeModules; const eventEmitter = new NativeEventEmitter(ChimeSdk); const NativeChimeView = requireNativeComponent('RNChimeVideoView'); const NativeChimeShareView = requir...
ThinkBIG-Company/instantgram
src/model/extension.ts
import { ShortcodeMedia } from './post'; export interface ContentResponse { accountName: string; mediaURL: string[]; original: ShortcodeMedia; timestamp: number; }
ThinkBIG-Company/instantgram
src/helpers/getHighestResImg.ts
<gh_stars>1-10 export default async function getHighestResImg(el: Element) { if (el.getAttribute('srcset')) { let urlWidthArr = []; el.getAttribute('srcset').split(',').forEach((item) => { urlWidthArr.push(item.trim().split(' ')); }) // Add original src element if exists...
ThinkBIG-Company/instantgram
src/helpers/isSemVer.ts
const isSemVer = (function () { const re = /^(<|>|[=!<>]=)?\s*(\d+(?:\.\d+){0,2})([a-z][a-z0-9\-]*)?$/i; function get_val(str, include_cmp) { let matches = (str + '').match(re); return matches ? (include_cmp ? (matches[1] || '==') : '') + '"' + (matches[2] +...
ThinkBIG-Company/instantgram
src/helpers/getDataFromUrl.ts
export default async function getDataFromUrl(url: string) { let response = await fetch(url); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.text(); }
ThinkBIG-Company/instantgram
src/components/Alert.ts
import sleep from '../helpers/sleep'; export type AlertType = 'default' | 'warn' | 'error'; export abstract class Alert { private static wrapper: HTMLDivElement = Alert.addBaseToPage(); public static add(text: string, type: AlertType = 'default', timeout: number = 5000): void { let element = document.getEle...
ThinkBIG-Company/instantgram
src/helpers/bulkDownloader.ts
<reponame>ThinkBIG-Company/instantgram import { Alert } from '../components/Alert'; import { ContentResponse } from '../model/extension'; import { GraphqlQuery, ShortcodeMedia } from '../model/post'; import { downloadZip } from 'client-zip'; import saveData from './saveData'; // tslint:disable-next-line:ban-types expo...
ThinkBIG-Company/instantgram
src/model/post.ts
<filename>src/model/post.ts<gh_stars>1-10 // tslint:disable:no-any export interface Dimensions { height: number; width: number; } export interface DisplayResource { src: string; config_width: number; config_height: number; } export interface DashInfo { is_dash_eligible: boolean; video_dash...
ThinkBIG-Company/instantgram
src/helpers/getPath.ts
export default function getPath(url, defaults) { var reUrlPath = /(?:\w+:)?\/\/[^\/]+([^?#]+)/; var query = /(?:\w+:)?\/\/[^\/]+([^?#]+)([^\?]+)(\?.*)?/; var urlParts = url.match(reUrlPath) || [url, defaults]; return urlParts.pop() + url.match(query).pop(); }
ThinkBIG-Company/instantgram
src/modules/MediaScanner.ts
import { Program } from '../App'; import { Module } from './Module'; import { Modal } from '../components/Modal'; import getHighestResImg from '../helpers/getHighestResImg'; import getBlobVideoUrl from '../helpers/getBlobVideoUrl'; import getPath from '../helpers/getPath'; import getPreLoader from '../helpers/getPreLoa...
ThinkBIG-Company/instantgram
src/App.ts
export type Program = { VERSION: string; hostname: string; path: string; regexHostname: RegExp; regexRootPath: RegExp; regexProfilePath: RegExp; regexPostPath: RegExp; regexStoriesURI: RegExp; foundByModule: null | string; foundVideo: boolean; foundImage: boolean; foundProfile: boolean; }
ThinkBIG-Company/instantgram
src/helpers/isElementInViewport.ts
<filename>src/helpers/isElementInViewport.ts export default function isElementInViewport(el: Element): boolean { let viewport: any; if (window !== null && window !== undefined) { viewport = window; } else { viewport = document.documentElement; } const rect = el.getBoundingClientRect...
ThinkBIG-Company/instantgram
src/modules/Module.ts
<reponame>ThinkBIG-Company/instantgram import { Program } from '../App'; export abstract class Module { public abstract getName(): string; public abstract execute(program: Program, callback?: any): Promise<any>; }
ThinkBIG-Company/instantgram
src/modules/Update.ts
<filename>src/modules/Update.ts import localize from '../helpers/localize'; import isSemVer from '../helpers/isSemVer'; import { Modal } from '../components/Modal'; function informOutdatedVersion_In_DevConsole(data: any) { console.warn(localize('modules.update@consoleWarnOutdatedInfo')); console.warn(localize(...
ThinkBIG-Company/instantgram
src/modules/ProfilePageDownload.ts
import { Program } from '../App'; import { Module } from './Module'; import { Modal } from '../components/Modal'; import localize from '../helpers/localize'; import sleep from '../helpers/sleep'; import validURL from '../helpers/validURL'; import { downloadBulk, getMedia } from '../helpers/bulkDownloader'; export clas...
ThinkBIG-Company/instantgram
src/helpers/saveData.ts
const saveData = (function () { let existsElement = document.getElementById('instantgram-bulk-downloader-download'); if (existsElement) { existsElement.remove(); } let a = document.createElement('a'); a.id = 'instantgram-bulk-downloader-download'; document.body.appendChild(a); a.set...
ThinkBIG-Company/instantgram
src/helpers/getBlobVideoUrl.ts
import getDataFromUrl from './getDataFromUrl' async function getBlobVideoUrl(el: HTMLVideoElement, article: any, pos: number, callback: any) { if (Object.keys(el).length > 0) { const instanceKey = Object.keys(el).find(key => key.includes('Instance')); if (typeof instanceKey !== 'undefined') { ...
ThinkBIG-Company/instantgram
src/index.ts
<filename>src/index.ts import { Program } from './App'; import { MediaScanner } from './modules/MediaScanner'; import { ProfilePageDownload } from './modules/ProfilePageDownload'; import { Modal } from './components/Modal'; import Update from './modules/Update'; import localize from './helpers/localize'; console.clear...
ThinkBIG-Company/instantgram
src/helpers/getPreLoader.ts
export default function getPreLoader() { return '<img src="https://i.giphy.com/SolJ197tbbfTqcdbzq.gif" alt="Loading" />'; }
EnjoyWT/vite-plugin-vue-store-router
src/declaration.d.ts
<gh_stars>1-10 declare module 'vite-plugin-store-router' { const router: any const store: any }
MargaretKrutikova/podcast-episode-api
src/generated/graphql.ts
import { GraphQLResolveInfo } from "graphql" export type Maybe<T> = T | null export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string String: string Boolean: boolean Int: number Float: number ...
MargaretKrutikova/podcast-episode-api
src/listenNotesApi.ts
<filename>src/listenNotesApi.ts<gh_stars>1-10 import { SearchInput, SearchResults, Search_Type } from "./generated/graphql" import { ListennotesSearchResult, fromEpisodeSearchResult, ListennotesEpisodeSearchResult, ListennotesPodcastSearchResult, fromPodcastSearchResult, ListennotesPodcast, fromPodcast, ...
MargaretKrutikova/podcast-episode-api
src/itunesApi.ts
<gh_stars>1-10 import { ItunesEpisode } from "./generated/graphql" import axios from "axios" export type ItunesEpisodeQuery = { podcastId: string episodeName: string } type EpisodeData = { id: string attributes: { name: string websiteUrl: string } } type PodcastData = { data: EpisodeData[] } con...
MargaretKrutikova/podcast-episode-api
src/env.ts
<gh_stars>1-10 import dotenv from "dotenv" // Load environment variables from .env file, where API keys and passwords are configured dotenv.config({ path: ".env" })
MargaretKrutikova/podcast-episode-api
src/mapping.ts
import { Episode, Podcast } from "./generated/graphql" export type ListennotesPodcastSearchResult = { rss: string description_highlighted: string description_original: string title_highlighted: string title_original: string publisher_highlighted: string publisher_original: string image: string thumbn...
MargaretKrutikova/podcast-episode-api
src/server.ts
import express from "express" import { ApolloServer } from "apollo-server-express" import { typeDefs } from "./schema" import { Resolvers, QuerySearchArgs, QueryGetPodcastByIdArgs, Episode, Podcast, QueryGetEpisodesByIdsArgs } from "./generated/graphql" import { getItunesEpisode, ItunesEpisodeQuery } from "...
MargaretKrutikova/podcast-episode-api
src/schema.ts
import { gql } from "apollo-server-express" export const typeDefs = gql` type Episode { id: String! listennotesUrl: String! lengthSec: Int! rss: String! description: String! title: String! publisher: String! image: String! thumbnail: String! podcastItunesId: Int! pubDate: ...
Donskelle/stencilStarter
src/components/dynamic-component/dynamic-component.tsx
<reponame>Donskelle/stencilStarter import { Component, Prop, EventEmitter, Event } from "@stencil/core"; import { PossibleProps } from "./interfaceProp"; @Component({ tag: "dynamic-component", shadow: false }) export class DynamicComponent { @Prop() tag: string = "div"; @Prop() props: PossibleProps; @Event()...
Donskelle/stencilStarter
src/components/dynamic-component/interfaceProp.ts
export interface PossibleProps { arr?: Array<string>; [propName: string]: any; }
Donskelle/stencilStarter
src/components.d.ts
/* tslint:disable */ /** * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ import '@stencil/core'; import { PossibleProps, } from './components/dynamic-component/interfaceProp'; export namespace Components { ...
umairinam76/nestjs-task-managment
src/auth/auth.service.ts
<gh_stars>0 import { Injectable, UnauthorizedException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { AuthCredentialsDto } from './dto/auth-credentails.dto'; import { UserRepository } from './users.repository'; import { bcrypt } from 'bcrypt'; import { JwtService } from '@nestjs/j...
umairinam76/nestjs-task-managment
src/tasks/tasks.controller.ts
import { Body, // Body, Controller, Delete, Get, // Delete, // Get, Param, Post, Patch, // Post, Query, UseGuards, } from '@nestjs/common'; import { CreateTaskDto } from './dto/create-task.dto'; import { Task } from './tasks.entity'; import { TasksService } from './tasks.service'; // import { ...
umairinam76/nestjs-task-managment
src/tasks/tasks.service.ts
import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { TasksReporsitory } from './tasks.repository'; import { Task } from './tasks.entity'; import { CreateTaskDto } from './dto/create-task.dto'; // import { create } from 'domain'; import { TaskStatus...
umairinam76/nestjs-task-managment
src/auth/auth.controller.ts
<filename>src/auth/auth.controller.ts import { Body, Controller, Post } from '@nestjs/common'; import { AuthService } from './auth.service'; import { AuthCredentialsDto } from './dto/auth-credentails.dto'; // import { AuthGuard } from '@nestjs/passport'; // import { User } from './user.entity'; @Controller('auth') exp...
umairinam76/nestjs-task-managment
src/tasks/tasks.entity.ts
// import { JwtModule, JwtService } from '@nestjs/jwt'; import { JwtStrategy } from 'src/auth/jwt.strategy'; import { User } from 'src/auth/user.entity'; import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'; import { TaskStatus } from './task-status.enum'; @Entity() export class Task { constru...
piotrmski/plaid
src/plaid/components/grid/worklog-editor/worklog-editor.component.ts
<reponame>piotrmski/plaid import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, ViewChild, Output, OnInit, ViewContainerRef } from '@angular/core'; import {DateRange} from '../../../model/date-range'; import {Worklog} from '../../../model/worklog'; import {...
piotrmski/plaid
src/plaid/core/worklog/worklog.facade.ts
import {Injectable} from '@angular/core'; import {EMPTY, Observable, Subscription} from 'rxjs'; import {DateRange} from '../../model/date-range'; import {User} from '../../model/user'; import {Worklog} from '../../model/worklog'; import {WorklogState} from './worklog.state'; import {WorklogApi} from './worklog.api'; im...
theweaver19/wbtc-cafe
src/containers/SwapRevertModalContainer.tsx
import Backdrop from "@material-ui/core/Backdrop"; import Button from "@material-ui/core/Button"; import Fade from "@material-ui/core/Fade"; import Grid from "@material-ui/core/Grid"; import Modal from "@material-ui/core/Modal"; import Typography from "@material-ui/core/Typography"; import classNames from "classnames";...
theweaver19/wbtc-cafe
src/store/web3Store.ts
import RenSDK from "@renproject/ren"; import WalletConnectProvider from "@walletconnect/web3-provider"; import Web3 from "web3"; import { AbiItem } from "web3-utils"; import Web3Modal from "web3modal"; import { createContainer } from "unstated-next"; import { useCallback } from "react"; import { List } from "immutable"...
theweaver19/wbtc-cafe
src/containers/NetworkModalContainer.tsx
import Backdrop from "@material-ui/core/Backdrop"; import Fade from "@material-ui/core/Fade"; import Grid from "@material-ui/core/Grid"; import Modal from "@material-ui/core/Modal"; import Typography from "@material-ui/core/Typography"; import React from "react"; import { makeStyles } from "@material-ui/core"; import ...
theweaver19/wbtc-cafe
src/types/declarations.d.ts
<reponame>theweaver19/wbtc-cafe declare module "react-smooth-marquee"; declare module "wallet-address-validator";
theweaver19/wbtc-cafe
src/store/feeStore.ts
<gh_stars>0 import { AbiItem } from "web3-utils"; import { UnmarshalledFees } from "@renproject/interfaces"; import { useCallback, useEffect, useState } from "react"; import curveABI from "../utils/ABIs/curveABI.json"; import { CURVE_MAIN, CURVE_TEST } from "../utils/environmentVariables"; import { Store } from "./stor...
theweaver19/wbtc-cafe
src/components/Footer.tsx
import React from "react"; import Container from "@material-ui/core/Container"; import Grid from "@material-ui/core/Grid"; import Typography from "@material-ui/core/Typography"; import { makeStyles } from "@material-ui/core"; import RenVM from "../assets/renvm-powered.svg"; import { Store } from "../store/store"; impo...
theweaver19/wbtc-cafe
src/containers/NavContainer.tsx
import Button from "@material-ui/core/Button"; import Container from "@material-ui/core/Container"; import Grid from "@material-ui/core/Grid"; import Typography from "@material-ui/core/Typography"; import classNames from "classnames"; import React from "react"; import { makeStyles } from "@material-ui/core"; import Ca...
theweaver19/wbtc-cafe
src/components/ExternalLink.tsx
import React from "react"; import { AProps } from "../types/jsx"; type Props = AProps; export const ExternalLink: React.FC<Props> = ({ children, defaultValue, ...props }) => ( // tslint:disable-next-line: react-a11y-anchors <a defaultValue={defaultValue as string[]} {...props} target="_blank" ...
theweaver19/wbtc-cafe
src/theme/theme.ts
import grey from "@material-ui/core/colors/grey"; import { createMuiTheme } from "@material-ui/core/styles"; export const theme = createMuiTheme({ typography: { fontFamily: [ "-apple-system", "BlinkMacSystemFont", `"Segoe UI"`, "Roboto", `"Helvetica Neue"`, "Arial", "san...
theweaver19/wbtc-cafe
src/containers/DepositModalContainer.tsx
import { makeStyles } from "@material-ui/core"; import Backdrop from "@material-ui/core/Backdrop"; import Button from "@material-ui/core/Button"; import Checkbox from "@material-ui/core/Checkbox"; import Divider from "@material-ui/core/Divider"; import Fade from "@material-ui/core/Fade"; import FormControlLabel from "@...
theweaver19/wbtc-cafe
src/containers/TransactionsTableContainer.tsx
import { makeStyles } from "@material-ui/core"; import Grid from "@material-ui/core/Grid"; import Table from "@material-ui/core/Table"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableHead from "@material-ui/core/TableHead"; import TableRow from "@ma...
theweaver19/wbtc-cafe
src/utils/environmentVariables.ts
require("dotenv").config(); // export const ADAPTER_MAIN = '0xc995c7cb6a3faecc8a3e033575b3592f727455f8' // export const ADAPTER_TEST = '0x8fb1a3e0eb443a91f28728b8799f5f0eb8a51f96' export const ADAPTER_MAIN = "0x73aB2Bd10aD10F7174a1AD5AFAe3ce3D991C5047"; export const ADAPTER_TEST = "0xF85999731C696d1C86558b057101b69889b...
theweaver19/wbtc-cafe
src/components/ConversionStatus.tsx
<filename>src/components/ConversionStatus.tsx<gh_stars>0 import Typography from "@material-ui/core/Typography"; import React from "react"; import { Transaction } from "../types/transaction"; interface Props { tx: Transaction; } export const ConversionStatus: React.FC<Props> = ({ tx }) => { const targetBtcConfs =...
theweaver19/wbtc-cafe
src/hooks/useTransactionLifecycle.ts
<reponame>theweaver19/wbtc-cafe import RenJS from "@renproject/ren"; import { useCallback, useEffect, useState, useRef } from "react"; import * as Sentry from "@sentry/react"; import { EthArgs, UTXOIndex } from "@renproject/interfaces"; import { AbiItem } from "web3-utils"; import { useInterval } from "../hooks/useInte...
theweaver19/wbtc-cafe
src/containers/CancelModalContainer.tsx
import { makeStyles } from "@material-ui/core"; import Backdrop from "@material-ui/core/Backdrop"; import Button from "@material-ui/core/Button"; import Fade from "@material-ui/core/Fade"; import Grid from "@material-ui/core/Grid"; import Modal from "@material-ui/core/Modal"; import Typography from "@material-ui/core/T...
theweaver19/wbtc-cafe
src/utils/database/firebase/firebaseUtils.ts
<filename>src/utils/database/firebase/firebaseUtils.ts import firebase from "firebase/app"; require("firebase/auth"); require("firebase/firestore"); require("firebase/functions"); // Creates a user profile that is used for authenticating provision // to transaction records // FIXME: don't think this approach really p...
theweaver19/wbtc-cafe
src/utils/database/defaultDatabase.ts
<filename>src/utils/database/defaultDatabase.ts<gh_stars>0 import { FireBase } from "./firebase/firebase"; export const newDefaultDatabase = <Transaction extends { id: string }>() => new FireBase<Transaction>();
theweaver19/wbtc-cafe
src/store/store.ts
<reponame>theweaver19/wbtc-cafe import { useState } from "react"; import { UnmarshalledFees } from "@renproject/interfaces"; import RenJS from "@renproject/ren"; import Web3 from "web3"; import { createContainer } from "unstated-next"; import { List } from "immutable"; import { Transaction } from "../types/transaction...
theweaver19/wbtc-cafe
src/App.tsx
<reponame>theweaver19/wbtc-cafe import * as queryString from "query-string"; import React from "react"; import Container from "@material-ui/core/Container"; import Grid from "@material-ui/core/Grid"; import Marquee from "react-smooth-marquee"; import { makeStyles } from "@material-ui/core"; import { Footer } from "./...
theweaver19/wbtc-cafe
src/components/ActionLink.tsx
import { makeStyles } from "@material-ui/core"; import classNames from "classnames"; import React from "react"; import { AProps } from "../types/jsx"; const useStyles = makeStyles({ link: { fontSize: 12, textDecoration: "underline", cursor: "pointer", }, linkDisabled: { opacity: 0.6, cursor:...
theweaver19/wbtc-cafe
src/store/transactionStore.ts
import { createContainer } from "unstated-next"; import { List } from "immutable"; import { useCallback } from "react"; import { useTransactionLifecycle } from "../hooks/useTransactionLifecycle"; import { Transaction } from "../types/transaction"; import { Store } from "./store"; // should be moved to a global config...
theweaver19/wbtc-cafe
src/components/CurrencyInput.tsx
<gh_stars>0 import { makeStyles } from "@material-ui/core"; import Button from "@material-ui/core/Button"; import InputAdornment from "@material-ui/core/InputAdornment"; import Menu from "@material-ui/core/Menu"; import MenuItem from "@material-ui/core/MenuItem"; import TextField from "@material-ui/core/TextField"; imp...
theweaver19/wbtc-cafe
src/hooks/useTaskScheduler.ts
import { useCallback, useEffect, useState } from "react"; const SECONDS = 1000; const time = (): number => Math.floor(new Date().getTime() / SECONDS); type ReturnResult<T> = number | { timeout: number; result: T }; // tslint:disable-next-line: no-any export const useTaskSchedule = <T = undefined>( task: () => Retu...
theweaver19/wbtc-cafe
src/utils/database/database.ts
export interface Database<Transaction extends { id: string }> { addTx: ( tx: Transaction, localWeb3Address: string, fsSignature: string | null ) => Promise<void>; updateTx: (tx: Transaction) => Promise<void>; deleteTx: (tx: Transaction) => Promise<void>; getTxs: (signature: string) => Promise<T...
theweaver19/wbtc-cafe
src/components/ConversionActions.tsx
// eslint-disable jsx-a11y/anchor-is-valid import { makeStyles } from "@material-ui/core"; import React from "react"; import { Store } from "../store/store"; import { TransactionStore } from "../store/transactionStore"; import { Transaction } from "../types/transaction"; import { ExternalLink } from "./ExternalLink";...
theweaver19/wbtc-cafe
src/types/transaction.ts
<filename>src/types/transaction.ts<gh_stars>0 export interface Transaction { id: string; type: string; instant: boolean; awaiting: string; sourceAsset: string; sourceAmount: string | number; sourceNetwork: string; sourceNetworkVersion: string; destAddress: string; destNetwork: string; destNetworkV...
theweaver19/wbtc-cafe
src/utils/assets.ts
import BTC from "../assets/tokens/btc.png"; import WBTC from "../assets/tokens/wbtc.png"; export enum Asset { BTC = "btc", WBTC = "wbtc", renBTC = "renbtc", } export const NAME_MAP = { [Asset.BTC]: "Bitcoin", [Asset.WBTC]: "Wrapped Bitcoin", [Asset.renBTC]: "renBTC", }; export const MINI_ICON_MAP = { [...
theweaver19/wbtc-cafe
src/App.test.tsx
import { ThemeProvider } from "@material-ui/core"; import React from "react"; import ReactDOM from "react-dom"; import { App } from "./App"; import { FeeStore } from "./store/feeStore"; import { Store } from "./store/store"; import { TransactionStore } from "./store/transactionStore"; import { Web3Store } from "./store...
theweaver19/wbtc-cafe
src/utils/database/firebase/firebase.ts
import firebase from "firebase/app"; import { FB_KEY } from "../../environmentVariables"; import { Database } from "../database"; import { getFirebaseUser } from "./firebaseUtils"; if (!FB_KEY) { console.warn(`No database key set.`); } firebase.initializeApp({ apiKey: FB_KEY, authDomain: window.location.hostna...
theweaver19/wbtc-cafe
src/containers/ViewGatewayContainer.tsx
import Backdrop from "@material-ui/core/Backdrop"; import Button from "@material-ui/core/Button"; import Fade from "@material-ui/core/Fade"; import Grid from "@material-ui/core/Grid"; import Modal from "@material-ui/core/Modal"; import Typography from "@material-ui/core/Typography"; import classNames from "classnames";...
theweaver19/wbtc-cafe
src/index.tsx
import React from "react"; import ReactDOM from "react-dom"; import { ThemeProvider } from "@material-ui/core"; import * as Sentry from "@sentry/react"; import { App } from "./App"; import "./index.css"; import * as serviceWorker from "./serviceWorker"; import { Store } from "./store/store"; import { TransactionStore ...
theweaver19/wbtc-cafe
src/types/jsx.ts
/** * Helper types for extending JSX tags. */ export type AProps = React.DetailedHTMLProps< React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement >;
theweaver19/wbtc-cafe
src/containers/TransferContainer.tsx
import Button from "@material-ui/core/Button"; import Grid from "@material-ui/core/Grid"; import TextField from "@material-ui/core/TextField"; import ToggleButton from "@material-ui/lab/ToggleButton"; import ToggleButtonGroup from "@material-ui/lab/ToggleButtonGroup"; import React, { useRef } from "react"; import Numbe...
vigneshgithub007/todolistappFrontEnd
src/app/user/signin/signin.component.ts
import { Component, OnInit,ViewContainerRef } from '@angular/core'; import { FormControl, FormGroupDirective, NgForm, Validators } from '@angular/forms'; import { ErrorStateMatcher } from '@angular/material/core'; import { Router, ActivatedRoute } from '@angular/router'; import { Cookie } from 'ng2-cookies/ng2-cookies'...
vigneshgithub007/todolistappFrontEnd
src/app/individualtasks/individualtasks.component.ts
import { Component, OnInit, HostListener, OnDestroy } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { MatSnackBar } from '@angular/material'; import { AppService } from "./../app.service"; import { SocketService } from './../socket.service'; import { Cookie } from 'ng2-cookies/n...
arvitaly/aque
index.ts
<reponame>arvitaly/aque import { Job, Queue } from "kue"; import sleep from "sleep-es6"; (Symbol as any).asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator"); interface IJob<P, R> extends Job { result: R; data: P; } export class Aque<P extends { [index: string]: any }, R extends { [index...
PookMook/strating-blocks
src/pages/index.tsx
import { ReactElement } from "react" import { TemplateIcon } from "ui/icons" import { Users } from "components/users/user" export default function IndexPage(): ReactElement { return ( <> <h1>Hello World</h1> <TemplateIcon Spin Size="banner" Stroke="bold" /> <Users /> </> ) }
PookMook/strating-blocks
src/components/toggleBox.test.tsx
import "@testing-library/jest-dom" import { render, fireEvent } from "testing" import { ToggleBox } from "./toggleBox" test("you can open the Box", () => { const { getByRole, queryByText } = render(<ToggleBox id="7d8f0eeb-4ebe-4d44-a2b9-174d6c79537b" />) const button = getByRole("button", { name: /Click Me/i }) ...
PookMook/strating-blocks
src/graphql/types/user.ts
import { objectType, queryType } from "nexus" import { Context } from "graphql/context" const User = objectType({ name: "User", definition(t) { t.nonNull.field("id", { type: "ID", description: "ID of the user" }) t.nonNull.field("name", { type: "String", description: "Name of the user" }) }, }) const U...
PookMook/strating-blocks
src/components/users/user.tsx
<filename>src/components/users/user.tsx import { useLoadAllUsersQuery } from "generated/graphql" import { ReactElement, useEffect } from "react" import { Pre } from "ui/pre" export function Users(): ReactElement { const { data, status, refetch } = useLoadAllUsersQuery(undefined, { enabled: false }) useEffect(() =...
PookMook/strating-blocks
src/graphql/context.ts
<filename>src/graphql/context.ts import { PrismaClient } from "@prisma/client" // add prisma to the NodeJS global type // eslint-disable-next-line @typescript-eslint/no-namespace declare namespace NodeJS { class Global { prisma?: PrismaClient } } declare const global: NodeJS.Global & { prisma?: PrismaClient }...
PookMook/strating-blocks
src/ui/stitches.config.ts
<gh_stars>1-10 import { createStitches } from "@stitches/react" import { violet, violetDark, mauve, mauveDark, red, redDark, tomato, tomatoDark, purple, purpleDark, } from "@radix-ui/colors" function calculateScale(step: number, unit = "rem"): string { // Static config const baseScale = 1.618 /...
PookMook/strating-blocks
src/pages/_app.tsx
<gh_stars>1-10 import type { AppProps } from "next/app" import { ReactElement } from "react" import { QueryClient, QueryClientProvider } from "react-query" import { globalStyles } from "ui/stitches.config" const queryClient = new QueryClient() export default function App({ Component, pageProps: { ...pageProps } }: Ap...
PookMook/strating-blocks
src/generated/graphql.ts
<reponame>PookMook/strating-blocks<gh_stars>1-10 import { useQuery, UseQueryOptions } from 'react-query'; export type Maybe<T> = T | null; export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }; export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> ...
PookMook/strating-blocks
src/ui/pre.ts
import { styled, theme } from "./stitches.config" export const Pre = styled("pre", { variants: { Type: { primary: { fontSize: theme.fontSizes.plus1, color: theme.colors.highContrastColored, }, }, Size: { smallExtra: { fontSize: theme.fontSizes.minus2, }, ...
ZzRanger/hackportal
pages/index.tsx
import Head from 'next/head'; import { GetServerSideProps } from 'next'; import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; import { buttonDatas, stats } from '../lib/data'; import { RequestHelper } from '../lib/request-helper'; import firebase from 'firebase/app'; import 'firebase/me...
jae1911/newer.jae.fi
pages/api/webring.tsx
<reponame>jae1911/newer.jae.fi export default function handler(req,res) { res.status(200).json({ "members": [ { "name": "<NAME>", "url": "https://jae.fi", "owner": "<NAME>" }, { "name": "<NAME>", ...
jae1911/newer.jae.fi
pages/timezone.tsx
import type { NextPage } from 'next' import Head from 'next/head' import Image from 'next/image' import Link from 'next/link' import Clock from 'react-live-clock' import os from 'os'; // Custom components import Art from 'components/art' const Home: NextPage = () => { let network = os.hostname(); return ( <...
jae1911/newer.jae.fi
components/letters.tsx
import Image from 'next/image' export default function Alphabet(letter) { let te = "/svgfont/" + letter.letter + ".svg"; return( <Image width="30" height="30" src={te}/> ) }
jae1911/newer.jae.fi
pages/api/me.tsx
<reponame>jae1911/newer.jae.fi<filename>pages/api/me.tsx export default function handler(req,res) { res.status(200).json({ "name": "Jae", "currentJob": "Back-end Developer", "birthday": "2001-04-28", "location": "Helsinki, Finland", "mxid": "@me:jae.fi", "email": "<EM...
jae1911/newer.jae.fi
pages/api/ranges.tsx
export default function handler(req,res) { res.status(200).send("2001:67c:2724::/48,FI,,,\n2a0e:8f02:f01f::/48,DE,,,\n2a12:4946:9900::/40,BE,,,\n172.16.58.3/24,FI,,,") }
jae1911/newer.jae.fi
pages/index.tsx
import type { NextPage } from 'next' import Head from 'next/head' import Image from 'next/image' import Link from 'next/link' import Clock from 'react-live-clock' import os from 'os'; // Custom components import Art from 'components/art' import Alphabet from 'components/letters' const Home: NextPage = () => { let ...
jae1911/newer.jae.fi
pages/pics.tsx
<reponame>jae1911/newer.jae.fi import type { NextPage } from 'next' import Head from 'next/head' import Image from 'next/image' import Link from 'next/link' import Clock from 'react-live-clock' import os from 'os'; // Custom components import Art from 'components/art' const Home: NextPage = () => { let network = o...
taylorhutchison/statewarden
src/StateWarden.ts
import { Subject, Observable, Subscriber, Subscription } from 'rxjs'; export abstract class StateWarden<T> extends Observable<T> { private _value!: Readonly<T>; private _subscriber!: Subscriber<T>; private _subscription: Subscription; private _history: History<T>; constructor(initialState: T) { ...
taylorhutchison/statewarden
tests/history.spec.ts
import { ITestState } from './setup/ITestState'; import { TestObservableState } from './setup/TestObservableState'; import { initialState1 as initialState } from './setup/InitialState'; import { History } from '../src/StateWarden'; describe('Observable State History', () => { let observableState: TestObservableS...
taylorhutchison/statewarden
tests/basic.spec.ts
<reponame>taylorhutchison/statewarden import { ITestState } from './setup/ITestState'; import { TestObservableState } from './setup/TestObservableState'; import { initialState1 as initialState } from './setup/InitialState'; describe('Deriving a class from Observable State', () => { let observableState: TestObser...
taylorhutchison/statewarden
tests/pipe.spec.ts
describe('Pipe an observable before subscribing', () => { });
taylorhutchison/statewarden
tests/subscribe.spec.ts
import { ITestState } from './setup/ITestState'; import { TestObservableState } from './setup/TestObservableState'; import { initialState1 as initialState } from './setup/InitialState'; import { take, skip } from 'rxjs/operators'; describe('Subscribing to the observable State', () => { let observableState: TestO...
taylorhutchison/statewarden
tests/setup/TestObservableState.ts
import { ITestState } from "./ITestState"; import { StateWarden } from '../../src/StateWarden'; export class TestObservableState extends StateWarden<ITestState> { constructor(initialState: ITestState) { super(initialState); } update(func: (current: Readonly<ITestState>) => ITestState): void { ...
taylorhutchison/statewarden
tests/setup/InitialState.ts
import { ITestState } from "./ITestState"; export const initialState1: ITestState = { name: '<NAME>', num: 0 }