text stringlengths 7 3.69M |
|---|
import React from 'react';
import {View,Text,StyleSheet} from 'react-native';
import {string,bool,shape} from 'prop-types';
function Hello(props) {
const {children,bang,style}=props;
return (
<View>
<Text style={[styles.text,style]}>
{`Hello ${children} ${bang ? '!' :''}`}
</Text>
... |
'use strict';
// npm install @eslint/eslintrc globals gulp gulp-eslint-new
const globals = require('globals');
const { series, src } = require('gulp');
const gulpESLintNew = require('gulp-eslint-new');
const { join } = require('path');
/**
* Simple example of using ESLint and a formatter.
* Note: ... |
// @flow
import React from 'react';
import {StyleSheet} from 'react-native';
import {View, Text} from '../../../components/core';
import ScheduleListItem from './ScheduleListItem';
import {GREY} from '../../../constants/colors';
import {
FONT_BOLD,
DEFAULT_FONT_SIZE,
LARGE_FONT_SIZE,
} from '../../../constants/... |
var thumb77="TkSWZ9/CYkrrc5VP0dIfEmWzpWcz3FP6jmPx9rlbjigAvDzIbgJzza2DuUGJO6ELfhjc1KFIUqlRn/gKsUwjzdDI+u7b9DM4XSUJjXksWz75BgmIezs7U8NrvrjAeZM3aoDLh2QaGueSvvnvKy60DtVP2IpMfLmGxy4QsspuS15GGUmskpI2nEIkTzKIrx5FfQLgvR05DCeSipF0IRMtlJhxv1Y23hRERL6tT8xld0ZQVa/d6rc/T05mNT/a1jEHPCBUwoeuVqk9bZh5UqOS1tY9fL/ItP3U//jKqt7/mh0II7ZUWp... |
/*
Edit area
*/
import $ from '../util/dom-core.js'
import { getPasteText, getPasteHtml, getPasteImgs } from '../util/paste-handle.js'
import { UA, isFunction } from '../util/util.js'
// Dapatkan data JSON dari elem.childNodes
function getChildrenJSON($elem) {
const result = []
const $children = $elem.chi... |
Component({
// 组件的属性列表
properties: {
},
/**
* 组件的初始数据
*/
data: {
showThis: false,
text: '',
showIcon: false,
isLoading: false,
animationData: "",
},
/**
* 组件的方法列表
*/
methods: {
loadMore: function () {
this.animate(35,0);
this.setData({
showT... |
const utils = {
isFunction(functionToCheck) {
return functionToCheck && {}.toString.call(functionToCheck) === '[object Function]';
},
wait(p_iTime) {
return (p_uData) => new Promise(resolve => {
return setTimeout(() => {
resolve(p_uData);
}, p_iTime)
})
}
}
module.exports = util... |
/**
* External dependencies
*/
import concatenateReducers from 'redux-concatenate-reducers'
/**
* WordPress dependencies
*/
const {
compose
} = wp.compose;
const {
withSelect,
withDispatch,
} = wp.data;
const composeWithSettingsEditor = ( component, settingKeys, blockGroupId ) => compose( [
withSelect( ( sel... |
var results = 0;
var noEl = document.querySelector("[data-no-results]");
var suggestToggle = document.querySelector("[data-suggest-toggle]");
function filterNames() {
var input, inputVal, filter, list, person, name, i;
input = document.querySelector(".search");
submitInput = document.querySelector(".submit-searc... |
const RANGE = "C:D";
export let getValues = async (spreadsheetId, success, fail) => {
const response = await window.gapi.client.sheets.spreadsheets.values.get({
spreadsheetId: spreadsheetId,
range: RANGE,
});
if (response.result.error) {
fail(response.result.error.message);
}
... |
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
var BattleField = function BattleField(turnOrder, monsters, floor) {
_classCallCheck(this, BattleField);
this.turnOrder = turnOrder;
this.monsters = monsters;
this.floor = floor;
this.checkedForWeapon = false;
};
export { BattleField as d... |
// Express imports
const express = require('express')
const router = express.Router()
// Middlewares for entire routes
const logMiddleware = require('../middlewares/logger.js')
//logger middleware added
router.use(logMiddleware)
//Handlers
const accountHandler = require('./account/accountHandler')
const ... |
/**
* feedback.js - HumanInput Feedback Plugin: Provides visual, audio, and vibration feedback for HumanInput events.
* Copyright (c) 2016, Dan McDougall
* @link https://github.com/liftoff/HumanInput/src/feedback.js
* @license Apache-2.0
*/
import HumanInput from './humaninput';
import { getNode } from './utils... |
const gameScreen = document.getElementById('gameScreen');
gameScreen.width = 800;
gameScreen.height = 600;
const ctx = gameScreen.getContext('2d');
const p1Score = document.getElementById('p1');
const p2Score = document.getElementById('p2');
class Paddle {
constructor(x, y, ctx, keyCodes, color){
this.sc... |
import React, { Component } from 'react';
import { Form } from 'antd';
import Input from 'sub-antd/lib/input';
import Checkbox from 'sub-antd/lib/checkbox';
import Radio from 'sub-antd/lib/radio';
import message from 'sub-antd/lib/message';
import DatePicker from 'sub-antd/lib/date-picker';
import axios from 'axios';
i... |
const { Pool } = require('pg');
const pool = new Pool({
name: '',
password: '123',
host: 'localhost',
database: 'lightbnb'
});
module.exports = {
query: (queryText, queryParams, callback) => {
let start = Date.now()
return pool.query(queryText, queryParams, (err, res) => {
const duration = Dat... |
import jwt from 'jsonwebtoken';
import bcrypt from 'bcrypt';
import Employee from '../models/Employee.model';
import config from '../config';
class EmployeeController {
static async loginEmployee(req, res) {
try {
const { email, password } = req.body;
if (!email || !password) {
throw new Erro... |
// pascals nums
// dynammic programming approach
// bottom down using memo
const generate = (numRows) => {
// handle 0th case
if (numRows === 0) {
return [];
}
// store the first two cases
const memo = {
0: [1],
1: [1,1],
};
const pascalRows = [];
for (let i = 0; i < numRows; i++) {
/... |
// components/dialogs/quit/quit.js
import baseBehavior from '../helpers/baseBehavior'
import { $wuxBackdrop } from '../dialog-util'
Component({
/**
* 组件的属性列表
*/
properties: {
},
behaviors: [baseBehavior],
externalClasses: ['wux-class'],
/**
* 组件的初始数据
*/
data: {
},... |
require("../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/packageB/prepayment_calc/_rate_picker" ], {
"18a2": function(t, e, n) {
n.r(e);
var r = n("a327"), a = n.n(r);
for (var o in r) [ "default" ].indexOf(o) < 0 && function(t) {
n.d(e, t... |
"use strict";
process.env["NODE_CONFIG_DIR"] = __dirname + '/../conf';
module.exports = {
MockLogger: require(__dirname + "/mock-logger")
}; |
// pages/collect/collect.js
Page({
/**
* 页面的初始数据
*/
data: {
tabs: [
{
id: 1,
tab: "收藏的店铺",
isActive: true,
},
{
id: 2,
tab: "收藏的商品",
isActive: false
},
{
id: 3,
tab: "关注的商品",
isActive: false
},
... |
import React, { Component } from 'react';
import { Table, Alert } from 'antd';
import { emptyTableLocale } from '../common/constants';
import { sortFilterByProps, formatDate } from '../common/utils';
export default class FeedbackTable extends Component {
renderFeedbackDetail = (text, record) => {
var feed... |
import { createStore, combineReducers, compose, applyMiddleware } from 'redux';
import { productListReducer } from './reducers/productReducer';
import thunk from 'redux-thunk';
const initialState = {};
const reducer = combineReducers({
productList: productListReducer,
})
// reducer gets a state and an action and r... |
import React, { createContext, useReducer } from "react";
import { ADD_TODO, UPDATE_TODO, DELETE_TODO } from "./types";
import { actions } from "./actions";
export const DataContext = createContext();
const initialState = {};
export const reducer = (state, action) => {
switch (action.type) {
case ADD_TODO:
... |
import headerTemplate from './headerTemplate';
import buttonTemplate from './buttonTemplate';
export {
headerTemplate,
buttonTemplate
};
|
import React, { useContext, useState, useEffect, useRef } from 'react';
import ReactDOM from 'react-dom';
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
import { List, CellMeasurerCache } from 'react-virtualized';
import ItemsContext from '../../contexts/ItemContext';
import getRowRenderer from './g... |
/**
* Created by fdr08 on 2016/7/21.
*/
(function (root, factory) {
var core = factory(root);
if (typeof define === 'function' && define.amd) {
// AMD
// define([], factory);
define('core', function () {
return core;
});
} else if (typeof exports === 'object') {... |
// JavaScript Document
(function($) {
inlineEditMedia = {
type : 'attachment',
init : function() {
var t = this;
t.id = $('#media_id').val();
$('#cancel_btn').click( function(e) {
try {
tb_remove();
} catch (e) {
try { window.parent.tb_remove(); } catch (e) {};
}
e.preventDefault();
... |
import React, { Component } from "react";
import { Card, Button, CardTitle, Row, Col, CardImg } from "reactstrap";
import { Link } from "react-router-dom";
export default class Dar extends Component {
render() {
return (
<div
style={{
padding: "10px"
}}
>
<Card
... |
const CustomError = require('../CustomError');
/** @typedef {'NOT_FOUND'} NotFoundCode Error code */
/** @typedef {import('../CustomError').ErrorMessage} NotFoundMessage Error message */
/**
* @typedef {import('../CustomError')} NotFound
* @param {NotFoundCode} code Internal server error code
* @param {NotFoundMes... |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Route, Switch, withRouter } from 'react-router-dom';
import classnames from 'classnames/bind';
import AuthWrapper from '../AuthWrapper';
import AppWrapper from '../AppWrapper';
import s from './styles.css';
const cx = classname... |
//utils:
const geocode = require('./utils/geocode');
const forecast = require('./utils/forecast');
const commandPlace = process.argv[2] + ' ' + process.argv[3];
const weatherInfo = (address) => {
if (!address) {
console.log('Please provide address');
} else {
geocode(address, (error, {place, l... |
import {Dimensions, Platform, StyleSheet} from 'react-native'
export default StyleSheet.create({
formItem: {
marginLeft: 0,
height: 65,
flexDirection: 'row'
},
inputLabel: {
paddingTop: 20,
position: 'absolute',
color: '#9F9F9F'
},
inputLabelActive: {... |
import React from 'react';
import {connect} from 'react-redux';
import {withRouter} from 'react-router-dom';
import {message} from 'antd';
import Timeline from './timeline';
import Overview from './overview';
import {toWei} from '../utils';
import {fetchTicker} from '../actions/ticker';
import {fetchBalance} from '../a... |
'use strict';
import React, { Component } from 'react'
import commonStyles, { colors } from '../styles'
import { SafeAreaView } from 'react-navigation'
import PlaceholderView from '../Component/PlaceholderView'
export default class BasePage extends Component {
constructor(props) {
super(props);
t... |
// JavaScript Document
function convert()
{
var oprt = document.getElementById("operators").value;
var slct = document.getElementById("selectors").value;
if(slct==="d")
{ var d= parseInt(document.getElementById("inpt").value);
if(oprt === "d")
{
document.getElementById("result").value = d;
... |
/**
* @file mofron-effect-shadow/index.js
* @brief shadow effect for mofron
* this effect makes the component has a shadow.
* @feature the size changes according to the value of the 'value' parameter.
* the blur percentage changes according to the value of the 'blur' parameter.
* @license MIT
*/
... |
import wards from '../../../lib/flatfoot_web/static/js/reducers/wards';
const initialState = [];
const ADD_WARD = 'ADD_WARD', REMOVE_WARD = 'REMOVE_WARD', UPDATE_WARD = 'UPDATE_WARD', LOGOUT = 'LOGOUT', CLEAR_DASHBOARD = 'CLEAR_DASHBOARD';
var wardParams1 = {id: 1, name: 'Dave Lively', relationship: 'father', active:... |
'use strict'
module.exports = {
OpenRefine: require('./lib/openrefine')
}
|
export const state = () => ({
counter: 345
})
export const getters = {
getCounter(state) {
return state.counter
}
}
|
import React from "react"
import Checkbox from '@material-ui/core/Checkbox';
import Button from '@material-ui/core/Button';
import ButtonGroup from '@material-ui/core/ButtonGroup';
import './App.css';
export default class SingleMessage extends React.Component{
constructor(props){
super(props);
this... |
import React from 'react';
import TodoForm from './components/TodoForm.js';
import TodoList from './components/TodoList.js';
const list = [
{
task: 'Organize Garage',
id: 1528817077286,
completed: false
},
{
task: 'Bake Cookies',
id: 1528817084358,
completed: false
... |
/*
* Module code goes here. Use 'module.exports' to export things:
* module.exports.thing = 'a thing';
*
* You can import it from another modules like this:
* var mod = require('util.market');
* mod.thing == 'a thing'; // true
*/
var logger = require("screeps.logger");
logger = new logger("util.market");
//logge... |
DrunkCupid.Views.ProfileMonolith = Backbone.CompositeView.extend({
template: JST['profileMonolith'],
className: 'profile-monolith',
initialize: function () {
this.addSubs();
this.listenTo(this.model, 'sync', this.addSubs)
},
render: function () {
var content = this.template({user: this.model});... |
import { faArrowsAltH, faArrowsAltV, faExpand, faSearchMinus, faSearchPlus } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React from 'react';
const OrganigrammeGeneral = () => {
return (
<div>
<h5 className="vde">Organigram... |
/**
* @project: Push Notifications
*
* @author Fabian Bitter ([email protected])
* @copyright (C) 2020 Fabian Bitter
* @version X.X.X
*/
var initPushNotifications = function (config) {
var sendTokenToServer = function (token) {
$.ajax({
type: "POST",
url: CCM_DISPATCH... |
$(function(){
var key = getCookie('key');
if (!key) {
window.location.href = WapSiteUrl + '/tmpl/member/login.html';
return;
}
var signonline_id = getQueryString('id');
if (!signonline_id) {
window.location.href = WapSiteUrl + '/tmpl/member/login.html';
return;
}... |
/* eslint-disable max-len */
const Bull = require('bull');
const Queue = new Bull('queue', process.env.REDIS_URL);
const db = require('../models/models');
let leaderboard = [];
let question = [];
const allLeaderboards = {};
const ranks = {};
const questionPoints = {};
let mainLeaderboard = [];
const getLeaderboardA... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsFlag = {
name: 'flag',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z"/></svg>`
};
|
import React, { Component } from 'react';
import './sideStyles.css';
import firebase from '../../../firebase';
import { connect } from 'react-redux';
import {HiOutlineChevronDown} from 'react-icons/hi';
import { setCurrentChatRoom, setPrivateChatRoom } from '../../../redux/actions/chatRoom_action';
class Favorited ext... |
Views.registerView("talentTree", {
selector: "#talentTree",
talentTree() {
let html = "";
for (const talent in talentData) {
html += talent;
}
return html;
},
html() {
// todo: add talent tree
const html =
`<div>
... |
import ItemCart from '@components/CartItem';
import InputTextCustom from '@components/InputTextCustom';
import colors from '@config/colors';
import images from '@res/icons';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Image, Text, TouchableOpacity, View, TextInput } from 'react-n... |
var Model = require('./db.js');
var dbFunc = {
addScript: function(script, res) {
var newScript = new Model.script(script);
newScript.save(function(err){
if(err) {
console.log('error', err);
}
console.log("Script Added!", newScript);
res.send(newScript);
})
},
getScripts: function(script... |
(function(){
var app = angular.module('imgur', ['api']);
})();
// var storage_str = '[';
// gen_str = function() {
// comments.forEach(function(comment) {
// storage_str = storage_str.concat(JSON.stringify(comment));
// storage_str = storage_str.concat(',');
// });
// storage_str = storage_str.concat... |
Ext.onReady(function() {
var win = new App.view.definition.MainPanel();
win.show);
}); |
import React, { Component, useState } from 'react';
import { ajouterContact, isLogged} from '../Service/DataService';
const FormPraticien = (props) => {
const [contact, setContact] = useState({
nom: '',
prenom: '',
adresse: '',
telephone: '',
email: ''
})
cons... |
const app = getApp()
const http = require('../../utils/http.js') // 引入
const dialog = require('../../utils/dialog.js') // 引入
Page({
data: {
showAttr: false,
show: false,
param: {},
categoryFilter: false,
filterCategory: [],
page: 1,
size: 6,
currentSortType: 'default',
currentSor... |
Vue.component("global-nav", {
template: `
<div class="header-wrapper">
<div class="header">
<h2 class="header-title">Oitoku</h2>
<h5 class="header-subtitle">みんなの「気になる」を置いとく場所</h5>
</div>
</div>
`
});
new Vue({
el: "#app",
data: {
articles: null
},
mounted() {
axi... |
var searchData=
[
['vertexsim3',['VertexSim3',['../classlsd__slam_1_1_vertex_sim3.html',1,'lsd_slam']]]
];
|
const testPages = [
{name: "Multiple delayed root elements", url: "/streaming"},
{name: "Client navigation", url: "/clientTransition/0"},
{name: "Component change on client", url: "/serverClient"},
];
export default class Index {
getElements() {
return <div>
<h1>Welcome to react-server demo</h1>
<ul>
{... |
var dayjs = require('dayjs')
require('dayjs/locale/zh-cn')
dayjs.locale('zh-cn') // 全局使用简体中文
// dayjs.extend(relativeTime)
|
/**
* 1 ~ 50까지 반복
* 홀수 값과 짝수 값을 따로 누적
* 홀수, 짝수, 전체 누적 값을 반환
*/
// odd_num : 홀수, even_num : 짝수
var odd_num=0, even_num=0;
for (k = 1;k <= 50; k++) {
if(k%2===1){ /* k를 2로 나눠 나오는 나머지 값이 1이면 홀수 값이고 아니면 짝수 값 */
odd_num = odd_num + k; /* 홀수 값 누적 */
} else {
even_num = even_num + k; /* 짝수 값 누적*/
... |
// Try writing a simple progress bar in the callback style. Your progress bar should have three callbacks, onStart, onProgress, and onEnd. When you call a start function of the progress bar it should call the onStart callback, and begin count from 1 to 100. Every 10 items it counts, it should call the onProgress callba... |
import Vue from 'vue'
import VueRouter from 'vue-router'
// 默认导入自定义组件
import Layout from '@/views/layout.vue'
// 按需导入自定义组件
import { getToken } from '@/utils/storage.js'
// 导入vant组件
import { Toast } from 'vant'
const Detail = () => import('@/views/detail')
const Register = () => import('@/views/register')
const Login... |
function slidesPlugin( activeSlide = 0 ){
const slides = document.querySelectorAll('.slide') ;
slides[activeSlide].classList.add('active') ;
// for (const slide of slides) {
// slide.addEventListener('click' , () => {
// clearActiveClasses() ;
// slide.classList.toggle('active') ;
// })
// }
... |
/* eslint-disable no-new */
import express from 'express';
import Auth from './routes/auth';
const apiRouter = express.Router();
new Auth(apiRouter);
export default apiRouter;
|
// model.js is a utility to carry operations on a list of objects
function transpose (data) {
let schema = {}
Object.keys(data).map((key) => {
const value = data[key]
const valueKeys = Object.keys(value)
const invertedObject = valueKeys.forEach((valueKey) => {
if (!schema[valueKey]) schema[valueK... |
import axios from 'axios'
import EventEmitter from 'events'
import bus from './bus'
class StyleguideLoader extends EventEmitter
{
constructor(store, url)
{
super();
this.store = store;
this.url = url;
}
load()
{
axios.get(this.url.append('/all'))
.then((response) => {
// Initialize store
this... |
import React from "react";
import { connect } from "react-redux";
import { openDayDetails } from "../actions/day-forecast"
const WeatherDay = props => {
const dayName = new Date(props.day.dt);
const options = { weekday: 'short', month: 'short', day: 'numeric'};
return (
<li className={props.selecte... |
module.exports = (sequelize, DataTypes) => {
return sequelize.define('record', {
'user_id': DataTypes.INTEGER,
'word_id': DataTypes.INTEGER,
'remember': DataTypes.INTEGER,
'mark_time': DataTypes.DOUBLE,
})
}
|
export default `<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 0.5H4C2.067 0.5 0.5 2.067 0.5 4V18C0.5 19.933 2.067 21.5 4 21.5H18C19.933 21.5 21.5 19.933 21.5 18V4C21.5 2.067 19.933 0.5 18 0.5Z" stroke="black"/>
</svg>`; |
function Stack(){
this.myarray = [];
}
var a = new Stack();
Stack.prototype.push = function (a){this.myarray.push(a);}
Stack.prototype.pop = function (){return this.myarray.pop();}
Stack.prototype.peek = function (){return this.myarray[this.myarray.length -1];}
Stack.prototype.isEmpty = function (){return this.mya... |
import styles from '../styles/Home.module.css'
export default function Home() {
return (
<div className="landingPage">
<button>Fabian Soosaithasan</button>
<div className="container"></div>
</div>
)
}
|
var host = "https://br1.api.riotgames.com/";
var key = "RGAPI-291e7346-9dfe-4156-bc98-995914a4a509";
var $username = $("#username");
var $warning = $(".warning");
var $profileImg = $("#profileImg");
var $btnSend = $("#send");
var $sumLvl = $("#sumLvl");
var $info = $("#info");
var champions = [];
var matchQuantity = 5... |
function handleConnection(socket) {
console.log("A user has connected");
socket.on("login", function (name) {
if (name)
console.log("Helper", name, "has logged in.");
else
console.log("A helper has refreshed.");
socket.join("helpers");
});
socket.on("logout", function () {
console.... |
import React from "react";
import Countdown from "./session-display/countdown";
import ProgressBar from "./session-display/progressBar";
import SessionTitle from "./session-display/sessionTitle";
const SessionDisplay = ({ session, focusDuration, breakDuration }) => {
//declares variable as the timeRemaining value in... |
const webpack = require('webpack')
const nodemon = require('nodemon')
const express = require('express')
const webpackDevMiddleware = require('webpack-dev-middleware')
const webpackHotMiddleware = require('webpack-hot-middleware')
const webpackConfig = require('@mrk-beta/webpack').default
const { logMessage, compiler... |
import React from "react";
import SearchBar from "../UI/SearchBar";
import Logo from "../UI/logo/logo";
const Navbar = () => {
return (
<div>
<nav>
<ul className="navbar-flex">
<div className="nav-item-logo m-auto">
<li className="py-3">
<Logo />
</li>... |
import React from 'react';
//components
import SimpleStepper from './SimpleStepper/SimpleStepper.jsx';
import VerticalStepper from './VerticalStepper/VerticalStepper.jsx';
import HorizontalNonLinearStepper from './HorizontalNonLinearStepper/HorizontalNonLinearStepper.jsx';
import Subheader from 'material-ui/Subheader';... |
exports.run = (client, message, args) => {
const detail = args[0];
if (detail){
const command = client.commands.get(detail);
if (command) {
const output = ["= " + detail + " ="];
if (command.help) {
output.push(command.help.description);
ou... |
const ObjectId = require('mongodb').ObjectID;
const Project = require('../models/Project');
const utilsDB = require('../config/db');
const { check, validationResult } = require('express-validator/check');
exports.index = async (req, res) => {
const db = utilsDB.getDbConnection();
const projects = db.collection('pr... |
import RouterHandler from './router.js' //importing RouteHandler class
//import './store.js' //temporary importing store for testing.
/*whenever i have a hash router (#), whenever using a # in the url that changes, can detect the change with the onhashchange property.
the following will console log the word chang... |
function toggleMenu() {
document.getElementById("primaryNav").classList.toggle("hide");
}
function showBanner() {
let d = new Date()
const banner = document.getElementById('pancake-banner');
if (d.getDay() == 5) {
banner.style.display = "block";
}
}
document.getElementById("currentyear").... |
import HKDF from 'hkdf'
import {expect} from 'chai'
import CryptoJS from 'crypto-js'
describe('Unseen Chat Security', () => {
it('generates HMAC keys', () => {
let message = 'my plain text'
let hkdfMacKey = 'the HKDF mac key'
let hmac = CryptoJS.HmacSHA256(message, hkdfMacKey).toString()
console.lo... |
const mongoose = require("mongoose");
const ImagesSchema = mongoose.Schema({
imageName: { type: String, required: true },
carId: { type: String, required: true },
});
module.exports = mongoose.model("Images", ImagesSchema);
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require("path");
//创建插件对象,使用path拼接当前项目的路径,如果直接写/,是相对于系统磁盘的,此时/不代表项目的根目录,因此需要使用path模块进行拼接
const htmlPlugin = new HtmlWebpackPlugin(
{
template:path.join((__dirname),"/src/index.html"),
filename:"index.html"
}
);
module.exp... |
import Mock from 'mockjs';
const data = Mock.mock({
// 属性 list 的值是一个数组,其中含有 1 到 10 个元素
'foods|10-50': [{
'name': "@ctitle(2,10)",
"img": "@image('600x600',#b7ef7c)",
"brief": "@csentence(1,50)",
"price|0-20.0-2": 1,
"num": 0,
"minusFlag": true,
"time": "@time",
"peisongfei|0-100.0-2"... |
self.__precacheManifest = [
{
"revision": "fa3b3379364551d9100a544850f1bf70",
"url": "/lol-builds/static/media/jesusGirando.fa3b3379.gif"
},
{
"revision": "ea683c0c38e54716a743",
"url": "/lol-builds/static/js/runtime~main.84e1de9c.js"
},
{
"revision": "c301b48fa0257e3792b2",
"url": "/l... |
import React from "react";
import sushi1 from "./pictures/sushi1.jpg";
import sushi2 from "./pictures/sushi2.jpg";
import sushi3 from "./pictures/sushi3.jpg";
import sushi4 from "./pictures/sushi4.jpg";
import sushi5 from "./pictures/sushi5.jpg";
import sushi6 from "./pictures/sushi6.jpg";
import sushi7 from "./picture... |
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(ex... |
function menuInit ($) {
var menu = $("div#menu").find("li");
menu.on("click", function(){
target = $(this).data("pos");
$("body").animate ( {
"scrollTop" : $("#"+target).offset().top
}, 2000);
})
}; |
'use strict';
define(['../../../app'], function(app) {
app.factory('cdcInventoryQuery', ['$http', '$q', '$filter', 'HOST', function($http, $q, $filter, HOST) {
return {
getThead: function() {
return [{
field: 'pl4GridCount',
name: '序号',
type: 'pl4GridCount'
}, ... |
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var ipfs = require('./modules/ipf/upload');
var addAssets = require('./modules/participants/addAssets');
var fileUpload = require('express-fileupload');
var identity = require('./modules/auth/register')
var au... |
const path = require('path')
const merge = require('webpack-merge')
const nodeExternals = require('webpack-node-externals')
const { _root } = require('../../env')
const base = require('./base.babel')
// const _dev = process.env.NODE_ENV === 'development'
module.exports = merge(base, {
target: 'node',
entry: [pat... |
export default {
getAttributes(){
}
} |
const url = window.location.href;
if (url.indexOf('dashboard.') < 0 ) {
setInterval(() => {
const videos = document.getElementsByTagName('video');
for (let i = 0; i < videos.length; i++) {
if (videos.length > 2
&& videos[i].parentElement
&& videos[i].pare... |
var chai = require('chai');
var expect = chai.expect;
var should = chai.should();
var chaiHttp = require('chai-http');
var productservice = require('../src/service/product-service');
chai.use(chaiHttp);
var product = {
"productId": "110",
"productName": "Fsports",
"size": "3",
"price": 5000000,
"d... |
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import {
makeStyles,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
} from '@material-ui/core';
const useStyles = makeStyles((theme) => ({
table: {
marginTop: 5 + 'rem',
justifyContent: 'center',
... |
import SimonBase from './simon-base.js';
// Make selected classes available outside the library
export { SimonBase }; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.