repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
KhvanKonstantin/pwarss | frontend/src/model/NewsEntry.ts | <filename>frontend/src/model/NewsEntry.ts
// Created by <NAME> on 7/16/18 9:24 AM
export type IdType = string
export class NewsEntry {
id: IdType = "";
tags: string[] = [];
link: string = "";
title: string = "";
date: string = "";
content: string = "";
}
export const NullEntry: NewsEntry = {... |
KhvanKonstantin/pwarss | frontend/src/screens/NewsEntryScreen.tsx | // Created by <NAME> on 5/24/20, 1:15 AM
import React, {useEffect} from 'react';
import {IdType} from "../model/NewsEntry";
import {extractTextFromHtmlString} from "../forms/util";
import {observer} from "mobx-react";
import {useStores} from "../hooks/stores";
import {useHistory, useParams} from "react-router-dom";
im... |
KhvanKonstantin/pwarss | frontend/src/screens/SplashScreen.tsx | <reponame>KhvanKonstantin/pwarss<filename>frontend/src/screens/SplashScreen.tsx
// Created by <NAME> on 7/16/18 3:35 PM
export const SplashScreen = () =>
<div style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
fontSize: "12vw",
width: "100vw",
... |
KhvanKonstantin/pwarss | frontend/src/forms/StarButton.tsx | // Created by <NAME> on 5/24/20, 1:15 AM
import {IdType, NewsEntry, newsEntryStarred} from "../model/NewsEntry";
import * as React from "react";
import {observer} from "mobx-react";
import {useStores} from "../hooks/stores";
import StarFilled from "@material-ui/icons/Star";
import StarBorder from "@material-ui/icons/S... |
KhvanKonstantin/pwarss | frontend/src/model/Notifications.ts | // Created by <NAME> on 9/22/18 8:46 AM
export enum NotificationKind {
INFO = "info",
ERROR = "error"
}
export interface NotificationInfo {
kind: NotificationKind
content?: string | null
autoHideMillis?: number | null
}
|
KhvanKonstantin/pwarss | frontend/src/App.tsx | // Created by <NAME> on 7/11/18 2:04 PM
import React, {useEffect} from 'react';
import {observer} from "mobx-react";
import AuthStore from "./stores/AuthStore";
import {LoginScreen} from "./screens/LoginScreen";
import {SplashScreen} from "./screens/SplashScreen";
import {useStores} from "./hooks/stores";
import {Brow... |
KhvanKonstantin/pwarss | frontend/src/forms/AppBar.tsx | <reponame>KhvanKonstantin/pwarss<filename>frontend/src/forms/AppBar.tsx
// Created by <NAME> on 9/22/18 10:01 AM
import * as React from "react";
import {MutableRefObject, ReactElement, useRef, useState} from "react";
import {AppBar, Drawer, IconButton, makeStyles, Menu, Toolbar, Typography} from "@material-ui/core";
i... |
KhvanKonstantin/pwarss | frontend/src/stores/UIStateStore.ts | <filename>frontend/src/stores/UIStateStore.ts
// Created by <NAME> on 9/22/18 8:46 AM
import {action, observable} from "mobx";
import {NotificationInfo} from "../model/Notifications";
export class UIStateStore {
@observable
currentNotification: NotificationInfo | null = null;
private allNotifications: ... |
crystal-pool/GrayWing | graywing-client/src/app/sparql-variable-binding-view/sparql-variable-binding-view.component.spec.ts | <gh_stars>0
import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { SparqlVariableBindingViewComponent } from "./sparql-variable-binding-view.component";
describe("SparqlVariableBindingViewComponent", () => {
let component: SparqlVariableBindingViewComponent;
let fixture: ComponentFixtu... |
crystal-pool/GrayWing | graywing-client/src/app/status-indicator/status-indicator.component.ts | import { Component, OnInit, Inject, OnDestroy } from "@angular/core";
import { ISparqlServiceInjectionToken, ISparqlService } from "../sparql.service.contract";
import { Subscription } from "rxjs";
@Component({
selector: "app-status-indicator",
templateUrl: "./status-indicator.component.html",
styleUrls: ["./sta... |
crystal-pool/GrayWing | graywing-client/src/app/result-viewer/result-viewer.component.ts | import { Component, OnInit, Input, Inject, OnDestroy, ViewChild, TemplateRef } from "@angular/core";
import { TableColumn } from "@swimlane/ngx-datatable";
import { SparqlQueryResult } from "../sparql-models";
import { ISparqlServiceInjectionToken, ISparqlService } from "../sparql.service.contract";
import { Subscripti... |
crystal-pool/GrayWing | graywing-client/src/app/sparql.service.contract.ts | import { SparqlQueryResult, SparqlQueryRecord, SparqlUri, SparqlLiteral, SparqlBlankNode, SparqlVariableBindingValue } from "./sparql-models";
import { Observable } from "rxjs";
import { InjectionToken } from "@angular/core";
export interface ISparqlQueryStatus {
// undefined indicates the user hasn't executed any... |
crystal-pool/GrayWing | graywing-client/src/app/sparql-language.ts | export const languageId = "sparql";
export const extensionPoint: monaco.languages.ILanguageExtensionPoint = {
id: "sparql",
aliases: ["SPARQL"]
};
export const config: monaco.languages.LanguageConfiguration = {
comments: {
lineComment: "#",
},
brackets: [
["{", "}"],
["[", ... |
crystal-pool/GrayWing | graywing-client/src/app/sparql.service.mock.ts | import { Injectable } from "@angular/core";
import { SparqlQueryResult } from "./sparql-models";
import { BehaviorSubject, Observable } from "rxjs";
import { HttpClient } from "@angular/common/http";
import { ISparqlService, ParseQueryResult, ISparqlQueryStatus } from "./sparql.service.contract";
import { delay } from ... |
crystal-pool/GrayWing | graywing-client/src/app/code-editor/code-editor.component.ts | import { Component, OnInit, Inject, Input, ViewChild, OnDestroy } from "@angular/core";
import { ISparqlService, ISparqlServiceInjectionToken } from "../sparql.service.contract";
import { ISetCodeEditorContentMessage } from "../window-messages";
import { Subscription } from "rxjs";
@Component({
selector: "app-code-e... |
crystal-pool/GrayWing | graywing-client/src/app/sparql.service.ts | <filename>graywing-client/src/app/sparql.service.ts
import { Injectable } from "@angular/core";
import { SparqlQueryResult } from "./sparql-models";
import { BehaviorSubject } from "rxjs";
import { HttpClient } from "@angular/common/http";
import { ISparqlService, ParseQueryResult, ISparqlQueryStatus } from "./sparql.s... |
crystal-pool/GrayWing | graywing-client/src/app/material-ref/material-ref.module.spec.ts | <filename>graywing-client/src/app/material-ref/material-ref.module.spec.ts
import { MaterialRefModule } from "./material-ref.module";
describe("MaterialRefModule", () => {
let materialRefModule: MaterialRefModule;
beforeEach(() => {
materialRefModule = new MaterialRefModule();
});
it("should create an in... |
crystal-pool/GrayWing | graywing-client/src/app/app.module.ts | <gh_stars>0
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { AppComponent } from "./app.component";
import { HttpClientModule } from "@angular/common/http";
import { FormsModule } from "@angular/forms";
import { NgxDatatableModule } from "@swimlane/ngx-datat... |
crystal-pool/GrayWing | graywing-client/src/app/result-viewer/result-viewer.component.spec.ts | import { async, ComponentFixture, TestBed } from "@angular/core/testing";
import { ResultViewerComponent } from "./result-viewer.component";
describe("ResultViewerComponent", () => {
let component: ResultViewerComponent;
let fixture: ComponentFixture<ResultViewerComponent>;
beforeEach(async(() => {
TestBed... |
crystal-pool/GrayWing | graywing-client/src/app/app.component.ts | <gh_stars>0
import { Component, AfterViewInit, Inject, OnInit, OnDestroy } from "@angular/core";
import { IApplicationReadyMessage } from "./window-messages";
import { ISparqlServiceInjectionToken, ISparqlService } from "./sparql.service.contract";
import { Subscription } from "rxjs";
const applicationTitle = "Crystal... |
crystal-pool/GrayWing | graywing-client/src/app/window-messages.ts | <gh_stars>0
// Used with window.postMessage
export interface ISetCodeEditorContentMessage {
type: "SetCodeEditorContent";
content: string;
}
export interface IApplicationReadyMessage {
type: "ApplicationReady";
}
|
crystal-pool/GrayWing | graywing-client/src/app/sparql-variable-binding-view/sparql-variable-binding-view.component.ts | import { Component, OnInit, Input } from "@angular/core";
import { SparqlVariableBindingValue, SparqlUri, SparqlBlankNode } from "../sparql-models";
const wellKnownUriPrefixes: { [prefix: string]: string } = {
"wd": "https://crystalpool.cxuesong.com/entity/",
"xml": "http://www.w3.org/XML/1998/namespace/",
"rdf"... |
crystal-pool/GrayWing | graywing-client/src/app/sparql-models.ts | <filename>graywing-client/src/app/sparql-models.ts
export class SparqlQueryResult {
public static readonly Empty: SparqlQueryResult = new SparqlQueryResult();
public variables: string[];
public resultBoolean?: boolean;
public records: SparqlQueryRecord[];
}
/**
* This is actually a `<result>` nod... |
relmify/typedoc-functional-theme | test/src/index.ts | <gh_stars>0
export abstract class Example1 {
/**
* Wait for the boolean to return
* @returns True if it waited
*/
abstract waitForOk: () => Promise<boolean>
}
|
relmify/typedoc-functional-theme | plugin.ts | /**
* Modifications Copyright 2020 Relmify
*
* Copyright 2019 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/L... |
MagicHaddock/discord-player | src/utils/Util.ts | import { StageChannel, VoiceChannel } from "discord.js";
import { TimeData } from "../types/types";
class Util {
/**
* Utils
*/
private constructor() {} // eslint-disable-line @typescript-eslint/no-empty-function
/**
* Creates duration string
* @param {object} durObj The duration objec... |
MagicHaddock/discord-player | src/Structures/PlayerError.ts | <filename>src/Structures/PlayerError.ts<gh_stars>100-1000
export enum ErrorStatusCode {
STREAM_ERROR = "StreamError",
AUDIO_PLAYER_ERROR = "AudioPlayerError",
PLAYER_ERROR = "PlayerError",
NO_AUDIO_RESOURCE = "NoAudioResource",
UNKNOWN_GUILD = "UnknownGuild",
INVALID_ARG_TYPE = "InvalidArgType",... |
MagicHaddock/discord-player | src/Structures/ExtractorModel.ts | import { ExtractorModelData } from "../types/types";
class ExtractorModel {
name: string;
private _raw: any; // eslint-disable-line @typescript-eslint/no-explicit-any
/**
* Model for raw Discord Player extractors
* @param {string} extractorName Name of the extractor
* @param {object} data E... |
ryurock/shizoo | src/main-process/data-store/adapter.ts | <reponame>ryurock/shizoo<filename>src/main-process/data-store/adapter.ts
const NeDb = require('nedb');
const Path = require('path');
const electron: typeof Electron = require('electron');
export class Adapter {
static neDb() {
return new NeDb({filename: Path.join(electron.app.getPath('home'), '.shizoo.db')... |
ryurock/shizoo | src/main-process/oauth/github/client.ts | <filename>src/main-process/oauth/github/client.ts
const SecretOAuth = require('../../../../config/secret.json').oauth.github;
const QueryString = require('querystring');
const Url = require('url');
const SimpleOAuth2 = require('simple-oauth2');
export class OAuthGithubClient {
private credentials: {key:... |
ryurock/shizoo | src/main-process/data-store/index.ts | <filename>src/main-process/data-store/index.ts
export {Adapter} from './adapter';
|
ryurock/shizoo | src/main-process/index.ts | <reponame>ryurock/shizoo
/// <reference path="../../node_modules/electron/electron.d.ts" />
const electron = require('electron');
const ipcMain: typeof Electron.ipcMain = electron.ipcMain;
const BrowserWindow: typeof Electron.BrowserWindow = electron.BrowserWindow;
const app: Electron.App = electron.app;
import {OAuth... |
ryurock/shizoo | src/main-process/oauth/github.ts | <gh_stars>0
/// <reference path="../../../node_modules/electron/electron.d.ts" />
/// <reference path="../../../node_modules/@types/node/index.d.ts" />
import { BrowserWindow, EventEmitter } from "electron";
const electron: typeof Electron = require('electron');
const ipcMain: typeof Electron.ipcMain = electron.ipcMai... |
maxim760/nest-rest-vladilen | src/products/products.service.ts | <reponame>maxim760/nest-rest-vladilen
import { Injectable } from '@nestjs/common';
import { CreateProductDto } from './dto/create-product.dto';
import { InjectModel } from '@nestjs/mongoose';
import { Product, ProductDocument } from './schemas/product.schema';
import { Model } from 'mongoose';
import { UpdateProductDto... |
maxim760/nest-rest-vladilen | src/products/products.controller.ts | <filename>src/products/products.controller.ts
import {
Controller,
Get,
Param,
Query,
Req,
Res,
HttpStatus,
Post,
Put,
Delete,
Body,
Redirect,
HttpCode,
Header,
} from '@nestjs/common';
import { Response } from 'express';
import { CreateProductDto } from './dto/create-product.dto';
import {... |
SamuelThulin/SensingSugar | src/views/Play/DataDrawer.tsx | <filename>src/views/Play/DataDrawer.tsx
import MedicationIcon from '@mui/icons-material/Medication';
import RateReviewIcon from '@mui/icons-material/RateReview';
import { Box, Table, TableBody, TableCell, TableHead, TableRow } from '@mui/material';
import { styled } from '@mui/material/styles';
import { useAppState } f... |
SamuelThulin/SensingSugar | src/i18n.ts | <filename>src/i18n.ts
import i18next from 'i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';
import en from './locales/en-CA.json';
import fr from './locales/fr-CA.json';
import pt from './locales/pt-BR.json';
export const resources = { en, fr,... |
SamuelThulin/SensingSugar | src/views/Play/index.tsx | import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import { AppBar, Box, Button, Drawer, IconButton, Toolbar, Typography } from '@mui/material';
import { useActions, useAppState } from '@src/overmind';
import React, { FC, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import... |
SamuelThulin/SensingSugar | webpack.config.ts | <reponame>SamuelThulin/SensingSugar
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { ESBuildMinifyPlugin } from 'esbuild-loader';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
impor... |
SamuelThulin/SensingSugar | src/@types/index.ts | export interface FileDetail {
fileName: string;
name: string;
path: string;
}
export interface IData {
'#'?: string;
glucose?: number;
timestamp?: "25/10/2021 08:23:36"
activity?: string | null;
data_source?: string;
location?: string | null;
meal?: number;
meal_marker?: string | null;
medicati... |
SamuelThulin/SensingSugar | src/views/DataForm/Instructions.tsx | import { Box, Typography, useMediaQuery, useTheme } from '@mui/material';
import React, { FC } from 'react';
import { useTranslation } from 'react-i18next';
const Instructions: FC = () => {
const { t } = useTranslation('common');
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('sm... |
SamuelThulin/SensingSugar | src/theme/index.ts | import { colors, createTheme } from '@mui/material';
const theme = (darkMode?: boolean) =>
createTheme({
palette: {
mode: darkMode ? 'dark' : 'light',
primary: {
main: colors.deepOrange[500],
},
secondary: {
// main: colors.deepPurple[400],
main: colors.amber[400],... |
SamuelThulin/SensingSugar | src/overmind/effects.ts | import axios, { AxiosResponse } from 'axios';
import type { FileDetail } from '../@types';
export const api = {
getGallery: async (): Promise<FileDetail[]> => {
const response: AxiosResponse<FileDetail[]> = await axios.get('/api/gallery');
return response.data;
},
};
|
SamuelThulin/SensingSugar | src/views/Playground/Visuals.ts | <gh_stars>0
import Hydra from 'hydra-synth';
let h: any;
export const start = () => {
const canvas = document.getElementById('visuals');
h = new Hydra({
canvas, // canvas element to render to. If none is supplied, a canvas will be created and appended to the screen
// width: 1280, ... |
SamuelThulin/SensingSugar | server/index.ts | import kleur from 'kleur';
import server from './server';
const port = process.env.PORT || 3000;
server.listen(port, () => {
console.log(kleur.bgGreen().black(`\n Server listening on port ${port}! \n`));
}); |
SamuelThulin/SensingSugar | src/layouts/Blank/index.tsx | <gh_stars>0
import { Box } from '@mui/material';
import React, { FC } from 'react';
import { Outlet } from 'react-router-dom';
const BlankLayout: FC = () => (
<Box
sx={{
display: 'flex',
width: '100%',
backgroundColor: 'background.default',
}}
>
<Box sx={{ flex: '1 1 auto' }}>
<... |
SamuelThulin/SensingSugar | src/views/error/NotFoundView.tsx | import { Box, Link, Stack, Typography } from '@mui/material';
import Page from '@src/components/Page';
import React, { FC } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { Link as RouterLink } from 'react-router-dom';
const NotFoundView: FC = () => {
const { t } = useTranslation('common... |
SamuelThulin/SensingSugar | src/routes.tsx | <reponame>SamuelThulin/SensingSugar
import React from 'react';
import BlankLayout from './layouts/Blank';
import DefaultLayout from './layouts/Default';
import DataForm from './views/DataForm';
import NotFound from './views/error/NotFoundView';
import Gallery from './views/Gallery';
import Home from './views/Home';
imp... |
SamuelThulin/SensingSugar | src/views/Playground/index.tsx | <reponame>SamuelThulin/SensingSugar
import HomeIcon from '@mui/icons-material/Home';
import { Box, Button, ButtonGroup, IconButton, Stack, Typography } from '@mui/material';
import React, { FC } from 'react';
import { useNavigate } from 'react-router-dom';
import * as Sound from './Sound';
import * as Visuals from './V... |
SamuelThulin/SensingSugar | src/views/Playground/Sound.ts | import { Segment } from '@mui/icons-material';
import * as Tone from 'tone';
import { Envelope } from 'tone';
//create a synth and connect it to the main output (your speakers)
const synth = new Tone.Synth().toDestination();
// * simple
export const playSimple = async () => {
await Tone.start();
//debugging:
//... |
SamuelThulin/SensingSugar | src/views/DataForm/index.tsx | <gh_stars>0
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import {
Box,
Checkbox,
FormControlLabel,
Grid,
IconButton,
Paper,
Stack,
Typography,
useMediaQuery,
useTheme,
} from '@mui/material';
import { useActions } from '@src/overmind';
import { motion, useAnimation } from 'framer-motio... |
SamuelThulin/SensingSugar | src/views/Playground/Visuals_ts.ts | <reponame>SamuelThulin/SensingSugar
import REGL from 'regl';
import { Hydra } from 'hydra-ts';
let h: any;
export const start = () => {
const canvas = document.getElementById('visuals');
if (!canvas) return;
const regl = REGL();
console.log(regl);
const hydra = new Hydra({
regl, //... |
SamuelThulin/SensingSugar | src/utilities/util.ts | <reponame>SamuelThulin/SensingSugar
export interface Language {
code: string;
name: string;
shortName: string;
}
export const Languages: Map<string, Language> = new Map();
export const supportedLanguages: typeof Languages = new Map([
['en-CA', { code: 'en-CA', name: 'english', shortName: 'en' }],
['fr-CA', ... |
SamuelThulin/SensingSugar | src/views/Gallery/index.tsx | import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import { Box, Button, IconButton, Stack, Typography, useMediaQuery, useTheme } from '@mui/material';
import React, { FC, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import t... |
SamuelThulin/SensingSugar | src/components/LanguageMenu.tsx | import { Box, Button, Menu, MenuItem } from '@mui/material';
import LanguageIcon from '@mui/icons-material/Language';
import { useActions, useAppState } from '@src/overmind';
import { supportedLanguages } from '@src/utilities/util';
import { motion } from 'framer-motion';
import React, { FC, MouseEvent, useState } from... |
SamuelThulin/SensingSugar | server/server.ts | <filename>server/server.ts
import express from 'express';
import path from 'path';
import repository from './routes/repository';
const publicPath = path.join(__dirname, '..', 'dist');
const server = express();
server.use(express.json({ limit: '5mb' })); // support json encoded bodies
// dev tools
const loadDevTools... |
SamuelThulin/SensingSugar | src/views/Play/Sound.ts | <filename>src/views/Play/Sound.ts<gh_stars>0
import * as Tone from 'tone';
import { IData } from '../../@types'
//create a synth and connect it to the main output (your speakers)
// const synth = new Tone.Synth().toDestination();
const synth = new Tone.PolySynth(Tone.Synth).toDestination();
export const play = async ... |
SamuelThulin/SensingSugar | src/overmind/index.ts | import { IContext } from 'overmind';
import {
createActionsHook,
createEffectsHook,
// createReactionHook,
createStateHook,
} from 'overmind-react';
import { state } from './state';
import * as actions from './actions';
import * as effects from './effects';
export const config = {
state,
actions,
effects... |
SamuelThulin/SensingSugar | src/views/DataForm/PrivacyTerms.tsx | <gh_stars>0
import { Box, Typography, useMediaQuery, useTheme } from '@mui/material';
import React, { FC } from 'react';
import { useTranslation } from 'react-i18next';
const PrivacyTerms: FC = () => {
const { t } = useTranslation('common');
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoi... |
SamuelThulin/SensingSugar | src/overmind/actions.ts | import { IData } from '@src/@types';
import Papa, { ParseError, ParseMeta, ParseResult } from 'papaparse';
import { supportedLanguages } from '../utilities/util';
import { Context } from './';
//* INIITIALIZE
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const onInitializeOvermind = async ({ sta... |
SamuelThulin/SensingSugar | src/views/Gallery/Sample.tsx | import { Box, Stack, Typography, useTheme } from '@mui/material';
import { motion } from 'framer-motion';
import React, { FC } from 'react';
import { useNavigate } from 'react-router-dom';
import type { FileDetail } from '../../@types';
interface SampleProps {
file: FileDetail;
}
const Sample: FC<SampleProps> = ({ f... |
SamuelThulin/SensingSugar | src/overmind/state.ts | import type { Language } from '../utilities/util';
import { IData } from '../@types'
type State = {
data: IData[];
language: Language;
unitGlucose: string;
unitMeal: string;
};
export const state: State = {
data: [],
language: { code: 'en-CA', name: 'english', shortName: 'en' },
unitGlucose: 'mmol/L',
... |
SamuelThulin/SensingSugar | src/layouts/Default/index.tsx | import AttractionsIcon from '@mui/icons-material/Attractions';
import { Box, IconButton, Stack, useMediaQuery, useTheme } from '@mui/material';
import React, { FC } from 'react';
import { Outlet, useNavigate } from 'react-router-dom';
import Footer from '../../components/Footer';
import LanguageMenu from '../../compone... |
SamuelThulin/SensingSugar | src/components/Page.tsx | /* eslint-disable react/prop-types */
/* eslint-disable react/display-name */
import React, { forwardRef } from 'react';
import { Helmet } from 'react-helmet';
interface PageProps {
title?: string;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const Page = forwardRef<PageProps, any>(({ children, t... |
SamuelThulin/SensingSugar | src/views/Home/index.tsx | import VolumeOffIcon from '@mui/icons-material/VolumeOff';
import VolumeUpIcon from '@mui/icons-material/VolumeUp';
import { Box, Button, IconButton, Stack, Typography, useMediaQuery, useTheme } from '@mui/material';
import React, { FC, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { u... |
SamuelThulin/SensingSugar | server/routes/repository.ts | <filename>server/routes/repository.ts
import express from 'express';
import fs from 'fs';
import path from 'path';
interface FileDetail {
fileName: string;
name: string;
path: string;
}
const router = express.Router();
const isFile = (file: FileDetail) => fs.lstatSync(path.join(file.path, file.fileName)).isFil... |
SamuelThulin/SensingSugar | src/components/Footer.tsx | <reponame>SamuelThulin/SensingSugar<filename>src/components/Footer.tsx<gh_stars>0
import { Box, Button } from '@mui/material';
import React, { FC } from 'react';
import { useTranslation } from 'react-i18next';
const Footer: FC = () => {
const { t } = useTranslation('common');
return (
<Box sx={{ marginTop: 'au... |
Blackbandit1804/altv-T800a-sandbox | src/T8VEH/client/webview/webview.ts | <filename>src/T8VEH/client/webview/webview.ts
//@ts-ignore
const app = Vue.createApp({
data() {
return {
vehicles: [],
vehicle: null,
vehAddons: [],
vehAddon: null,
vehMaker: [],
vehClasses: [],
vehClass: null,
filter: 0,
}
},
... |
Blackbandit1804/altv-T800a-sandbox | src/T8CLOTH/client/client.ts | import alt from 'alt-client';
import natives from 'natives';
import { createPedEditCamera, destroyPedEditCamera, setFov, setZPos } from './classes/camera';
import { T8_webView } from './classes/webview';
// let WEBVIEW = new T8_webView();
var webview = null;
alt.onServer("T8CLT:client:createWindow", () => { T8CLT_... |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/client/client.ts | <reponame>Blackbandit1804/altv-T800a-sandbox<filename>src/T8INT/client/client.ts
import alt from 'alt-client';
import natives from 'natives';
import * as chat from "chat";
import { Raycast, GetDirectionFromRotation, playAnimation } from './classes/utility';
import { T8IntWebView } from './classes/webview';
import { WAS... |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/client/classes/webview.ts | import alt from 'alt-client';
import natives from 'natives';
import * as chat from "chat";
// this.webview.unfocus();
// this.webview.destroy();
// this.webview.focus();
export class T8IntWebView {
private webViewURL:string = 'http://resource/client/webview/index.html';
public webview:any ... |
Blackbandit1804/altv-T800a-sandbox | src/T8UNE/server/server.ts | <gh_stars>0
/// <reference types="@altv/types-server" />
import alt from 'alt-server';
import * as chat from "chat";
chat.registerCmd("tune", (player ) => {
alt.emitClient( player, "T8UNE:client:createWindow" );
});
alt.onClient('T8UNE:server:sendVehicle', ( player, vehicleID ) => {
// let veh = alt.Vehicle.g... |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/client/classes/utility.ts | import * as alt from 'alt-client';
import * as natives from 'natives';
export function GetDirectionFromRotation(rotation) {
var z = rotation.z * (Math.PI / 180.0);
var x = rotation.x * (Math.PI / 180.0);
var num = Math.abs(Math.cos(x));
return new alt.Vector3(
(-Math.sin(z) * num),
(Math.cos(z... |
Blackbandit1804/altv-T800a-sandbox | src/T8VEH/server/server.ts | /// <reference types="@altv/types-server" />
import alt from 'alt-server';
import * as chat from "chat";
chat.registerCmd("t8veh", ( player ) => {
alt.emitClient( player, "T8VEH:client:createWebView" );
});
alt.onClient('T8VEH:server:spawnVehicle', ( player, vehicleName:string ) => {
if ( player.vehicle ){ pl... |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/client/classes/wasdMenu.ts | import alt, { WebView } from 'alt-client';
import natives from 'natives';
import * as chat from "chat";
export class WASDmenu {
private webViewURL:string = 'http://resource/client/webview/index.html';
private n:number = 0;
private item:number = 0;
private menu_obj:a... |
Blackbandit1804/altv-T800a-sandbox | src/T8UNE/client/webview/webview.ts |
var color_grps = [
/*
{ text: "Metallic", id: 1 },
{ text: "Matte", id: 2 },
{ text: "Worm", id: 3 },
{ text: "Utility", id: 4 },
{ text: "Divers", id: 5 }
*/
"Metallic", "Matte", "Worm", "Utility", "Divers"
];
var wheelsTypeArray = [
// { id: -1, text: "Stock" },
{ id: 0, text: "Sport" },
... |
Blackbandit1804/altv-T800a-sandbox | src/T8CLOTH/server/server.ts | /// <reference types="@altv/types-server" />
import alt from 'alt-server';
import * as chat from "chat";
chat.registerCmd("cloth", (player ) => {
alt.emitClient( player, "T8CLT:client:createWindow" );
});
alt.onClient('T8CLT:server:updateCloth', ( player, dataJSON:string ) => {
/*
clothing: {
component:... |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/server/classes/serverInteractions.ts | <filename>src/T8INT/server/classes/serverInteractions.ts<gh_stars>0
import alt from 'alt-server';
import * as chat from "chat";
export class ServerInteractions {
constructor( private useToast:boolean = false ){};
public intObjArray:[any?];
public gasPumpArray:[any?];
init( allObjArray:any ){
th... |
Blackbandit1804/altv-T800a-sandbox | src/T8UG/server/server.ts | /// <reference types="@altv/types-server" />
import alt from 'alt-server';
import * as chat from "chat";
chat.registerCmd("t8ug", (player ) => {
alt.emitClient( player, "T8UG:client:createWindow" );
}); |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/server/server.ts | import alt from 'alt-server';
import JSONdb from 'simple-json-db';
import * as chat from 'chat';
import { ServerInteractions } from './classes/serverInteractions';
const DBM = new JSONdb('./JSONdb/db-menus.json');
const DBO = new JSONdb('./JSONdb/db-objects.json');
let INTER = new ServerInteractions( true );
INTER.... |
Blackbandit1804/altv-T800a-sandbox | src/T8CLOTH/client/classes/camera.ts | /*
Open Source - Character Editor - alt:V by Stuyk
https://github.com/Stuyk/altv-os-character-editor/blob/master/client/camera.js
*/
import * as alt from 'alt-client';
import * as native from 'natives';
let cameraControlsInterval;
let camera;
let zpos = 0;
let fov = 90;
let startPosition;
let startCamPosition;... |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/interfaces.ts | <filename>src/T8INT/interfaces.ts<gh_stars>0
interface Vector3 {
x: number;
y:number;
z:number;
};
interface InteractionObj {
isHit: boolean;
pos: Vector3;
rot: Vector3;
entity: number;
entityType: number;
entityHash: number;
entityID: number;
nearGasPump?: boolean;
}; |
Blackbandit1804/altv-T800a-sandbox | src/T8CLOTH/client/webview/webview.ts | let clothComp = [
{ id: 11, name: "Tops" },
{ id: 8, name: "Undershirts" },
{ id: 4, name: "Legs" },
{ id: 6, name: "Shoes" },
{ id: 1, name: "Masks" },
{ id: 5, name: "Bagpacks" },
{ id: 9, name: "Body Armor" },
{ id: 7, name: "Accessories" },
{ id: 3, name: "Torsos" },
{ id: 2... |
Blackbandit1804/altv-T800a-sandbox | src/T8UNE/client/client.ts | import alt from 'alt-client';
import natives from 'natives';
var webview = null;
alt.onServer("T8UNE:client:createWindow", () => { T8UNE_startWebview(); });
alt.on("T8UNE:client:createWindow", () => { T8UNE_startWebview(); });
function T8UNE_startWebview(){
if ( !webview && alt.Player.local.vehicle ){
web... |
Blackbandit1804/altv-T800a-sandbox | src/T8VEH/client/classes/webview.ts | import alt from 'alt-client';
// import natives from 'natives';
// import * as chat from "chat";
// this.wv.unfocus();
// this.wv.destroy();
// this.wv.focus();
/*
webview.unfocus();
webview.destroy();
webview = null;
webviewFocused = false;
lastPos = [];
if ( newped ){
natives.deletePed( newped );
};
newped = nu... |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/client/classes/interactions.ts | <filename>src/T8INT/client/classes/interactions.ts
import alt from 'alt-client';
import natives from 'natives';
import { Raycast, GetDirectionFromRotation, playAnimation } from './utility';
function rotate(ax:number, ay:number, bx:number, by:number, angle:number) {
var rad = (Math.PI / 180) * angle,
cos = Mat... |
Blackbandit1804/altv-T800a-sandbox | src/T8UG/client/client.ts | <filename>src/T8UG/client/client.ts
import alt from 'alt-client';
import natives from 'natives';
// import * as chat from 'chat';
let T8ug_loaded = false;
let webview = null;
let webviewFocused = false;
let lastPos = [];
let newped = null;
function T8ug_handleFromWebview( msg ) {
// chat.pushLine('>> T8UG >> handl... |
Blackbandit1804/altv-T800a-sandbox | src/T8VEH/client/client.ts | import alt from 'alt-client';
import natives from 'natives';
import { T8_webView } from './classes/webview';
/*
const vehJSON = '@SHARED/JSON/vehicles.json';
const vehAdsJSON = '@SHARED/JSON/vehicleAddons.json';
const vehClsJSON = '@SHARED/JSON/vehicleClasses.json';
if( alt.File.exists( vehJSON ) &&... |
Blackbandit1804/altv-T800a-sandbox | src/T8INT/client/classes/interactionObjects.ts | import alt from 'alt-client';
import natives from 'natives';
import * as chat from "chat";
export class InteractionObjects {
private hashes:[] = [];
private hashesGasPump:[] = [];
// nearestObject = { pos: alt.Player.local.pos, rot: alt.Player.local.rot, hash: 0, obj: null };
public nearestObject:Interac... |
arvinall/node-backend-boilerplate | scripts/dev.ts | <reponame>arvinall/node-backend-boilerplate
import { spawn, ChildProcess } from 'child_process'
import path from 'path'
import { watch, FSWatcher } from 'chokidar'
// Paths
const projectDirectory: string = path.join(__dirname, '..')
const sourceDirectory: string = './src'
const indexFile: string = './index.ts'
const d... |
arvinall/node-backend-boilerplate | src/tests/index.test.ts | import test from 'ava'
import td from 'testdouble'
import { getProducts, IProduct } from '../index'
import data from '../data.json'
const fakeProducts: IProduct[] = [
{
id: 0,
name: 'apple',
category: 'fruit',
amount: 5
},
{
id: 1,
name: 'orange',
category: 'fruit',
amount: 10
}... |
arvinall/node-backend-boilerplate | src/index.ts | <gh_stars>0
import { config as configEnv } from 'dotenv'
import data from './data.json'
configEnv()
export interface IProduct {
id: number
name: string
category: string
amount: number
}
export function getProducts (): IProduct[] {
return data.products as IProduct[]
}
console.log('Connecting to %s ...', pr... |
Hatulak/rest-epidemics-news-service | src/comments/dto/update-comment.dto.ts | import { IsNotEmpty, IsOptional } from 'class-validator';
export class UpdateCommentDto {
@IsNotEmpty()
id: string;
@IsOptional()
details: string;
@IsOptional()
nconst: string;
@IsOptional()
newsId: string;
}
|
Hatulak/rest-epidemics-news-service | src/news/news.model.ts | import * as mongoose from 'mongoose';
export enum NewsStatus {
CREATED = 'CREATED',
PUBLISHED = 'PUBLISHED',
}
export const NewsSchema = new mongoose.Schema({
title: { type: String, required: true },
description: { type: String, required: true },
nconst: { type: String, required: true },
cconst: { type: S... |
Hatulak/rest-epidemics-news-service | src/users/dto/user-dto.dto.ts | <reponame>Hatulak/rest-epidemics-news-service
import { UserRole } from '../user.model';
export interface UserDto {
id: string;
username: string;
role: UserRole;
}
|
Hatulak/rest-epidemics-news-service | src/news/news.service.ts | <filename>src/news/news.service.ts<gh_stars>0
import {
Injectable,
NotFoundException,
BadRequestException,
} from '@nestjs/common';
import { News, NewsStatus } from './news.model';
import { CreateNewsDto } from './dto/create-news.dto';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoos... |
Hatulak/rest-epidemics-news-service | src/comments/comments.controller.ts | <filename>src/comments/comments.controller.ts<gh_stars>0
import {
Controller,
Get,
Param,
Post,
UsePipes,
ValidationPipe,
Body,
Put,
Delete,
UseGuards,
Query,
} from '@nestjs/common';
import { CommentsService } from './comments.service';
import { CreateCommentDto } from './dto/create-comment.dto';... |
Hatulak/rest-epidemics-news-service | src/auth/auth.controller.ts | <reponame>Hatulak/rest-epidemics-news-service
import {
Controller,
Post,
Body,
UnauthorizedException,
UseGuards,
UsePipes,
ValidationPipe,
} from '@nestjs/common';
import { AuthService } from './auth.service';
import { LoginUserDto } from 'src/users/dto/login-user.dto';
import { User } from 'src/users/use... |
Hatulak/rest-epidemics-news-service | src/comments/comments.module.ts | <reponame>Hatulak/rest-epidemics-news-service
import { Module } from '@nestjs/common';
import { CommentsService } from './comments.service';
import { CommentsController } from './comments.controller';
import { MongooseModule } from '@nestjs/mongoose';
import { CommentSchema } from './comment.model';
import { NewsSchema... |
Hatulak/rest-epidemics-news-service | src/users/dto/delete-user.dto.ts | <reponame>Hatulak/rest-epidemics-news-service<filename>src/users/dto/delete-user.dto.ts
import { IsNotEmpty } from 'class-validator';
export class DeleteUserDto {
@IsNotEmpty()
password: string;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.