repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
nakatamaho/qni | packages/simulator/src/state-vector.ts | <gh_stars>10-100
import {Complex, DetailedError} from '@qni/common'
import {Matrix} from './matrix'
export class StateVector {
public matrix: Matrix
public size: number
public nqubit: number
get bra(): Matrix {
return this.matrix.adjoint()
}
get ket(): Matrix {
return this.matrix
}
construct... |
nakatamaho/qni | packages/common/src/swap-gate.ts | export const SerializedSwapGateType = 'Swap'
export type SerializedSwapGate = {
type: typeof SerializedSwapGateType
targets: [number, number]
controls?: number[]
}
|
nakatamaho/qni | packages/simulator/src/index.ts | export * from './matrix'
export * from './simulator'
export * from './state-vector'
export * from './util'
|
nakatamaho/qni | packages/common/src/h-gate.ts | export const SerializedHGateType = 'H'
export type SerializedHGate = {
type: typeof SerializedHGateType
targets: number[]
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/elements/src/control-gate-element.ts | import {
ActivateableMixin,
DisableableMixin,
DraggableMixin,
HelpableMixin,
HoverableMixin,
IconableMixin,
MenuableMixin
} from './mixin/'
import {html, render} from '@github/jtml'
import {SerializedControlGateType} from '@qni/common'
import controlGateIcon from '../icon/control-gate.svg'
import {control... |
nakatamaho/qni | packages/common/src/z-gate.ts | <reponame>nakatamaho/qni
export const SerializedZGateType = 'Z'
export type SerializedZGate = {
type: typeof SerializedZGateType
targets: number[]
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/common/src/control-gate.ts | <filename>packages/common/src/control-gate.ts
export const SerializedControlGateType = '•'
export type SerializedControlGate = {
type: typeof SerializedControlGateType
targets: number[]
}
|
nakatamaho/qni | packages/simulator/src/util.ts | export function round(n: number, decimal: number): number {
return Math.round(n * Math.pow(10, decimal)) / Math.pow(10, decimal)
}
|
nakatamaho/qni | packages/common/src/rz-gate.ts | <gh_stars>10-100
export const SerializedRzGateType = 'Rz'
export type SerializedRzGate = {
type: typeof SerializedRzGateType
targets: number[]
angle?: string
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/elements/src/z-gate-element.ts | import {
ActivateableMixin,
DisableableMixin,
DraggableMixin,
HelpableMixin,
HoverableMixin,
IconableMixin,
IfableMixin,
MenuableMixin
} from './mixin/'
import {html, render} from '@github/jtml'
import {ControllableMixin} from './mixin/controllable'
import {SerializedZGateType} from '@qni/common'
import... |
nakatamaho/qni | packages/common/src/format.ts | type UnicodeFraction = {character: string; ref: string; value: number}
/**
* Copyright 2017 Google Inc.
*
* 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/l... |
nakatamaho/qni | packages/elements/src/mixin/constructor.ts | export type Constructor<T = unknown> = new (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...args: any[]
) => T
|
nakatamaho/qni | packages/elements/src/inspector-button-element.ts | <reponame>nakatamaho/qni
import {Angleable, Ifable} from './mixin'
import {Operation, isOperation} from './operation'
import {html, render} from '@github/jtml'
import tippy, {Instance as TippyInstance} from 'tippy.js'
import {Flaggable} from './mixin/flaggable'
import {OperationInspectorElement} from './operation-inspe... |
nakatamaho/qni | packages/elements/src/circle-notation-element.ts | import {Complex, Util} from '@qni/common'
import {TemplateResult, html, render} from '@github/jtml'
import {attr, controller, targets} from '@github/catalyst'
import tippy, {Instance, ReferenceElement, createSingleton, roundArrow} from 'tippy.js'
export class CircleNotationElement extends HTMLElement {
@attr qubitCo... |
nakatamaho/qni | packages/common/src/bloch-display.ts | export const SerializedBlochDisplayType = 'Bloch'
export type SerializedBlochDisplay = {
type: typeof SerializedBlochDisplayType
targets: number[]
}
|
nakatamaho/qni | packages/elements/src/util.ts | export function isNumeric(value: string) {
return /^-?\d+$/.test(value)
}
|
nakatamaho/qni | packages/common/test/angle-parser.ts | <gh_stars>10-100
/* eslint-env qunit */
import {
angleDenominator,
angleNumerator,
isAngleGreaterThan,
isAngleLessThan,
isValidAngle,
radian,
reduceAngle
} from '../src/angle-parser'
QUnit.module('angle-parser', () => {
QUnit.module('radian', () => {
QUnit.test('0', assert => {
assert.equal(... |
nakatamaho/qni | packages/elements/src/angle-slider-element.ts | import {DetailedError, Util, angleDenominator, describe, radian as radianOf} from '@qni/common'
import {Interpreter, createMachine, interpret} from 'xstate'
import {attr, controller} from '@github/catalyst'
import {html, render} from '@github/jtml'
import {InteractEvent} from '@interactjs/types'
import interact from 'i... |
nakatamaho/qni | packages/simulator/test/util.ts | import {ArrayIsh, Complex, describe, equate, hasOwnProperty} from '@qni/common'
export function isEqualTo(subject: unknown, other: unknown): boolean {
return equate(subject, other)
}
export function isApproximatelyEqualTo(subject: unknown, other: unknown, epsilon = 0.000001): boolean {
return isApproximatelyEqual... |
nakatamaho/qni | packages/common/src/phase-gate.ts | <gh_stars>10-100
export const SerializedPhaseGateType = 'P'
export type SerializedPhaseGate = {
type: typeof SerializedPhaseGateType
angle?: string
targets: number[]
controls?: number[]
if?: string
}
|
nakatamaho/qni | apps/www/app/javascript/controllers/share_controller.ts | <reponame>nakatamaho/qni
import {Controller} from '@hotwired/stimulus'
class Util {
static updateUrlJson(json: string): void {
history.pushState('', '', encodeURIComponent(json))
}
static get urlJson(): string {
const json = window.location.href.toString().split(window.location.host)[1].slice(1)
ret... |
nakatamaho/qni | packages/common/src/index.ts | <reponame>nakatamaho/qni
export * from './angle-parser'
export * from './complex'
export * from './describe'
export * from './detailed-error'
export * from './equate'
export * from './format'
export * from './util'
export * from './h-gate'
export * from './x-gate'
export * from './y-gate'
export * from './z-gate'
expo... |
nakatamaho/qni | packages/elements/src/mixin/index.ts | <reponame>nakatamaho/qni
export * from './activateable'
export * from './angleable'
export * from './controllable'
export * from './disableable'
export * from './draggable'
export * from './flaggable'
export * from './helpable'
export * from './hoverable'
export * from './iconable'
export * from './ifable'
export * fro... |
nakatamaho/qni | packages/common/test/describe.ts | <reponame>nakatamaho/qni<filename>packages/common/test/describe.ts
/* eslint-env qunit */
import {describe} from '../src'
QUnit.module('describe', () => {
class DescribableClass {
private x: number
constructor() {
this.x = 1
}
}
class DescribedClass {
private x: number
constructor()... |
nakatamaho/qni | packages/elements/src/mixin/iconable.ts | import {TemplateResult, html} from '@github/jtml'
import {Constructor} from './constructor'
import {attr} from '@github/catalyst'
export declare class Iconable {
get icon(): string
set icon(value: string)
iconHtml(svg: string): TemplateResult
}
export function IconableMixin<TBase extends Constructor<HTMLElement... |
nakatamaho/qni | packages/elements/src/circuit-editor-element.ts | import {Angleable, Flaggable, Ifable, isAngleable, isIfable, isMenuable} from './mixin'
import {CircuitStepElement, isCircuitStepElement} from './circuit-step-element'
import {Interpreter, createMachine, interpret} from 'xstate'
import {Operation, isOperation} from './operation'
import {Util, describe} from '@qni/commo... |
nakatamaho/qni | packages/elements/src/@types/@interactjs/index.d.ts | declare module '@interactjs'
declare module '@interactjs/interact'
|
nakatamaho/qni | packages/common/src/complex.ts | <filename>packages/common/src/complex.ts
/**
* Copyright 2017 Google Inc.
*
* 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/LICENSE-2.0
*
* Unles... |
nakatamaho/qni | packages/common/src/rnot-gate.ts | export const SerializedRnotGateType = 'X^½'
export type SerializedRnotGate = {
type: typeof SerializedRnotGateType
targets: number[]
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/common/src/circuit-step.ts | <gh_stars>10-100
import {SerializedBlochDisplay} from './bloch-display'
import {SerializedControlGate} from './control-gate'
import {SerializedHGate} from './h-gate'
import {SerializedMeasurementGate} from './measurement-gate'
import {SerializedPhaseGate} from './phase-gate'
import {SerializedRnotGate} from './rnot-gat... |
nakatamaho/qni | packages/common/src/x-gate.ts | <reponame>nakatamaho/qni
export const SerializedXGateType = 'X'
export type SerializedXGate = {
type: typeof SerializedXGateType
targets: number[]
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/elements/src/mixin/angleable.ts | <gh_stars>10-100
import {Constructor} from './constructor'
import {attr} from '@github/catalyst'
export declare class Angleable {
get angle(): string
set angle(value: string)
get reducedAngle(): string
set reducedAngle(value: string)
}
export const isAngleable = (arg: unknown): arg is Angleable =>
typeof ar... |
nakatamaho/qni | packages/elements/src/circuit-step-element.ts | <reponame>nakatamaho/qni
import {
DetailedError,
SerializedCircuitStep,
SerializedHGate,
SerializedMeasurementGate,
SerializedPhaseGate,
SerializedRnotGate,
SerializedRxGate,
SerializedRyGate,
SerializedRzGate,
SerializedSwapGate,
SerializedTGate,
SerializedXGate,
SerializedYGate,
Serialized... |
nakatamaho/qni | packages/elements/src/operation.ts | <reponame>nakatamaho/qni
import {BlochDisplayElement} from './bloch-display-element'
import {ControlGateElement} from './control-gate-element'
import {HGateElement} from './h-gate-element'
import {MeasurementGateElement} from './measurement-gate-element'
import {PhaseGateElement} from './phase-gate-element'
import {Rno... |
nakatamaho/qni | packages/simulator/src/matrix.ts | <filename>packages/simulator/src/matrix.ts
import {Complex, DetailedError, Format, Util, radian} from '@qni/common'
import {Eq} from 'fp-ts/number'
import {isNonEmpty} from 'fp-ts/lib/Array'
import {range} from 'fp-ts/NonEmptyArray'
import {uniq} from 'fp-ts/lib/ReadonlyNonEmptyArray'
export class Matrix {
static re... |
nakatamaho/qni | packages/common/src/rx-gate.ts | export const SerializedRxGateType = 'Rx'
export type SerializedRxGate = {
type: typeof SerializedRxGateType
targets: number[]
angle?: string
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/common/src/ry-gate.ts | export const SerializedRyGateType = 'Ry'
export type SerializedRyGate = {
type: typeof SerializedRyGateType
targets: number[]
angle?: string
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/elements/src/bloch-display-element.ts | import {ActivateableMixin, DraggableMixin, HelpableMixin, HoverableMixin, MenuableMixin} from './mixin/'
import {SerializedBlochDisplayType, Util} from '@qni/common'
import {attr, controller, target, targets} from '@github/catalyst'
import {html, render} from '@github/jtml'
import tippy, {Instance as TippyInstance, Ref... |
nakatamaho/qni | packages/common/test/complex.ts | <reponame>nakatamaho/qni
/* eslint-env qunit */
import {Complex} from '../src/complex'
import {Format} from '../src/format'
QUnit.module('Complex', () => {
QUnit.test('isEqualTo', assert => {
const c = new Complex(5, 7)
assert.equates(c, c)
assert.notEquates(c, null)
assert.notEquates(c, '')
as... |
nakatamaho/qni | packages/elements/src/measurement-gate-element.ts | import {ActivateableMixin, DraggableMixin, HelpableMixin, HoverableMixin, IconableMixin, MenuableMixin} from './mixin/'
import {attr, controller} from '@github/catalyst'
import {html, render} from '@github/jtml'
import {FlaggableMixin} from './mixin/flaggable'
import {SerializedMeasurementGateType} from '@qni/common'
i... |
nakatamaho/qni | packages/common/test/qunit-custom-assertions.ts | <reponame>nakatamaho/qni
import {equate} from '../src/equate'
import {isApproximatelyEqualToHelper} from './util'
declare global {
interface Assert {
equates: (subject: unknown, other: unknown, message?: string) => void
notEquates: (subject: unknown, other: unknown) => void
approximatelyEquates: (subject... |
nakatamaho/qni | packages/common/src/t-gate.ts | export const SerializedTGateType = 'T'
export type SerializedTGate = {
type: typeof SerializedTGateType
targets: number[]
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/elements/src/palette-dropzone-element.ts | <gh_stars>0
import {Interpreter, createMachine, interpret} from 'xstate'
import {Operation, isOperation} from './operation'
import {attr, controller} from '@github/catalyst'
import {html, render} from '@github/jtml'
import {isHelpable} from './mixin'
type PaletteDropzoneContext = Record<string, never>
type PaletteDrop... |
nakatamaho/qni | packages/elements/src/circuit-block-element.ts | import {attr, controller} from '@github/catalyst'
import {html, render} from '@github/jtml'
@controller
export class CircuitBlockElement extends HTMLElement {
@attr comment = ''
@attr finalized = false
finalize(): void {
this.finalized = true
}
connectedCallback(): void {
this.attachShadow({mode: '... |
nakatamaho/qni | packages/common/src/util.ts | /**
* Copyright 2017 Google Inc.
*
* 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/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
nakatamaho/qni | packages/elements/src/quantum-circuit-element.ts | import {CircuitDropzoneElement, isCircuitDropzoneElement} from './circuit-dropzone-element'
import {CircuitStepElement, isCircuitStepElement} from './circuit-step-element'
import {HGateElement, HGateElementProps} from './h-gate-element'
import {Interpreter, createMachine, interpret} from 'xstate'
import {PhaseGateEleme... |
nakatamaho/qni | packages/elements/src/mixin/flaggable.ts | <reponame>nakatamaho/qni
import {Constructor} from './constructor'
import {attr} from '@github/catalyst'
export declare class Flaggable {
get flag(): string
set flag(value: string)
}
export const isFlaggable = (arg: unknown): arg is Flaggable =>
typeof arg === 'object' && arg !== null && typeof (arg as Flaggabl... |
nakatamaho/qni | packages/simulator/test/state-vector.ts | import {Matrix, StateVector} from '../src/'
import {Complex} from '@qni/common'
QUnit.module('StateVector', () => {
let stateVector: StateVector
QUnit.module('creation', () => {
QUnit.test('|0>', assert => {
stateVector = new StateVector('0')
assert.equal(stateVector.toString(), '{{1}, {0}}')
... |
nakatamaho/qni | apps/www/app/javascript/controllers/circuit_svg_controller.ts | <gh_stars>10-100
import '@svgdotjs/svg.filter.js'
import {G, SVG, Svg} from '@svgdotjs/svg.js'
import {Controller} from '@hotwired/stimulus'
export default class CircuitSvgController extends Controller {
static targets = ['circuitScaler', 'circuit', 'title', 'logo']
declare circuitScalerTarget: HTMLElement
decl... |
nakatamaho/qni | packages/elements/src/operation-inspector-element.ts | <filename>packages/elements/src/operation-inspector-element.ts
import {AngleSliderElement, isAngleSliderElement} from './angle-slider-element'
import {Angleable, Ifable, isAngleable, isIfable} from './mixin'
import {Flaggable, isFlaggable} from './mixin/flaggable'
import {Operation, isPhaseGateElement, isRxGateElement,... |
anvitmangal/solana-breeding | src/components/WalletConnection/WalletConnection.tsx | <reponame>anvitmangal/solana-breeding
import React from 'react';
import {
useAnchorWallet,
useConnection,
} from '@solana/wallet-adapter-react';
import {
WalletModalProvider,
WalletMultiButton,
} from '@solana/wallet-adapter-react-ui';
const MyWallet: React.FC = () => {
const { connectio... |
anvitmangal/solana-breeding | src/components/SendTokens/SendTokens.tsx | import { useConnection, useWallet } from '@solana/wallet-adapter-react';
import { WalletError, WalletNotConnectedError } from '@solana/wallet-adapter-base';
import { Keypair, SystemProgram, Transaction, LAMPORTS_PER_SOL, PublicKey } from '@solana/web3.js';
import React, { useCallback, FC, useState, useEffect } from ... |
anvitmangal/solana-breeding | src/components/BioElement/BioElement.tsx | import './BioElement.css';
import React from 'react';
export const BioElement = (props) => {
return (
<div className="footer-container">
<img alt="bio Logo" className="bio-logo" src={props.logo[0]} />
<a
className="footer-text"
href={props.li... |
anvitmangal/solana-breeding | src/components/Navbar/Navbar.tsx | import React, { FC, useState } from 'react';
import AppBar from '@mui/material/AppBar';
import Box from '@mui/material/Box';
import Toolbar from '@mui/material/Toolbar';
import Button from '@mui/material/Button';
import IconButton from '@mui/material/IconButton';
import MenuIcon from '@mui/icons-material/Menu';
... |
anvitmangal/solana-breeding | src/App.tsx | import React, { FC } from 'react';
// import logo from "./logo.svg";
import "./App.css";
import "./styles.css";
// require('@solana/wallet-adapter-react-ui/styles.css');
import {
ConnectionProvider,
WalletProvider,
} from "@solana/wallet-adapter-react";
import { WalletAdapterNetwork } from "@solana/wallet-adapter-b... |
EnetoJara/adopt-me | server/types/api/index.d.ts | <reponame>EnetoJara/adopt-me<filename>server/types/api/index.d.ts
import { BuildOptions, Model } from "sequelize";
export interface UserAttributes {
id: number,
name: string;
middlename: string;
lastname: string;
secondlastname: string;
phone: string;
password: string;
email: string;
... |
EnetoJara/adopt-me | server/types/lib.d.ts | <reponame>EnetoJara/adopt-me<gh_stars>0
/// <reference types="node" />
/// <reference types="express" />
declare namespace NodeJS {
interface ProcessEnv {
readonly NODE_ENV: 'development' | 'production' | 'test';
readonly PUBLIC_URL: string;
readonly GOOGLE_ID: string;
readonly GOO... |
EnetoJara/adopt-me | server/src/models/comments-model.ts | import { DataTypes, Sequelize } from 'sequelize';
import { CommentsStatic } from "../../types/api/index";
export function commentsFactory (config: Sequelize): CommentsStatic {
return <CommentsStatic>config.define("comments", {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
... |
EnetoJara/adopt-me | server/src/models/users-adopts.ts | import { DataTypes, Sequelize } from 'sequelize';
import { UserAdoptsStatic } from "../../types/api/index";
export function userAdoptsFActory (config: Sequelize): UserAdoptsStatic {
return <UserAdoptsStatic>config.define("user_adopts", {
id: {
type: DataTypes.INTEGER,
autoIncrement:... |
EnetoJara/adopt-me | server/src/utils/passport.ts | <reponame>EnetoJara/adopt-me<gh_stars>0
import * as passport from "passport";
import { OAuth2Strategy, Profile, VerifyFunction } from "passport-google-oauth";
import { GOOGLE_CALLBACK, GOOGLE_ID, GOOGLE_SECRET } from "./constants";
passport.use(
new OAuth2Strategy(
{
clientID: GOOGLE_ID,
clientSecret... |
EnetoJara/adopt-me | server/src/index.ts | import * as http from "http";
import { expressConfig } from "./express-config";
import { dbConfig } from "./models";
import { logger } from "./utils/logger";
require("dotenv-expand")(
require("dotenv").config({
path: '.env',
})
);
dbConfig.sync().then(()=>logger.debug("Db sync")).catch(error => {
... |
EnetoJara/adopt-me | server/src/utils/utility.ts | <reponame>EnetoJara/adopt-me
import { logger } from "./logger";
/**
* Utility function to check wether if we are running on production or not.
*
* @param {string} running - the current enviroment.
* @param {string} positive - in case of positive.
* @param {string} negative - in case of negative.
* @param {string}... |
EnetoJara/adopt-me | server/src/routes/index.ts | /**
* Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
<NAME>
*/
export { routes } from "./routes";
|
EnetoJara/adopt-me | server/src/models/driver.ts | import * as sequelize from "sequelize";
import { BD_HOST, BD_NAME, BD_PASSWORD, BD_PORT, BD_USER } from "../utils/constants";
export const dbConfig = new sequelize.Sequelize(BD_NAME,BD_USER,BD_PASSWORD, {
port: Number(BD_PORT),
host: BD_HOST,
dialect: "postgres",
pool: {
min: 0,
max: 10,
acquire: 3... |
EnetoJara/adopt-me | server/src/models/google-info.ts | import { DataTypes, Sequelize } from 'sequelize';
import { UserGoogleStatic } from "../../types/api/index";
export function googleInfoFactory (config: Sequelize): UserGoogleStatic {
return <UserGoogleStatic>config.define("google_info", {
id: {
type: DataTypes.INTEGER,
autoIncrement:... |
EnetoJara/adopt-me | server/src/controllers/user-controller.ts | import { BaseController } from "./base-controller";
export class UserController extends BaseController {
public constructor () {
super();
}
}
|
EnetoJara/adopt-me | server/src/routes/routes.ts | <filename>server/src/routes/routes.ts
import { Router } from "express";
import { ADDRESS, BDAY, CONTACTS, EMAIL, LOGIN, PHONES, PROFILE, ROUTE_GOOGLE_AUTH, ROUTE_GOOGLE_CALLBACK } from "../utils/constants";
import { google } from "../utils/passport";
/**
* Place where all the endpoints of our server are defined.
*
... |
EnetoJara/adopt-me | server/src/models/kinds-model.ts | import { DataTypes, Sequelize } from 'sequelize';
import { KindsStatic } from "../../types/api/index";
export function kindsFactory(config: Sequelize): KindsStatic {
return <KindsStatic>config.define("kinds", {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryK... |
EnetoJara/adopt-me | server/src/controllers/base-controller.ts | <gh_stars>0
import { PoolClient } from 'pg';
export class BaseController {
private connection: PoolClient;
public constructor() {
this.beginTransaction = this.beginTransaction.bind(this);
this.rollback = this.rollback.bind(this);
this.commitTransaction = this.commitTransaction.bind(this);
}
prot... |
EnetoJara/adopt-me | server/src/models/index.ts | <reponame>EnetoJara/adopt-me<gh_stars>0
import { commentsFactory } from "./comments-model";
import { dbConfig } from "./driver";
import { googleInfoFactory } from "./google-info";
import { kindsFactory } from "./kinds-model";
import { petsFactory } from "./pets-model";
import { userFactory } from "./user-model";
import... |
EnetoJara/adopt-me | server/src/models/pets-model.ts | import { DataTypes, Sequelize } from 'sequelize';
import { PetsStatic } from "../../types/api/index";
export function petsFactory(config: Sequelize): PetsStatic {
return <PetsStatic>config.define("pets", {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: t... |
EnetoJara/adopt-me | server/src/express-config.ts | import { json, urlencoded } from "body-parser";
import * as compression from "compression";
import * as cors from "cors";
import * as express from "express";
import * as helmet from "helmet";
import { routes } from "./routes/routes";
import { google } from "./utils/passport";
/**
* Creates the basic configuration for... |
EnetoJara/adopt-me | server/src/models/user-model.ts | <filename>server/src/models/user-model.ts
import { DataTypes, Sequelize } from 'sequelize';
import { UserStatic } from "../../types/api/index";
export function userFactory(config: Sequelize): UserStatic {
return <UserStatic>config.define("users", {
id: {
type: DataTypes.INTEGER,
au... |
EnetoJara/adopt-me | server/src/utils/constants.ts | <gh_stars>0
export const ERROR = 0;
export const WARN = 1;
export const INFO = 2;
export const VERBOSE = 3;
export const DEBUG = 4;
export const HTTP = 5;
export const PRODUCTION = "production";
export const DEVELOPMENT = "development";
export const ROUTE_LOGIN = "/v1/login";
export const ROUTE_REGISTER = "/v1/regist... |
nsidnev/setup-edgedb | src/main.ts | import * as core from '@actions/core'
import * as exec from '@actions/exec'
import {ExecOptions} from '@actions/exec/lib/interfaces'
import * as io from '@actions/io'
import * as cp from 'child_process'
import * as tc from '@actions/tool-cache'
import * as fs from 'fs'
import * as fetch from 'node-fetch'
import * as os... |
nsidnev/setup-edgedb | src/setup-edgedb.ts | <reponame>nsidnev/setup-edgedb<filename>src/setup-edgedb.ts
import * as main from './main'
import * as win from './win'
import * as os from 'os'
if (os.platform() === 'win32') {
win.run()
} else {
main.run()
}
|
nsidnev/setup-edgedb | __tests__/ver.test.ts | <reponame>nsidnev/setup-edgedb<filename>__tests__/ver.test.ts<gh_stars>1-10
import * as main from '../src/main'
describe('setup-edgedb', () => {
it('Sorts versions correctly', async () => {
let versionMap = new Map([
['1.0.0-beta.2+d20210806.g803b254e6', 'foo'],
['1.0.0-beta.2+d20210808.g121de78de', ... |
sonidelav/nest-cassandra-test | src/users/users.service.ts | <gh_stars>0
import { Injectable } from '@nestjs/common';
import { Repository, InjectRepository } from '@iaminfinity/express-cassandra';
import { UserEntity } from './user.entity';
@Injectable()
export class UsersService {
constructor(
@InjectRepository(UserEntity)
private readonly userRepository: R... |
sonidelav/nest-cassandra-test | src/users/user.entity.ts | import { Entity, Column } from "@iaminfinity/express-cassandra";
@Entity({
table_name: 'users',
key: ['id']
})
export class UserEntity {
@Column({
type: 'uuid',
default: { $db_function: 'uuid()' }
})
id: any;
@Column({
type: 'text',
})
name: string;
@Column... |
sonidelav/nest-cassandra-test | src/users/users.controller.ts | <gh_stars>0
import { Controller, Get } from '@nestjs/common';
import { UsersService } from './users.service';
@Controller('users')
export class UsersController {
constructor(
private readonly userService : UsersService
) {}
@Get('/')
async getAllUsers() {
return await this.userService.... |
sonidelav/nest-cassandra-test | src/database.options.ts | <filename>src/database.options.ts
import { auth } from "cassandra-driver";
import { ExpressCassandraModuleOptions } from "@iaminfinity/express-cassandra";
export default {
clientOptions: {
contactPoints: ["localhost"],
keyspace: "test",
protocolOptions: {
port: 9042,
},... |
harrriii/enrollmentsystem | node_modules/fastq/test/example.ts | import * as fastq from '../'
// Basic example
const queue = fastq(worker, 1)
queue.push('world', (err, result) => {
if (err) throw err
console.log('the result is', result)
})
queue.push('push without cb')
queue.concurrency
queue.drain()
queue.empty = () => undefined
console.log('the queue tasks are', queue.... |
harrriii/enrollmentsystem | node_modules/fastq/index.d.ts | <reponame>harrriii/enrollmentsystem<filename>node_modules/fastq/index.d.ts<gh_stars>10-100
declare function fastq<C, T = any, R = any>(context: C, worker: fastq.worker<C, T, R>, concurrency: number): fastq.queue<T, R>
declare function fastq<C, T = any, R = any>(worker: fastq.worker<C, T, R>, concurrency: number): fastq... |
yzpTsubasa/vscode-git-quick-commit | src/extension.ts | import * as vscode from 'vscode';
import quickCommit from './command/quickCommit';
import {ICommand} from './command/Command';
function handleSuccess(result: any) {
if (result) {
vscode.window.showInformationMessage(result);
}
}
function handleError(err: Error) {
if (err && err.message) {
vscode.window.sho... |
yzpTsubasa/vscode-git-quick-commit | src/lib/quickCommit.ts | import * as vscode from 'vscode';
const util = require('util');
const childProcess = require('child_process');
const exec = util.promisify(childProcess.exec);
export default async (options: any): Promise<string> => {
let isShowDialog = options && options.showDialog ? true : false;
let editor = vscode.window.activ... |
yzpTsubasa/vscode-git-quick-commit | src/command/quickCommit.ts | import quickCommit from '../lib/quickCommit';
import {ICommand} from './Command';
const cmd: ICommand = function() {
let options = {showDialog: false};
return quickCommit(options);
};
export default cmd; |
areai51/nitro3 | libs/components/src/nav/nav.mock.ts | export default [
{
title: 'New In',
image: '',
},
{
title: 'Activewear',
image: '',
},
{
title: 'Co-odsDucts, pipes',
image: '',
},
{
title: 'Dungarees & Boiler Suites',
image: '',
},
{
title: 'Hoodies & Sweatshirts',
image: '',
},
{
title: 'Jackets & Co... |
areai51/nitro3 | apps/home/public/mocks/products-list.mock.ts | export default [
{
id: 11001,
imageUrl: '/images/pic1.jpeg',
imageAlt: 'adidas Originals 3-stripe England t-shirt in white',
title: 'adidas Originals 3-stripe England t-shirt in white',
formattedPrice: '£18.15',
priceUnit: ' ',
reviewCount: 34,
rating: 4,
onSale: true,
},
{
... |
areai51/nitro3 | libs/ui-kit/src/index.ts | <filename>libs/ui-kit/src/index.ts
export * from './/nav/nav';
export * from './/header/header';
export * from './/product-card/product-card';
export * from './/hero-banner/hero-banner';
export * from './lib/ui-kit';
|
areai51/nitro3 | libs/components/src/footer/footer.tsx | <reponame>areai51/nitro3<filename>libs/components/src/footer/footer.tsx
import React from 'react';
import styled from '@emotion/styled';
/* eslint-disable-next-line */
export interface FooterProps {}
const StyledFooter = styled.div`
{
background-color: #555;
padding: 1rem;
color: #efefef;
text-align... |
areai51/nitro3 | apps/browse/pages/index.tsx | <filename>apps/browse/pages/index.tsx
import React from 'react';
import Container from '@material-ui/core/Container';
import Grid from '@material-ui/core/Grid';
import { makeStyles } from '@material-ui/core/styles';
import { ProductTile } from '@nitro3/components';
import ProductMock from '../public/mocks/products-list... |
areai51/nitro3 | libs/components/src/hero-banner/hero-banner.tsx | import React from 'react';
import Container from '@material-ui/core/Container';
import Typography from '@material-ui/core/Typography';
import Grid from '@material-ui/core/Grid';
import Button from '@material-ui/core/Button';
/* eslint-disable-next-line */
import { makeStyles } from '@material-ui/core/styles';
const use... |
areai51/nitro3 | libs/components/src/nav/nav.tsx | import React from 'react';
import clsx from 'clsx';
import { makeStyles, useTheme } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
import Button from '@material-ui/core/Button';
import List from '@material-ui/core/List';
import Divider from '@material-ui/core/Divider';
import ListItem f... |
areai51/nitro3 | libs/components/src/hero-banner/hero-banner.spec.tsx | <filename>libs/components/src/hero-banner/hero-banner.spec.tsx
import React from 'react';
import { render } from '@testing-library/react';
import HeroBanner from './hero-banner';
describe('HeroBanner', () => {
it('should render successfully', () => {
const { baseElement } = render(<HeroBanner />);
expect(ba... |
areai51/nitro3 | libs/components/src/product-tile/product-tile.tsx | <filename>libs/components/src/product-tile/product-tile.tsx
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Card from '@material-ui/core/Card';
import CardActionArea from '@material-ui/core/CardActionArea';
import CardActions from '@material-ui/core/CardActions';
import CardCont... |
areai51/nitro3 | libs/components/src/index.ts | <filename>libs/components/src/index.ts
export * from './product-tile/product-tile';
export * from './footer/footer';
export * from './header/header';
export * from './nav/nav';
export * from './product-card/product-card';
export * from './hero-banner/hero-banner';
|
areai51/nitro3 | libs/templates/src/lib/templates.tsx | import React, { useState } from 'react';
import Head from 'next/head';
import { makeStyles } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import { Header } from '@nitro3/components';
import { Footer } from '@nitro3/components';
const useStyles = makeStyles({
container: {... |
areai51/nitro3 | libs/components/src/product-card/product-card.tsx | <gh_stars>0
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Card from '@material-ui/core/Card';
import CardActions from '@material-ui/core/CardActions';
import CardContent from '@material-ui/core/CardContent';
import CardMedia from ... |
areai51/nitro3 | libs/components/src/product-card/product-card.spec.tsx | <reponame>areai51/nitro3
import React from 'react';
import { render } from '@testing-library/react';
import ProductCard from './product-card';
describe('ProductCard', () => {
it('should render successfully', () => {
const { baseElement } = render(<ProductCard />);
expect(baseElement).toBeTruthy();
});
});... |
areai51/nitro3 | apps/home/pages/home.tsx | <reponame>areai51/nitro3
import React from 'react';
import styled from '@emotion/styled';
import { makeStyles } from '@material-ui/core/styles';
import { HeroBanner } from '@nitro3/components';
import { Master as Layout } from '@nitro3/templates';
const StyledPage = styled.div``;
const useStyles = makeStyles((theme) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.