repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
phos-dev/crw-shop | src/routes/Home/Gallery/Item.tsx | <reponame>phos-dev/crw-shop
import React from 'react';
import NavLink from 'components/NavLink';
import { IItem } from '../interfaces';
const Item = (props: IItem) => {
const { image, name, slug, className } = props;
return (
<NavLink
href={`/category/${slug}`}
className={`flex justify-center it... |
phos-dev/crw-shop | src/pages/shop/[category].tsx | import React, { useEffect, useState } from 'react';
import { Checkbox, Col, Divider, Input, Rate, Row } from 'antd';
import Text from 'antd/lib/typography/Text';
import { useRouter } from 'next/router';
import Button from 'components/Button/Button';
import Layout from 'components/Layout';
const { Search } = Input;
c... |
phos-dev/crw-shop | src/components/Layout/Header/interfaces.tsx | <filename>src/components/Layout/Header/interfaces.tsx
export type IMenuItem = {
label: string;
url: string;
};
|
phos-dev/crw-shop | src/components/Layout/Layout.tsx | import React from 'react';
import { Divider, Layout as AntdLayout } from 'antd';
import CustomHeader from './Header';
const { Content } = AntdLayout;
type ILayoutProps = {
children: React.ReactNode;
};
const Layout = ({ children }: ILayoutProps) => {
return (
<AntdLayout style={{ minHeight: '100vh' }}>
... |
phos-dev/crw-shop | src/routes/Home/Home.tsx | <gh_stars>0
import React from 'react';
import Gallery from './Gallery';
import { IItem } from './interfaces';
const Home = () => {
const items: Array<IItem> = [
{
slug: 'smartwatches',
name: 'SMARTWATCHES',
image: 'https://wallpaperaccess.com/full/2067364.jpg',
className: 'flex-1',
}... |
phos-dev/crw-shop | src/components/Layout/Header/Header.tsx | import React, { useState } from 'react';
import {
UserOutlined,
SettingOutlined,
UnorderedListOutlined,
} from '@ant-design/icons';
import {
Avatar,
Badge,
Popover,
Layout as AntdLayout,
Button,
Divider,
Menu,
} from 'antd';
import Text from 'antd/lib/typography/Text';
import Image from 'next/image... |
phos-dev/crw-shop | src/components/Layout/Header/useContextMenuItems.tsx | <filename>src/components/Layout/Header/useContextMenuItems.tsx
import { useRouter } from 'next/router';
import { IMenuItem } from './interfaces';
const useContextMenuItems = () => {
const router = useRouter();
const menuItems: Array<IMenuItem> = [
{
label: 'login',
url: '/auth/login',
},
... |
phos-dev/crw-shop | src/pages/auth/register.tsx | <filename>src/pages/auth/register.tsx
import React from 'react';
import { Col, Row } from 'antd';
import { Form, Formik } from 'formik';
import * as yup from 'yup';
import Button from 'components/Button/Button';
import FormItem from 'components/FormItem';
import Layout from 'components/Layout';
import NavLink from 'c... |
phos-dev/crw-shop | src/pages/auth/login.tsx | <reponame>phos-dev/crw-shop
import React from 'react';
import { GoogleOutlined } from '@ant-design/icons';
import { Col, Row } from 'antd';
import { Form, Formik } from 'formik';
import * as yup from 'yup';
import Button from 'components/Button/Button';
import FormItem from 'components/FormItem';
import Layout from '... |
phos-dev/crw-shop | src/routes/Home/Gallery/Gallery.tsx | import { IItem } from '../interfaces';
import Item from './Item';
type IGalleryProps = {
items: Array<IItem>;
};
const Gallery = (props: IGalleryProps) => {
const { items } = props;
return (
<div className="flex w-full flex-wrap">
{items.map((item, key) => (
<Item key={key} {...item} />
... |
phos-dev/crw-shop | src/pages/orders/index.tsx | <gh_stars>0
import React from 'react';
import { Card, Col, Menu, Row, Select, Table, Typography } from 'antd';
import { ColumnsType } from 'antd/es/table';
import Search from 'antd/lib/input/Search';
import Layout from 'components/Layout';
import NavLink from 'components/NavLink';
// TODO: IMPLEMENT
interface Order ... |
phos-dev/crw-shop | src/pages/index.tsx | <filename>src/pages/index.tsx<gh_stars>0
import Layout from 'components/Layout';
import Home from 'routes/Home';
const Index = () => {
return (
<Layout>
<Home />
</Layout>
);
};
export default Index;
|
ParisDeno/deno-bot | lib/twitter/SearchBuilder.ts | import { OAuth } from "../oauth-1.0a/OAuth.ts";
export interface Criterion {
exclude: boolean;
type: "lang" | "from" | "to" | "filter" | "plain";
text: string;
}
interface CriterionWithID extends Criterion {
id: number;
}
type Filter =
| "safe"
| "media"
| "retweets"
| "native_video"
| "periscope"
... |
ParisDeno/deno-bot | api/task/fav_rt.ts | <gh_stars>1-10
import {
APIGatewayProxyEvent,
APIGatewayProxyResult,
Context,
} from "https://deno.land/x/lambda/mod.ts";
import type { RequestBody } from "../../lib/types.ts";
import { favRT } from "../../lib/features/fav_rt.ts";
/**
* Cron every 15 mins
* - get user timeline (50 item) "GET statuses/user_time... |
ParisDeno/deno-bot | lib/utils.ts | <filename>lib/utils.ts<gh_stars>1-10
import { RequestBody } from "./types.ts";
export function getBody<T = any>(req: RequestBody) {
const rawBody = req.body
? req.encoding === "base64" ? atob(req.body as string) : req.body
: null;
if (typeof rawBody === "string") {
if (rawBody.includes("Content-Dispos... |
ParisDeno/deno-bot | api/register_webhook.ts | import {
APIGatewayProxyEvent,
APIGatewayProxyResult,
Context,
} from "https://deno.land/x/lambda/mod.ts";
import { Client } from "../lib/twitter/Twitter.ts";
import { RequestBody } from "../lib/types.ts";
export async function handler(
event: APIGatewayProxyEvent,
context: Context,
req: RequestBody = JSON... |
ParisDeno/deno-bot | lib/features/fav_rt.ts | <gh_stars>1-10
import { Client, TweetStatus } from "../twitter/Twitter.ts";
import { SearchBuilder } from "../twitter/SearchBuilder.ts";
import { logDiscord, errorDiscord } from "../utils.ts";
export async function favRT(dryRun: boolean, famous: boolean) {
const twitter = Client.getInstance();
const alreadyFavorit... |
ParisDeno/deno-bot | lib/oauth-1.0a/OAuth.ts | export namespace OAuth {
/**
* OAuth data, including the signature.
*/
export interface Authorization extends Data {
oauth_signature: string;
}
/**
* Method used to generate the body hash.
*
* Note: the key is used for implementation HMAC algorithms for the body hash,
* but ty... |
ParisDeno/deno-bot | api/webhook/twitter.ts | import {
APIGatewayProxyEvent,
APIGatewayProxyResult,
Context,
} from "https://deno.land/x/lambda/mod.ts";
import { Client } from "../../lib/twitter/Twitter.ts";
import type { RequestBody } from "../../lib/types.ts";
export async function handler(
event: APIGatewayProxyEvent,
context: Context,
req: Request... |
ParisDeno/deno-bot | lib/twitter/Twitter.ts | import { assert } from "https://deno.land/std/testing/asserts.ts";
import { hmac } from "https://deno.land/x/hmac/mod.ts";
import { OAuth } from "../oauth-1.0a/OAuth.ts";
import { SearchBuilder } from "./SearchBuilder.ts";
const TWITTER_API = "https://api.twitter.com/1.1";
interface WebhookGet {
id: number;
url: ... |
lucacasonato/deno-fetchevent | mod.ts | <filename>mod.ts
export {
listenAndServe,
listenAndServeTLS,
serve,
Server,
serveTLS,
} from "./src/server.ts";
export type { FetchEvent } from "./src/server.ts";
export type { HTTPOptions, HTTPSOptions } from "./deps.ts";
|
lucacasonato/deno-fetchevent | src/server.ts | import {
HTTPOptions,
HTTPSOptions,
ServerRequest,
StdServer,
} from "../deps.ts";
import { ReadableStreamIOReader } from "./toReader.ts";
export interface FetchEvent extends Event {
request: Request;
respondWith(response: Promise<Response> | Response): Promise<Response>;
}
class FetchEventImpl extends Ev... |
lucacasonato/deno-fetchevent | src/toReader.ts | <reponame>lucacasonato/deno-fetchevent<gh_stars>1-10
export class ReadableStreamIOReader implements Deno.Reader {
#reader: ReadableStreamDefaultReader<Uint8Array>;
#buffer: Uint8Array | null;
#encoder: TextEncoder;
constructor(dst: ReadableStream<Uint8Array>) {
this.#reader = dst.getReader();
this.#buf... |
lucacasonato/deno-fetchevent | example.ts | import { serve } from "./mod.ts";
console.log("Listening on http://localhost:8080/");
for await (const event of serve(":8080")) {
const { request } = event;
console.log("---");
console.log(request.url);
console.log(request.method);
if (request.body) console.log(await request.text());
event.respondWith(
... |
lucacasonato/deno-fetchevent | deps.ts | export {
Server as StdServer,
ServerRequest,
} from "https://deno.land/std@0.77.0/http/mod.ts";
export type {
HTTPOptions,
HTTPSOptions,
} from "https://deno.land/std@0.77.0/http/mod.ts";
|
Chocrates/retry-invite-action | __tests__/main.test.ts | <reponame>Chocrates/retry-invite-action
/* global octomock */
import { run, getEmail } from "../src/main";
import outdent from "outdent";
let issueNumber = 1;
let login = "User";
let name = "RepoName";
let testEmail = "<EMAIL>";
let issues = [
{
url: "",
number: 1,
title: "Issue 1",
user: {
log... |
Chocrates/retry-invite-action | src/main.ts | <filename>src/main.ts
import * as core from "@actions/core";
import * as github from "@actions/github";
import outdent from "outdent";
function getEmail(issueBody: string, regexString: string): string {
const emailRegex = new RegExp(regexString);
const match = issueBody.match(emailRegex);
if (match && match[1... |
leinerke/nextjs-ts-taildwind | src/pages/index.tsx | <filename>src/pages/index.tsx
import type { NextPage } from 'next';
const Home: NextPage = () => (
<div className="min-h-screen bg-gray-50 py-6 flex flex-col justify-center relative overflow-hidden sm:py-12">
<img
src="https://play.tailwindcss.com/img/beams.jpg" alt=""
className="absolute top-1/2 lef... |
Blockception/BC-Vscode-Utilities | src/Lib/Completion/Builder.ts | import { CompletionItem, CompletionItemKind, MarkupContent } from "vscode-languageserver-types";
/**An object that helps with creating completion items */
export class CompletionBuilder {
public items: CompletionItem[];
public OnNewItem: ((NewItem: CompletionItem) => void) | undefined;
constructor() {
this.... |
Blockception/BC-Vscode-Utilities | src/Lib/Diagnostics/Context.ts | <filename>src/Lib/Diagnostics/Context.ts
import { DiagnosticsBuilder } from "./Builder";
export interface DiagnosticContext<T> {
Context: T;
Builder: DiagnosticsBuilder;
}
|
Blockception/BC-Vscode-Utilities | src/Lib/Completion/Context.ts | import { Context } from "mocha";
import { CompletionBuilder } from "./Builder";
export interface CompletionContext<T> {
Context: T;
Builder: CompletionBuilder;
}
|
Blockception/BC-Vscode-Utilities | src/Lib/Diagnostics/include.ts | /* Auto generated */
export * from "./Builder";
export * from "./Context"; |
Blockception/BC-Vscode-Utilities | src/Lib/include.ts | /* Auto generated */
export * as Completion from "./Completion/include";
export * as Connection from "./Connection/include";
export * as Diagnostics from "./Diagnostics/include";
export * as Documents from "./Documents/include";
export * as Json from "./Json/include";
|
Blockception/BC-Vscode-Utilities | test/main.ts | import "mocha";
describe("nothing yet", () => {});
|
Blockception/BC-Vscode-Utilities | src/Lib/Json/JsonDocument.ts | <reponame>Blockception/BC-Vscode-Utilities
/*BSD 3-Clause License
Copyright (c) 2021, Blockception Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the ... |
Blockception/BC-Vscode-Utilities | src/Lib/Connection/Manager.ts | <reponame>Blockception/BC-Vscode-Utilities<gh_stars>1-10
/*BSD 3-Clause License
Copyright (c) 2021, Blockception Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code mu... |
Blockception/BC-Vscode-Utilities | src/Lib/Diagnostics/Builder.ts | <reponame>Blockception/BC-Vscode-Utilities
/*BSD 3-Clause License
Copyright (c) 2021, Blockception Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the ... |
Blockception/BC-Vscode-Utilities | src/Lib/Documents/Documents.ts | /*BSD 3-Clause License
Copyright (c) 2021, Blockception Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of con... |
ismaeldevmw/javascript-profesional-course | ejercicios/typescript/index.ts | console.log('Hello, TypeScript');
function add(a: number, b: number) {
return a + b;
}
const sum = add(2, 3);
|
jvmn/groundzero-taskrunner-webpack | lib/templates/pattern.ts | /**
* init <%= filename %>
* @alias <%= filename %>
* @return {Object} <% if(js){ %>public methods and css bundle<% } %><% if (!js) { %>with css bundle<% } %>
*/
<% if (js) { %>
import { FrontendModuleInstance } from "../../../../types"
<% } %>
<% if (scss) { %>
<% if (cssinjs) { %>
require('./<%= filename %>.modul... |
DanteCoder/JoplinPluginNoteVariables | src/noteVariables.ts | <filename>src/noteVariables.ts
import joplin from "api";
import { settings } from "./settings";
import { ToolbarButtonLocation, ContentScriptType } from "api/types";
export namespace noteVariables {
const note_template = <any>{
vars: {}
}
const noteVarsName = '%NoteVariables%';
let noteVarsId... |
DanteCoder/JoplinPluginNoteVariables | src/markdownItPlugin.ts | <gh_stars>1-10
let noteVariables = <any>{vars:{}};
let fence = '%'
syncWithPlugin();
export default function (context) {
return {
plugin: function (markdownIt, _options) {
const defaultRender = markdownIt.renderer.rules.text || function (tokens, idx, options, env, self) {
return self.renderToken(tokens, idx,... |
DanteCoder/JoplinPluginNoteVariables | src/index.ts | import joplin from 'api';
import { noteVariables } from './noteVariables';
joplin.plugins.register({
onStart: async function () {
noteVariables.init();
},
});
|
DanteCoder/JoplinPluginNoteVariables | src/settings.ts | <filename>src/settings.ts
import joplin from "api";
import { SettingItemType } from "api/types";
export namespace settings {
export async function register() {
await joplin.settings.registerSection('noteVariablesSection', {
label: 'Note Variables',
iconName: 'fas fa-superscript',
... |
metabeen/TourOfHeroes | src/app/app.component.ts | <filename>src/app/app.component.ts
import { Component } from '@angular/core';
import { Hero } from './hero'
@Component({
selector: 'my-app',
template: `
<h1>{{title}}</h1>
<h2>My favorite hero is: {{myHero.name}}</h2>
<p>Heroes:</p>
<ul>
<li *ngFor="let hero of heroes">
{{hero.name}}
</li>
</ul>
`
})
export ... |
alexsasharegan/browser-http-client | src/index.ts | <filename>src/index.ts<gh_stars>1-10
import { Client } from "./xhr/client";
type Dictionary<T> = { [key: string]: T };
let key = "",
err = null,
compatChecks: Dictionary<boolean> = Object.create(null);
compatChecks.XMLHttpRequest = "XMLHttpRequest" in window;
compatChecks.Promise = "Promise" in window;
compatChe... |
alexsasharegan/browser-http-client | src/xhr/status.ts | export enum Status {
// HTTP status codes as registered with IANA.
// See: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
Continue = 100, // RFC 7231, 6.2.1
SwitchingProtocols = 101, // RFC 7231, 6.2.2
Processing = 102, // RFC 2518, 10.1
OK = 200, // RFC 7231, 6.3.1
Created = 2... |
alexsasharegan/browser-http-client | src/xhr/headers.ts | export type Dictionary<T> = { [key: string]: T };
const ignoreDupeMap: Dictionary<boolean> = {
age: true,
authorization: true,
"content-length": true,
"content-type": true,
etag: true,
expires: true,
from: true,
host: true,
"if-modified-since": true,
"if-unmodified-since": true,
"last-modified": ... |
alexsasharegan/browser-http-client | src/encoding/qstr.ts | export type Primitive = string | number | boolean | null;
export type PrimitiveArray = Array<Primitive>;
export type QueryObject = { [index: string]: Primitive | PrimitiveArray };
export function encode_query(data: QueryObject): string {
let encoded = [];
let enc = encodeURIComponent;
let val: any;
let v: any;... |
alexsasharegan/browser-http-client | src/xhr/client.ts | <reponame>alexsasharegan/browser-http-client
import { Ok, Err, Result, expect_never } from "safe-types";
import * as Headers from "./headers";
import * as QStr from "../encoding/qstr";
import { ContentType } from "./contentType";
export interface RequestOptions {
query?: QStr.QueryObject;
data?: RequestData;
hea... |
alexsasharegan/browser-http-client | __test__/client.test.ts | import { Client } from "../src/index";
import { RequestErrType } from "../src/xhr/client";
const base = `https://jsonplaceholder.typicode.com`;
const mock = {
url: suffix => base + suffix,
wait: ms => new Promise(resolve => setTimeout(resolve, ms)),
};
Client.Timeout = 2000;
interface Geo {
lat: string;
lng: ... |
alexsasharegan/browser-http-client | __test__/qstr.test.ts | <gh_stars>1-10
import { encode_query } from "../src/encoding/qstr";
describe("encoding/qstr", async () => {
it("should work with primitive types", async () => {
let test = encode_query({
string: "a string",
number: 100,
bool: false,
empty: null,
});
// Snapshot was initially to g... |
alexsasharegan/browser-http-client | src/xhr/contentType.ts | <gh_stars>1-10
export enum ContentType {
Json = "application/json",
Text = "text/plain",
Html = "text/html",
Form = "application/x-www-form-urlencoded",
Multipart = "multipart/form-data",
Stream = "application/octet-stream",
}
|
githbq/hbq-event-helper | src/index.ts | /**
* 自定义事件 事件名 支持以数组的方式 对应多个事件
*/
class EventHelper {
public handlers: any
constructor() {
this.handlers = {}
}
static create() {
return new EventHelper()
}
/**
* 判断事件是否存在
* @param name
*/
has(name) {
return this.handlers[name] && this.handlers[name].length > 0
}
/**
* 监听事件... |
esiammd/proffys | web/src/pages/Page404/index.tsx | <reponame>esiammd/proffys<filename>web/src/pages/Page404/index.tsx
import React from "react";
function Page404() {
return (
<div style={{ textAlign: "center" }}>
<h1>404</h1>
<span>Página não encontrada</span>
</div>
);
}
export default Page404;
|
esiammd/proffys | server/knexfile.ts | <reponame>esiammd/proffys
import path from "path";
module.exports = {
client: "sqlite3",
connection: {
filename: path.resolve(__dirname, "src", "database", "database.sqlite"),
},
migrations: {
directory: path.resolve(__dirname, "src", "database", "migrations"),
},
useNullDefault: true,
pool: {
... |
ANYWORLDS/keep3r-network-v2 | test/e2e/keeper-job-interaction.spec.ts | <gh_stars>1-10
import { JsonRpcSigner } from '@ethersproject/providers';
import { IKeep3rV1, JobForTest, Keep3r, UniV3PairManager } from '@types';
import { evm, wallet } from '@utils';
import { toUnit } from '@utils/bn';
import { snapshot } from '@utils/evm';
import { expect } from 'chai';
import { BigNumber } from 'et... |
KirillMetrik/nx | packages/workspace/src/core/project-graph/daemon/tmp-dir.ts | <filename>packages/workspace/src/core/project-graph/daemon/tmp-dir.ts
/**
* Per workspace (to avoid subtle differences and issues), we want to have a deterministic
* location within the OS's tmp directory where we write log files for background processes
* and where we create the actual unix socket/named pipe for th... |
KirillMetrik/nx | packages/cypress/src/executors/cypress/cypress.impl.ts | import 'dotenv/config';
import { basename, dirname, join } from 'path';
import { installedCypressVersion } from '../../utils/cypress-version';
import {
ExecutorContext,
logger,
parseTargetString,
readTargetOptions,
runExecutor,
stripIndents,
} from '@nrwl/devkit';
const Cypress = require('cypress'); // @NO... |
KirillMetrik/nx | packages/workspace/src/utils/versions.ts | export const nxVersion = '*';
export const angularCliVersion = '~13.1.0';
export const typescriptVersion = '~4.4.3';
export const prettierVersion = '^2.5.1';
export const tslintVersion = '~6.1.0';
export const typescriptESLintVersion = '~5.3.0';
export const eslintVersion = '8.2.0';
export const eslintConfigPrettierVe... |
KirillMetrik/nx | packages/workspace/src/core/project-graph/daemon/client/client.ts | import { ProjectGraph } from '@nrwl/devkit';
import { ChildProcess, spawn, spawnSync } from 'child_process';
import { openSync, readFileSync } from 'fs';
import { ensureDirSync, ensureFileSync } from 'fs-extra';
import { connect } from 'net';
import { performance } from 'perf_hooks';
import { output } from '../../../..... |
veoveo234/testplaid | node/node_modules/plaid/dist/common.d.ts | /**
* The Plaid API
* The Plaid REST API. Please see https://plaid.com/docs/api for more details.
*
* The version of the OpenAPI document: 2020-09-14_1.31.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class m... |
veoveo234/testplaid | frontend/src/Components/ProductTypes/Products.tsx | import React, { useContext } from "react";
import Endpoint from "../Endpoint";
import Context from "../../Context";
import ProductTypesContainer from "./ProductTypesContainer";
import {
transactionsCategories,
authCategories,
identityCategories,
balanceCategories,
investmentsCategories,
paymentCategories,
... |
Greegko/andyvazul | src/utils/render/is-newline.ts | export const isNewLine = node => node.type === "text" && node.value.match(/^\s$/) !== null;
|
Greegko/andyvazul | src/components/layout.tsx | import * as React from 'react';
import { Menu } from './menu';
import { getMenuItems, MenuItem } from '../queries';
import { Helmet } from 'react-helmet';
import { SubmenuContext } from '../components/context';
interface LayoutProperties {
children: any;
location: any;
title: string;
description: string;
dis... |
Greegko/andyvazul | src/components/content/project-group.tsx | <filename>src/components/content/project-group.tsx
import * as React from 'react';
export const ProjectGroup = ({ children }) => {
const items = children.filter(x => typeof x !== 'string');
return (
<div style={{ display: 'flex' }}>
<div style={{ flex: 1 }}>{items[0]}</div>
<div style={{ flex: 1, ... |
Greegko/andyvazul | src/templates/custom-page.tsx | <gh_stars>0
import * as React from 'react';
import { Layout } from '../components/layout';
import { render, isNewLine } from '../utils/render';
import './custom-page.scss';
export default function CustomPage({ location, pageContext: { content, title, description } }) {
const displayAsBlock = location.pathname === "/... |
Greegko/andyvazul | src/components/list-project-groups.tsx | <gh_stars>0
import * as React from 'react';
import { getProjects, ProjectType, CuratedProject } from '../queries/get-projects';
import { urlFriendly, render } from '../utils';
import { SubmenuItem } from './content';
import { Images, Image } from './content/images';
import { groupWith, sortBy } from 'ramda';
import { g... |
Greegko/andyvazul | src/components/content/images.tsx | <filename>src/components/content/images.tsx
import * as React from 'react';
import { Link } from 'gatsby';
export interface Image {
src: string;
alt: string;
link?: string;
group?: string;
title?: string;
}
import './images.scss';
export const Images = ({ images }: { images: Image[] }) => {
const [numberO... |
Greegko/andyvazul | src/utils/render/render.ts | import * as React from 'react';
import rehypeReact from "rehype-react";
import { SubmenuItem, ProjectGroup } from '../../components/content';
import { Stern } from '../../components/stern';
import { ListProjectsByGroup } from '../../components/list-projects-by-group';
import { ListProjectGroups } from '../../component... |
Greegko/andyvazul | src/components/content/index.ts | export * from './submenu-item';
export * from './project-group';
|
Greegko/andyvazul | src/queries/get-projects.ts | <reponame>Greegko/andyvazul<filename>src/queries/get-projects.ts
import { useStaticQuery, graphql } from "gatsby";
export enum ProjectType { Artistic, Curated };
export interface ProjectBase {
id: string;
title: string;
slug: string;
order?: number;
image: {
sizes: string;
src: string;
srcSet: s... |
Greegko/andyvazul | src/queries/index.ts | export * from './get-menu-items';
export * from './get-projects';
|
Greegko/andyvazul | src/components/list-projects-by-group.tsx | import * as React from 'react';
import { getProjects, ProjectType, ArtisticProject, Project } from '../queries';
import { urlFriendly } from '../utils';
import { SubmenuItem } from './content';
import { Image, Images } from './content/images';
import { groupBy, sortBy } from 'ramda';
import { getProjectUrl } from '../u... |
Greegko/andyvazul | src/utils/get-project-url.ts | <gh_stars>0
import { urlFriendly } from "./url-friendly";
import { ProjectType, Project } from "../queries";
export const getProjectUrl = (project: Project, withSlug?: boolean): string => {
if (project.type === ProjectType.Artistic) {
return `/artistic-works/${urlFriendly(project.group)}` + (withSlug ? "/" + pro... |
Greegko/andyvazul | src/utils/render/div-render.ts | <filename>src/utils/render/div-render.ts
import * as React from 'react';
export const divRender = (params) => {
const newParams = removeEmptyLinesInGrids(params);
return React.createElement('div', newParams);
}
const isOnlyWhitespace = x => typeof x === 'string' && x.match(/^\s+$/);
const removeEmptyLinesInGrids... |
Greegko/andyvazul | src/utils/index.ts | export * from './url-friendly';
export * from './render';
|
Greegko/andyvazul | src/components/context/submenu.context.ts | import * as React from 'react';
import { MenuItem } from "../../queries";
export const SubmenuContext = React.createContext<{ addSubmenuItem: (item: MenuItem) => void }>({} as any);
|
Greegko/andyvazul | src/templates/project.tsx | import * as React from 'react';
import { Layout } from '../components/layout';
import { render } from '../utils/render';
import { getProjects, MenuItem, Project, ProjectType } from '../queries';
import { Images } from '../components/content/images';
import { uniqBy } from 'ramda';
import { urlFriendly } from '../utils'... |
Greegko/andyvazul | src/components/menu.tsx | import * as React from "react";
import { MenuItem } from "../queries";
import { Link } from "gatsby";
interface MenuProperties {
items: MenuItem[];
activeItem: string;
base: string;
padding: number;
setActiveElementPosition?: (pos: number) => void;
}
import "./menu.scss";
export const Menu = ({ items, activ... |
Greegko/andyvazul | src/utils/render/index.ts | <filename>src/utils/render/index.ts
export * from './render';
export * from './is-newline'; |
Greegko/andyvazul | src/components/context/index.ts | <gh_stars>0
export * from './submenu.context';
|
Greegko/andyvazul | src/utils/url-friendly.ts | <filename>src/utils/url-friendly.ts<gh_stars>0
export const urlFriendly = (path: string) =>
path
.toString()
.toLowerCase()
.replace(/[^\w]/g, '-')
.replace(/(\w)\W+$/, "\$1")
.replace(/^\W+(\w)/, "\$1");
|
Greegko/andyvazul | src/components/content/submenu-item.tsx | import * as React from 'react';
import { SubmenuContext } from '../context';
import { urlFriendly } from '../../utils';
interface SubmenuItemProperties {
url?: string;
children: string | string[];
hidden?: boolean;
id?: string;
}
export const SubmenuItem = ({ children, url, hidden, id = children as string }: ... |
Greegko/andyvazul | src/queries/get-menu-items.ts | <gh_stars>0
import { useStaticQuery, graphql } from "gatsby";
import { urlFriendly } from "../utils";
export interface MenuItem {
title: string;
path: string;
style?: object;
order?: number;
}
export function getMenuItems(): MenuItem[] {
const MenuQuery = useStaticQuery(graphql`
query ContentfulMenu {
... |
Greegko/andyvazul | src/components/stern.tsx | import * as React from 'react';
import './stern.scss';
export const Stern = ({ children }) => {
const content = Array.isArray(children) ? children[0] : children;
return <div className="stern" contentEditable>{content.toLocaleUpperCase()}</div>
};
|
mariotip/heroes | src/app/components/buscar/buscar.component.ts | import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { HeroesService } from 'src/app/services/heroes.service';
@Component({
selector: 'app-buscar',
templateUrl: './buscar.component.html'
})
export class BuscarComponent implements OnInit {
heroes: an... |
mariotip/heroes | src/app/components/hero/hero.component.ts | import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { HeroesService } from 'src/app/services/heroes.service';
@Component({
selector: 'app-hero',
templateUrl: './hero.component.html',
styles: [
]
})
export class HeroComponent implements OnInit {
heroe: ... |
mariotip/heroes | src/app/app-routing.module.ts | import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './components/home/home.component';
import { AboutComponent } from './components/about/about.component';
import { HeroesComponent } from './components/heroes/heroes.component';
import { HeroCo... |
Adiltonzsl/vscode-codeql | extensions/ql-vscode/src/vscode-tests/cli-integration/run-cli.test.ts | import { expect } from 'chai';
import { extensions, Uri } from 'vscode';
import * as path from 'path';
import { SemVer } from 'semver';
import { CodeQLCliServer, QueryInfoByLanguage } from '../../cli';
import { CodeQLExtensionInterface } from '../../extension';
import { skipIfNoCodeQL } from '../ensureCli';
import { g... |
Apple-Network/apple-blockchain-gui | src/components/plotNFT/PlotNFTRecovery.tsx | <filename>src/components/plotNFT/PlotNFTRecovery.tsx
import React, { useState } from 'react';
import {useDispatch, useSelector} from 'react-redux';
import styled from 'styled-components';
import { Trans } from '@lingui/macro';
import { Typography, Button } from '@material-ui/core';
import { bech32m } from "bech32";
imp... |
Apple-Network/apple-blockchain-gui | src/types/FarmingInfo.ts | type FarmingInfo = {
challenge_hash: string;
signage_point: string;
timestamp: number;
passed_filter: number;
proofs: number;
total_plots: number;
time_consuming: number;
};
export default FarmingInfo;
|
Apple-Network/apple-blockchain-gui | src/components/wallet/did/WalletDIDRecovery.tsx | import React, { useState } from 'react';
import { useHistory } from 'react-router';
import { useDispatch, useSelector } from 'react-redux';
import { AlertDialog, Back, ButtonLoading, Card, Flex, Dropzone } from '@apple/core';
import { Trans } from '@lingui/macro';
import {
Typography,
Button,
Box,
} from '@materi... |
MadeWithCards/adaptivecards-wc | src/src/components.d.ts | <reponame>MadeWithCards/adaptivecards-wc
/* eslint-disable */
/* tslint:disable */
/**
* This is an autogenerated file created by the Stencil compiler.
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { Act... |
MadeWithCards/adaptivecards-wc | samples/Vue/sample/src/main.ts | <reponame>MadeWithCards/adaptivecards-wc<filename>samples/Vue/sample/src/main.ts<gh_stars>0
import Vue from 'vue'
import App from './App.vue'
import { defineCustomElements } from '@madewithcards/adaptivecards-wc/dist/loader';
defineCustomElements(window);
Vue.config.productionTip = false
// Tell Vue to ignore all com... |
MadeWithCards/adaptivecards-wc | src/src/components/adaptivecard/types/cardConfig.ts | export class CardConfig {
public cardTemplate: string;
public sendToUrl: string;
public authHash: string;
} |
MadeWithCards/adaptivecards-wc | src/src/components/adaptivecard/adaptivecard.tsx | import { Component, h, Prop, Element, Event, EventEmitter} from '@stencil/core';
import { AdaptiveCard, HostConfig, Input, Action } from 'adaptivecards';
import * as ACData from 'adaptivecards-templating';
import axios from 'axios';
// Cards && Sample Data
import sampleCard from './assets/exampleCard.json';
import lig... |
prolifick1/ts-algorithms | src/isValidParentheses.ts | <reponame>prolifick1/ts-algorithms
function isValidParentheses(str : string) : boolean {
let brackets : Record<string, string> = {
'{': '}',
'[': ']',
'(': ')'
};
let stack : string[] = [];
for(let i = 0; i < str.length; i++) {
if(str[i] in brackets) {
stack.push(str[i]);
} else {
... |
prolifick1/ts-algorithms | test/majorityElement.spec.ts | import { expect } from 'chai';
import majorityElement from '../src/majorityElement';
describe('majorityElement', function() {
it('evaluates [3,2,3] to be 3', function() {
expect(majorityElement([3,2,3])).to.eq(3);
});
it('works for single element', function() {
expect(majorityElement([9])).to.eq(9);
});
});
|
prolifick1/ts-algorithms | test/isValidParentheses.spec.ts | <reponame>prolifick1/ts-algorithms
import isValidParentheses from '../src/isValidParentheses';
import { expect } from 'chai';
describe('isValidParentheses', () => {
it('returns true for \(\)', () => {
expect(isValidParentheses('()')).to.equal(true);
});
it('returns true for \(\)\[\]\{\}', () => {
expect... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.