repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
MagnoBelloni/ImpactaAngular4 | src/app/app.module.ts | <filename>src/app/app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { appRoutes } from './rotas/app.routes';... |
MagnoBelloni/ImpactaAngular4 | src/app/menu/menu.component.ts | import {Component} from '@angular/core';
@Component({
moduleId: module.id,
selector: 'menu',
templateUrl: 'views/menu.component.html',
styleUrls: ['./views/menu.component.css']
})
export class MenuComponent{
titulo_escola: string = "Impacta Treinamentos";
titulo_lista: string = "Listagem de Cu... |
MagnoBelloni/ImpactaAngular4 | src/app/classes/interface.card.ts | <filename>src/app/classes/interface.card.ts
export interface ICard{
titulo: string;
descricao: string;
} |
MagnoBelloni/ImpactaAngular4 | src/app/exemplos/Pessoa.ts | <filename>src/app/exemplos/Pessoa.ts
class Pessoa {
static totalDePessoas: number = 0;
constructor(protected nome: string, protected idade: number) {
Pessoa.totalDePessoas += 1;
}
}
class Aluno extends Pessoa {
private curso: string;
constructor(curso: string, nome: string, idade: number)... |
MagnoBelloni/ImpactaAngular4 | src/app/classes/Iinterface.curso.ts | <reponame>MagnoBelloni/ImpactaAngular4
export interface ICurso{
codigo: number;
descricao: string;
ch: number;
} |
MagnoBelloni/ImpactaAngular4 | src/app/filters/sublista.filter.ts | import { Pipe, PipeTransform } from '@angular/core';
import { ICurso } from '../classes/Iinterface.curso';
@Pipe({
name: 'sublista'
})
export class SublistaFilter implements PipeTransform {
transform(cursos: ICurso[], input: string) : ICurso[] {
return cursos.filter(curso => curso.descricao.... |
MagnoBelloni/ImpactaAngular4 | src/app/erro/notFound.component.ts | import {Component} from '@angular/core';
@Component({
template: `
<div class="container margem">
<h1 class="erro">ERRO 404 - Pagina não encontrada</h1>
</div>
`
})
export class NotFoundComponent{} |
MagnoBelloni/ImpactaAngular4 | src/app/cadastro/cadastro.component.ts | <gh_stars>0
import { Component } from '@angular/core';
import { ICurso } from '../classes/Iinterface.curso';
import { FormBuilder } from '@angular/forms';
@Component({
moduleId: module.id,
templateUrl: './views/cadastro.component.html'
})
export class CadastroComponent {
//Simulação definindo apenas um c... |
MagnoBelloni/ImpactaAngular4 | src/app/lista/lista.component.ts | import { Component } from '@angular/core';
import { ICurso } from '../classes/Iinterface.curso';
import { CursosService } from '../services/cursos.service';
@Component({
moduleId: module.id,
templateUrl: 'views/lista.component.html'
})
export class ListaComponent {
apiLink: string = "https://robohash.org/... |
dgigstv/mc-song-animator | src/util.ts | import { Position } from './interface';
export function positionToString (pos: Position) {
return `${pos.x} ${pos.y} ${pos.z}`;
}
|
dgigstv/mc-song-animator | src/guard.ts | import { constants } from './constants';
export function hasInstrumentToBlockMapping (instr: number): instr is keyof (typeof constants.instrumentToBlock) {
return constants.instrumentToBlock[(instr as keyof (typeof constants.instrumentToBlock))] !== undefined;
}
export function hasInstrumentToGlassMapping (instr:... |
dgigstv/mc-song-animator | src/interface.ts | <gh_stars>0
export interface Cache {
lastInstrument: number;
lastKey: number;
}
export interface Mappings {
colors: {
slots: {
[key: number]: Position;
};
};
instruments: {
slots: {
[key: number]: Position;
};
};
noteblocks: {
... |
dgigstv/mc-song-animator | src/constants.ts | export const constants = {
fileHeader: '###############################################\n' +
'# MCFUNCTON file generated by mc-song-animator by DGigsTV.\n' +
'###############################################\n\n',
fileNames: {
animation: 'animation',
main: 'play.mc... |
dgigstv/mc-song-animator | src/index.ts | <filename>src/index.ts<gh_stars>0
#!/usr/bin/env node
import { constants } from './constants';
import path from 'path';
import { Cache, Mappings } from './interface';
import yargs from 'yargs';
import * as nbsViewer from 'nbs-viewer';
import * as fs from 'fs/promises';
import { hasInstrumentToBlockMapping, hasInstrume... |
pepebecker/react-json-editor | src/json-field.tsx | import React, { useCallback, useEffect, useState } from 'react'
import { useDebouncedCallback } from 'use-debounce'
import { camelCase, camelCaseTransformMerge } from 'camel-case'
import {
generateKey,
getType,
insertKeyValueAfter,
renameKey,
replaceInArray,
} from './utils'
import { TypeMap } from './type-m... |
pepebecker/react-json-editor | src/index.test.tsx | <gh_stars>1-10
import JSONEditor from './index'
describe('JSONEditor', () => {
it('is truthy', () => {
expect(JSONEditor).toBeTruthy()
})
})
|
pepebecker/react-json-editor | src/utils.ts | interface AnyMap {
[key: string]: any;
}
interface StringMap {
[key: string]: string;
}
export const generateKey = (defaultName: string, object: AnyMap) => {
let key = defaultName;
let index = 1;
while (key in object) {
key = defaultName + index;
index++;
}
return key;
};
export const insertKey... |
pepebecker/react-json-editor | src/index.tsx | import * as React from 'react'
import getPaths from 'deepdash-es/paths'
import styles from './styles.module.css'
import { createCopy, getPathsTree, isJsonPath } from './utils'
import { TypeMap } from './type-map'
import JSONField from './json-field'
interface Props {
value: any
hiddenPaths?: string[]
hiddenKeys... |
pepebecker/react-json-editor | src/type-map.ts | <gh_stars>1-10
export interface TypeMap {
string?: string
number?: string
boolean?: string
object?: string
array?: string
null?: string
}
|
pepebecker/react-json-editor | src/json-type-selector.tsx | import React from 'react'
interface Props {
type: string
disabled?: boolean
suggestChild?: boolean
onSelect?(value: string): void
}
const JSONTypeSelector = (props: Props) => {
return (
<select
value={props.type}
disabled={props.disabled}
onChange={(ev) => props.onSelect?.(ev.target.va... |
pepebecker/react-json-editor | src/indent.tsx | <gh_stars>1-10
import React from 'react'
interface Props {
depth: number
styles: { [key: string]: string }
children: any
}
const Indent = (props: Props) => {
const styles = props.styles || {}
return Array(props.depth || 0)
.fill(0)
.reduce((children) => {
return <span className={styles.indent}... |
pepebecker/react-json-editor | example/src/App.tsx | <filename>example/src/App.tsx
import React, { useCallback, useState } from 'react'
import { useDebounce } from 'use-debounce'
import JSONEditor from 'react-json-editor'
import 'react-json-editor/dist/index.css'
const initialData = {
name: 'James',
gender: 'male',
age: 26,
student: false,
friends: [
{
... |
Talkaboat/training-room | src/app/shared/header/header.component.ts | <filename>src/app/shared/header/header.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.scss']
})
export class HeaderComponent implements OnInit {
sidebar;
main;
isConnected = false;... |
Talkaboat/training-room | src/app/components/rooms/room-talkaboat/room-talkaboat.component.spec.ts | <filename>src/app/components/rooms/room-talkaboat/room-talkaboat.component.spec.ts
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RoomTalkaboatComponent } from './room-talkaboat.component';
describe('RoomTalkaboatComponent', () => {
let component: RoomTalkaboatComponent;
let fixture: ... |
Talkaboat/training-room | src/app/services/file/file.service.ts | import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { TranslateService } from '../i18n/translate.service';
@Injectable({
providedIn: 'root'
})
export class FileService {
readonly jsonPath = "./assets/json/{0}/{1}{2}"
constructor(private readonly htt... |
Talkaboat/training-room | src/app/services/account/account.service.ts | <filename>src/app/services/account/account.service.ts<gh_stars>0
import { Injectable } from '@angular/core';
import { FileService } from '../file/file.service';
import { TranslateService } from '../i18n/translate.service';
@Injectable({
providedIn: 'root'
})
export class AccountService {
file: string = "tutorial.... |
Talkaboat/training-room | src/app/services/training/training-room.service.spec.ts | import { TestBed } from '@angular/core/testing';
import { TrainingRoomService } from './training-room.service';
describe('TrainingRoomService', () => {
let service: TrainingRoomService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TrainingRoomService);
});
it('shou... |
Talkaboat/training-room | src/app/services/i18n/languages/en.ts | <filename>src/app/services/i18n/languages/en.ts
export const en = {
lang: ' English',
logo: './assets/images/logo.png',
talkaboat_tutorial_intro: 'Welcome to the Talkaboat-tutorial',
documentation: ' Documentation',
team: ' Team',
chapter_overview: 'Chapter Overview',
task: 'Exercise-',
... |
Talkaboat/training-room | src/app/components/rooms/room-talkaboat/room-talkaboat.component.ts | import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-room-talkaboat',
templateUrl: './room-talkaboat.component.html',
styleUrls: ['./room-talkaboat.component.scss']
})
export class RoomTalkaboatComponent implements OnInit {
answers: string[] = ["Talkaboat", "Bitcoin", "Money Moon"];
... |
Talkaboat/training-room | src/app/shared/sidebar/sidebar.component.ts | <gh_stars>0
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { AccountService } from 'src/app/services/account/account.service';
import { TranslateService } from '../../services/i18n/translate.service';
@Component({
selector: 'app-sidebar',
templat... |
Talkaboat/training-room | src/app/services/i18n/translate.service.ts | <filename>src/app/services/i18n/translate.service.ts
import { Injectable } from "@angular/core";
import { en } from "./languages/en";
import { de } from "./languages/de";
import { ActivatedRoute, Router } from '@angular/router';
import { CookieService } from 'ngx-cookie-service';
import { EventEmitter } from "@angular/... |
Talkaboat/training-room | src/app/app.module.ts | import { BrowserModule } from '@angular/platform-browser';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SidebarComponent } from './shared/sidebar/sidebar.component';
import { HeaderCom... |
Talkaboat/training-room | src/app/services/i18n/languages/de.ts | export const de = {
lang: ' Deutsch',
logo: './assets/images/logo.png',
talkaboat_tutorial_intro: 'Willkommen beim Talkaboat-Tutorial',
documentation: ' Dokumentation',
team: ' Team',
chapter_overview: 'Kapitel Übersicht',
task: 'Übung-',
//Talkaboat room
room_talkaboat: 'Alles über... |
Talkaboat/training-room | src/app/components/home/home.component.ts | import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { AccountService } from 'src/app/services/account/account.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class Hom... |
robchambers/hypothetical | src/app/hypothetical.ts | <reponame>robchambers/hypothetical<gh_stars>0
import * as _ from 'lodash';
import Taxee from 'taxee-tax-statistics';
console.log(Taxee);
// export enum MaritalStatusEnum {
// SINGLE, MARRIED, MARRIED_SEPARATELY, HEAD_OF_HOUSEHOLD
// }
export class Baseline {
constructor(public income :number = 50000,
... |
robchambers/hypothetical | src/app/app.component.ts | <reponame>robchambers/hypothetical
import { Component, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms'
import { DataModelService } from './data-model.service';
import { ModalDirective } from 'ng2-bootstrap';
import * as hypothetical from './hypothetical';
import * as _ from 'lodash';
@Compon... |
robchambers/hypothetical | src/app/data-model.service.ts | <reponame>robchambers/hypothetical
import { Injectable } from '@angular/core';
import * as hypothetical from './hypothetical';
import * as _ from 'lodash';
/**
* Store input/output data corresonding to a single baseline and associated hypotheticals.
*
* Functionality should eventually include:
* * Save/load for ... |
robchambers/hypothetical | src/types/taxee-tax-statistics/index.d.ts | declare module 'taxee-tax-statistics';
|
robchambers/hypothetical | src/app/hypothetical.spec.ts | <filename>src/app/hypothetical.spec.ts
/* tslint:disable:no-unused-variable */
import * as hypothetical from './hypothetical.ts';
describe('Hypothetical Classes', () => {
beforeEach(() => {
});
// it('should properly handle no delta.', () => {
// let baseline = new hypothetical.Baseline();
// expect(b... |
mariotaku/nk-spritegen | src/index.ts | #!/usr/bin/env node
import fs from 'fs';
import { Bin, IOption, MaxRectsPacker, Rectangle } from 'maxrects-packer';
import path from 'path';
import sharp, { OutputInfo, OverlayOptions } from 'sharp';
import { promisify } from 'util';
import yargs from 'yargs';
const { hideBin } = require('yargs/helpers');
const readd... |
Daphne-dev/nestjs-typeorm-graphql-example | src/users/users.resolver.ts | import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
import {
CreateAccountInput,
CreateAccountOutput,
} from './dtos/create-account.dto';
import { UserProfileInput, UserProfileOutput } from './dtos/user-profile.dto';
import { User } from './entities/user.entity';
import { UsersService } from './users... |
Daphne-dev/nestjs-typeorm-graphql-example | src/users/users.service.ts | <gh_stars>0
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import {
CreateAccountInput,
CreateAccountOutput,
} from './dtos/create-account.dto';
import { UserProfileOutput } from './dtos/user-profile.dto';
import { User } from '... |
bonomat/droplet | extension/src/components/SwapItem.tsx | <filename>extension/src/components/SwapItem.tsx<gh_stars>0
import { Box, Center, Flex, Grid, GridItem, Image, Spacer, Text } from "@chakra-ui/react";
import React from "react";
import { BTC_TICKER, TradeSide, USDT_TICKER } from "../models";
import Bitcoin from "./bitcoin.svg";
import Usdt from "./tether.svg";
interfac... |
bonomat/droplet | extension/src/options/index.tsx | <gh_stars>10-100
import { ChakraProvider } from "@chakra-ui/react";
import React from "react";
import ReactDOM from "react-dom";
import theme from "../theme";
import Options from "./Options";
ReactDOM.render(
<React.StrictMode>
<ChakraProvider theme={theme}>
<Options />
</ChakraProvider... |
bonomat/droplet | extension/src/messages.ts | <filename>extension/src/messages.ts
export enum MessageKind {
WalletStatusRequest = "WalletStatusRequest",
WalletStatusResponse = "WalletStatusResponse",
SellRequest = "SellRequest",
SellResponse = "SellResponse",
BuyRequest = "BuyRequest",
BuyResponse = "BuyResponse",
LoanRequest = "LoanReq... |
bonomat/droplet | waves/src/App.tsx | <gh_stars>0
import { Box, Button, Center, HStack, Image, useToast, VStack } from "@chakra-ui/react";
import Debug from "debug";
import React, { useEffect, useReducer } from "react";
import { useAsync } from "react-async";
import { useSSE } from "react-hooks-sse";
import { Link as RouteLink, Redirect, Route, Switch, use... |
bonomat/droplet | waves/src/components/RateInfo.tsx | <filename>waves/src/components/RateInfo.tsx<gh_stars>10-100
import { Box, Text } from "@chakra-ui/react";
import React from "react";
import { Rate } from "../App";
interface RateInfoProps {
rate: Rate;
direction: "ask" | "bid";
}
function RateInfo({ rate, direction }: RateInfoProps) {
switch (direction) {... |
bonomat/droplet | extension/src/components/ConfirmSwap.tsx | <gh_stars>0
import { Box, Button, Heading } from "@chakra-ui/react";
import React from "react";
import { useAsync } from "react-async";
import { signAndSendSwap } from "../background-proxy";
import { SwapToSign } from "../models";
import YouSwapItem from "./SwapItem";
interface ConfirmSwapProps {
onCancel: (tabId:... |
bonomat/droplet | extension/src/wasmProxy.ts | import Debug from "debug";
import { Address, BalanceUpdate, CreateSwapPayload, LoanDetails, Status, Trade, Txid, WalletStatus } from "./models";
Debug.enable("*");
const debug = Debug("wasmProxy");
export async function walletStatus(name: string): Promise<WalletStatus> {
const { wallet_status } = await import("./... |
bonomat/droplet | extension/src/background-proxy.ts | import { browser } from "webextension-polyfill-ts";
import { Address, BalanceUpdate, LoanDetails, LoanToSign, SwapToSign, Txid, WalletStatus } from "./models";
const proxy = browser.extension.getBackgroundPage();
export async function getAddress(): Promise<Address> {
// @ts-ignore
return proxy.getAddress();
}... |
bonomat/droplet | extension/src/background/index.ts | <filename>extension/src/background/index.ts<gh_stars>0
import Debug from "debug";
import { browser } from "webextension-polyfill-ts";
import { Direction, Message, MessageKind } from "../messages";
import { LoanDetails, LoanToSign, SwapToSign } from "../models";
import {
createWallet,
extractLoan,
extractTra... |
bonomat/droplet | waves/src/calculateBetaAmount.test.tsx | import { Asset } from "./App";
import calculateBetaAmount from "./calculateBetaAmount";
test("bid amount", () => {
const rate = {
bid: 1900,
ask: 2000,
};
const alpha = Asset.LBTC;
const alphaAmount = 1.0;
const expectedBetaAmount = 1900;
const betaAmount = calculateBetaAmount... |
bonomat/droplet | extension/src/index.tsx | import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import "./index.css";
function checkLogger() {
const debugSettings = localStorage.getItem("debug");
if (debugSettings) {
// `debug` var set: we honor existing settings and do not overwrite them.
return;
}
... |
bonomat/droplet | waves/src/components/NumberInput.tsx | import { InputGroup, InputLeftAddon, NumberInputField, NumberInputStepper } from "@chakra-ui/react";
import { NumberInput as CUINumberInput } from "@chakra-ui/react";
import React from "react";
type StringOrNumber = string | number;
function NumberInput({ currency, value, onAmountChange, precision, step, isDisabled, ... |
bonomat/droplet | extension/src/components/ConfirmLoan.tsx | import { Box, Button, Flex, Heading, Image, Spacer, Text } from "@chakra-ui/react";
import React from "react";
import { useAsync } from "react-async";
import { signLoan } from "../background-proxy";
import { LoanToSign, USDT_TICKER } from "../models";
import YouSwapItem from "./SwapItem";
import Usdt from "./tether.svg... |
bonomat/droplet | waves/src/calculateBetaAmount.tsx | import { Asset, Rate } from "./App";
/**
* returns a (beta) amount based on alphaAsset, amount and rate.
* Currently only BTC and USDT are accepted
* @param alphaAsset needs to be either AssetType.BTC or AssetType.USDT
* @param amount the alpha amount is used as the multiplicand
* @param rate depicts a bid and as... |
bonomat/droplet | extension/src/options/Options.tsx | import {
Box,
Button,
Center,
FormControl,
FormLabel,
HStack,
Input,
InputGroup,
InputRightElement,
Radio,
RadioGroup,
VStack,
} from "@chakra-ui/react";
import Debug from "debug";
import { useState } from "react";
import * as React from "react";
import "./Options.css";
... |
bonomat/droplet | waves/src/Bobtimus.tsx | <reponame>bonomat/droplet
import Debug from "debug";
import React, { ReactElement } from "react";
import { SSEProvider } from "react-hooks-sse";
import { CreateSwapPayload, LoanRequestPayload } from "./waves-provider/wavesProvider";
const debug = Debug("bobtimus");
export async function fundAddress(address: string): ... |
bonomat/droplet | waves/src/components/AssetSelect.tsx | <reponame>bonomat/droplet<filename>waves/src/components/AssetSelect.tsx<gh_stars>10-100
import { ChevronDownIcon } from "@chakra-ui/icons";
import {
Box,
Button,
Drawer,
DrawerBody,
DrawerContent,
DrawerHeader,
DrawerOverlay,
Grid,
HStack,
Image,
Modal,
ModalBody,
Mod... |
bonomat/droplet | waves/src/index.tsx | import { ChakraProvider } from "@chakra-ui/react";
import Debug from "debug";
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import App from "./App";
import { BobtimusRateProvider } from "./Bobtimus";
import "./index.css";
import reportWebVitals from "./re... |
bonomat/droplet | e2e_tests/src/e2e.test.ts | import * as assert from "assert";
import Debug from "debug";
import fetch from "node-fetch";
import { Builder, By, until } from "selenium-webdriver";
const firefox = require("selenium-webdriver/firefox");
const firefoxPath = require("geckodriver").path;
const getElementById = async (driver, xpath, timeout = 4000) => ... |
bonomat/droplet | waves/src/App.test.tsx | import { act, render, screen } from "@testing-library/react";
import React from "react";
import { Listener, Source, SSEProvider } from "react-hooks-sse";
import { BrowserRouter } from "react-router-dom";
import App, { Asset, reducer } from "./App";
import calculateBetaAmount from "./calculateBetaAmount";
const default... |
bonomat/droplet | extension/src/in-page/index.ts | <reponame>bonomat/droplet
import Debug from "debug";
import { Direction, Message, MessageKind } from "../messages";
import { Address, CreateSwapPayload, LoanRequestPayload, Tx, Txid, WalletStatus } from "../models";
Debug.enable("*");
const debug = Debug("inpage");
export default class WavesProvider {
public asyn... |
bonomat/droplet | extension/src/contentScript/index.ts | import Debug from "debug";
import { browser } from "webextension-polyfill-ts";
import { Direction, Message } from "../messages";
Debug.enable("*");
const debug = Debug("content");
debug("Hello world from content script");
async function forwardToBackground(message: Message<any>): Promise<Message<any>> {
try {
... |
bonomat/droplet | waves/src/components/ExchangeIcon.tsx | import { IconButton } from "@chakra-ui/react";
import React from "react";
import { TiArrowSync } from "react-icons/ti";
interface ExchangeIconProps {
onClick: () => void;
dataCy: string;
}
export default function ExchangeIcon({ onClick, dataCy }: ExchangeIconProps) {
return (
<IconButton
... |
Alino/TAPICC-API-implementation | api/models/Job.ts | /**
* Job.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
id: {
type: 'integer',
autoIncrement: true,
uni... |
Alino/TAPICC-API-implementation | api/controllers/InputController.ts | /**
* InputController
*
* @description :: Server-side logic for managing Inputs
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
import { Model } from 'sails-typings';
declare var Input: Model;
declare var sails;
const path = require('path');
module.exports = {
'uploadFile': (r... |
Alino/TAPICC-API-implementation | api/controllers/IndexController.ts | <gh_stars>1-10
declare var Job, Input, Task, Account;
module.exports = {
'index': (req, res) => {
let JobsCount, InputsCount, TasksCount, AccountsCount;
Job.count()
.then((val) => {
JobsCount = val;
return Input.count();
})
.then((val) => {
... |
Alino/TAPICC-API-implementation | api/models/Input.ts | <reponame>Alino/TAPICC-API-implementation
/**
* Input.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
id: {
type: 'in... |
Alino/TAPICC-API-implementation | api/controllers/JobController.ts | <filename>api/controllers/JobController.ts
/**
* JobController
*
* @description :: Server-side logic for managing jobs
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
module.exports = {
};
|
Alino/TAPICC-API-implementation | api/models/Task.ts | <reponame>Alino/TAPICC-API-implementation
/**
* Task.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
export = {
attributes: {
id: {
type: 'integer',
... |
Alino/TAPICC-API-implementation | api/models/Webhook.ts | <filename>api/models/Webhook.ts
/**
* Webhook.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
id: {
type: 'integer',
... |
Alino/TAPICC-API-implementation | api/controllers/TaskController.ts | /**
* TaskController
*
* @description :: Server-side logic for managing tasks
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
import { Model } from 'sails-typings';
declare var Task: Model;
declare var sails;
const path = require('path');
module.exports = {
'uploadFile... |
APDF-blockchain/blockchain | src/proof-of-work/proof-of-work.ts | // These functions were taken from https://lhartikk.github.io/jekyll/update/2017/07/13/chapter2.html
// in seconds
import { Utils } from '../utils/utils';
import { Block } from '../block-chain/block';
export class ProofOfWork {
// in seconds
private BLOCK_GENERATION_INTERVAL: number = 10;
// in blocks
... |
APDF-blockchain/blockchain | src/main.ts | // This code was cloned from the "Simple Miner with Proof-of-Work in JS Extended" exercise 6 from
// MI1OD: Blockchain Essentials - USA Self-paced Sept 2019 assignment
//import CryptoJS from 'Crypto-js';
import express from 'express';
import bodyParser from 'body-parser';
import WebSocket from 'ws';
import { Block } ... |
APDF-blockchain/blockchain | src/block-chain/block-chain.ts | // This code was cloned from the "Simple Miner with Proof-of-Work in JS Extended" exercise 6 from
// MI1OD: Blockchain Essentials - USA Self-paced Sept 2019 assignment
import CryptoJS from 'Crypto-js';
//import express from 'express';
//import bodyParser from 'body-parser';
//import WebSocket from 'ws';
import { Bloc... |
APDF-blockchain/blockchain | src/sign-transaction/ethereum-hd-wallet.ts | <gh_stars>1-10
// import jQuery from "jquery";
// window.$ = window.jQuery = jQuery;
// 1A) Restore HD Wallet from Existing Mnemonic
const ethers = require('ethers');
function restoreHDNode(mnemonic) {
return ethers.utils.HDNode.fromMnemonic(mnemonic);
}
let mnemonic = "upset fuel enhance depart portion hope co... |
APDF-blockchain/blockchain | src/main copy.ts | // This code was cloned from the "Simple Miner with Proof-of-Work in JS Extended" exercise 6 from
// MI1OD: Blockchain Essentials - USA Self-paced Sept 2019 assignment
import CryptoJS from 'Crypto-js';
import express from 'express';
import bodyParser from 'body-parser';
import WebSocket from 'ws';
const http_port = p... |
APDF-blockchain/blockchain | src/block-chain/block.ts | <filename>src/block-chain/block.ts
export class Block {
public index: number;
public hash: string;
public previousHash: string;
public timestamp: number;
public data: any;
public difficulty: number;
public nonce: number
constructor(_index: number, _hash: string, _previousHash: string, _... |
Salwan/salwan.github.io | other/smb1/smb1/main.ts | /// <reference path="../phaser262/typescript/phaser.d.ts" />
import '../phaser262/build/phaser.min.js';
const WIDTH = 512.0;
const HEIGHT = 480.0;
const RESMULX = 2.0;
const RESMULY = 2.0;
const GRAVITY = 16 * 220;
const MAX_SPEED = 16 * 40;
const COLOR_SKY = 0x5c94fc;
const COLOR_BLACK = 0x000000... |
YoussefSalahHan/Auth0Disqus | node_modules/ngx-disqus/module/disqus.model.d.ts | <filename>node_modules/ngx-disqus/module/disqus.model.d.ts
export interface DisqusComment {
id: number;
name: string;
}
export interface DisqusReady {
height: number;
}
|
YoussefSalahHan/Auth0Disqus | src/app/app.routes.ts | import { Routes } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { CallbackComponent } from './callback/callback.component';
import { ProductComponent } from './product/product.component';
import { ProfileComponent } from './profile/profile.component';
import { TestComponent } fro... |
YoussefSalahHan/Auth0Disqus | node_modules/ngx-disqus/ngx-disqus.d.ts | <reponame>YoussefSalahHan/Auth0Disqus
/**
* Generated bundle index. Do not edit.
*/
export * from './index';
export { DisqusComponent as ɵb } from './module/disqus.component';
export { DisqusService as ɵa } from './module/disqus.service';
|
YoussefSalahHan/Auth0Disqus | node_modules/ngx-disqus/module/lib.module.d.ts | import { ModuleWithProviders, InjectionToken } from '@angular/core';
import { DisqusService } from './disqus.service';
/** Initialize Disqus with shortname */
export declare function DisqusFactory(shortname: string): DisqusService;
export declare const SHORTNAME: InjectionToken<string>;
export declare class DisqusModul... |
YoussefSalahHan/Auth0Disqus | node_modules/ngx-disqus/module/disqus.component.d.ts | <filename>node_modules/ngx-disqus/module/disqus.component.d.ts
import { OnChanges, OnDestroy, Renderer2, ElementRef, EventEmitter } from '@angular/core';
import { DisqusService } from './disqus.service';
import { DisqusComment, DisqusReady } from './disqus.model';
export declare class DisqusComponent implements OnChang... |
YoussefSalahHan/Auth0Disqus | node_modules/ngx-disqus/module/disqus.service.d.ts | export declare class DisqusService {
shortname: string;
constructor(shortname: string);
readonly window: any;
}
|
Effeppi/pesda-cloud-config-client | src/model/index.ts | export * from './module-configuration'
export * from './server-response' |
Effeppi/pesda-cloud-config-client | src/model/module-configuration.ts | <gh_stars>1-10
export interface Configuration {
serverConfig: ServerConfiguration,
errorConfig: ErrorConfiguration,
loggerConfig: LoggerConfig,
}
export interface ServerConfiguration {
applicationName: string,
baseUri: string,
profile?: string,
label?: string,
}
export interface ErrorConf... |
Effeppi/pesda-cloud-config-client | src/util/index.ts | export * from './log'
export * from './retry-strategy'
export * from './url'
|
Effeppi/pesda-cloud-config-client | src/model/server-response.ts | export interface PropertySources {
name: string,
source: Source
}
export interface SpringCloudConfigServerResponse {
name: string,
profiles: string[],
label: string,
version: string,
state: string,
propertySources: PropertySources[]
}
export interface Source {
[key: string]: any,
} |
Effeppi/pesda-cloud-config-client | src/service/property-sources.ts | <filename>src/service/property-sources.ts
import axios, { AxiosRequestConfig } from 'axios'
import { of, Observable } from 'rxjs';
import { retryWhen, map, catchError, take } from 'rxjs/operators';
import { SpringCloudConfigServerResponse, PropertySources } from '../model';
import { Logger, retryStrategy$ } from '../ut... |
Effeppi/pesda-cloud-config-client | src/service/index.ts | export * from './property-sources'
|
Effeppi/pesda-cloud-config-client | src/util/log.ts | import { LoggerConfig, LoggerLevel } from "../model";
import { LogConfiguration } from '../context';
enum LogColor {
error = '\x1b[31m%s\x1b[0m',
debug = '\x1b[36m%s\x1b[0m',
info = "\x1b[0m%s\x1b[0m"
}
interface LogConfig {
label: string,
color: LogColor
}
const PROJECT_NAME = 'pesda-cloud-confi... |
Effeppi/pesda-cloud-config-client | src/context/index.ts | <filename>src/context/index.ts<gh_stars>1-10
export * from './client-config'
export * from './env-enum'
export * from './log-config'
|
Effeppi/pesda-cloud-config-client | src/context/log-config.ts | <reponame>Effeppi/pesda-cloud-config-client
import { LoggerConfig, LoggerLevel } from "../model";
import { Environment } from "./env-enum";
export class LogConfiguration {
private static _instance: LogConfiguration;
private _options: LoggerConfig = { enabled: false };
private constructor() {
... |
Effeppi/pesda-cloud-config-client | src/context/env-enum.ts | export enum Environment {
'APPLICATION_NAME' = 'PCCC_APPLICATION_NAME',
'BASE_URI' = 'PCCC_BASE_URI',
'PROFILE' = 'PCCC_PROFILE',
'LABEL' = 'PCCC_LABEL',
'FAIL_FAST' = 'PCCC_FAIL_FAST',
'MAX_RETRY_ATTEMPTS' = 'PCCC_MAX_RETRY_ATTEMPTS',
'SCALING_DURATION' = 'PCCC_SCALING_DURATION_MS',
... |
Effeppi/pesda-cloud-config-client | src/util/retry-strategy.ts | import { Observable, throwError, timer } from 'rxjs';
import { mergeMap } from 'rxjs/operators';
import { RetryStrategyConfig } from '../model';
import { Logger } from '../util';
export const retryStrategy$ = (cfg: RetryStrategyConfig) => (attempts: Observable<any>) => {
return attempts.pipe(
mergeMap((error, i)... |
Effeppi/pesda-cloud-config-client | src/context/client-config.ts | import { ServerConfiguration, ErrorConfiguration, RetryStrategyConfig } from "../model";
import { Environment } from "./env-enum";
import { isURL } from "../util";
export class ClientConfiguration {
private readonly DEFAULT_MAX_RETRY_ATTEMPTS = 6;
private readonly DEFAULT_SCALING_DURATION = 1000;
private... |
Effeppi/pesda-cloud-config-client | src/util/url.ts | <reponame>Effeppi/pesda-cloud-config-client<filename>src/util/url.ts
export function isURL(target: string) {
var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|'+ // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
'(\\:\\d+)?(\\/[... |
devIkuJS/native-script-demo | src/app/services/shared.service.ts | <reponame>devIkuJS/native-script-demo
import { Injectable } from '@angular/core';
import {throwError } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class SharedService {
errorHandl(error) {
let errorMessage = '';
if(error.error instanceof ErrorEvent) {
// Error lado cliente
errorMe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.