text stringlengths 7 3.69M |
|---|
function solve(firstNum, secondNum){
let firstFactoriel = calculateFactoriel(firstNum);
let secondFactoriel = calculateFactoriel(secondNum);
let result = firstFactoriel / secondFactoriel;
console.log(result.toFixed(2));
function calculateFactoriel(n){
if(n === 1){
return 1... |
import { CHANGE_MODAL_VISIBLE, BLOCK, BLOCKEDUSERS, UNLOCKUSERS } from './action-types'
export const showModalAction = (record) => {
return {
type: CHANGE_MODAL_VISIBLE,
content: record
}
}
export const blockUser = (index) => {
return {
type: BLOCK,
blockUserId: index
}... |
import { useQuery } from "react-query";
import { getMovieDetails } from "../api/movie";
export const useMovieDetails = (imdbId) => {
return useQuery(["movie", imdbId], () => getMovieDetails(imdbId), {
enabled: !!imdbId,
});
};
|
import React from 'react';
const Screen = (props) => {
return(
<div className="fl w-100">
<input type="text"
placeholder={props.text}
value={props.text}
className="dib pa3 ma2 bg-light-gray ba2 fl w-100"/>
</div>
);
}
export default Screen; |
var form = document.getElementById('contact-form');
form.addEventListener("focusout", isValid);
form.addEventListener('focusin', removePlaceholder);
function removePlaceholder(el){
if(el.target.type === "textarea" && el.target.value === "Nachricht"){
el.target.value = "";
}
}
//sets final state cla... |
var dummybase = [
{fortune: 'Today its up to you to create the peacefulness you long for.', user: 'David'},
{ fortune: 'A friend asks only for your time not your money.', user: 'Someone' },
{ fortune: 'There is a true and sincere friendship between you and your friends.', user: 'Someone' },
{ fortune: 'You fin... |
$(document).ready(function(){
OrderView.init();
})
var OrderView = {
init: function()
{
var orderJson = JSON.parse($('#orderRawData').val());
var node = new PrettyJSON.view.Node({
el:$('#orderJson'),
data: orderJson
})
},
history: function (id)
... |
'use strict';
/**
* @ngdoc service
* @name thelistwebApp.restService
* @description
* # restService
* Factory in the thelistwebApp.
*/
angular.module('thelistwebApp')
.factory('restService', ['$http', function ($http) {
var baseUrl = 'http://localhost:8888/';
// var baseUrl = 'https://2-dot-th... |
const mongoose= require('mongoose');
const Schema = mongoose.Schema;
const TaskSchema = new Schema({
title: String,
email:String,
monto:String,
carrera:String,
grupo:String,
telefono:String,
description: String,
status:{
type:Boolean,
default:false
}
})
module.expor... |
import React from 'react';
import ReactDOM from 'react-dom';
// Styles
import "./style/css/main.css"
//Views
import App from './App'
const root = document.querySelector("#__body");
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
root
); |
import React from 'react'
import ExitIcon from 'material-ui/svg-icons/action/exit-to-app'
import UsersIcon from 'material-ui/svg-icons/social/people'
import DashboardIcon from 'material-ui/svg-icons/action/dashboard'
import SupportIcon from 'material-ui/svg-icons/communication/chat'
import IconButton from './IconButto... |
import React, { Component } from 'react';
import './publish.scss';
import ReactQuill from 'react-quill'; // ES6
import 'react-quill/dist/quill.snow.css'; // ES6
import * as util from '../../assets/util'
import { Button, Input, message } from 'antd';
export default class List extends Component {
constructor(props) {
... |
var app = angular.module('starterApp', [ 'ngRoute', 'ngMessages', 'ngMaterial' ]);
app.config([
'$routeProvider',
'$mdThemingProvider',
function($routeProvider, $mdThemingProvider) {
$routeProvider
.when('/', {
templateUrl: 'partials/home.tmpl.htm... |
// create custom component
var TimerExample = React.createClass({
getInitialState: function () {
// called before render function
// object returned is assigned to this.state, for late reuse
return { elapsed: 0 };
},
componentDidMount: function () {
// componentDidMount is called by reacvt when comp rendere... |
// Evolutility-UI-React :: /views/one/Card.js
// Single card (usually part of a set of Cards)
// https://github.com/evoluteur/evolutility-ui-react
// (c) 2017 Olivier Giulieri
import React from 'react'
import models from '../../../models/all_models'
import format from '../../utils/format'
import { Link } from 'rea... |
var GameManager = new function() {
var RP_URL = null;
var tutorialState = false;
var isFirstConn = false;
var userText = ["임시사용자", "-"];
this.getUserText = function() {
return userText;
};
this.getFirstConn = function() {
return isFirstConn;
};
this.init = fun... |
var express = require("express");
var router = express.Router();
const sqlite3 = require("sqlite3").verbose();
const json2csv = require("json2csv");
/* GET data listing. */
router.get("/", function(req, res, next) {
// console.log("algo");
let sc = req.query.sc;
let q = req.query.q;
let mun = req.query.mun;
let... |
/**
* @license
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requi... |
/* eslint-disable class-methods-use-this */
// @flow
import TONAsync from '../TONAsync';
import TONLimitedFetcher from '../TONLimitedFetcher';
class TestFetcher extends TONLimitedFetcher<*, *> {
async fetchData(params: *): Promise<*> {
await TONAsync.timeout(1);
return params;
}
}
test('Data F... |
//offline data functionality
db.enablePersistence()
.catch(err => {
if(err.code == 'failed-precondition'){
//Probably multiple tabs open at once
console.log('persistence failed');
} else if (err.code == 'unimplemented'){
//Lack of browser support
... |
import {Router} from 'express'
import {compose, liftA, get, reduce, filter} from '@cullylarson/f'
import jwt from 'express-jwt'
import {expressJwtSecret} from 'jwks-rsa'
import isUuid from 'is-uuid'
import validateMustExist from './validators/validateMustExist'
import ForbiddenError from './errors/ForbiddenError'
impor... |
import 'vue-material/dist/vue-material.min.css'
import 'vue-material/dist/theme/default.css'
import './styles.scss'
import Vue_ from 'vue'
import {
MdApp,
MdAvatar,
MdButton,
MdCard,
MdCheckbox,
MdContent,
MdDatepicker,
MdDialog,
MdDivider,
MdDrawer,
MdEmptyState,
MdF... |
'use strict';
var cache = require('gulp-cached');
var changed = require('gulp-changed');
var csslint = require('gulp-csslint');
var del = require('del');
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var jsonlint = require('gulp-json-lint');
var less = require('gulp-less');
var livereload = require(... |
const db = require('../config/connection');
var collection = require('../config/collection')
var Objectid = require('mongodb').ObjectID
module.exports = {
addProduct: (product, callback) => {
db.get().collection('product').insertOne(product).then((data) => {
callback(data.ops[0]._id)
... |
const onecolor = require('onecolor');
const vec2 = require('gl-matrix').vec2;
const vec3 = require('gl-matrix').vec3;
const vec4 = require('gl-matrix').vec4;
const mat4 = require('gl-matrix').mat4;
const b2Vec2 = require('box2dweb').Common.Math.b2Vec2;
const b2World = require('box2dweb').Dynamics.b2World;
const b2Fixtu... |
import React, { Component } from 'react';
// import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import MyNav from '../Component/nav'
import MyCard from '../Component/mycard'
import { PageHeader, small, Carousel, Glyphicon, Col, Navbar, Nav, NavItem, NavDropdown, MenuItem, Button } from 'react-bootstrap... |
import request from '@/utils/request'
import { urlSystem } from '@/api/commUrl'
const url = urlSystem
// const url = 'http://test.womaoapp.com:8080/sys/'
// const url = 'https://apiengine.womaoapp.com/security/sys/'
export function login(username, password, captcha) {
return request({
url: url + 'sys/login',
... |
import { ListGroup, Col, Button, Form, Card, Toast } from 'react-bootstrap'
import { Link } from 'react-router-dom'
import { useState, useEffect } from 'react'
import { QuestionCard } from './QuestionCard.js'
import API from './API'
function SubmitSurvey(props) {
const [questions, setQuestions] = useState([])
... |
import Vue from 'vue'
import Router from 'vue-router'
import {BasicLayout} from '@/layouts'
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject);
return origina... |
'use strict';
require('./enroll.public.css');
require('../../../../../../asset/css/buttons.css');
require('../../../../../../asset/js/xxt.ui.image.js');
require('../../../../../../asset/js/xxt.ui.editor.js');
require('./_asset/ui.repos.js');
require('./_asset/ui.tag.js');
require('./_asset/ui.topic.js');
require('./_as... |
import {
GENERATE_PASSWORD_REQUEST,
GENERATE_PASSWORD_SUCCESS,
GENERATE_PASSWORD_FAILURE,
} from './manage-users-constants';
const initialState = {
isLoading: false,
};
const generatePassword = (state = initialState, action) => {
switch (action.type) {
case GENERATE_PASSWORD_REQUEST:
return {
... |
var path = require('path')
var postcss = require('postcss')
exports.postfactory = function (opts) {
return [
//css层级写法 https://github.com/postcss/postcss-nested
require('postcss-nested')(),
//css浏览器兼容
require('autoprefixer')({ browsers: ['last 2 versions'] }),
];
}
|
'use strict'
require('core-js/stable/object/assign') // TODO: remove dependency
require('core-js/stable/set') // TODO: remove dependency
require('core-js/stable/map') // TODO: remove dependency
require('core-js/stable/typed-array') // TODO: remove dependency
const platform = require('./src/platform')
const browser = ... |
import Default from '@src/view/Default.vue';
import Foo from '@src/view/Foo.vue';
import Bar from '@src/view/Bar.vue';
export default {
mode: 'history',
routes: [
{path: '/', component: Default},
{path: '/foo', component: Foo},
{path: '/bar', component: Bar},
],
};
|
import React, { Component } from 'react';
import Modal from '../Modal/Modal';
import { Link } from "react-router-dom";
import api from "../API/api";
class Login extends Component {
state = {
email: null,
senha: null,
alert: null,
novaSenha: null,
confirmarNovaSenha: null,
modal: false,
... |
Ext.define('AM.controller.CashMutations', {
extend: 'Ext.app.Controller',
stores: ['CashMutations'],
models: ['CashMutation'],
views: [
'master.cashmutation.List',
],
refs: [
{
ref: 'list',
selector: 'cashmutationlist'
}
],
init: function() {
this.control({
'cashmutationlist... |
$(document).ready(function() {
responsive_resize();
// NAVIGATION
$('.menu-toggle').click(function(){
$('.menu-toggle').toggleClass('active');
});
$('.teams-nav-link').hover(function(){
console.log(123);
$('.teams-list').toggleClass('team-list-active');
});
// Change wid... |
import React from 'react';
import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Flight from '.';
Enzyme.configure({ adapter: new Adapter() });
describe('Flight component', () => {
test('exists without data', () => {
const wrapper = shallow(<Flight />);
expect(wrap... |
// @TODO fix unterminated expression? {...
DefaultScript.parse = function (source, name, onException) {
if (typeof onException !== 'function') {
throw new TypeError('onException must be provided');
}
var syntax = DefaultScript.syntax;
var isEscape = false;
var isComment = false;
var breaks = [-1];
... |
'use strict';
angular.module('biofuels.sections.customers.controller', [])
.controller('customersCtrl',
function ($log,
customerService
) {
(function (vm) {
$log.debug('This is from the customers page');
vm.selected = [];
vm.customers = [];
function getCus... |
import Link from "next/link";
export function Tag({ name, children }) {
return (
<>
<Link href={`/tags/${name.toLowerCase()}/1`}>
<a>#{children}</a>
</Link>
</>
);
}
|
({
doInit: function (component, event, helper) {
try {
let regionDetected = window.sessionStorage.getItem("regionStorage");
if (regionDetected) {
helper.getCoursePlanList(component, event, helper);
}
} catch (e) {
helper.sendGAExceptio... |
import React from "react";
import { NavLink } from "react-router-dom";
const AppCommon = (props) => {
return (
<>
<section id="header" className=" d-flex ">
<div className="container-fluid">
<div className="row ">
<div className="col-10 mx-auto ">
<div className=... |
/** @format */
import { StatusBar } from "expo-status-bar";
import { filter } from "lodash";
import React from "react";
import { FlatList } from "react-native";
import {
StyleSheet,
Text,
TextInput,
TouchableOpacity,
KeyboardAvoidingView,
ScrollView,
Dimensions,
SafeAreaView,
View,
Alert,
Modal,
... |
describe('bubbleSort', function () {
it('should be a function', function () {
expect(bubbleSort).to.be.a('function');
});
it('should take a single Array as an argument and sort it to ascending order', function () {
var testArr = [5, 1, 4, 2, 8];
var testArr2 = [3, 4, 2, 1, 6];
var testArr3 = [... |
import React from "react";
import { configure, shallow } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import App from "./App";
import Basket from "./basket/basket";
configure({ adapter: new Adapter() });
describe("<App /> Component tests", () => {
let wrapper;
beforeEach(() => {
wrapper = s... |
var semver = require('semver')
var shell = require('shelljs')
/**
* Execute a shell command.
*
* @param {string} command
*/
function exec (command) {
return shell.exec(command, { silent: true })
}
var repo = {
/**
* Check whether a repo exists.
*
* @return {bool}
*/
exists: function () {
re... |
import http from "./httpService";
function getTypes() {
return http.get("/types");
}
export default {
getTypes
};
|
import React, { Component } from "react";
import PropTypes from "prop-types";
import RcSlider from "rc-slider";
import Typography from "components/Typography";
import Diamond from "components/Icons/Diamond";
import sliderSound from "assets/slider-change-sound.mp3";
import loseSound from "assets/lose-sound.mp3";
import ... |
import styled from "styled-components";
import Ticker from "react-ticker";
import StyledImageComponent from "../../utility/ImageComponent";
const BannerContainer = styled("div")`
width: 100vw;
margin-top: 5rem;
`;
const ImageContainer = styled.div`
display: flex;
justify-content: center;
`;
const images = [
... |
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import Spinner from 'Components/Spinner';
import ShoppingBagHeader from './ShoppingBagHeader';
// Dynamically load ShoppingBagBody component and name it 'ShoppingBagBody' for webpackChunkName. For more info: https://webpack.js.org/guides/code... |
"use strict";
// Controller
function Assets(app, req, res) {
// HTTP action
this.action = (params) => {
// Send file
app.sendFile(res, app.getConfig().files.assets_path + params[0]);
};
};
module.exports = Assets; |
MyApp.service('Config', function() {
/*
Macro Definition
*/
this.APIBASE_URL = 'https://api.bounceequestrian.com/';
});
|
$(document).ready(function() {
$('.list-group-items').click(function() {
$(this).find('span', function(span) {
var num = Number($(this).html());
num--;
if (num <= 0) {
num = '';
}
$(this).html = num;
})
});
}); |
(function () {
'use strict';
APP.NoteModel = Backbone.Model.extend({
// Defaults
defaults: {
title: '',
description: '',
author: '',
id: _.random(0, 10000)
},
validate: function (attributes) {
var errors = {};
if (!attributes.title) {
errors.title = 'Please give this note a title.';
... |
import {
GraphQLList,
GraphQLObjectType,
GraphQLString,
} from 'graphql';
import { fetchPersonByURL } from '../api';
const Person = new GraphQLObjectType({
name: 'Person',
description: 'Represent Person',
fields: () => ({
id: {type: GraphQLString},
firstName: {
type: GraphQLString,
reso... |
//var scriptControllerGUI : ControllerGUI ;
var scriptControllerGUI : MonoBehaviour;
var functionTouchDown : String = null;
var functionTouchedDownAndContinue : String = null;
var functionTouchUpInside : String = null;
var functionTouchUpOutside : String = null;
private var imageNormal : Texture;
var imageOver : Textu... |
const CONFIG = {
AppFilesPath: './app/**/*.js',
BuildDestination: './dist/',
BuildOrder: [
// Father object
'./core/MVCLite.js',
// Framework Utilities
'./utilities/Http.js',
// Base Objects
'./core/MVCLiteObject.js',
'./core/DynamicNode.js',
... |
var builder = require('botbuilder');
var customVision = require('./CustomVision');
var musicAlbum = require('./MusicAlbumCard');
var musicTrack = require('./MusicTrackCard');
var musicArtist = require('./MusicArtistCard');
var movieTitleCard = require('./MovieTitleCard');
var movie = require('./FavouriteMovie');
var mu... |
$(document).ready(function() {
var rounds = 1;
var ties = 0;
var userScore = 0;
var computerScore = 0;
var computerChoice = "The computer has not decided yet.";
var userChoice;
$("#game-running p").html("Game is off. Click on red button to turn the game on.");
// $(".image").on("click", function(){
/... |
/// <reference types="Cypress" />
const incometab = ".sidebar-menu > :nth-child(4)"
const addincome = "#sibe-box > ul.sidebar-menu.verttop > li.treeview.active > ul > li:nth-child(1) > a"
const head = "#inc_head_id"
const name = "#name"
const invoiceno = "#invoice_no"
const date = "#date"
const amount = "#amount"
const... |
import React from 'react';
import Particle from 'react-tsparticles'
import { optionsParticles } from '../utility';
function HomePage() {
//SECURITY CONCERN #1 = ONLY SEND THE INFO NEEDED FOR RELEVANT DISPLAY IE DO NOT SEND EVERYTHING TO DASHBOARD
//GENERATE TEST USERS
return (
<div className="App">
<... |
const Discord = require("discord.js");
exports.name = "ban";
exports.guildonly = true;
exports.run = async (robot, mess, args)=>{
try{
var embed4 = new Discord.MessageEmbed({title: 'Ошибка!', description: 'Эта команда недоступна в лс!'}).setThumbnail('https://cdn.discordapp.com/emojis/863804794170245121.gif?v=1... |
var texts = `/*
* 大家好,我是王伟超。
* 这是我的简历。
* 来点代码来渲染气氛吧。
* 让我们嗨起来~~~
*/
/* 看我变个身 */
html {
color:rgb(222,222,222);
background:rgb(90, 99, 68);
}
/* 先加个过渡吧!免得晃瞎眼~~~ */
* {
transition:all 1s;
}
/* 再加个框框,免得跑偏 */
.tag {
margin:20px;
width:600px;
overflow: auto;
height:666px;
border:2px solid #f082;
border-radi... |
export const product = {
COMMON: 'common',
WITH_DESCRIPTION: 'with_description',
};
|
'use strict';
/**
* @ngdoc directive
* @name seedApp.directive:uploader
* @description
* # uploader
*/
angular.module('seedApp')
.directive('uploader', ['', function () {
return {
templateUrl: 'views/uploader.dir.html',
scope: {
ids: '=',
},
restrict: 'E',
compile: func... |
import config from './config/config';
const history = {
action: config.pushName
};
export default history;
|
/**
* Station
* @flow
*/
import {handleErrors} from "./utils";
import {REQUEST_STATION, RECEIVE_STATION} from "../constants/ActionTypes";
export function requestStation() {
return {
type: REQUEST_STATION
};
}
export function receiveStation(station: Object) {
return {
type : RECEIVE_STATION,
... |
import * as goober from '../index';
describe('goober', () => {
it('exports', () => {
expect(Object.keys(goober).sort()).toEqual([
'css',
'extractCss',
'glob',
'keyframes',
'setup',
'styled'
]);
});
});
|
import Highlight from 'vue-highlight-component';
export default {
components: {Highlight},
data() {
return {
rowsPerPage: [50, 100, {text: 'All', value: -1}],
headers: [
{text: this.$t('notify.name'), align: 'left', value: 'name'},
{text: this.$t(... |
const express = require('express');
const router = express.Router();
const ctrlHome = require('../controllers/home');
const ctrlAdmin = require('../controllers/admin');
const ctrlLogin = require('../controllers/login');
const isAdmin = (req, res, next) => {
if (req.session.isAdmin) {
return next();
}
res.re... |
import {reactive, readonly} from 'vue'
import axios from 'axios'
const state = reactive({
tasks: []
})
const methods = {
// postTasks(task) {
// return apiClient.post('/task',task)
// },
// getTasks() {
// return apiClient.get('/tasks')
// }
}
export default {
st... |
var count = 0;
function buildHTMLForInput(name, type, id) {
return '<tr>' +
'<td>'+ id +'</td>' +
'<td>' +name +'</td>' +
'<td>' + type + '</td>' +
'<td>' +
'<div class="dropdown">' +
'<a href="#" id="drop3... |
const expect = require('expect.js');
const part1 = require('./part1');
const part2 = require('./part2');
describe('Day 03: Part 1', () => {
it('Calculates closest intersection from input 1', () => {
expect(part1('R75,D30,R83,U83,L12,D49,R71,U7,L72\nU62,R66,U55,R34,D71,R55,D58,R83')).to.equal(159);
});
it('C... |
import { createStackNavigator} from 'react-navigation';
import AdvancedPage from './AdvancedPage';
import PortfolioProjectionPage from './PortfolioProjectionPage;'
export default createStackNavigator({
Advanced: AdvancedPage,
PortfolioProjection: PortfolioProjectionPage,
});
|
const User =require('../models/user');
const {errorHandler}= require('../helpers/dbErrorHandler')
exports.sayHi =(req,res) =>{
res.json({
error:0,
code:200,
message:"The app is running on server side"})
}
exports.signup =(req,res) =>{
console.log("req.body",req.body);
const user =n... |
atom.declare("Game.Ship_fighter_1", Game.Ship,
{
configure: function method()
{
this.quads = 8;
this.solidW = 10;
this.solidH = 50;
this.baseThrust = 0.03;
this.slowdown = 0.005;
this.maxThrust = 1;
this.rotateSpeed = 0.002;
this.HP = 250;
this.regenerateHP = 0.01;
this.regenerateCooldown = 100... |
import React from 'react';
import { shallow} from 'enzyme';
import Reviews from '../client/src/components/Reviews.jsx';
import { reviews, stars } from './testDummyData.js';
describe('Reviews', () => {
it('should be defined', () => {
expect(Reviews).toBeDefined();
});
it('should render correctly', () ... |
import React, { useState } from 'react'
import { View, TextInput, Image, TouchableOpacity, Alert } from 'react-native'
import { connect } from 'react-redux'
import { KeyboardAwareView } from 'react-native-keyboard-aware-view'
import axios from 'axios'
import AsyncStorage from '@react-native-async-storage/async-storage'... |
import {Form, Input, Icon, Select, DatePicker, Row, Col, Checkbox, Button, AutoComplete} from 'antd';
import React, {Component} from 'react';
import moment from 'moment';
import 'moment/locale/zh-cn';
import SearchModal from '../../components/modal/SearchModal.js'
import {getCodeType} from '../../requests/http-req.js'
... |
import multer from 'multer';
const storage = multer.diskStorage({
destination: (req, file, cb) => {
cb(null, __basedir + '/images/')
},
filename: (req, file, cb) => {
file.name = file.originalname;
const date = Date.now();
const newName = date + "_" + file.originalname.replace(/\s/g, '').toLower... |
var linkman =decodeURI(decodeURI(Request['linkman']));
var linkphone = Request['linkphone'];
var addrs = decodeURI(decodeURI(Request['addr']));
$(function () {
$('#quxiao').click(function() {
$('#dialog1').hide();
});
//页面初始化取得收货地址列表A
currentPage = 1;
deleteId = "";
if(!empty(MemberInfo... |
/**
* @class widgets.Util.Tela
* Configura componentes genéricos na tela.
* @alteracao 21/01/2015 176562 Projeto Carlos Eduardo Santos Alves Domingos
* Criação.
*/
var args = arguments[0] || {};
/**
* Faz as configurações iniciais da window. Deve ser invocado no costrutor de todo Controller que possui janela.
... |
const Todo = require('models/todo');
const User = require('models/user');
module.exports = {
app: (req, res) => {
res.render('index', { title: 'Todo list', auth: req.isAuthenticated() ? req.user.username : 'anon' });
},
main: (req, res) => {
res.render('main', { title: 'Todo' });
},
signIn: (req, res)... |
const request = require('supertest');
const app = require('../app');
const { User, userAdminId, userAdmin, setupDatabase } = require('./fixtures/db');
// Change the timeout from 5000 ms to 3000 ms
jest.setTimeout(60000);
// Define the authentication path url
const url = '/api/v1/auth';
beforeEach(setupDatabase);
/*... |
import React from "react"
const Footer=()=>{
return(
<>
<footer className="w-100 bg-light text-center">
<p> Made In India | Privacy Policy | About | Insights | Contact Copyright All Rights Reserved © 2020 TechnoIdentity.</p>
</footer>
</>
)
}
export default Footer; |
define(["ex1/Place"], function (Place) {
"use strict";
function Home(title, latitude, longitude, whoLivesHere) {
Place.apply(this, arguments);
this.whoLivesHere = whoLivesHere;
}
Home.prototype = Object.create(Place.prototype);
Home.prototype.toString = function () {
var s = Place.prototype.t... |
import React, { Component } from "react";
import ReactDOMServer from "react-dom/server";
import {
Position,
Toaster,
Button,
InputGroup,
ButtonGroup
} from "@blueprintjs/core";
const { constants, csvToJson, electron, fs, path, process } = window;
const { configDir, defaultToast } = constants;
let { baseDir ... |
// pages/cart/index.js
Page({
/**
* 页面的初始数据
*/
data: {
goodsList:Array,
// 所有金额
allPrice:'',
// 判断全选
allSelect:false,
// 选中的商品数
selectGoodsCount:0
},
// 页面加载
onLoad(){
},
onShow(){
let goodsList = wx.getStorageSync('cart') || [];
this.statisticsGoods(goodsList)
... |
// global NAMESPACE SWAP_GURU
var SWAP_GURU = SWAP_GURU || {};
SWAP_GURU.posts = SWAP_GURU.posts || {};
(function($){
var $dialog;
var post_id, trade_post_id;
var ITEM_PER_PAGE = 2;
var page_offset = ITEM_PER_PAGE;
function create_dialog_myposts(){
$dialog = $('<div></div>')
.html('This dialog will show eve... |
import {useEffect} from 'react';
import {createPortal} from 'react-dom';
const modalRoot = document.getElementById('modal-container');
const Modal = (props) => {
const element = document.createElement('dialog');
const inner = document.createElement('div');
element.style.padding = 0;
element.appendChild(inner);
... |
import React from 'react';
const Landing = () => <p>This is the landing page</p>;
export default Landing;
|
/*
* Homework 06 - Dynamic Programming
*
*
* Problem 1: Max Consecutive Sum
*
* Prompt: Given an array of integers find the sum of consecutive
* values in the array that produces the maximum value.
*
* Input: Unsorted array of positive and negative integers
* Output: Integer (max c... |
export default {
home: '调度大盘',
login: '登录',
params: '系统配置',
sys_monitor: '系统监控',
data_monitor: '数据监控',
// cache_monitor: '缓存监控',
// equip_monitor: '资源监控',
// thread_monitor: '线程监控',
task_pool: '线程池配置',
repo:'资源库管理',
business:'业务配置',
busi_db:'业务数据库',
busi_db_edit:'业务库编辑',
busi_dict:'业务字典',
... |
// Copyright (c) 2021 Antti Kivi
// Licensed under the MIT License
import localizedLinkQuery from './localizedLinkQuery';
import navigationQuery from './navigationQuery';
const { site: linkSite, ...pages } = localizedLinkQuery;
export default {
...navigationQuery,
...pages,
site: {
siteMetadata: {
..... |
import React from 'react';
import { Grid, CircularProgress } from '@material-ui/core';
import { useSelector } from 'react-redux';
import Order from './Order/Order';
import useStyles from './styles';
const Orders = ({ setCurrentId }) => {
const orders = useSelector((state) => state.orders);
const classes = useStyl... |
import ChampionCard from "../ChampionCard/ChampionCard";
import styles from "./ChampionsList.Module.scss";
const ChampionsList = ({ champions }) => {
const champList = champions.map((champ) => (
<ChampionCard key={champ.id} champion={champ} />
));
return <ul className={styles.container}>{champList}</ul>;
};
... |
import React, {Fragment} from 'react';
import {useDispatch} from 'react-redux';
import {deleteAsset} from '../../actions/assetActions';
const Asset = ({asset, showDelete}) => {
const dispatch = useDispatch();
const assetData = asset.asset;
const assetHeaders = (
<Fragment>
<thead>
<tr>
... |
$(function() {
$(".change-devoured").on("click", function(event) {
console.log($(this));
var id = $(this).attr("id");
var newDevoured = $(this).attr("data-newDevoured");
var newState = {
devoured: newDevoured
};
//send PUT req
$.ajax("/api/burgers/" + id, {
type: "PUT",
... |
import {Component, ChangeDetectionStrategy} from '/ui/web_modules/@angular/core.js';
import {FormGroup, FormControl} from "/ui/web_modules/@angular/forms.js";
import {UIRouter} from "/ui/web_modules/@uirouter/angular.js";
import {pluck, take, filter, switchMap,
switchMapTo, map, shareReplay, takeUntil} from '/u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.