repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
angelxehg/angelxehg.github.io
src/pages/index.tsx
import React from "react" import SEO from "../components/SEO" import Layout from "../layouts/Layout" import { HugeHeader } from "../components/Header" import DefaultFooter from "../components/Footer" import DefaultNavbar from "../components/Navbar" import { AboutSection } from "./about" import { SkillsSection } from ...
angelxehg/angelxehg.github.io
src/meta/data/generic.ts
import { LinkMeta } from "../types" export const genericWebLink: LinkMeta = { name: "Web", icon: { svgPath: "bootstrap-icons/globe2.svg", }, href: "https://angelxehg.github.io/", } const generics: LinkMeta[] = [ { name: "Day", icon: { svgPath: "bootstrap-icons/sun.svg", }, href: "h...
angelxehg/angelxehg.github.io
src/meta/data/tools.ts
<filename>src/meta/data/tools.ts<gh_stars>0 import { LinkMeta } from "../types" const tools: LinkMeta[] = [ { name: "Cordova", icon: { svgPath: "seek-logo/cordova.svg", style: { backgroundColor: "white", borderRadius: "15%", padding: "0.05rem", }, }, href: "h...
angelxehg/angelxehg.github.io
src/meta/data/frameworks.ts
<filename>src/meta/data/frameworks.ts import { LinkMeta } from "../types" const frameworks: LinkMeta[] = [ { name: "Angular", icon: { style: { color: "#D6002F" }, svgPath: "seek-logo/angular.svg", }, href: "https://angular.io/", }, { name: "Bootstrap", icon: { svgPath: "...
angelxehg/angelxehg.github.io
src/pages/about.tsx
import React from "react" import { CreateLink } from "../components/Link" import Redirect from "../components/Redirect" const UTZACLink = () => ( <a href="http://www.utzac.edu.mx" rel="external" title="UTZAC"> Universidad Tecnológica del Estado de Zacatecas </a> ) export const AboutSection = () => ( <secti...
angelxehg/angelxehg.github.io
src/meta/data/syntax.ts
<filename>src/meta/data/syntax.ts import { LinkMeta } from "../types" const syntaxs: LinkMeta[] = [ { name: "Dart", icon: { svgPath: "seek-logo/dart.svg", }, href: "https://dart.dev/", }, { name: "GraphQL", icon: { svgPath: "seek-logo/graphql.svg", }, href: "https://gr...
angelxehg/angelxehg.github.io
src/components/Redirect.tsx
<gh_stars>0 import React, { useEffect } from "react" import { navigate } from "gatsby" import CenterLayout from "../layouts/Center" import SEO from "./SEO" interface RedirectProps { title: string url: string } const ConcernedSVG = require("../assets/concerned.svg") const Redirect = (props: RedirectProps): JSX.E...
angelxehg/angelxehg.github.io
src/meta/types.ts
<reponame>angelxehg/angelxehg.github.io import React from "react" export interface IconMeta { // color?: string fill?: boolean style?: React.CSSProperties svgPath: string } export interface LinkMeta { name: string displayName?: string icon: IconMeta href: string }
angelxehg/angelxehg.github.io
src/pages/projects.tsx
import React from "react" import { Link } from "gatsby" import { GatsbyImage } from "gatsby-plugin-image" import Layout from "../layouts/Layout" import DefaultFooter from "../components/Footer" import SEO from "../components/SEO" import { usePages, Page } from "../hooks/use-pages" import DefaultNavbar from "../compone...
angelxehg/angelxehg.github.io
src/components/Icon.tsx
<reponame>angelxehg/angelxehg.github.io<gh_stars>0 import React from "react" import { IconMeta } from "../meta/types" export interface IconProps { size?: string className?: string } const useIconStyle = ( props: IconProps & { meta: IconMeta } ): React.CSSProperties => { const { size } = props return { ....
angelxehg/angelxehg.github.io
src/components/Header.tsx
<filename>src/components/Header.tsx<gh_stars>0 import React from "react" import "./Header.scss" import { CreateIcon, CreateLink } from "./Link" const email = { from: "Email", title: "Enviame un Email", href: "mailto:<EMAIL>", } const resume = { from: "File", title: "Descarga mi CV", href: "/CV-AngelHurt...
angelxehg/angelxehg.github.io
src/pages/skills.tsx
import React from "react" import stacks from "../meta/stacks" import { CreateBadge } from "../components/Link" import Redirect from "../components/Redirect" const SkillCard = (props: { title: string; tools: string[] }) => ( <div className="card" style={{ height: "100%" }}> <div className="card-body"> <h3 ...
angelxehg/angelxehg.github.io
src/meta/links.ts
<reponame>angelxehg/angelxehg.github.io import frameworks from "./data/frameworks" import generics, { genericWebLink } from "./data/generic" import platforms from "./data/platforms" import syntaxs from "./data/syntax" import tools from "./data/tools" import websites from "./data/websites" const allLinks = [ ...gener...
tawashley/typescript-skill-share
src/3-all-the-types.ts
<filename>src/3-all-the-types.ts /** * 'hello types' * * literal & union types */ type fooString = 'foo'; type onlyFalse = false; const thereIsOnlyOneFoo: fooString = "foo"; const isItStillWarmOutside: onlyFalse = false; type fooObject = { name?: string | string[], string: fooString, hasToBeFalse: onl...
tawashley/typescript-skill-share
src/4-react.tsx
import React, { Component } from 'react'; interface ComponentProps { prop1: string, prop2: boolean, props3: 'one' | 'two' | 'three' } interface ComponentState { state1: string, state2: boolean } // // 'type up' component props and state // class ReactComponent extends Component<ComponentProps, Co...
tawashley/typescript-skill-share
src/2-with-types.ts
<reponame>tawashley/typescript-skill-share // arbitrary TS example is arbitrary function addTwoNumbers(number1: number, number2: number) { return number1 + number2; } var five = addTwoNumbers(1, 4); // 5, all good // var ten = addTwoNumbers("9", 1); // Compilation error, parameter signiture mismatch // var two = add...
amjha/tseo-assets
app.ts
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; const express = require('express'); const bodyParser = require('body-parser'); const ldap = require('ldapjs'); const jwt = require('jsonwebtoken'); const app = express(); import { resolve } from "path"; import { config } from "dotenv"; config({ path: resolve(__dirname, ...
amjha/tseo-assets
checkAuth.ts
const jwt = require('jsonwebtoken'); export const checkAuth = (req, res, next) => { try { const token = req.headers.authorization.split(' ')[1]; jwt.verify(token, process.env.JWT_SECRET); next(); } catch (err) { console.log('Authorization failed'); res.status(401).json({...
amjha/tseo-assets
server.ts
<filename>server.ts const app = require('./app'); const http = require('http'); const normalizePort = val => { const portInt = parseInt(val, 10); if (isNaN(portInt)) { return val; } if (portInt >= 0) { return portInt; } return false; }; const onError = error => { if (error.syscall !== 'listen')...
amjha/tseo-assets
db.ts
import {createConnection} from 'typeorm'; import {Photo} from './model'; let conn; export async function connectionHandle() { if (conn === undefined) { try { // @ts-ignore conn = await createConnection({ type: process.env.DB_TYPE, host: pr...
VitalPointAI/graph-near-blocks
src/mapping.ts
<filename>src/mapping.ts<gh_stars>0 import { near, BigInt } from "@graphprotocol/graph-ts"; import { BlockEvent } from "../generated/schema"; export function handleBlock(block: near.Block): void { const header = block.header; let event = new BlockEvent(header.hash.toHexString()); event.number = BigInt.fromI32(he...
abhishekgoenka/training
angular/lab2/my-project/src/app/data-entry/data-entry.component.ts
import { Component, OnInit } from '@angular/core'; import { Post } from '../post'; import { Observable } from 'rxjs'; import { DataService } from '../data.service'; @Component({ selector: 'app-data-entry', templateUrl: './data-entry.component.html', styleUrls: ['./data-entry.component.css'] }) export class DataE...
abhishekgoenka/training
angular/lab2/my-project/src/app/data-entry-reactive/data-entry-reactive.module.ts
<reponame>abhishekgoenka/training<filename>angular/lab2/my-project/src/app/data-entry-reactive/data-entry-reactive.module.ts import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { DataEntryReactiveRoutingModule } from './data-entry-reactive-routing.module'; import { DataEntr...
abhishekgoenka/training
angular/lab3/my-project/src/app/data-entry/data-entry.component.ts
<gh_stars>1-10 import { Component, OnInit } from '@angular/core'; import { Post } from '../post'; import { Observable } from 'rxjs'; import { DataService } from '../data.service'; import { ActivatedRoute } from '@angular/router'; declare var toastr; @Component({ selector: 'app-data-entry', templateUrl: './data-ent...
abhishekgoenka/training
kinetic/Lab/my-project/src/app/toastr.service.ts
import { Injectable } from '@angular/core'; import { EpToastService } from '@epicor/kinetic'; @Injectable({ providedIn: 'root' }) export class ToastrService { constructor(public epToast: EpToastService) {} success(msg: string) { this.toastr(msg, 'success'); } error(msg: string) { this.toastr(msg, '...
abhishekgoenka/training
protractor/starter/src/app/app-routing.module.ts
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; import { DataEntryComponent } from './data-entry/data-entry.component'; import { ReportComponent } from './report/report.component'; import { DataEntryReactiveComponent } from './dat...
abhishekgoenka/training
kinetic/Lab/my-project/e2e/src/entry.e2e-spec.ts
<reponame>abhishekgoenka/training import { EntryPage } from './entry.po'; import { browser } from 'protractor'; describe('my-project App', () => { let entry: EntryPage; beforeEach(() => { entry = new EntryPage(); }); it('should be on entry page', () => { entry.getCurrentUrl().then(url => { expec...
abhishekgoenka/training
protractor/starter/src/app/data.service.ts
import { Injectable } from '@angular/core'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Post } from './model/post'; import { Observable, throwError, of } from 'rxjs'; import { ApplicationError } from './model/application-error'; import { catchError } from 'rxjs/operators'; @Injectabl...
abhishekgoenka/training
kinetic/Lab/my-project/e2e/src/entry.po.ts
import { browser, by, element, promise } from 'protractor'; export class EntryPage { getCurrentUrl(): promise.Promise<string> { return browser.getCurrentUrl(); } setValue(ele: string, val: string) { return element(by.id(ele)).sendKeys(val); } submitButton() { return element(by.className('btn btn-...
abhishekgoenka/training
angular/lab3/my-project/src/app/report/report.component.ts
<reponame>abhishekgoenka/training import { Component, OnInit } from '@angular/core'; import { DataService } from '../data.service'; import { Post } from '../post'; import { Router } from '@angular/router'; declare var toastr; @Component({ selector: 'app-report', templateUrl: './report.component.html', styleUrls:...
abhishekgoenka/training
protractor/starter/src/app/data.service.spec.ts
<reponame>abhishekgoenka/training<gh_stars>1-10 import { TestBed, inject } from '@angular/core/testing'; import { DataService } from './data.service'; import { HttpClientTestingModule, HttpTestingController, TestRequest } from '@angular/common/http/testing'; import { Post } from './model/post'; import { ApplicationErro...
abhishekgoenka/training
kinetic/Lab/my-project/e2e/src/app.e2e-spec.ts
import { AppPage } from './app.po'; describe('my-project App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should have right title', () => { page.navigateTo(); expect(page.getPageTitle()).toEqual('MyProject'); }); });
abhishekgoenka/training
protractor/starter/src/app/data-entry/data-entry.component.edit.spec.ts
<reponame>abhishekgoenka/training<filename>protractor/starter/src/app/data-entry/data-entry.component.edit.spec.ts<gh_stars>1-10 import { TestBed, ComponentFixture } from '@angular/core/testing'; import { DataEntryComponent } from './data-entry.component'; import { DataService } from '../data.service'; import { Activat...
abhishekgoenka/training
angular/lab3/my-project/src/app/data.service.ts
import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { Post } from './post'; @Injectable({ providedIn: 'root' }) export class DataService { private URL = 'http://localhost:3000'; constructor(private http: HttpClient) { } post...
abhishekgoenka/training
kinetic/Lab/my-project/src/app/model/application-error.ts
<filename>kinetic/Lab/my-project/src/app/model/application-error.ts export class ApplicationError { errorNumber: number; errorMsg: string; }
abhishekgoenka/training
angular/lab2/my-project/src/app/report/report.component.ts
import { Component, OnInit } from '@angular/core'; import { DataService } from '../data.service'; import { Post } from '../post'; @Component({ selector: 'app-report', templateUrl: './report.component.html', styleUrls: ['./report.component.css'] }) export class ReportComponent implements OnInit { posts: Post[];...
abhishekgoenka/training
protractor/starter/src/app/data-entry-reactive/data-entry-reactive.component.ts
<reponame>abhishekgoenka/training<filename>protractor/starter/src/app/data-entry-reactive/data-entry-reactive.component.ts import { Component, OnInit } from '@angular/core'; import { Post } from '../model/post'; import { DataService } from 'src/app/data.service'; import { FormBuilder, FormControl, Validators, FormGroup...
abhishekgoenka/training
angular/lab3/my-project/src/app/data-entry/data-entry.component.spec.ts
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { DataEntryComponent } from './data-entry.component'; import { DataEntryModule } from './data-entry.module'; import { ActivatedRoute } from '@angular/router'; import { DataService } from '../data.service'; import { FormsModule } from '@angular/fo...
yasinskydew/postgres-nest
src/users/users.controllers.ts
import { Body, Controller, Get, Post, Delete, Param } from '@nestjs/common'; import { CreateUserDto } from './users.dto'; import { UsersService} from './users.service'; @Controller('users') export class UsersControllers { constructor(private usersService: UsersService) {} @Post() create(@Body() createUser: Crea...
JaviMiot/patternDesignJS_Python
Builder/typeScript/builder.ts
<filename>Builder/typeScript/builder.ts /* ? * Se crea el producto complejo */ class Car { public seats: number = 0; public power: number = 0; public doors: number = 0; public wheels: number = 0; public trunk: boolean = false; public polarizedGlasses: boolean = false; constructor() {} } interface ICar...
JaviMiot/patternDesignJS_Python
State/typeScript/state.ts
<reponame>JaviMiot/patternDesignJS_Python class Bank { private _instanceState!: IStateAccount; private _amount: number = 0; constructor(initialState: IStateAccount) { this.setState(initialState); } public get amount(): number { return this._amount; } public set amount(amount: number) { this....
JaviMiot/patternDesignJS_Python
Singleton/typeScript/singleton.ts
<reponame>JaviMiot/patternDesignJS_Python<filename>Singleton/typeScript/singleton.ts<gh_stars>0 class Car { static _instance: Car; color: string; capacity: number; private constructor(color: string, capacity: number) { this.color = color; this.capacity = capacity; } static getInstance(color: strin...
JaviMiot/patternDesignJS_Python
Factory/typeScript/factory.ts
<reponame>JaviMiot/patternDesignJS_Python /** * ! * Crear una fabrica de Mascotas * */ abstract class PetCreator { abstract createPet(): IPet; } class CreateDog extends PetCreator { ladrido: string; constructor(ladrido: string) { super(); this.ladrido = ladrido; } createPet(): IPet { retur...
JaviMiot/patternDesignJS_Python
Strategy/typeScript/strategy.ts
interface IOperation { calculate(number1: number, number2: number): number; } class Sum implements IOperation { calculate(number1: number, number2: number): number { console.log('add'); return number1 + number2; } } class Diff implements IOperation { calculate(number1: number, number2: number): number...
malectro/30songs-gatsby
src/components/page.tsx
import React from 'react'; import {graphql} from 'gatsby'; import Layout from 'src/components/layout.tsx'; import Navigation from 'src/components/navigation.tsx'; import * as css from './page.module.css'; export default function Page({ data, }: { data: { pagesJson: { content: { html: string; ...
malectro/30songs-gatsby
src/components/og-meta.tsx
<filename>src/components/og-meta.tsx import React from 'react'; export const ogMeta = (props: {[key: string]: string}) => ( Object.keys(props).map(key => ( <meta key={key} property={`og:${key}`} content={props[key]} /> )) ); export default ogMeta;
malectro/30songs-gatsby
src/pages/index.tsx
import * as React from 'react'; import Helmet from 'react-helmet'; import {graphql, useStaticQuery, Link} from 'gatsby'; import Layout from 'src/components/layout.tsx'; import socialIcons from 'src/images/social-icons.svg'; import logo from 'src/images/long-logo-1000.svg'; import * as css from './index.module.css'; ...
malectro/30songs-gatsby
src/components/navigation.tsx
<filename>src/components/navigation.tsx import * as React from 'react'; import classnames from 'classnames'; import {useStaticQuery, graphql, Link} from 'gatsby'; import {StaticImage} from 'gatsby-plugin-image'; import * as css from './navigation.module.css'; export default function Navigation({ songNumber, lates...
malectro/30songs-gatsby
src/components/layout.tsx
<gh_stars>0 import * as React from 'react'; import Helmet from 'react-helmet'; import {Link} from 'gatsby'; import {StaticImage} from 'gatsby-plugin-image'; import ogMeta from 'src/components/og-meta.tsx'; import * as css from './layout.module.css'; export default function Layout({ header, navigation, children...
malectro/30songs-gatsby
src/components/song.tsx
<gh_stars>0 import * as React from 'react'; import {graphql} from 'gatsby'; import Helmet from 'react-helmet'; import Layout from 'src/components/layout'; import Navigation from 'src/components/navigation'; import ogMeta from 'src/components/og-meta'; import * as css from './song.module.css'; export default function...
dottgonzo/node-file-gen-series
test/main.ts
<gh_stars>0 import * as nodeFileGen from '../index' import * as chai from 'chai' const filepath = '/tmp/Bonobo - Ketto-4tXFA6jTulk.mp4' const filepathZero = '/tmp/Bonobo - Ketto-4tXFA6jTulk_000099.mp4' const options = { numberLenght: 5 } const expect = chai.expect describe('Main File Gen Test', function () { des...
dottgonzo/node-file-gen-series
index.ts
import * as fileExists from 'file-exists' import * as fileInfo from 'filenameinfo' import * as fileGen from 'file-gen-series' export interface IFileGenOptions { numberLenght?: number } export interface IFileGenSettings extends IFileGenOptions { numberLenght: number } export function genFileSequence(path: string, ...
rzfury/rentot
index.tsx
import React from "react"; import ReactDOM from "react-dom"; import './src/styles/index.css'; const App = () => { return <p>RnToT</p> } ReactDOM.render(<App/>, document.querySelector("#root"));
Trembit/lite.vatra.com
src/app/stusan/login/login.component.ts
<gh_stars>0 import { Component, OnInit, AfterContentInit, ViewChild, ElementRef, OnDestroy } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ActivatedRoute, Router } from '@angula...
Trembit/lite.vatra.com
src/app/stusan/shared/services/popup/popup.service.ts
<filename>src/app/stusan/shared/services/popup/popup.service.ts<gh_stars>0 import { ConnectionPositionPair, FlexibleConnectedPositionStrategyOrigin, Overlay } from '@angular/cdk/overlay'; import { ComponentPortal } from '@angular/cdk/portal'; import { ElementRef, Injectable, Injector, TemplateRef, InjectionToken } from...
Trembit/lite.vatra.com
src/app/stusan/shared/services/state.service.ts
<reponame>Trembit/lite.vatra.com import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { LayoutType, ThemeType } from '@enums'; import { environment } from '../../../../environments/environment'; import { CustomizationService } from '../../services/customization.service'; @Injectab...
Trembit/lite.vatra.com
src/app/stusan/shared/components/toggle/toggle.component.ts
<gh_stars>0 import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef, Input } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; @Component({ selector: 'thevatra-toggle', templateUrl: './toggle.component.html', styleUrls: ['./toggle.component.scss'], c...
Trembit/lite.vatra.com
src/app/stusan/shared/services/index.ts
<gh_stars>0 export * from './janus.service'; export * from './state.service';
Trembit/lite.vatra.com
src/app/stusan/models/customization.model.ts
<reponame>Trembit/lite.vatra.com export interface CustomizationModel { homeLogo: string; // if null - hide logo roomLogo?: string; homeShowDescription: {}; // true by default, false for grouproom.sirius.video. mediaEchoCancellation: {}; // by default mediaAutoGainControl: {}; // by default mediaNoiseSuppres...
Trembit/lite.vatra.com
src/app/stusan/models/janus.dto.ts
<gh_stars>0 import Janus from '../../../assets/stusan/scripts/janus'; import { JanusJS } from '../../../assets/stusan/scripts/janus'; export interface JanusInterface extends Janus { reconnect: (options: JanusJS.ReconnectOptions) => void; }
Trembit/lite.vatra.com
src/app/stusan/enums/index.ts
export * from './layout-type'; export * from './theme-type'; export * from './video-type';
Trembit/lite.vatra.com
src/app/stusan/enums/layout-type.ts
export enum LayoutType { Leader = 'leader', Tile = 'tile', }
Trembit/lite.vatra.com
src/app/app.component.ts
import { Component, Inject, OnInit } from '@angular/core'; import { DOCUMENT } from '@angular/common'; import { Title } from '@angular/platform-browser'; import { StateService } from './stusan/shared/services/state.service'; import { ThemeType } from './stusan/enums'; import { CustomizationService } from './stusan/ser...
Trembit/lite.vatra.com
src/app/stusan/room/header/header.component.ts
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; import { interval, pipe } from 'rxjs'; import { map, startWith } from 'rxjs/operators'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { JanusService } from '@shared/services/janus.service'; imp...
Trembit/lite.vatra.com
src/app/stusan/room/controls/controls.component.ts
<reponame>Trembit/lite.vatra.com import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef, ViewChild, ElementRef, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import * as Sentry from '@sentry/browser'; import { BehaviorSubject, Subject } from 'rxjs'; // @ts-ignore import cal...
Trembit/lite.vatra.com
src/app/stusan/shared/pipes/first-word.pipe.ts
<filename>src/app/stusan/shared/pipes/first-word.pipe.ts import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'firstWord' }) export class GetFirstWord implements PipeTransform { transform(value: string): string { value = ('' + value).trim(); if (!value) { return ''; } if (value.i...
Trembit/lite.vatra.com
src/environments/environment.prod.ts
export const environment = { production: true, sentryDSN: 'https://some-sentry-url.com', sentryOrigin: 'localhost:4200', callstats: { appId: 111222333, appSecret: 'some-app-secret' }, envName: 'prod', janus: { debug: false, stringRoomIds: false, server: 'wss://janus-cloud-url.com:443' ...
Trembit/lite.vatra.com
src/app/app.module.ts
<reponame>Trembit/lite.vatra.com import { ErrorHandler, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { MatDialogModule } from '@angular/material/dialog'; import * as Sentry from '@sentry/angular'; import { OverlayModule } from '@angular/cdk/overlay'; import { AppRo...
Trembit/lite.vatra.com
src/environments/environment.ts
// This file can be replaced during build by using the `fileReplacements` array. // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. // The list of file replacements can be found in `angular.json`. export const environment = { production: false, sentryDSN: 'https://some-sentry-url.com', se...
Trembit/lite.vatra.com
src/app/stusan/shared/services/popup/popup.ref.ts
import { OverlayRef } from '@angular/cdk/overlay'; import { TemplateRef, Type } from '@angular/core'; import { Subject } from 'rxjs'; export interface PopupCloseEvent<T = any> { type: 'backdropClick' | 'close' | 'escKey'; data: T; } export type PopupContent = TemplateRef<any> | Type<any> | string; export class P...
Trembit/lite.vatra.com
src/app/stusan/models/join-room.dto.ts
<reponame>Trembit/lite.vatra.com import { JanusErrorDto } from './janus-error.dto'; interface Publishers { id: string; // <unique ID of active publisher #1> display?: string; // <display name of active publisher #1, if any> audio_codec: string; // <audio codec used by active publisher #1, if any> video_codec: ...
Trembit/lite.vatra.com
src/app/stusan/shared/shared.module.ts
<filename>src/app/stusan/shared/shared.module.ts import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ScrollingModule } from '@angular/cdk/scrolling'; import { ObserversModule } from '@angular/cdk/observers'...
Trembit/lite.vatra.com
src/app/stusan/room/room.component.ts
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import * as Sentry from '@sentry/browser'; // @ts-ignore import callstats from 'callstats-js/callstats.min'; import { JanusService } from '@shared/services/janus.serv...
Trembit/lite.vatra.com
src/app/stusan/room/videos/videos.component.ts
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core'; import { CdkScrollable } from '@angular/cdk/scrolling'; import { Subject } from 'rxjs'; import { filter, takeUntil } from 'rxjs/operators'; import ...
Trembit/lite.vatra.com
src/app/stusan/models/video.ts
import { JanusJS } from '../../../assets/stusan/scripts/janus'; import { VideoType } from '@enums'; export interface Video { audioKindAdded?: boolean; videoKindAdded?: boolean; stream: MediaStream; pluginHandle: JanusJS.PluginHandle; id: number; name: string | null; remote: boolean; type: VideoType; ...
Trembit/lite.vatra.com
src/app/stusan/enums/video-type.ts
export enum VideoType { Video = 'video', Screen = 'screen', }
Trembit/lite.vatra.com
src/app/stusan/models/index.ts
export * from './create-room.dto'; export * from './janus-error.dto'; export * from './join-room.dto'; export * from './room-exists.dto'; export * from './video'; export * from './janus.dto'; export * from './text-message.dto';
Trembit/lite.vatra.com
src/app/stusan/room/chat/chat.component.ts
import { Component, OnInit, ChangeDetectionStrategy, HostBinding } from '@angular/core'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { StateService } from '@shared/services/state.service'; @UntilDestroy() @Component({ selector: 'stusan-chat', templateUrl: './chat.component.html', ...
Trembit/lite.vatra.com
src/app/stusan/shared/components/settings/settings.component.ts
import { Component, OnInit, ChangeDetectionStrategy, Inject, ViewChild, ElementRef, AfterViewInit, ChangeDetectorRef, OnDestroy } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { Subject } from 'rxjs'; impor...
Trembit/lite.vatra.com
src/app/stusan/shared/components/video/video.component.ts
import { Component, ChangeDetectionStrategy, Input, AfterViewInit, ViewChild, ElementRef, OnDestroy, OnInit } from '@angular/core'; import { Subject } from 'rxjs'; import { filter, takeUntil } from 'rxjs/operators'; // @ts-ignore import { WebRTCStats } from '@peermetrics/webrtc-stats'; import { Video, MicState, Connec...
Trembit/lite.vatra.com
src/app/stusan/shared/components/dropdown/dropdown.component.ts
<reponame>Trembit/lite.vatra.com import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef, Input, ViewChild, ElementRef, TemplateRef, HostBinding } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { PopupRef } from '@shared/services/popup/popup.ref'; i...
Trembit/lite.vatra.com
src/app/stusan/models/room-exists.dto.ts
import { JanusErrorDto } from './janus-error.dto'; export interface RoomExistsDto { videoroom: 'success'; room: number; // <unique numeric ID> exists: boolean; } export type RoomExistsResponse = RoomExistsDto | JanusErrorDto;
Trembit/lite.vatra.com
src/app/stusan/shared/services/popup/popup.component.ts
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { PopupContent, PopupRef } from './popup.ref'; @Component({ templateUrl: './popup.component.html', }) export class PopupComponent implements OnInit { renderMethod: 'text' | 'template' | 'component' = 'component'; content: any; co...
Trembit/lite.vatra.com
src/app/stusan/shared/components/mic-warning-popup/mic-warning-popup.component.ts
import {Component, OnInit, ChangeDetectionStrategy, Output, EventEmitter} from '@angular/core'; @Component({ selector: 'thevatra-mic-warning-popup', templateUrl: './mic-warning-popup.component.html', styleUrls: ['./mic-warning-popup.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export c...
Trembit/lite.vatra.com
src/app/stusan/shared/services/sound.service.ts
import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class SoundService { private joinAudio: HTMLAudioElement; private leaveAudio: HTMLAudioElement; constructor() { } public playJoin() { if (!this.joinAudio) { this.joinAudio = new Audio('../../../../assets/media/j...
Trembit/lite.vatra.com
src/app/stusan/shared/services/janus.service.ts
import { Injectable } from '@angular/core'; import { Platform } from '@angular/cdk/platform'; // @ts-ignore import callstats from 'callstats-js/callstats.min'; import { BehaviorSubject, Subject, Observable, Observer } from 'rxjs'; import Janus, { JanusJS } from '../../../../assets/stusan/scripts/janus/janus'; import a...
Trembit/lite.vatra.com
src/app/stusan/models/create-room.dto.ts
<gh_stars>0 import { JanusErrorDto } from './janus-error.dto'; export interface CreateRoomDto { videoroom: 'created'; room: number; // <unique numeric ID> permanent: boolean; // <true if saved to config file, false if not> } export type CreateRoomResponse = CreateRoomDto | JanusErrorDto;
Trembit/lite.vatra.com
src/app/stusan/shared/services/settings.service.ts
import { Injectable } from '@angular/core'; import { Observable, from, Observer, BehaviorSubject, Subject, merge } from 'rxjs'; import { map } from 'rxjs/operators'; const isSetsEqual = (a: any, b: any) => a.size === b.size && [...a].every(value => b.has(value)); @Injectable({ providedIn: 'root', }) export class S...
Trembit/lite.vatra.com
src/app/stusan/models/janus-error.dto.ts
<reponame>Trembit/lite.vatra.com export interface JanusErrorDto { videoroom: 'event'; error_code: number; // <numeric ID, check Macros below> error: string; // <error description as a string> }
Trembit/lite.vatra.com
src/app/stusan/room/room.module.ts
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RoomRoutingModule } from './room-routing.module'; import { SharedModule } from '@shared/shared.module'; import { RoomComponent } from './room.component'; ...
Trembit/lite.vatra.com
src/app/stusan/shared/services/media.service.ts
import { Injectable } from '@angular/core'; import defaultsDeep from 'lodash.defaultsdeep'; import { BehaviorSubject } from 'rxjs'; import { StateService } from './state.service'; export type Resolution = { name: string; width: number; height: number; alt?: number; }; export const RESOLUTIONS: Resolution[] = ...
Trembit/lite.vatra.com
src/app/stusan/shared/components/control-button/control-button.component.ts
<gh_stars>0 import { Component, ChangeDetectionStrategy, Input } from '@angular/core'; @Component({ selector: 'stusan-control-button', templateUrl: './control-button.component.html', styleUrls: ['./control-button.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class ControlButtonCo...
Trembit/lite.vatra.com
src/app/stusan/models/text-message.dto.ts
export interface MicState { userId: number; enabled: boolean; } export interface MessageData { feed: number; enabled: boolean; type: string; } export interface MicStates { [key: string]: boolean; }
Trembit/lite.vatra.com
src/app/stusan/services/customization.service.ts
<gh_stars>0 import { Injectable } from '@angular/core'; import { environment } from 'src/environments/environment'; import { CustomizationModel } from '../models/customization.model'; @Injectable({ providedIn: 'root' }) export class CustomizationService { readonly siriusHost = 'grouproom.sirius.video'; // readonl...
msage-godaddy/cypress-web-vitals
commands.d.ts
<gh_stars>1-10 /// <reference types="cypress" /> declare namespace Cypress { interface WebVitalsThresholds { /** * Largest contentful paint. * @see https://web.dev/lcp/ */ lcp?: number; /** * First input delay. * @see https://web.dev/fid/ */ fid?: number; /** ...
rylphs/TsUML
src/demo/main.ts
import { Ninja } from "./ninja"; import { Katana } from "./katana"; const ninja = new Ninja(new Katana()); ninja.fight(5);
rylphs/TsUML
src/core/templates.ts
import { PropertyDetails, MethodDetails} from "./interfaces"; export const templates = { composition: "+->", implementsOrExtends: (abstraction: string, implementation: string) => { return ( `${templates.plainClassOrInterface(abstraction)}` + `^-${templates.plainClassOrInterface(implemen...
rylphs/TsUML
src/core/interfaces.ts
<filename>src/core/interfaces.ts<gh_stars>0 export interface MethodDetails { name: string; } export interface PropertyDetails { name: string; type: string; tracked: boolean; } export interface HeritageClause { clause: string; className: string; }
rylphs/TsUML
src/core/emitter.ts
import Ast, * as SimpleAST from "ts-simple-ast"; import * as ts from "typescript"; import { flatten, join } from "lodash"; import * as path from "path"; import { PropertyDetails, MethodDetails, HeritageClause } from "./interfaces"; import { templates }from "./templates"; import { download } from "./io"; export functio...
rylphs/TsUML
src/core/parser.ts
<gh_stars>0 import Ast, * as SimpleAST from "ts-simple-ast"; import * as ts from "typescript"; import { flatten, join } from "lodash"; import { PropertyDetails, MethodDetails, HeritageClause } from "./interfaces"; export function getAst(tsConfigPath: string, sourceFilesPaths?: string[]) { const ast = new Ast({ ...