repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
emmycook/emmycook.dev
src/contents/example.tsx
import { h } from '../h'; import { Template } from '../template'; import { Unbound } from '../unbound'; import { VNode, Collector, createFragment } from '@virtualstate/x'; export async function InitialExample() { return ( <> <h3>This is an example of various capabilities of this pattern</h3> <pre> ...
emmycook/emmycook.dev
src/contents/goals.tsx
import { h } from '../h'; import { Template } from '../template'; export const Goals = ( <Template id="goals-template"> <section id="goals"> <h4>Goals of this project</h4> <p> Currently available frontend tooling allows for JSX to be utilised to represent both web and native user inte...
emmycook/emmycook.dev
src/contents/tokens.tsx
<gh_stars>1-10 import { h } from "../h"; import { createToken } from '@virtualstate/x'; import { Template } from '../template'; const Select = createToken( Symbol("Select"), { defaultValue: "", class: "select" }, <option disabled>No options available</option> ); interface PersonUpdateOptions { first...
emmycook/emmycook.dev
src/contents/defer.ts
<reponame>emmycook/emmycook.dev export interface Deferred<T = void> { resolve(value: T): void; reject(reason: unknown): void; promise: Promise<T>; } export function deferred<T = void>(): Deferred<T> { let resolve: Deferred<T>["resolve"] | undefined = undefined, reject: Deferred<T>["reject"] | undefined = u...
mochiya98/DefinitelyTyped_webpack-log
index.d.ts
// Type definitions for webpack-log 1.3 // Project: https://github.com/shellscape/webpack-log // Definitions by: <NAME> <https://github.com/mochiya98> // Definitions: - export = webpackLog; declare function webpackLog( options?: Partial<webpackLog.WebpackLogOptions> ): webpackLog.WebpackLogger; declare namespace w...
JacobLinCool/kimlimjustin.com
pages/index.tsx
import type { NextPage } from 'next'; import Head from 'next/head'; import { useEffect, useState } from 'react'; import { StarsIcon, ForksIcon, FollowerIcon, Theme, TerminalIcon } from '../Util/icon'; import LoadingAnimation from './components/loading'; import Topnav from './components/topnav'; import SocialLinks from ...
JacobLinCool/kimlimjustin.com
pages/components/loading.tsx
const LoadingAnimation = () => { return ( <div className="loading-animation"> <div className="loading-animation-icon"> <svg viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <pattern id="img" patternUnits="u...
JacobLinCool/kimlimjustin.com
pages/components/topnav.tsx
<filename>pages/components/topnav.tsx import Image from 'next/image'; import { useEffect, useState } from 'react'; const Topnav = () => { const [screenWidth, setScreenWidth] = useState<number>(0); const [topnavExpanded, setTopnavExpanded] = useState<boolean>(false); useEffect(() => { setScreenWidth...
JacobLinCool/kimlimjustin.com
Util/terminal.tsx
<reponame>JacobLinCool/kimlimjustin.com<filename>Util/terminal.tsx import { useEffect, useState } from 'react'; import { ABOUT_ME, AVAILABLE_TERMINAL_THEMES, EMAIL, FOREM_LINK, GITHUB_LINK, INSTAGRAM_LINK, REDDIT_LINK, TWITTER_LINK } from './constant'; interface IArticle { connacial_url: string; collection_id:...
JacobLinCool/kimlimjustin.com
pages/components/social.tsx
import { FOREM_LINK, GITHUB_LINK, INSTAGRAM_LINK, REDDIT_LINK, TWITTER_LINK } from '../../Util/constant'; import { GitHubIcon, InstagramIcon, ForemIcon, RedditIcon, TwitterIcon } from '../../Util/icon'; const SocialLinks = () => { return ( <div className="social-link"> <a href={GITHUB_LINK} clas...
JacobLinCool/kimlimjustin.com
Util/icon.tsx
import React from 'react'; export const GitHubIcon = () => ( <svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" > <path d="M9...
JacobLinCool/kimlimjustin.com
pages/components/about.tsx
<reponame>JacobLinCool/kimlimjustin.com import Image from 'next/image'; import { ABOUT_ME, METRICS_SRC } from '../../Util/constant'; const AboutMe = () => { return ( <> <h2 className="about-heading" id="about"> About me </h2> <div className="about"> ...
JacobLinCool/kimlimjustin.com
pages/components/contact.tsx
const GetInTouch = () => { return ( <div className="contacts" id="contacts"> <h1 className="contacts-title">Get In Touch</h1> <div className="contacts-content"> <p className="contacts-content-text"> Any questions or just want to say hi? My inbox is...
JacobLinCool/kimlimjustin.com
pages/components/terminal.tsx
import React, { useEffect, useState } from 'react'; import ProcessTerminalInput from '../../Util/terminal'; interface TerminalCmd { cmd: any; output: any; } const Terminal = ({ displayed, setDisplayed }: { displayed: boolean; setDisplayed: any }) => { const [maximized, setMaximized] = useState(false); ...
JacobLinCool/kimlimjustin.com
pages/components/intro.tsx
<reponame>JacobLinCool/kimlimjustin.com import Image from 'next/image'; import { Typewriter } from '../../Util/typewriter'; import { MY_TITLE } from '../../Util/constant'; const Intro = () => { return ( <div className="intro" id="home"> <div className="intro-about"> <span classN...
JacobLinCool/kimlimjustin.com
pages/components/projects.tsx
/* eslint-disable @next/next/no-img-element */ import { GitHubIcon, WebsiteIcon } from '../../Util/icon'; const Projects = () => { return ( <> <div className="projects aos-init" id="projects" data-aos="zoom-in"> <h1 className="projects-title">Notable Projects</h1> ...
JacobLinCool/kimlimjustin.com
Util/constant.tsx
<reponame>JacobLinCool/kimlimjustin.com<filename>Util/constant.tsx export const MY_TITLE = [ 'high school student.', 'tech enthusiast.', 'hobbyist programmer.', 'full stack developer.', 'open source enthusiast.', 'science fiction fan.', 'martial artist.', 'multilingual.', ]; export cons...
gallayl/aurelia-cv-template
src/models/job.ts
import { IHasLocation } from './../interfaces/ihaslocation'; import { Tag } from './../models/tag'; import { Project } from './project'; import { LocalizedString } from './types'; import { Employer } from './employer'; export class Job implements IHasLocation { Employer: Employer; FromDate: Date; UntilDate...
gallayl/aurelia-cv-template
src/services/localizationservice.ts
<filename>src/services/localizationservice.ts import { LocalizedKeyValuePair, LocalizedString } from '../models/types'; import { LocalizationLanguage as Language } from '../models/enums'; import { LocalizedResource } from '../models/localizedresource'; export class LocalizationService { private static LocalStorag...
gallayl/aurelia-cv-template
src/resources/index.ts
import { Hobbies } from './../home/hobbies'; import { FrameworkConfiguration } from 'aurelia-framework'; import { TranslateValueConverter } from './value-converters/translate'; export function configure(config: FrameworkConfiguration) { config.globalResources([ './value-converters/translate', './value-conver...
gallayl/aurelia-cv-template
aurelia_project/tasks/preparematerialize.ts
<gh_stars>1-10 import * as gulp from 'gulp'; import * as merge from 'merge-stream'; import * as project from '../aurelia.json'; import * as path from 'path'; export function prepareMaterialize() { let source = 'node_modules/materialize-css/dist'; let sourceStyle = path.join(source, 'css'); let sourceFonts = pat...
gallayl/aurelia-cv-template
src/resources/value-converters/date-range.ts
import { LocalizationService } from './../../services/localizationservice'; import { autoinject } from 'aurelia-framework'; @autoinject export class DateRangeValueConverter { constructor(private localizationService: LocalizationService) { } toView(value:Date, until?: Date) { let dateNow = this.lo...
gallayl/aurelia-cv-template
src/home/schools.ts
<reponame>gallayl/aurelia-cv-template import { School } from '../models/school'; import { SchoolService } from '../services/schoolservice'; import { LocalizationService } from '../services/localizationservice'; import { autoinject, bindable } from 'aurelia-framework'; @autoinject export class Schools { @bindable ...
gallayl/aurelia-cv-template
src/services/hobbyservice.ts
<filename>src/services/hobbyservice.ts<gh_stars>1-10 import { Hobby } from './../models/hobby'; export class HobbyService { public Get(): Hobby[] { return [ { Name: "hobby-iot", ImageUrl: "./assets/photo-iot.jpg", Tags: [ { Nam...
gallayl/aurelia-cv-template
src/home/jobs.ts
<gh_stars>1-10 import { Job } from './../models/job'; import { JobService } from './../services/jobservice'; import { Employer } from './../models/employer'; import { School } from '../models/school'; import { SchoolService } from '../services/schoolservice'; import { LocalizationService } from '../services/localizatio...
gallayl/aurelia-cv-template
src/home/hobbies.ts
<reponame>gallayl/aurelia-cv-template<filename>src/home/hobbies.ts import { Hobby } from './../models/hobby'; import { HobbyService } from './../services/hobbyservice'; import { autoinject } from 'aurelia-framework'; @autoinject export class Hobbies{ public Hobbies:Hobby[]; constructor(private hobbie...
gallayl/aurelia-cv-template
src/interfaces/ihaslocation.ts
<gh_stars>1-10 import { LocalizedString } from '../models/types'; export interface IHasLocation { LocationQuery: string; Address: LocalizedString }
gallayl/aurelia-cv-template
src/resources/value-converters/translate.ts
import { LocalizedString } from '../../models/types'; import { LocalizationService } from '../../services/localizationservice'; import { autoinject } from 'aurelia-framework'; @autoinject export class TranslateValueConverter { constructor(private localization: LocalizationService) { } toView(value: string): Local...
gallayl/aurelia-cv-template
src/services/ownerservice.ts
import { LocalizedString } from '../models/types'; import { Owner } from '../models/owner'; export class OwnerService { public Get(): Owner { return { Name: "<NAME>", Title: 'owner-title', Address: <LocalizedString>"1144 Budapest, Rákosfalva park 4.", Email:...
gallayl/aurelia-cv-template
src/models/types.ts
import { LocalizationLanguage } from './enums'; export type Link = string; export type LocalizedKeyValuePair = [LocalizationLanguage, LocalizedString]; export type LocalizedString = string; export type LanguageSkill = 'language-skill-Elementary' | 'language-skill-Limited' | 'language-skill-Professional' | 'language-sk...
gallayl/aurelia-cv-template
src/models/localizedresource.ts
<reponame>gallayl/aurelia-cv-template<gh_stars>1-10 import { LocalizedKeyValuePair, LocalizedString } from './types'; import { LocalizationLanguage } from './enums'; export class LocalizedResource{ Key: string; Values: LocalizedKeyValuePair[]; }
gallayl/aurelia-cv-template
src/models/owner.ts
<gh_stars>1-10 import { IHasLocation } from './../interfaces/ihaslocation'; import { Hobby } from './hobby'; import { Project } from './project'; import { Job } from './job'; import { School } from './school'; import { Link, LocalizedString } from './types'; export class Owner implements IHasLocation { Name: strin...
gallayl/aurelia-cv-template
src/home/projects.ts
<gh_stars>1-10 import { Project } from './../models/project'; import { bindable, autoinject } from 'aurelia-framework'; export class Projects{ @bindable Projects:Project[]; }
gallayl/aurelia-cv-template
src/services/schoolservice.ts
<reponame>gallayl/aurelia-cv-template<gh_stars>1-10 import { Link } from '../models/types'; import { School } from '../models/school'; export class SchoolService { public Get(): School[] { return [ { Name: "Microsoft certification 70-480", Description: "", ...
gallayl/aurelia-cv-template
src/models/tag.ts
<gh_stars>1-10 export class Tag { Name: string; Url: string; }
gallayl/aurelia-cv-template
src/services/languagesservice.ts
<filename>src/services/languagesservice.ts import { Language } from './../models/language'; export class LanguageService { public Get(): Language[] { return [ { Name: "language-hungarian", Level: 'language-skill-Native' }, { ...
gallayl/aurelia-cv-template
src/models/certification.ts
<reponame>gallayl/aurelia-cv-template import { Link, LocalizedString } from './types'; import { Tag } from './tag'; export class Certification{ IssuerName: string; Description: LocalizedString; Url: Link; Tags: Tag[]; }
gallayl/aurelia-cv-template
src/models/school.ts
import { IHasLocation } from './../interfaces/ihaslocation'; import { Link, LocalizedString } from './types'; import { Tag } from './tag'; export class School implements IHasLocation{ Name: LocalizedString; Type: string; Description: LocalizedString; Homepage: Link; Tags: Tag[]; FromDate: Date...
gallayl/aurelia-cv-template
src/services/skillservice.ts
<reponame>gallayl/aurelia-cv-template import { Skill } from '../models/skill'; export class SkillService { public Get(): Skill[] { return [ { Name: "skill-programming languages", Tags: [ { Name: "C#", Url: "https://en.wikipedia.org/wiki/C_Shar...
gallayl/aurelia-cv-template
src/models/hobby.ts
<gh_stars>1-10 import { Tag } from './tag'; import { Link, LocalizedString } from './types'; export class Hobby { public Name:string; public ImageUrl: Link; public Tags:Tag[]; }
gallayl/aurelia-cv-template
src/models/project.ts
<filename>src/models/project.ts<gh_stars>1-10 import { LocalizedString } from './types'; import { Tag } from './tag'; export class Project{ Name: LocalizedString; Description: LocalizedString; Tags: Tag[]; }
gallayl/aurelia-cv-template
src/services/jobservice.ts
<gh_stars>1-10 import { Job } from './../models/job'; import { LocalizedString } from '../models/types'; import { Language } from '../models/language'; import { LocalizationService } from './localizationservice'; import { autoinject, Aurelia } from 'aurelia-framework'; @autoinject export class JobService { constr...
gallayl/aurelia-cv-template
src/models/enums.ts
export enum LocalizationLanguage{ English, Hungarian }
gallayl/aurelia-cv-template
src/models/skill.ts
<filename>src/models/skill.ts<gh_stars>1-10 import { Tag } from './tag'; import { LocalizedString } from './types'; export class Skill { Name: string; Tags: Tag[]; }
gallayl/aurelia-cv-template
src/app.ts
import { LocalizationService } from './services/localizationservice'; import { OwnerService } from './services/ownerservice'; import { RouterConfiguration, Router } from 'aurelia-router'; import { autoinject } from 'aurelia-framework'; @autoinject export class App { private router: Router; constructor(private ow...
gallayl/aurelia-cv-template
src/home/home.ts
<filename>src/home/home.ts import { LanguageService } from './../services/languagesservice'; import { LocalizationService } from '../services/localizationservice'; import { Owner } from '../models/owner'; import { OwnerService } from '../services/ownerservice'; import {autoinject, bindable} from 'aurelia-framework'; @...
gallayl/aurelia-cv-template
src/home/languages.ts
<filename>src/home/languages.ts import { autoinject, bindable } from 'aurelia-framework'; import { Language } from './../models/language'; import { LanguageService } from './../services/languagesservice'; import { LocalizationService } from './../services/localizationservice'; @autoinject export class Languages{ ...
gallayl/aurelia-cv-template
src/home/cv-header.ts
import { LocalizationLanguage } from '../models/enums'; import { LocalizationService } from '../services/localizationservice'; import { Link, LocalizedString } from '../models/types'; import { bindable, autoinject } from 'aurelia-framework'; import { Owner } from '../models/owner'; import {BindingSignaler} from 'aureli...
gallayl/aurelia-cv-template
src/resources/elements/fa-button-link.ts
<gh_stars>1-10 import { Link } from '../../models/types'; import {bindable} from 'aurelia-framework'; export class FaButtonLink { @bindable iconName : string; @bindable linkUrl : Link; @bindable title : string; @bindable target: string; iconNameChanged(newValue, oldValue) { } linkUrlChanged(newValue, old...
gallayl/aurelia-cv-template
aurelia_project/tasks/dist.ts
import * as gulp from 'gulp'; import * as project from '../aurelia.json'; export function dist() { return gulp.src(project.dist.sources, { "base" : "." }) .pipe(gulp.dest(project.dist.output)); }
gallayl/aurelia-cv-template
src/models/employer.ts
<reponame>gallayl/aurelia-cv-template import { Link, LocalizedString } from './types'; export class Employer { Name: string; Description: LocalizedString; HomePage: Link; LogoUrl: Link; }
gallayl/aurelia-cv-template
src/resources/elements/tag-list.ts
<reponame>gallayl/aurelia-cv-template import { Tag } from './../../models/tag'; import {bindable} from 'aurelia-framework'; export class TagList { @bindable tags: Tag[]; }
gallayl/aurelia-cv-template
src/models/language.ts
import { LocalizedString } from './types'; import { LanguageSkill } from './types'; export class Language { Name: LocalizedString; Level: LanguageSkill; }
gallayl/aurelia-cv-template
src/home/skills.ts
import { Skill } from '../models/skill'; import { SkillService } from './../services/skillservice'; import { autoinject } from 'aurelia-framework'; @autoinject export class Skills{ public Skills: Skill[]; constructor(private SkillService:SkillService) { this.Skills = SkillService.Get(); ...
gallayl/aurelia-cv-template
src/resources/elements/google-map.ts
import { MdModal } from 'aurelia-materialize-bridge/dist/es6'; import { IHasLocation } from './../../interfaces/ihaslocation'; import { Guid } from './../../utils/guit'; import {bindable} from 'aurelia-framework'; export class GoogleMap { @bindable Item: IHasLocation private modal: MdModal; openMap($event: Event...
gallayl/aurelia-cv-template
aurelia_project/tasks/preparefontawesome.ts
import * as gulp from 'gulp'; import * as merge from 'merge-stream'; import * as project from '../aurelia.json'; import * as path from 'path'; import * as changedInPlace from 'gulp-changed-in-place'; export function prepareFontAwesome() { const faSource = 'node_modules/font-awesome/fonts/*'; const mdSource = 'node...
MasudSiraj/AngularJS-applications-Protractor
lib/ptor.ts
import {Browser, ElementHelper} from './browser'; import {ProtractorBy} from './locators'; import {ElementFinder, ElementArrayFinder} from './element'; import * as EC from './expectedConditions'; import {Promise} from './selenium-webdriver/promise'; export namespace protractor { export let browser: Browser; export...
MasudSiraj/AngularJS-applications-Protractor
testapp/ng2/app/async/async.component.ts
import {bootstrap} from 'angular2/bootstrap'; import {Component, NgZone} from 'angular2/core'; import {NgIf} from 'angular2/common'; @Component({ templateUrl: 'app/async/async-component.html', directives: [NgIf] }) export class AsyncComponent { val1: number = 0; val2: number = 0; val3: number = 0; val4: nu...
MasudSiraj/AngularJS-applications-Protractor
testapp/hybrid/app/ng2.ts
<reponame>MasudSiraj/AngularJS-applications-Protractor<filename>testapp/hybrid/app/ng2.ts import {Component} from 'angular2/core'; import {TimerWrapper} from 'angular2/src/facade/async'; import {ng1} from './ng1' import {adapter} from './upgrader'; @Component({ selector: 'ng2', templateUrl: './html/ng2.html', di...
MasudSiraj/AngularJS-applications-Protractor
lib/runner.ts
<gh_stars>0 import * as q from 'q'; import * as util from 'util'; import {EventEmitter} from 'events'; import * as helper from './util'; import {Config} from './configParser'; import {Logger} from './logger2'; import {AttachSession, BrowserStack, Direct, Hosted, Local, Mock, Sauce} from './driverProviders'; import {Plu...
MasudSiraj/AngularJS-applications-Protractor
lib/plugins.ts
var webdriver = require('selenium-webdriver'); var log = require('./logger'); import * as q from 'q'; import {ConfigParser} from './configParser'; export enum PromiseType { Q, WEBDRIVER } export interface PluginConfig { path?: string; package?: string; inline?: ProtractorPlugin; name?: string; [key: str...
MasudSiraj/AngularJS-applications-Protractor
testapp/hybrid/app/upgrader.ts
import {UpgradeAdapter} from 'angular2/upgrade'; export const adapter: UpgradeAdapter = new UpgradeAdapter();
MasudSiraj/AngularJS-applications-Protractor
testapp/hybrid/app/main.ts
<filename>testapp/hybrid/app/main.ts import * as angular from 'angular2/src/upgrade/angular_js'; import {myApp} from './myApp' import {ng2} from './ng2' import {ng1} from './ng1' import {adapter} from './upgrader'; var ng1module = angular.module('hybridApp', []); ng1module.directive('myApp', myApp); ng1module.directi...
fuqi1001/-Angular2Study
app/components/book-form/book-form.component.ts
import {Component, Input} from "@angular/core"; import {IBook} from "../../interfaces/books/ibook"; @Component({ selector: "book-form", templateUrl: "./app/components/book-form/book-form.component.html" }) export class BookFormComponent { @Input() book: IBook; }
fuqi1001/-Angular2Study
app/components/post-form/post-form.component.ts
<filename>app/components/post-form/post-form.component.ts /** * Created by qifu on 16/12/7. */ import {Component, Input} from "@angular/core"; import {IPost} from "../../interfaces/posts/ipost"; import {NgForm} from '@angular/forms'; import {Headers} from '@angular/http' import {Http} from "@angular/http"; import {Fi...
fuqi1001/-Angular2Study
app/components/book-list/book-list.component.ts
import { Component } from "@angular/core"; import { OnInit } from "@angular/core"; import { IBook } from "../../interfaces/books/ibook"; import { BookService } from "../../services/books/books.service"; @Component({ selector: "book-list", templateUrl: "./app/components/book-list/book-list.component.html" }) e...
fuqi1001/-Angular2Study
app/app.module.ts
<reponame>fuqi1001/-Angular2Study import {NgModule} from "@angular/core"; import {BrowserModule} from "@angular/platform-browser"; import {HttpModule, JsonpModule} from '@angular/http'; import {RouterModule} from '@angular/router'; import { FormsModule } from '@angular/forms'; import { ReactiveFormsModule } from '@an...
fuqi1001/-Angular2Study
app/interfaces/posts/ipost.ts
<filename>app/interfaces/posts/ipost.ts /** * Created by qifu on 16/12/7. */ export interface IPost { title: string; body: string; photo?: string; id: string; }
fuqi1001/-Angular2Study
app/components/book/book.component.ts
import {Component, Input} from "@angular/core"; import {IBook} from "../../interfaces/books/ibook"; @Component({ selector: "book", templateUrl: "./app/components/book/book.component.html" }) export class BookComponent { @Input() book: IBook; }
fuqi1001/-Angular2Study
app/components/book-detail/book-detail.component.ts
<reponame>fuqi1001/-Angular2Study<gh_stars>0 import { Component } from "@angular/core"; import { Router, ActivatedRoute, Params } from '@angular/router'; import { IBook } from "../../interfaces/books/ibook"; import { BookService } from "../../services/books/books.service"; @Component({ selector: "book-detail", ...
fuqi1001/-Angular2Study
app/components/post-list/post-list.component.ts
/** * Created by qifu on 16/12/7. */ import {Component} from "@angular/core"; import {OnInit} from "@angular/core"; import {IPost} from "../../interfaces/posts/ipost"; import {PostService} from "../../services/posts/posts.service"; import {Router, ActivatedRoute, Params} from '@angular/router'; @Component({ select...
fuqi1001/-Angular2Study
app/services/posts/posts.service.ts
<reponame>fuqi1001/-Angular2Study /** * Created by qifu on 16/12/7. */ import { Injectable } from "@angular/core"; import { IPost } from "../../interfaces/posts/ipost"; import { Http, Response, URLSearchParams } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; impor...
selfcontained/node-slack-sdk
packages/oauth/src/index.ts
<gh_stars>0 import { IncomingMessage, ServerResponse } from 'http'; import { sign, verify } from 'jsonwebtoken'; import { WebClient } from '@slack/web-api'; import { CodedError, InstallerInitializationError, UnknownError, MissingStateError, GenerateInstallUrlError, AuthorizationError, } from './errors'; imp...
mreubensaunders/react-tsx-graphql-chat
src/App.tsx
import React, { useEffect } from 'react'; import logo from './logo.svg'; import './App.css'; import Dynamic from './components/dynamic' import Messages from './components/messages' import Users from './components/users' import MessageInput from './components/messageInput' import Loading from './components/loading' imp...
mreubensaunders/react-tsx-graphql-chat
src/components/dynamic.tsx
<gh_stars>1-10 import React, { useState, useCallback, useEffect } from 'react'; import img1 from '../style/kimchi.jpg' import img2 from '../style/ader.jpeg' import img3 from '../style/setup.jpg' import img4 from '../style/hype.jpg' interface IProps { val: string; } function changeImage (val: number) { return...
mreubensaunders/react-tsx-graphql-chat
src/components/messageInput.tsx
<reponame>mreubensaunders/react-tsx-graphql-chat<gh_stars>1-10 import React, { useState, useCallback, useEffect } from 'react'; import Alert from '../components/alert' import { useMutation } from 'urql'; interface IProps { username: string; } const MsgMutation = ` mutation($from: String!, $message: String!) { ...
mreubensaunders/react-tsx-graphql-chat
src/index.tsx
import React from 'react'; import ReactDOM from 'react-dom'; import './style/main.css'; import App from './App'; import * as serviceWorker from './serviceWorker'; import { SubscriptionClient } from 'subscriptions-transport-ws'; import { Client, Provider, defaultExchanges, subscriptionExchange } from 'urql'; const sub...
PowerKiKi/graphql-tag
src/tests.ts
<filename>src/tests.ts import 'source-map-support/register'; import { assert } from 'chai'; import type { DocumentNode, FragmentDefinitionNode } from 'graphql'; import gql from './index'; const loader = require('../loader'); describe('gql', () => { it('parses queries', () => { assert.equal(gql`{ testQuery }`.k...
potherca-contrib/coderbox
src/app/shared/services/seo/seo.service.ts
<filename>src/app/shared/services/seo/seo.service.ts import { Injectable } from '@angular/core'; import { Title, Meta } from '@angular/platform-browser'; import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; import { filter, map, mergeMap } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }...
potherca-contrib/coderbox
src/app/shared/validators/date.validator.ts
import { AbstractControl, ValidationErrors } from '@angular/forms'; export function DateValidator(ctrl: AbstractControl): ValidationErrors | null { const date = new Date(ctrl.value); if (isNaN(date.getTime())) return { invalidDate: { source: ctrl.value } }; return null; }
potherca-contrib/coderbox
e2e/src/app.po.ts
import { browser, by, element, until, WebElementPromise, ElementFinder } from 'protractor'; export class AppPage { private static readonly SELECTOR_APP_TITLE = '[data-test-id="app-title"]'; private static readonly SELECTOR_APP_SIDENAV = '[data-test-id="app-sidenav"]'; private static readonly SELECTOR...
potherca-contrib/coderbox
src/app/shared/services/breakpoint/breakpoint.service.ts
<gh_stars>1-10 import { Injectable } from '@angular/core'; import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }) export class BreakpointService { private xsmall$: Observable<boolean>; pri...
potherca-contrib/coderbox
src/app/shared/components/input-copy-button/input-copy-button.component.ts
import { Component, Input, ElementRef, AfterViewInit } from '@angular/core'; @Component({ selector: 'app-input-copy-button', templateUrl: './input-copy-button.component.html', styleUrls: ['./input-copy-button.component.scss'] }) export class InputCopyButtonComponent implements AfterViewInit { @Input('inputElem...
potherca-contrib/coderbox
src/app/app.component.ts
<filename>src/app/app.component.ts import { Component } from '@angular/core'; import { SEOService } from './shared/services/seo/seo.service'; import { ThemeService } from './shared/services/theme/theme.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component....
potherca-contrib/coderbox
e2e/src/app.e2e-spec.ts
import { AppPage } from './app.po'; import { browser, logging } from 'protractor'; describe('workspace-project App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); page.navigateTo(); }); it('should display app title text', async () => { const appTitleText = await page.getAppT...
potherca-contrib/coderbox
src/app/shared/directives/autofocus/autofocus.directive.ts
import { Directive, ElementRef, AfterViewInit } from '@angular/core'; import { FocusMonitor } from '@angular/cdk/a11y'; @Directive({ selector: '[appAutofocus]' }) export class AutofocusDirective implements AfterViewInit { constructor(private el: ElementRef, private focusMonitor: FocusMonitor) {} ngAfterViewInit...
potherca-contrib/coderbox
src/app/pages/epoch-converter/epoch-converter.page.ts
import { Component, OnInit, OnDestroy, PLATFORM_ID, Inject } from '@angular/core'; import { isPlatformBrowser } from '@angular/common'; import { FormControl, Validators } from '@angular/forms'; import { Observable, Subscription, timer, of } from 'rxjs'; import { map } from 'rxjs/operators'; import { DateValid...
potherca-contrib/coderbox
src/app/shared/services/theme/theme.service.spec.ts
<filename>src/app/shared/services/theme/theme.service.spec.ts<gh_stars>1-10 import { TestBed } from '@angular/core/testing'; import { ThemeService } from './theme.service'; describe('ThemeService', () => { let service: ThemeService; let bodyClassList: DOMTokenList; let overlayClassList: DOMTokenList; beforeE...
potherca-contrib/coderbox
src/app/shared/shared.module.ts
import { NgModule, ModuleWithProviders, Inject } from '@angular/core'; import { CommonModule, DOCUMENT } from '@angular/common'; import { RouterModule } from '@angular/router'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ErrorStateMatcher, ShowOnDirtyErrorStateMatcher } from '@angula...
potherca-contrib/coderbox
src/app/shared/components/file-drop-area/file-drop-area.component.ts
import { Component, Output, EventEmitter, HostBinding, HostListener } from '@angular/core'; @Component({ selector: 'app-file-drop-area', templateUrl: './file-drop-area.component.html', styleUrls: ['./file-drop-area.component.scss'] }) export class FileDropAreaComponent { @Output() onFile = new EventE...
potherca-contrib/coderbox
src/app/shared/components/sidenav/sidenav.service.ts
<filename>src/app/shared/components/sidenav/sidenav.service.ts import { Injectable } from '@angular/core'; import { MatSidenav } from '@angular/material/sidenav'; import { Observable, Subject } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class SidenavService { private _sidenav: MatSidenav; private su...
potherca-contrib/coderbox
src/app/app-routing.module.ts
import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { path: '', loadChildren: () => import('./pages/home/home.module').then(mod => mod.HomeModule), pathMatch: 'full', data: { meta: [ { name: 'descript...
potherca-contrib/coderbox
src/app/shared/components/circle-clock/circle-clock.component.ts
import { Component, Input, ViewChild, HostBinding, HostListener, ElementRef, AfterViewInit } from '@angular/core'; import { MatRipple } from '@angular/material/core'; @Component({ selector: 'app-circle-clock', templateUrl: './circle-clock.component.html', styleUrls: ['./circle-clock.component.scss'...
potherca-contrib/coderbox
src/app/shared/components/navbar/navbar.component.spec.ts
<filename>src/app/shared/components/navbar/navbar.component.spec.ts<gh_stars>1-10 import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { MatToolbarModule } from '@angular/material/toolbar'; import { By } from '@angular/platform-browser'; imp...
potherca-contrib/coderbox
src/app/pages/hash-generator/hash-generator.page.spec.ts
<gh_stars>1-10 import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; import { MatSnackBarModule } from '@angular/material/snack-bar'; import { HashGeneratorPage } from './hash-generator.page'; describ...
potherca-contrib/coderbox
src/app/pages/unicode-converter/unicode-converter.page.ts
<reponame>potherca-contrib/coderbox import { Component, NgZone, ViewChildren, QueryList } from '@angular/core'; import { CdkTextareaAutosize } from '@angular/cdk/text-field'; import { take } from 'rxjs/operators'; @Component({ selector: 'app-unicode-converter', templateUrl: './unicode-converter.page.html', style...
potherca-contrib/coderbox
src/app/shared/components/navbar/navbar.component.ts
import { Component, OnInit } from '@angular/core'; import { SidenavService } from '../sidenav/sidenav.service'; @Component({ selector: 'app-navbar', templateUrl: './navbar.component.html', styleUrls: ['./navbar.component.scss'] }) export class NavbarComponent implements OnInit { constructor(public sidenavServi...
potherca-contrib/coderbox
src/app/shared/components/sidenav/sidenav.component.spec.ts
<reponame>potherca-contrib/coderbox<filename>src/app/shared/components/sidenav/sidenav.component.spec.ts import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { AppRoutingModule } from '../../../app-routing.module'; import { BrowserAnimationsM...
potherca-contrib/coderbox
src/app/shared/components/sidenav/sidenav.component.ts
import { Component, OnInit, AfterViewInit, ViewChild } from '@angular/core'; import { SidenavService } from './sidenav.service'; import { BreakpointService } from '../../services/breakpoint/breakpoint.service'; import { ThemeService } from '../../services/theme/theme.service'; import { MatSidenav } from '@angular/mater...
potherca-contrib/coderbox
src/app/shared/pipes/relative-time.pipe.ts
<reponame>potherca-contrib/coderbox<gh_stars>1-10 import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'relativeTime' }) export class RelativeTimePipe implements PipeTransform { transform(timestamp: number, relativeToTimestamp?: number): string { if (!Intl.RelativeTimeFormat) return ''; if (i...