text stringlengths 7 3.69M |
|---|
module.exports = rows => {
return new Promise((resolver, reject) => {
try{
const words = rows
.filter(filterValidRow)
.map(removePunctuation)
.map(removeTags)
.reduce(mergeRows)
... |
const actions = require('../support/actions')
const selectors = require('../support/selectors')
const { Given, When, Then, setDefaultTimeout } = require('@cucumber/cucumber')
setDefaultTimeout(60 * 1000);
Given('Open website', async () => {
await actions.visitWebSite();
});
When('Goto Help', async () => {
awa... |
import React, { useState, useMemo } from 'react';
import { View, StyleSheet } from 'react-native';
import Animated, { Easing, Extrapolate } from 'react-native-reanimated';
import { TouchableWithoutFeedback } from 'react-native-gesture-handler';
import Heart from './SVG/Heart';
const {
Clock,
Value,
set,
cond,
... |
import React, { Fragment, useEffect, useState } from 'react';
import Window from '../windows/Window';
import BlindsUp from '../windows/coverings/BlindsUp';
export default () => {
const getColor = () => {
const h = (Math.random() * 360).toFixed(0);
return {h, s: 60, l: 0}
}
const [light ,... |
// //arguments function is no longer bound with arrow functions
// const add = function(a, b){
// console.log(arguments); //will print all the arguments passed inside
// return a + b;
// }
// console.log(add(55, 1, 20));
// const addarrow = (a, b) => {
// //console.log(arguments); //will print an error
/... |
import App from '../App'
//事务模块
// const affairList = resolve => require(['../page/affair/affairList'], resolve);
// const affairDetail = resolve => require(['../page/affair/affairDetail'], resolve);
//单元模块
const unitInfoALL = resolve => require(['../page/unitInfo/unitInfoALL'], resolve);
const unitInfoAllMap = resolv... |
import {Component} from 'react'
import './index.css'
class DistrictData extends Component {
componentDidMount() {
this.getDistrictData()
}
getDistrictData = async () => {
const response = await fetch(
'https://data.covid19india.org/v4/min/data.min.json',
)
const data = await response.json(... |
// pages/home/index.js
const app = getApp();
const config = require("../../utils/config.js");
const userService = require("../../service/userService.js");
const couponService = require("../../service/couponService.js");
const depositService = require("../../service/depositService.js");
Page({
/**
* 页面的初始数据
*... |
var mongoose = require('mongoose')
var RecordSchema = new mongoose.Schema({
year: {
type: String,
required: [true, "can't be blank"],
match: [/\d{4}[MY]/, 'is invalid']
},
keyList: [String],
businessSegments: [{
business: {
type: String,
required: [true, "can't be blank"]
},
... |
module.exports = function(app) {
Ember.TEMPLATES['components/svg-i'] = require('./template.hbs');
require('./style.less');
app.SvgIComponent = Ember.Component.extend({
mIcon: '',
icon: 'close',
icons: require('../../../svg-icons'),
size: 0,
tagName: 'i',
did... |
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'login',
component: ()=>import('@/pages/login.vue')
},
{
path: '/register',
name: 'register',
component: ()=>import('@/pages/register.vue')
... |
import React from 'react';
import './App.css';
import Timer from "./timeManager.js";
import Dropdown from "./dropdown.js";
import Header from "./header.js";
import Calendar from "./calendar.js";
import Lunch from "./lunch.js";
import List from "./scheduleList.js";
import ButtonBar from "./buttonBar.js";
import Job from... |
import { StyleSheet } from 'react-native'
import { metrics, colors, fonts } from '../../styles'
const styles = StyleSheet.create({
container: {
backgroundColor: colors.primary,
height: 56,
width: 56,
borderRadius: 28,
position: 'absolute',
right: metrics.padding,
bottom: metrics.padding,
... |
import ReactDom from "react-dom";
import Highlight from "highlight.js";
function RenderService(){
const APP_CONTAINER_ID = "app";
const CODE_BLOCKS_TAG_NAME = "code";
function render({content}){
const appContainer = document.getElementById(APP_CONTAINER_ID);
ReactDom.unmountComponentAtNod... |
(function ($) {
if (window == top) {
//Global shortcuts
$.shortcuts.add(window, "CS+1", function () {
var tree = UmbClientMgr.mainTree()._tree;
if (tree) {
window.focus(); //Bug, at least in chrome. If window.focus has been called on... |
import {
SET_START_LOADING_PROGRESS
} from '../actions/startLoadingProgress';
const initialState = {
confirmations : 6,
progress : 0
};
export default function (state = initialState, action) {
switch (action.type) {
case SET_START_LOADING_PROGRESS :
return {...state, ...action.acti... |
import React from "react";
import { List, ListItem} from 'framework7-react';
import crypto from 'crypto-js';
const RoleList = (props) => {
if (props.roles) {
return (
<List mediaList>
{props.roles.map((role) =>
<ListItem
key={crypto.lib.WordArray.random(32)}
link=... |
let second = document.getElementById('second').innerHTML;
class taskTimer {
constructor(sec) {
this.defaultSec = sec;
this.timerID = 0;
second = this.defaultSec;
}
getTime() {
function fixTimer(value) {
let str = String(value);
let result = (value <... |
describe("Reverse Last Two Letters", function() {
it("swaps last 2 letters", function() {
expect(reverseLastTwoCharacters("OH")).toBe("HO");
});
});
describe("Reverse Last Two Letters", function() {
it("swaps last 2 letters", function() {
expect(reverseLastTwoCharacters("OH")).toBe("HO");
});
}); |
/*
index.js:Webpage入口起点文件
安装webpage指令:
1 先初始化一个package.json文件
1.1 npm init
1.2 输入名称
1.3 一直回车即可
2 npm i [email protected] [email protected] -g 这个是全局安装
只安装了全局的就可以
3 npm i [email protected] [email protected] -D 这个是开发包
4 node 执行代码 node .\build\built.js 相当于右键 run code
1.运行指令:
开发环境:webpack ./src/index.js -o ./buil... |
import { createStore } from "redux";
import rootReducer from "./modules";
import dataManager from "./modules/dataManager";
const store = createStore(dataManager(rootReducer));
export default store;
|
/**
* @param {number[][]} bookings
* @param {number} n
* @return {number[]}
*/
var corpFlightBookings = function(bookings, n) {
flights = {};
for (let i = 1; i <= n; i++) {
flights[i] = 0;
}
for (let i = 0; i < bookings.length; i++) {
for (let j = bookings[i][0]; j <= bookings[i][1]; j++) {
if... |
import React from 'react'
class IntroPage extends React.Component {
render() {
return (
<div className="intropage" >
<h1>Handy Dandy</h1>
<p>A place where people like you can hire or get hired to do something they good at!</p>
</div>
)
}
}
export default IntroPage;
|
import React, {Component} from 'react';
class Cate extends Component {
constructor(props) {
super(props);
this.onCateSelect = this.onCateSelect.bind(this);
}
onCateSelect() {
this.props.selectCate(this.props.cate.id);
}
render() {
return (
<ul className="kid-menu" style={{display: '... |
/** @format */
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import { makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableContain... |
var http = require('http');
var fs = require('fs');
var url = require('url');
var mongodb = require("mongodb");
var port = 8085;
var MongoClient = mongodb.MongoClient;
var collections = {
animale: null, //done
electronice: null, //done
useri: null, //done
haine: null, //done
bijuterii: null, //done... |
cc.Class({
extends: cc.Component,
properties: {
point1List: [cc.Node],
point2List: [cc.Node],
point3List: [cc.Node],
point4List: [cc.Node],
point5List: [cc.Node],
goldList: [cc.Node],
pufferModList: [cc.Node],
citieList: [cc.Node],
scene: [... |
const navMenu=document.getElementById('nav-menu'),
toggleMenu=document.getElementById('nav-toggle'),
closeMenu=document.getElementById('nav-close')
//show
toggleMenu.addEventListener('click',()=>{
navMenu.classList.toggle('show')
})
//hide
closeMenu.addEventListener('click',()=>{
navMenu.classList.rem... |
import { gql } from '@apollo/client';
const GET_OPERATOR_STATUS = gql`
query GetOperatorStatus($id: ID!) {
operator: getOperator(id: $id) {
id
givenName
familyName
email
}
}
`;
export { GET_OPERATOR_STATUS }; // eslint-disable-line
|
(function() {
'use strict';
angular
.module('iconlabApp')
.factory('PointAvancementSearch', PointAvancementSearch);
PointAvancementSearch.$inject = ['$resource'];
function PointAvancementSearch($resource) {
var resourceUrl = 'api/_search/point-avancements/:id';
retur... |
import React from 'react'
import { View, Text, Image, StyleSheet, TouchableWithoutFeedback } from 'react-native'
import PERSON from '../../images/person.png'
const buildImage = (person) => {
if (person.image) {
return <Image style={{width:80, height: 80, borderRadius:40}} source={person.image} resizeMode="... |
// Filename: libs/amcharts/amcharts-wrapper.js
define([
// Load the original amcharts source file
'lib/amcharts/amcharts'
], function(){
// Get global reference
// Apparently jscolor uses multiple globals, so this is actually pointless as a way to wrap jscolor.
// Only good for passing reference into ca... |
let express = require('express');
let router = express.Router();
const upload = require('../services/file.upload')
const singleUpload = upload.single('image')
router.post('/', function(req, res){
//console.log('hitting file route')
singleUpload(req, res, function(err){
if(err) {res.status(400).s... |
const Discord = require("discord.js");
module.exports = class howgay {
constructor(){
this.name = 'howgay',
this.alias = ['gay'],
this.usage = 'howgay'
}
run(bot, message, args){
var min=1;
var max=100;
var random =Math.floor(Math.random() * (+ma... |
import React from 'react';
import {Switch, Route, useRouteMatch} from 'react-router-dom';
import Rooms from "../pages/app/Rooms";
import SingleRoom from "../pages/app/Room/SingleRoom";
import PublicRooms from "../pages/app/PublicRooms";
import JoinedRooms from "../pages/app/JoinedRooms";
import NotFound from "../pages/... |
import React, { useContext, useState } from 'react';
import { Carousel, Card, Image } from 'antd';
import beijing from './beijing2.jpg';
import shanghai from './shanghai.jpg';
import shenzhen from './shenzhen.jpg';
// 'https://react.semantic-ui.com/images/wireframe/image.png'
import { Text, LanguageContext } from '.... |
/*************************************************************/
/**
* 接口名称:新建群分组<br>
* 功能:
* "action": "1.202"
* "method": "1.1.0001"
*/
var request = {
"head" : {
"key" : "e3659c12-ca74-46da-81c9-35d646b4ae65",
"name" : "",
"action" : "1.202",
"method" : "1.1.0001",
"version" : "1",
"time" : 15245799... |
const express = require("express");
const bodyParser = require("body-parser");
const app = express();
app.use(express.static("p"));
app.set("view engine", "ejs");
const mongoose = require("mongoose");
app.use(bodyParser.urlencoded({ extended: true }));
//create new database
mongoose.connect("mongodb://loc... |
import React from 'react';
import s from './ButtonsBlock.module.css'
import Button from "../../Button/Button";
import {connect} from "react-redux";
import {increment, reset} from "../../redux/reduser";
const ButtonsBlock = (props) => {
return (
<div className={s.buttonsBlock}>
<Button onClickF... |
module.exports = {
"sidebar.app": "App",
"sidebar.horizontal": "Horizontales",
"sidebar.horizontalMenu": "Horizontales Menü",
"sidebar.general": "Allgemeines",
"sidebar.component": "Komponente",
"sidebar.features": "Eigenschaften",
"sidebar.applications": "Anwendungen",
"sidebar.dashboard": "Instrumententafel",... |
import React, { Component } from 'react';
import {Redirect,Link} from "react-router-dom";
export class Bridegroomfather extends Component
{
constructor(props) {
super(props);
this.state = {
name: "React",
showHideDemo1: false,
};
const {value:{groomfatherlivingstatus,fatherschooseaddress,... |
/*
* @lc app=leetcode id=54 lang=yavascript
*
* [54] Spiral Matrix
*/
/**
* @param {number[][]} matrix
* @return {number[]}
*/
var spiralOrder = function(matrix) {
if (!(matrix.length && matrix[0].length)) {
return [];
}
const deep = Math.min(Math.ceil(matrix.length / 2), Math.ceil(matrix[0].... |
import React, { Component } from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import AppBar from 'material-ui/AppBar';
import RaisedButton from 'material-ui/RaisedButton';
import TextField from 'material-ui/TextField';
import FlatButton from 'material-ui/FlatButton';
import helpers from... |
app = document.getElementById('app')
let topDiv = document.createElement('div')
topDiv.id = 'topDiv'
topDiv.className = 'row'
let avatar = document.createElement('div')
avatar.id = 'avatar'
avatar.innerHTML = `<img src='./assets/avatar.jpg' class='avatar'>`
let info = document.createElement('div')
... |
"use strict";
module.exports = (sequelize, DataTypes) => {
const Car = sequelize.define(
"Car",
{
car_title: { allowNull: false, type: DataTypes.STRING },
car_location: { allowNull: false, type: DataTypes.STRING },
//car_brand_id: { allowNull: false, type: DataTypes.INTEGER },
car_mode... |
const MyError = require('./classError');
function ErrorReport(options) {
this.url = options.url;
this.method = options.method || 'POST';
if (!this.url) {
throw new Error('URL is not defined');
}
}
ErrorReport.prototype.report = function(err, meta) {
meta = meta || {};
if (typeof wind... |
var user ={
name:'Vasya',
sayHi: function(){
showName(this);
}
}
function showName(nameObj) {
console.log(nameObj);
}
user.sayHI();
|
import Riotcontrol from 'riotcontrol';
riot.control = Riotcontrol;
riot.EVT = {
pushChart: 'push_chart',
getChart: 'get_chart'
};
|
/*
Send an email to client to notify them of a new biography request
- called from pages/biography -> components/ParallaxBiog/Download.js
- call body = {
email: String
}
*/
// import sendgrid sdk
const sgMail = require('@sendgrid/mail')
import { validate } from './validation'
export def... |
import React from 'react'
// The loading animation ( set in css )
const screen = ( { message } ) => (
<div className = 'backdrop loading'>
<div className = "loader"></div>
<div>{ message }</div>
</div>
)
export default screen |
/* kozmetika -> kod lepo uredjen. nije vise sve u jednoj liniji */
var student = null;
(jQuery)(document).ready(function () {
var tabLink = "#1";
var autocompetecache = {},
lastXhr;
start();
function start() {
(jQuery)("#fb-text").focus(function () {
(jQuery)(this).val("");
});
(jQuery).ajax({
data : "... |
import React, { Component } from "react";
import { withRouter } from 'react-router-dom';
import { Row, Col, FormGroup, FormControl, Card } from "react-bootstrap";
import axios from 'axios';
import "../../app.css"
import "./forgot.css";
//Components
import Loader from '../Loader/Loader';
import Cancel from "../../comp... |
/* eslint-disable no-console */
const { Pool } = require('pg');
const pool = process.env.NODE_ENV === 'production'
? new Pool({
connectionString: process.env.DB_URI,
})
: new Pool({
user: process.env.LOCAL_USER,
host: 'localhost',
database: 'product_wrapper',
password: process.env.LOCAL_PASSW... |
import React, { Component } from 'react'
import styled from 'styled-components';
import {Portal, absolute} from 'Utilities';
import Icon from './Icon';
import {Card} from './Cards';
export default class Modal extends Component {
render() {
const { children, on, toggle } = this.props
return (
... |
(function () {
angular
.module('driverCheck')
.controller('employeeeditCtrl', employeeeditCtrl);
employeeeditCtrl.$inject = ['$location', '$routeParams', 'driverCheckData'];
function employeeeditCtrl($location, $routeParams, driverCheckData) {
var vm = this;
vm.pag... |
const datePicker = document.querySelector("#datePicker");
const submitBtn = document.querySelector("#submitBtn");
const resultDiv = document.querySelector("#result");
function reverseString(str) {
let charList = str.split("");
let reversedList = charList.reverse();
let reversedStr = reversedList.join("");
ret... |
/**
* 下一环节UI组件
* @param window
* @param $
*/
(function(window, $){
// UI类型常量
var UIType = {
"Text":"text",
"Radio":"radio",
"Check":"check",
"Select":"select",
"Input":"input",
"Textarea":"textarea",
"Tree":"tree",
"Next":"next",
"Hidden":"hidden",
'Combobox':'combobox'
};
/**
* 基类
*/
... |
const mongoose = require('mongoose')
const scheduleSchema = new mongoose.Schema({
title: {
type: String,
required: true
},
desc: {
type: String,
required: true
},
services: [
{
type: mongoose.ObjectId,
ref: 'Service',
requi... |
const formStyles = theme => ({
container: {
display: "flex",
flexWrap: "wrap",
flexDirection: "column"
}
});
export default formStyles;
|
/* This file was generated from TypeScript source C:/Users/autobuild/turbulenz/engine/tslib/webgl/ddsloader.ts */
// Copyright (c) 2011-2012 Turbulenz Limited
/*global TurbulenzEngine*/
/*global Uint8Array*/
/*global Uint16Array*/
/*global window*/
"use strict";
//
// DDSLoader
//
function DDSLoader() {
return th... |
import stuff from 'stuff'
import memoize from 'utils/memoize'
export default memoize(item => Object.keys(stuff).includes(item))
|
/*globals Globalize window jQuery wijInputResult document*/
/*
*
* Wijmo Library 2.2.1
* http://wijmo.com/
*
* Copyright(c) GrapeCity, Inc. All rights reserved.
*
* Dual licensed under the Wijmo Commercial or GNU GPL Version 3 licenses.
* [email protected]
* http://wijmo.com/licen... |
$(function () {
const $toggle = $(".js-humberger-menu");
const $globalNav = $(".js-global-nav");
$toggle.on("click", function () {
if($globalNav.css('display') === 'block') {
$globalNav.slideUp('1000');
}else {
$globalNav.slideDown('1000');
}
});
}); |
// Calculator:
const beansInput = document.querySelector("#beans");
const ratioInput = document.querySelector("#ratio");
const waterInput = document.querySelector("#water");
const coffeeInput = document.querySelector("#coffee");
const beansSlider = document.querySelector("#beans-slider");
const ratioSlider = document... |
module.exports = function (app) {
require('dotenv').config()
const accountSid = process.env.TWILIO_ACCOUNT_SID
const authToken = process.env.TWILIO_AUTH_TOKEN
const client = require('twilio')(accountSid, authToken)
client.messages.create({
body: 'This is a test text message!!',
from: '+12186667109',... |
mongo_const={
url:'mongodb://localhost:27017',
db:'email_auth',
collections:"users"
}
module.exports={
mongo_const
} |
//----------------------------------------------------------------------------------------
// Jay Lin
// API Practice
// My Favorite Songs
const express = require('express');
const app = express();
const PORT = 8080; // HTTP alt, above the restricted range
//------------------------------------------------------------... |
const express = require("express");
const Games = require("../models/Games");
const router = express.Router();
router.get("/", async (req, res) => {
const { q, limit, page, fields, orderBy, sortBy } = req.query;
const DEFAULT_LIMIT = 10;
const DEFAULT_PAGE = 1;
const DEFAULT_ORDER_BY = "title";
const criter... |
import faker from 'faker';
const getRandomIntInclusive = (min, max) => {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1) + min);
};
const generateData = (count = 1000) => {
let data = [];
for (let i = 0; i < count; i++) {
data.push({
name: faker.name.... |
Mondo.addTranslation('de-CH', { foo: 'foo'}); |
import React from 'react';
import Link from 'next/link';
import Layout from '../components/wrapper';
import { Grid, Header, Form, Message } from 'semantic-ui-react';
import web3 from '../../ethereum/web3';
import factory from '../../ethereum/factory';
class NewContest extends React.Component {
state = {
u... |
var should = require('should');
var request = require('request');
var async = require('async');
var utils = require('./utils');
var Couch = require('../lib/couch');
var _ = require('underscore');
var testPort = 12500;
var dbName = 'ws_mocks';
var dbConfig = {path... |
function convertStringToNumber (string, x = 10) {
let chars = string.split('');
let number = 0;
let i = 0;
while (i < chars.length && chars[i] !== '.') {
number = number * x;
if (/[a-f]/.test(chars[i])) {
number += chars[i].codePointAt(0) - 'a'.codePointAt() + 10;
} ... |
define([
'jquery',
'underscore',
'backbone'
], function($, _, Backbone){
window.Band = Backbone.Model.extend({
changePopulation: function(people){
this.set('population', this.get('population') + people);
this.trigger('change:population');
return this;
}
});
}) |
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import NavBar from './common/NavBar';
import InteractionForm from './Interactions';
import '../../node_modules/bootstrap/dist/css/bootstrap.min.css';
import '../css/main.css';
class Hello extends Component {
render() {
return (<div c... |
import React from "react";
import { useSpring, animated } from "react-spring";
import styled from "styled-components";
import { Responsive } from "../styles/vars";
const trans1 = (x, y) => `translate3d(${x / 10}px,${y / 10}px,0)`;
const trans2 = (x, y) => `translate3d(${x / 9}px,${y / 9}px,0)`;
const trans3 = (x, y) =>... |
import Axios from "axios";
import { LOADING, LOADED, ERROR, UNASKED, aF } from ".";
const DIRECT_OBJECT = `DROPS`;
const LOADING_DROPS = `LOADING_` + DIRECT_OBJECT;
const LOADED_DROPS = `LOADED_` + DIRECT_OBJECT;
const ERROR_DROPS = `ERROR_` + DIRECT_OBJECT;
const ADD_DROP = `ADD_DROP`;
const DELETE_DROP = `DELETE_DRO... |
import React, {Component} from 'react';
import ConnectTransitionWrapper from 'client/lib/ConnectTransitionWrapper';
@ConnectTransitionWrapper()
export default class DummyComponent extends Component {
render() {
return (
<div>
<p>Dummy</p>
</div>
);
}
}
|
var PLUGIN_INFO =
<KeySnailPlugin>
<name>Navigate Relations</name>
<description>Easily move via next/prev tags/links</description>
<version>0.1</version>
<updateURL>http://github.com/kidd/keysnail-navigate-relations/raw/master/navigate-relations.ks.js</updateURL>
<author mail="[email protected]" ... |
import React from 'react';
export default function Product(props){
return(
<div>
<div>{props.element.name}</div>
<div>{props.element.price}</div>
<div>{props.element.image}</div>
</div>
)
} |
import React from "react";
import Card from "react-bootstrap/Card";
import "../../style.css";
import "bootstrap/dist/css/bootstrap.min.css";
function AboutCard() {
return (
<Card className="quote-card-view">
<Card.Body>
<blockquote className="blockquote mb-0">
<p style={{ textAlign: "just... |
import io from 'socket.io-client';
import { NEW_MESSAGE, ADD_MESSAGE, SIGN_IN } from '../actions/types';
export const socketMiddleware = (baseUrl) => {
return storeAPI => {
let socket = io(baseUrl);
// Setup default listener
let listener = setupSocketListener('default', socket, storeAPI);
// Check... |
const NODE_ENV = process.env.NODE_ENV;
const PORT = process.env.PORT || 3000;
const DB_ADDRESS = process.env.DB_ADDRESS;
module.exports = {
NODE_ENV,
PORT,
DB_ADDRESS,
};
|
'use strict';
/**
* @name OnhanhDashboard
* @description ...
*/
productModule
.config(['$stateProvider',
function($stateProvider) {
var getSections = ['Sections', function(Sections) {
return Sections.all();
}];
var getProductId = ['$sta... |
import _ from 'lodash'
import Graph from '../Graph.js'
import Node from '../Node.js'
describe('Graph', () => {
beforeEach(() => {
jest.useFakeTimers()
})
const genBasicGraph = () => {
const graph = new Graph()
const nodeSpecFactories = {
node1: () => {
const nodeSpec = {
id... |
const express = require('express');
const app = express();
const posts = require('./routes/posts');
const login = require('./routes/login');
const btc = require('./routes/btc');
const calculator = require('./routes/calculator');
const recipes = require('./routes/recipe');
const comments = require('./routes/comments');
... |
// Dependencies
var express = require("express");
var app = express();
require("./routes/apiRoutes")(app);
// require("./routes/htmlRoutes")(app);
// Listen on port 3000
app.listen(3000, function() {
console.log("App running on port 3000!");
});
|
// buz.js
var Buz = function () {
this.arr = []
this.arr.push(0)
};
Buz.prototype.log = function () {
this.arr.push(this.arr.length)
console.log(this.arr);
return this.arr
};
Buz.prototype.chain1 = function (str) {
this.arr.push(str)
return this
};
module.exports = Buz; |
const { Robot } = require('./Robot');
describe('Robot class', () => {
const botTest = new Robot();
const position = {x:3,y:4,f:'NORTH'};
jest.spyOn(botTest, 'setPosition');
jest.spyOn(botTest,'faceOnChange');
jest.spyOn(botTest,'move');
it('should setPostion method take position as argum... |
import React, {
useCallback,
useEffect,
useState,
useRef,
useMemo,
} from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { LoadingOutlined } from '@ant-design/icons';
import { loadGroupsRequestAction } from '../../reducers/group';
import GroupList from './GroupList';
import styled fro... |
import AsyncStorage from "@react-native-async-storage/async-storage";
import * as React from "react";
import {
Text,
View,
StyleSheet,
TextInput,
Button,
ActivityIndicator,
TouchableOpacity,
} from "react-native";
import firebase from "../Firebase";
function OTPScreen(props) {
const { verificationId, p... |
X.define("modules.accountSettings.accountSafety",["model.userModel"],function (userModel) {
var view = X.view.newOne({
el: $(".xbn-content"),
url: X.config.accountSettings.tpl.accountSafety
});
//初始化控制器
var ctrl = X.controller.newOne({
view: view
});
ctrl.rendering = fu... |
var getSelectionText=function() {
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type != "Control") {
text = document.selection.createRange().text;
}
return text;
}
var help_me=function(){... |
import logo from './logo.svg';
import './App.css';
import AdminNavbar from "./components/navbar";
import VerticalBar from './components/graphs'
import { Container, Row, Col , Card} from "react-bootstrap";
import "./assets/css/demo.css";
import Dropdown from './components/select_dropdown'
import Spinner from './componen... |
import Vue from 'vue'
import Router from 'vue-router'
import vHeader from '../components/v-header'
import vCart from '../components/v-cart'
import vCatalog from '../components/v-catalog'
import vTable from '../components/v-table'
import vSofa from '../components/v-sofa'
Vue.use(Router);
let router = new Router({
... |
import { makeID } from './functions'
class MasterFormat {
generateCSI() {
//(?<=[0-9]) (?=[A-Z])
// \n
const masterformat = new MasterFormat();
const division_0 = masterformat.division_0()
const division_1 = masterformat.division_1()
const division_2 = masterformat.... |
// todo 未启用
module.exports = {
namespaced: true,
state: { openCreateDialog: false, openEditDialog: false },
getters: {
// menuTree: function(state) {
// return state.menuTree;
// }
},
mutations: {
// setMenuTree: function(state, data) {
// state.menuTree = data;
// }
},
actions... |
import React from 'react'
const backStyles = {
// marginTop: 85,
// paddingLeft: 45,
// color: "black",
// position: "fixed"
}
const TopBar = ({title}) => {
return (
<div className="topbar">
<a href="/work"><span id="logo" style={{color:"black", fontSize:"20px", fontWeight:"bold", po... |
window.onload = function () {
//设置背景
function setBodyBg() {
}
//获取select
var select = document.getElementById("select");
//设置改变监听
select.onchange = function () {
//获取当前改变的想
var bgColor = select.options[select.selectedIndex].value;
if(bgColor == ""){
docum... |
const puppeteer = require("puppeteer-extra")
const StealthPlugin = require("puppeteer-extra-plugin-stealth")
const util = require("./util")
puppeteer.use(StealthPlugin())
module.exports = async (twitchCookies, riotUsername, riotPassword, cb) => {
let args = ["--lang=fr-FR,fr", "--window-position=-1000,0"]
pup... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.