text stringlengths 7 3.69M |
|---|
import * as mutationTypes from './mutation-types'
export default {
[mutationTypes.SET_PLAYERS] (state, players) {
state.players = players;
},
[mutationTypes.DELETE_PLAYER] (state, playerId) {
state.players = state.players.filter(player => player._id !== playerId);
},
[mutationType... |
const { expect } = require('chai')
const { test1, test2 } = require('./')
describe('Test1 function', () => {
it('test1([1, 2, 3]) === 6', () => {
const result = test1([1, 2, 3]);
expect(result).to.equal(6);
});
it('test1([1, "one", 2, "two", 3, "three"]) === 6', () => {
const result = test1([1, "o... |
const Game = require('./game');
const readline = require('readline');
const reader = readline.createInterface({
output: process.stdout,
input: process.stdin
});
function completionCallback(){
reader.question("wanna go another round bru ?",(res) =>{
if(res === 'yes'){
let game = new Game();
game.... |
//'use strict'
//this keyword exmplaination
/*
1. Inside an object
2. inside a function
3. Using new operator
*/
//the this keyword in the context of object
let employee = {
"firstname":"Harish",
"lastname":'Kumar',
"department":'HR',
"dependents":[
{
'name':'Suma',
... |
/**
* Copyright (C) 2009 eXo Platform SAS.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This softwar... |
import {createStore, combineReducers, applyMiddleware} from 'redux';
import {userReducer} from './reducers/userReducer';
import {libraryReducer} from './reducers/libraryReducer';
import thunk from 'redux-thunk';
import AsyncStorage from '@react-native-community/async-storage';
import {persistStore, persistReducer} from... |
import React, {useState, useEffect} from 'react';
import logo from './logo.svg';
import './App.css';
import "./table/index.scss";
import Table from "./table/Table";
import EnhancedTableHead from "./table/EnhancedTableHead";
import TableBody from "./table/TableBody";
import TableRow from "./table/TableRow";
import Tabl... |
'use strict';
const utils = require('../lib/utils');
const errors = require('../lib/errors');
const q = require('../lib/constants/queries');
const Requirement = utils.Requirement;
const query = utils.query;
const GET_REPORT_REQS = [
new Requirement('query', 'season'),
new Requirement('query', 'year'),
];
// Get... |
console.log("hola banda") |
import React from "react";
import ProfileStatus from "./ProfileStatus/ProfileStatus";
import s from "./ProfileDesc.module.css";
function ProfileDesc(props) {
return (
<div>
<div className={s.name}>{props.profile.fullName}</div>
<ProfileStatus
status={props.status}
updateStatus={props.... |
// MODELS
module.exports.Token = require('./token.model');
module.exports.Organization = require('./organization.model');
module.exports.Key = require('./key.model');
module.exports.User = require('./user.model');
// SCHEMAS
module.exports.IssueSchema = require('./issue.schema');
module.exports.InvitationSchema = re... |
define(['angular'], function (angular) {
'use strict';
/**
* @ngdoc function
* @name kvmApp.controller:ProjectServerCtrl
* @description
* # ProjectServerCtrl
* Controller of the kubernetesApp
*/
angular.module('kvmApp.controllers.ShowSnapServerCtrl', [])
.controller('ShowSnapServerCtrl', fu... |
import React from 'react';
import cx from 'classnames';
import PropTypes from 'prop-types';
const Copyright = ( { className } ) => (
<span className={ cx( 'copyright', className ) }>
© { new Date().getFullYear() } Dash Financial Technologies. All Rights
Reserved.
</span>
);
Copyright.propTypes = {
classNa... |
const express = require('express');
const router = express.Router();
const product_controller=require('./product_controller')
router.post('/addProduct', product_controller.addProduct)
router.get('/getProducts', product_controller.getProducts)
router.patch('/updateProduct', product_controller.updateProduct)
router.dele... |
// Copyright 2018 Google LLC
//
// 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 in ... |
import { motion } from 'framer-motion';
import React from 'react';
import './Card.css';
export default function Card ({min, max, name, img, onClose, id}) {
return (
<motion.div
initial={{ scale: 0 }}
animate={{ rotate: 0, scale: 1 }}
transition={{
type: "spring",
stiffness: 260,... |
import React from 'react';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import SearchBar from 'react-native-vector-icons/AntDesign';
import HomeBar from 'react-native-vector-icons/Foundation';
import PostBar from 'react-native-vector-icons/Feather';
import ProfileBar from 'react-native-vecto... |
/*<input type = "radio" name = "lesson" value = "java" onclick = "changeImage(this)">java
<input type = "radio" name = "lesson" value = "oracle" onclick = "changeImage(this)">oracle
<input type = "radio" name = "lesson" value = "xml" onclick = "changeImage(this)">xml
<input type = "radio" name = "lesson" value = "html... |
describe("SWOS-63: Schema/Model section labeling", () => {
it("should render `Schemas` for OpenAPI 3", () => {
cy
.visit("/?url=/documents/petstore-expanded.openapi.yaml")
.get("section.models > h4")
.contains("Schemas")
})
it("should render `Models` for OpenAPI 2", () => {
cy
.vis... |
const async = require('async');
const should = require('should');
const mongodb = require('mongodb');
const highland = require('highland');
const {
getMongoDBConnection
} = require('../../mongo_utils');
const updateHandler = require('./oplog.update');
describe('Update Oplog Handler', () => {
before((done) => {
... |
const request = require('supertest'); // framework for testing API
const expect = require('chai').expect; // javascript functionality testing framework
///********test suite for the task*************///
describe('Test for the tasks', () => {
//********TEST 1task************//
it('should return an array with charact... |
import React from 'react'
import Link from 'gatsby-link'
import Navigation from './Navigation'
const Header = () => (
<div>
<div>
<h1 style={{display: 'inline', fontFamily: 'arial', fontWeight: 400, marginLeft: 2,}}>Clark Carter</h1>
<Navigation />
</div>
</div>
)
const TemplateWrapper = ({ ch... |
// const notesService = require('../../controllers/annotationService')
const objectUtil = require('../../controllers/util')
module.exports = (app) => {
app.put('/api/v1/update', async (req, res) => {
const { body } = req
for (let i = 0; i < body.rows.length; i++) {
const { id } = body.rows[i]
con... |
import React from 'react';
class ExRatesTable extends React.Component {
render() {
const { data, change } = this.props;
return (
<table>
<tbody>
<tr>
<td>BTC/USD</td>
<td>
<input type="number" name="btcusd" defaultValue={data.btcusd} onChange... |
import React, { useState, useContext } from "react";
import {
View,
Text,
StyleSheet,
FlatList,
TouchableOpacity,
} from "react-native";
import { Ionicons } from "@expo/vector-icons";
import Context from "../context/Context";
const StoreCard = ({ item }) => {
const context = useContext(Context);
const [d... |
"use strict"
const {SimCard} = require('./schemas')
const mongoose = require('mongoose')
//Connect to Mongodb
mongoose.connect('mongodb://localhost/simcards', { promiseLibrary: global.Promise, useCreateIndex: true,useNewUrlParser: true })
const queries = {
provisionSim:async (sim={})=>{
return await new Si... |
let validated = true
const errorMessages = {}
let finalErrors = ''
let password = null
const ValidateFields = (field, newValue, prevState) => {
// apply validation rules and get final result
return checkValidationRule(prevState, newValue)
}
// validates fields with required property
const requiredValidation = (pr... |
'use strict'
const mongoose = require('mongoose');
let ApiacctSchema = new mongoose.Schema({
name: String,
appid: String,
password: String
});
module.exports = mongoose.model('Apiacct', ApiacctSchema); |
$(document).ready(function() {
$('.modal').on('click', '.add_userinvitee', function() {
var template = $('#userinvitee_fields');
var list_length = $('.userinvitees_list li').length;
console.log(list_length);
var new_invitee_template = Mustache.render(template.html(), {
i... |
function square(number) {
return number * number;
}
function noReturn() {
}
// 可以將返回值存到一個變數
var squareValue = square(10);
console.log(squareValue); //100
console.log(square(10) * 10); //1000
console.log(noReturn()); //undefined
|
import articleRepository from '../domain/repositories/article-repository'
const sortByDescendingNumberWithIntegerKey = (list, key) => list.sort((objectA, objectB) => {
if (parseInt(objectA[key], 10) > parseInt(objectB[key], 10)) {
return -1
}
if (parseInt(objectA[key], 10) < parseInt(objectB[key], 10)) {
... |
export default {
primary: "#F58634",
black: "#000000",
white: "#FFFFFF",
secondary: "#1976D2",
textColorDark: "#2B2B2B",
textColorLight: "#fff",
textColorLightestGrey: "#DBDBDB",
textColorLightGrey: "#CBCBCB",
textColorGrey: "#B7B7B7",
textColorMediumGrey: "#9A9A9A",
textColo... |
//context
function evtIntervalBench(){
let suite = new Benchmark.Suite;
const optInterval = 500
const optTake = 150;
const optEndTime = 3000;
suite.add('eventIntervalWindow cepjs',
function(deferred){
cepjs.interval(optInterval)
.pipe(cepjsOp.take(optTake)... |
import React from 'react'
import { render, fireEvent } from '@testing-library/react'
import api from '../../../../service/api'
import LoginDialog from '../index'
const loginSpy = jest.spyOn(api, 'login')
const checkUserSpy = jest.spyOn(api, 'checkUser')
const buildComponent = () => render(<LoginDialog />)
describe... |
Template.certificate.helpers({
certificateAddress() {
return Router.current().params.certificateAddress;
},
invalid() {
return Session.get("invalid");
},
valid() {
return Session.get("valid");
},
contractAddress() {
return contractAddress;
}
});
Template.... |
const { shell } = require('electron');
const parser = require('./parser');
const storage = require('./storage');
const ui = require('./ui');
class App {
constructor(storage, parser, ui) {
this.storage = storage;
this.ui = ui;
this.parser = parser;
}
init() {
this.initEventListeners();
this.i... |
var shiftingLetters = function(S, shifts) {
let sum = 0;
let newstring = [];
let alphabet = 'abcdefghijklmnopqrstuvwxyz';
for (let i = shifts.length-1; i >= 0; i--) {
sum += shifts[i];
newstring.unshift(alphabet[(alphabet.indexOf(S[i]) + sum) % 26]);
}
return newstring.join("");... |
Markdocs.controller('DocController', function(DocHelper, DocModel, marked, $filter) {
var main = this;
main.statuses = DocModel.getStatuses();
main.categories = DocModel.getCategories();
main.docs = DocModel.getDocs();
main.statusesIndex = DocHelper.buildIndex(main.statuses, 'name');
main.categoriesIndex = DocHe... |
import {
Schema,
} from "prosemirror-model";
import {
insertPoint
} from "prosemirror-transform";
import {
procedureXslt
} from "@/assets/js/documents/procedure.xslt.js";
import {
Document
} from "@/assets/js/documents/document.js";
const schema = new Schema({
nodes: {
content: {
content: "proced... |
// Pages
import React from 'react';
import Login from "./pages/Login";
import Admin from "./pages/Admin";
import Trainee from "./pages/trainee";
import { BrowserRouter as Router, Switch, Route} from "react-router-dom";
// auth & redux
import { connect } from "react-redux";
import AuthRoute from "./components/AuthRout... |
// all require file
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const MongoClient = require('mongodb').MongoClient;
require('dotenv').config();
// database variable
const uri = process.env.DB_PATH;
const app = express();
// PORT
const PORT = process.en... |
// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
// 云函数入口函数
const axios = require('axios')
exports.main = async (event, context) => {
const url = event.url
delete event.url
try {
const res = await axios.get(url, {
params: event
})
return res.data;
} catch (e) {
console.err... |
import React from "react";
import "./App.css";
function App() {
return (
<div className="App">
<div className="board" id="board">
<div className="cell"></div>
<div className="cell"></div>
<div className="cell"></div>
<div className="cell"></div>
<div className="cell"... |
self.addEventListener('push', function (event) {
console.log('[SW] PUSH RECEIVED');
console.log(`[SW] Data : ${event.data.text()}`);
const title = "BELAJAR PUSH";
const options = {
body: event.data.text(),
icon: "images/icon.png",
badge: "images/icon.png",
};
event.wait... |
import React from "react";
import ChatBox from "../../../components/pages/Messenger/ChatBox";
import request from "../../../utils/request";
import { socket } from "../../../utils/socket";
const INITIAL_STATE = {
messages: null,
currentInput: "",
skip: 0,
count: 0,
loadingMessages: false,
loadingMore: false... |
const { Linter, Configuration } = require('tslint');
function runLinter(options, configurationFilePath, files) {
const linter = new Linter(options);
files.forEach(({ filename, content }) => {
const config = Configuration.findConfiguration(configurationFilePath, filename).results;
linter.lint(filename, con... |
/**
* 验证旧密码是否正确
* 失去焦点的时候提示
**/
function OldPassword(){
var passwordOld = $("#passwordOld").val();//获取前台输入的旧密码
if(passwordOld == null){
layer.msg('您的旧密码不能为空', {time: 1000,/*1s后自动关闭*/ icon: 5});
}else{
$.ajax({
type:"post",
dataType:"json",
data:"passwordOld="+passwordOld,
url:"../../getPasswordByE... |
"use strict";
var MongoClient = require("mongodb").MongoClient,
cacheManager = require("cache-manager"),
mongoStore = require("../index.js"),
cacheDatabase = "cacheTest",
mongoUri = "mongodb://127.0.0.1:27017/" + cacheDatabase,
collection = "test_node_cache_mongodb_1",
assert = require("assert"),
debug =... |
import { StyleSheet } from 'react-native';
import * as theme from '../../../common/theme';
export default StyleSheet.create({
containerScrollable: {
backgroundColor: theme.PrimaryColor
},
container: {
flex: 1,
backgroundColor: theme.PrimaryColor
},
containerImage: {
width: '100%',
height... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Field, reduxForm, SubmissionError } from 'redux-form';
import PropTypes from 'prop-types';
import { updateList } from '../../../actions/boardActions';
class EditListForm extends Component {
componentDidMount() {
this.editL... |
// What is this, 2007? This is all in one file because I'm too lazy to
// hook up module loading for Babel.
// Gotta check for Safari because getByteFrequencyData returns all 0s :/
// Desktop Safari is fixed, but I guess not iOS?
// https://bugs.webkit.org/show_bug.cgi?id=125031
const ua = navigator.userAgent
const iO... |
import React, {Component} from 'react';
import {Form, Button, Input, Select} from 'antd'
import 'antd/dist/antd.css';
import BaseComponent from "../Base/BaseComponent";
import DynamicList from "../DynamicList/DynamicList";
import ShortcutSelects from "../selects/ShortcutSelects";
import store from "../../store"
import ... |
import React, { Component } from 'react';
import {
Col,
NavbarBrand,
ListGroup,
ListGroupItem
} from 'reactstrap';
import { Link } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faGithub } from '@fortawesome/free-brands-svg-icons';
import Session fr... |
import { useTips } from './TipDataProvider.js';
import { Tips } from './Tip.js';
let tipCollection = document.querySelector("#tips-list")
export function TipList(){
const allTheTips = useTips();
let tipListHTMLString = "";
for(let i = 0; i < allTheTips.length;i++){
tipListHTMLString += Tips(allT... |
import { Model, DataTypes } from "sequelize";
export default class User extends Model {
static init(sequelize) {
return super.init({
id: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
primaryKey: true
},
... |
import React, { PureComponent } from "react";
import classNames from "classnames";
const iconName = {
bold: "bold",
italic: "italic",
removeFormat:'trash-o'
};
class MenuButton extends PureComponent {
constructor(props) {
super(props);
this.inClicking = false;
this.state = {
_active: false
... |
import React from "react";
import { Box, Text, Avatar} from "@chakra-ui/core";
export default function Profile() {
return (
<Box
height="50%"
width="85%"
borderRadius="10px"
p={1}
display="flex"
flexDirection="column"
justifyContent="space-between... |
import {
Category,
Story,
Picture,
Content,
Group,
Image,
Obj,
Organization,
User_Organization,
Media
} from './models'
Category.hasMany(Group, {
as: 'groups',
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
foreignKey: 'categoryId',
sourceKey: 'id'
})
Category.belongsTo(Image, {
as: 'image'... |
(function () {
'use strict';
angular.module('experiment')
.directive('circle', circle);
experiment.$inject = ['$injector', 'experimentConfig', 'experiment'];
function circle($injector, experimentConfig, experiment) {
return {
templateUrl: function () {
retu... |
"use strict";
require("run-with-mocha");
const assert = require("assert");
const testTools = require("./_test-tools")
const AnalyserNodeFactory = require("../../src/factories/AnalyserNodeFactory");
describe("AnalyserNodeFactory", () => {
it("should defined all properties", () => {
const AnalyserNode = Analyser... |
import React from 'react';
import {
PokedexContainer,
SubContainer,
MiddleDisplay,
} from './Pokedex.styled';
import PokemonMainData from '../PokemonMainData';
import PokemonInfo from '../PokemonInfo';
import { connect } from 'react-redux';
const Pokedex = ({ pokemon }) => {
return (
<PokedexContainer>
... |
angular.module("EcommerceModule").controller("ProductFilterSearchController", function ($scope, $stateParams, ProductFilterpageService, CartService){
var routeparamkeyWord = $stateParams.keyWord;
this.keyWord = $stateParams.keyWord;
$scope.pageTitle = "Search: "+ routeparamkeyWord;
$scope.ProductData;
$scope.Produ... |
export { Button } from './button'
export { Input } from './input'
export { Issue } from './issue'
|
module.exports = require('./getMongoDBConnection');
|
'use strict'
var year = 2018
/*
while(year != 1991){
console.log(" estamos en el: "+year)
year--
}
*/
// do while
var years = 30
do{
alert("solo cuando sea mayor de 25")
years--
}while(years > 25) |
const jwt = require('jsonwebtoken');
//midleware
module.exports= function (req,res,next){
const token = req.header('auth-token');
if (!token) return res.status(401). send('invalid');
try{
const varified =jwt.verify(token,process.env.TOKEN_SECRET);
req.user= varified;
next();
}... |
import React from 'react';
import {Link} from 'react-router-dom';
export class ChapterTestTable extends React.Component{
render(){
return (
<table className="table table-hover">
<thead>
<ChapterTestTableHeader />
</thead>
<tbody>
{Array.isArray(this.props.testList)?
this.props.testLis... |
'use strict'
// Currently implemented round robin to the nodes - other startegies, like main node, fallback nodes
// needs to be implemented
var http = require('http')
var https = require('https')
var urlParser = require('url')
/* var optionTemplate = {
host: 'localhost',
path: '/_sql?types',
port: '4200',... |
import React from 'react';
const FilteredListNonReusable = ({ list, side }) => {
const filteredList = list.filter(char => char.side === side);
return filteredList.map(char => (
<div key={char.name}>
<div>Character: {char.name}</div>
<div>Side: {char.side}</div>
</div>
));
}
export default Fi... |
export default function UIDropdownDirective () {
return {
restrict: 'A',
link: (scope, element) => {
if (typeof element.dropdown !== 'undefined') {
element.dropdown()
}
}
}
}
|
/**
* Copyright 2016 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... |
// npm i mysql request
// 然后node执行
'use strict';
const password = '';
const port = '';
const msger = ''; // 消息接受者 为空则不发消息
// 先执行 npm i mysql
const mysql = require('mysql');
const request = require('request');
mysql && console.log('mysql加载成功...');
const args = process.argv.splice(2);
console.log('密码:' + password);
co... |
var http = require('http');
var fs = require('fs');
http.createServer(function (req, rsp) {
rsp.writeHead(200, {
'Content-Type': 'image/pjpeg'
});
var imgFile = fs.createReadStream('./assets/xp.jpg');
imgFile.pipe(rsp);
}).listen(8089);
console.log('Listening on port 8089 ...'); |
import React from 'react';
import PropTypes from 'prop-types';
import { Redirect } from 'react-router';
import { withStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import { connect } from 'react-redux';
import CircularProgress from '@material-ui/core/CircularProgress';
import Card... |
import Head from 'next/head';
import { connect } from 'react-redux';
import { useEffect } from 'react';
import UserAvailability from '../components/UserAvailability';
import SignUp from '../components/SignUp';
import Layout from '../components/Layout';
import { useRouter } from 'next/router';
import { Spinner } from '... |
'use strict';
import gulp from 'gulp';
import runSequence from 'run-sequence';
gulp.task('dev', ['clean'], function(cb) {
global.isProd = false;
global.env = 'development';
runSequence('browserify', 'watch', cb);
}); |
const chai = require('chai');
const chaiHttp = require('chai-http');
const server = require('../../server.js');
const should = chai.should();
const mongoose = require('mongoose');
const { user } = require('../../models');
// setup chai to use http assertion
chai.use(chaiHttp);
// create our testUser
const testUser = ... |
import indexRouter from "./index/employee";
import addRouter from "./add/employee";
import addOrEditRouter from "./add-or-edit/employee";
import removeRouter from "./remove/employee";
import randomRouter from "./random/employee";
import detailRouter from "./detail/employee";
export default [
indexRouter,
addRouter... |
import {combineReducers} from "redux";
import { reducer as formReducer } from "redux-form";
import authReducer from "./authReducer";
import eduReducer from "./eduReducer";
const rootReducer = combineReducers({
form: formReducer,
auth: authReducer,
edu: eduReducer
});
export default rootReducer;
|
var _ = require('lodash');
_.mixin(require('lodash-deep'));
var findParent = function (object, path, callback) {
var parent = object;
var key = path;
var keys = path.split('.');
if (keys.length > 1) {
for (var i = 0, length = keys.length - 1; i < length; i++) {
parent = parent[keys[i]] || (parent[keys[i]] = ... |
import test from "tape"
import { push } from ".."
test("push", t => {
t.deepEqual(push(null)([1]), [1, null], "(null)([]) should equal [null]")
t.deepEqual(
push(undefined)([]),
[undefined],
"(undefined)([]) should equal [undefined]"
)
t.deepEqual(push([])([]), [[]], "([])([]) should equal [[]]")... |
const { withExpo } = require('@expo/next-adapter');
const withFonts = require('next-fonts');
const withImages = require('next-images');
module.exports = withExpo(withFonts(withImages({
projectRoot: __dirname,
target: 'serverless'
}))
);
|
'use strict';
var forEach = require('lodash/collection/each');
function signinButtons(elements, config){
forEach(elements, function(el){
window.google.identitytoolkit.signInButton(el, config);
});
}
module.exports = signinButtons;
|
// ------------------- Constants
var BG = 'white';
var HEIGHT = 600;
var WIDTH = 700;
var GRAVITY = .2;
var FRICTION = .9;
var KEYS = {
SPACE: 32,
UP: 38,
RIGHT: 39,
LEFT: 37
};
// ------------------- Vars
var canvas, ctx, gameLoop, player;
var keysPressed = {};
// ------------------- Player class
fu... |
import styled from 'styled-components'
export const InputWrapper = styled.div`
width: 100%;
padding: 16px;
box-sizing: border-box;
label {
p {
font-weight: bold;
}
.input {
padding: 16px;
box-sizing: border-box;
width: 100%;
border: 1px solid black;
}
}
` |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const network = require("./network");
const sidebar = require("./sidebar");
const header = require("./sidebar/header");
const buttonCallbacks_1 = require("./sidebar/entriesTreeView/buttonCallbacks");
const tabs = require("./tabs");
const tabsA... |
const express = require('express')
const bodyParser = require('body-parser')
const mongoose = require('mongoose')
const passport = require('passport')
const app = express()
//
const user = require('./routes/api/user')
const profile = require('./routes/api/profile')
const chat = require('./routes/api/chat')
// mongo ... |
var chai = require('chai');
var chaiHttp = require('chai-http');
var should = chai.should();
var server= 'https://politrap-api.herokuapp.com'
var got = require('got');
chai.use(chaiHttp);
describe('Evidences', function() {
it('should add a new evidence to database when requested', function(done) {
random_id = ... |
const ExtendableError = require('./ExtendableError')
module.exports = class extends ExtendableError {
constructor () {
super('Token is invalid or has expired', 'WRONG_TOKEN', 406)
}
}
|
var TuiGridUtility = new Object();
TuiGridUtility.setDefaults = function() {
tui.Grid.setLanguage('ko');
tui.Grid.applyTheme('default', {
selection: {
background: '#4daaf9',
border: '#004082'
},
scrollbar: {
background: '#f5f5f5',
thumb: '#d9d9d9',
active: '#c1c1c1'
},
row: {
... |
var express = require('express');
var mongoose = require('mongoose');
// var db = mongoose.connect('mongodb://localhost/prueba_1');
// var Schema = mongoose.Schema;
var app = express();
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
// var id = req.params.id;
// var... |
function openModal(id) {
$('#' + id).removeClass('closed').addClass('open');
}
function closeModal(id){
$('#' + id).removeClass('open').addClass('closed');
}
|
import React from 'react';
import fakeData from './getUserData';
function UserDetail({ match, history, props }) {
const user = fakeData.filter((user) => {
return String(user.id) === match.params.id;
});
console.log(history)
return (
<div>
<h2>User Detail</h2>
<img src="https://randomus... |
(function () {
"use strict";
angular.module("vcas").controller("IptvCtrl", IptvCtrl);
/* @ngInject */
function IptvCtrl($scope) {
var vm = this;
vm.title = "IPTV";
}
}());
|
var findJudge = function(N, trust) {
let arr = new Array(N+1);
arr.fill(0);
let ans = -1;
trust.forEach(comb => {
arr[comb[0]] = -1;
arr[comb[1]]++;
})
arr.forEach((person, i) => {
if (person === N-1) ans = i;
})
console.log(arr)
return ans;
};
// console.log... |
import React, { Component } from 'react';
import { Control, LocalForm, Errors } from 'react-redux-form';
import { Button, Col, Label, Row } from 'reactstrap';
import './ComponentView.css'
const required = (val) => val && val.length;
const maxLength = (len) => (val) => !(val) || (val.length <= len);
const minLength = (... |
/*
* Copyright (C) 2021 Radix IoT LLC. All rights reserved.
*/
multipleValuesFactory.$inject = [];
function multipleValuesFactory() {
const empty = {};
class MultipleValues {
constructor(length) {
this.values = Array(length);
this.valuesSet = new Set();
if (l... |
import { connect } from "react-redux";
import React, { Component } from "react";
import PropTypes from "prop-types";
import {
BrowserRouter as Router,
Route,
Link,
Switch,
Redirect,
} from "react-router-dom";
import { fetchPosts } from "../actions/posts";
import Home from "./Home";
import Page404 from "./Pag... |
"use strict";
document.addEventListener('DOMContentLoaded', function () {
$(window).scroll(function () {
var scrollVal = $(this).scrollTop();
// console.log(scrollVal);
if (scrollVal > 10) {
$("header").addClass("scroll");
} else {
$("header").removeClass("sc... |
'use strict';
import BoxModelPropTypes from './propTypes/BoxModelPropTypes';
import FlexboxPropTypes from './propTypes/FlexboxPropTypes';
import TextStylePropTypes from './propTypes/TextStylePropTypes';
import ColorPropTypes from './propTypes/ColorPropTypes';
import { pushWarnMessage } from './promptMessage';
import p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.