text stringlengths 7 3.69M |
|---|
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Table, Icon, Dropdown } from 'semantic-ui-react';
import { Link } from 'react-router-dom';
import {
chatLog,
searchChatLog
} from '../../Func/actions/ChatLog'
const options = [
{ key: 0, text: '전체', value: 0 },
{ key: 1, ... |
import Header from './index'
test('A test test', () => {
expect( '2' ).toBe( '2' )
})
|
import React from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import FollowerIcon from 'assets/icons/FollowerIcon';
import Text from 'components/Text';
const FollowersContainer = styled.div`
display: flex;
align-items: center;
`;
const StyledFollowerIcon = styled(FollowerIc... |
import { combineReducers } from 'redux'
import auth from './auth'
import drawer from './drawer'
import ui from './ui'
import youtube from './youtube'
export default combineReducers({
auth,
drawer,
ui,
youtube
})
|
(function() {
// 这些变量和函数的说明,请参考 rdk/app/example/web/scripts/main.js 的注释
var imports = [
'rd.attributes.Scroll', 'css!base/style'
];
var extraModules = [ ];
var controllerDefination = ['$scope', main];
function main(scope) {
}
rdk.$ngModule.config(['ScrollConfigProvider... |
import { Editor, Raw } from '../..'
import React from 'react'
import initialState from './state.json'
import keycode from 'keycode'
/**
* Define a set of node renderers.
*
* @type {Object}
*/
const NODES = {
'table': props => <table><tbody {...props.attributes}>{props.children}</tbody></table>,
'table-row': ... |
'use strict';
TSManager.controller('ListCtrl', function ($scope, Tasks) {
$scope.todos = Tasks.query();
$scope.from = '-done';
$scope.reverse = true;
$scope.alerts = [];
$scope.modal = {
"content": "Hello Modal",
"saved": false
}
$scope.create = function (task) {
Tasks.save(task);
$scope.todos.push... |
import Backbone from 'backbone';
const Message = Backbone.Model.extend({
defaults() {
return {
created: undefined,
text: '',
};
},
initialize() {
let created = this.attributes.created;
switch (typeof created) {
case 'object':
break;
case 'str... |
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
const cors=require('cors')
const mongoose = require('mongoose')
const verify = require('./middleware/verify')
var indexRouter = require('.... |
import './train.html';
import './train.css';
const TAB_NOTES = [
'DO_1', 'RE_1', 'MI_1', 'FA_1', 'SOL_1', 'LA_1', 'SI_1',
'DO_2', 'MI_2', 'FA_2', 'SOL_2', 'LA_2', 'SI_2',
];
const NOTES_PATH = '/images/NOTES/FA/';
const NB_SERIES = 15;
Template.train.onCreated(function () {
this.note = new ReactiveVar(''... |
import React from 'react';
import {HeaderWrapper, HeaderWrapper2, HeaderIcons, Contact,
Donations, Title, LogoDiv, Nav, NavList, NavListItem,
NavLink, HeaderText,HeaderWrapper3, NavList2, NavLink2, NavListItem2,
} from './header-styles';
import {Icon, Input} from 'antd';
import Logo from '../../../utils/Logo... |
'use strict'
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const passportLocalMongoose = require('passport-local-mongoose');
const options = {
errorMessages: {
UserExistsError: 'En användare med det användarnamnet finns redan',
IncorrectPasswordError: 'Felaktigt lösenord ell... |
import RK4 from './rk4';
export default class Entity extends RK4 {
}
|
let canvas = document.getElementById('canvas')
let gl = canvas.getContext("webgl", { premultipliedAlpha: true })
canvas.width = window.innerHeight
canvas.height = canvas.width
let img = new Image()
img.src = 'https://i.ibb.co/hsRMb22/smoke.png'
img.crossOrigin = "anonymous"
let ismousedown = false
let scaleProp... |
// USER LOGIN, REGISTER, LOADING
export const USER_LOADING = 'USER_LOADING';
export const USER_LOADED = 'USER_LOADED';
export const AUTH_ERROR = 'AUTH_ERROR';
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
export const LOGIN_FAIL = 'LOGIN_FAIL';
export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
export const LOGOUT_FAIL = ... |
besgamApp
.controller('newsletter', function( $scope, $http, $route, $log, vcRecaptchaService )
{
$scope.email = $route.current.params.email;
$scope.response = null;
$scope.widgetId = null;
$scope.model = {
key: '6LfuiAgTAAAAABTVAVcs1h1SEtBNTnhAT1gHi3uv'
... |
import React, { Component } from 'react'
import Yearselect from './comp/Yearselect'
import Monthselect from './comp/Monthselect'
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
const isEventValid = state => (
state.nazwa.length > 5 &&
state.dzien.length > 0 &&
... |
import { Container, Row, Col } from 'react-bootstrap';
import '../styles/portifolio.css';
import '../styles/images-portifolio.css';
import { useState, useEffect } from 'react';
import { fs } from '../../../../config/firebase.js'
import { PortifolioItemMain } from './portifolio-main-item.js';
import { motion } from "fra... |
import React, { Component } from "react";
import callAPI from "./../util/callAPI";
class TaskForm extends Component {
constructor(props) {
super(props);
this.state = {
name: "",
status: false,
price: ""
};
}
handleChange = e => {
var target = e.target;
var name = target.name;... |
const MOCK_SERVER = require('../mocks/mock_server');
let mud;
describe('Testing: AGGIE BEHAVIOR', () => {
let combatLoop;
let cmdLoop;
let mockPlayer;
let wolf;
let wolf2;
let wolfRoom;
let mockPlayerRoom;
let mockPlayerArea;
let server;
beforeEach((done) => {
mud = new... |
function _parseUpdateResult(){
window.returnValue = xmlUpdateResult.XMLDocument.documentElement.xml;
window.close();
} |
// Copyright 2012 Dmitry Monin. 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 required by applica... |
angular.module("mainModule", [])
.filter("removeHtml", function(){
return function(texto){
return texto;
}
}) |
import React, { Component } from 'react';
import AddTodo from './Components/AddTodo';
import Todos from './Components/Todos';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {
todos: [
{ id: 1, content: 'buy milk' },
{ id: 2, content: 'p... |
import React from 'react';
class VoteSubmitted extends React.Component {
render() {
return(
<div>
<p>Your vote of {this.props.voteCast} is submitted</p>
{!this.props.voteComplete &&
<button className="btn btn-primary" onClick={()=>{ this.props.onChangeVote()}}>Change Vote</button... |
const { expect } = require("chai");
let WithoutZK;
let withoutZK;
before(async () => {
WithoutZK = await ethers.getContractFactory("WithoutZK");
});
beforeEach(async () => {
withoutZK = await WithoutZK.deploy();
await withoutZK.deployed();
});
describe("WithoutZK", function () {
it("should process", async (... |
$(function() {
// ヘッダーメニュー
$('.menu-trigger').on('click', function() {
$(this).toggleClass('active');
});
// スムーススクロール
var scroll = new SmoothScroll('a[href*="#"]',{
speed: 1500,
});
$('.menu').on('click',function(){
$('.menu__line').toggleClass('active');... |
// ================================================================================
//
// Copyright: M.Nelson - technische Informatik
// Die Software darf unter den Bedingungen
// der APGL ( Affero Gnu Public Licence ) genutzt werden
//
// weblet: dbadmin/weblet/detail
// =========... |
import { expect } from 'chai';
import { parseAgentAndProcess } from './queryString';
describe('queryString', () => {
describe('parseAgentAndProcess', () => {
it('parses the agent and process from a path', () => {
[
{
path: '/agent/process',
expected: { agent: 'agent', process: '... |
/*=======================================================================
* FILE: Navigation.js
* AUTHOR: Kyler Ashby
* DATE: Winter 2021
*
* DESCRIPTION: Navigation module (for volumes, books)
* IS 542, Winter 2021, BYU.
*/
/*jslint
browser, long, for
*/
/*-----------------------------------... |
const GET_PRICE = "transactions/GET_PRICE";
export const BUY_STOCK = "transactions/BUY_STOCK";
const getPrice = (transactionPriceDict) => ({
type: GET_PRICE,
transactionPriceDict
});
const buyStock = (transaction) => ({
type: BUY_STOCK,
payload: transaction
})
export const getPriceShares = (ticker_symbol) =>... |
import Product from "../models/Product.js";
import ErrorResponse from "../helpers/errorResponse.js";
import asyncHandler from "../middlewares/async.js";
import slugify from "slugify";
/**
* @desc Get all Products
* @route GET /api/products
* @route GET /api/categories/:categoryId/products /// products belong... |
var salmin = 1045
var precokw = (salmin/7)/100
var kw
var rs = require('readline-sync')
var kw = rs.questionInt('Quantos KWH voce gastou esse mes? ')
while (kw <= 0){
var kw = rs.questionInt('Quantos KWH voce gastou esse mes? ')
}
kwdesc = (precokw*kw)*0.9
if (kw > 100){
console.log('Esta na media do consum... |
const expect = require('expect');
const {generateMessage,generateLocationMessage } = require('./message');
describe('Generate message', () => {
it('it should generate correct message object', () => {
let from = 'jen';
let text = 'some message';
let message = generateMessage(from,text);
... |
var inquirer = require('inquirer');
var isLetter = require('is-letter');
var Word = require('./foodword.js');
var Game = require('./randomFood.js');
//set the maxListener
require('events').EventEmitter.prototype._maxListeners = 100;
var hangman = {
wordBank: Game.newFood.foodList,
guessesRemaining: 10,
//emp... |
import { useEffect, useState } from "react"
import ContactUs from "../components/contactUs"
import NavBar from "../components/navbar"
const Contact = () => {
return (
<>
<NavBar />
<ContactUs />
</>
)
}
export default Contact |
/*
*author:秦浩
*Create date: 2009-05-19
*Description: 发货记录单表单验证
*/
function ValidateInput()
{
// var IsAllCheck = 0;
// var ddlCompanyName = $.trim($("#ddlCompanyName").val()); //物 流 公 司
// var txtGoodsOrderNO = $.trim($("#txtGoodsOrderNO").val());//发 货 单 号
// var chkBox = $("input[type='checkbox'... |
app.controller("MainController",function($rootScope,$scope,$window,$location){
$rootScope.last ="Austira";
$rootScope.go = function(path){
$location.path(path);
}
$rootScope.back = function(){
$window.history.back();
}
}); |
// ajax the delete button AND update graph
function ajaxDelete() {
// ajaxify crud functions
$('.delete-form').on("submit", function(event) {
event.preventDefault();
var $target = $(event.target);
console.log($target);
$.ajax({
url: $target.attr('action'),
type: 'DELETE'
}).done(fu... |
import { createStore, applyMiddleware, combineReducers } from 'redux';
import thunk from 'redux-thunk';
import { persistStore } from 'redux-persist';
import auth from './auth';
const rootReducer = combineReducers({
auth
});
// Add the thunk middleware to our store
const store = createStore(rootReducer, applyMiddlew... |
(function() {
'use strict';
const endpoint = 'https://api.ipify.org/?format=json';
const platformInfo = navigator.platform;
const isOnline = navigator.onLine;
const publicIpText = document.getElementById('public-ip');
const localIpText = document.getElementById('local-ip');
const platformText = docume... |
/**
* Created by ntban_000 on 4/27/2017.
*/
'use strict'
const mongoose = require('mongoose');
const bcrypt = require('bcrypt-nodejs');
const Schema = mongoose.Schema;
const UserSchema = new Schema({
username: { type:String, lowercase:true, required: true, unique:true },
password: { type: String, required:... |
function Sphere() {}
Sphere.prototype = {
setCenter: function(vector) {
this.center = vector;
return this;
},
setRadius: function(r) {
this.radius = r;
return this;
},
setDiffuseMaterialColors: function(colorVec) {
this.DiffMatColor = colorVec;
return this;
},
... |
var WorldBound = {
setpos: function (x, y) {
this.x = x
this.y = y
},
draw: function () {
UFX.draw("t", this.x*100, this.y*100)
},
}
var Stands = {
think: function (dt) {
if (this.parent) {
if (!this.parent.supports(this)) {
this.drop()
this.kjump = 1
this.y += 0.002
}
} else {
if (... |
import { combineReducers } from "redux";
import { messages } from "./reducers/messages"
import { options } from "./reducers/options"
import { loading } from "./reducers/loading"
import { language } from "./reducers/language"
import { auth } from "./reducers/auth"
export const reducer = combineReducers({
messages,
... |
// Konstruktor klasy tworzacej liste
// na wejscie otrzymuje wektor danych, z ktorych tworzy liste <ul/>
// autor: Patryk Jar jar dot patryk at gmail dot com
// data : 28 marca 2010 r.
var yList = function() {
return {
};
}; |
const Arbre=require('../Modele/arbreModel')
exports.create=(req,res)=>{
const newArbre=new Arbre({
name:req.body.name,
ImageArbre:req.file.originalname,
categori:req.body.categori,
prix:req.body.prix,
quantite:req.body.quantite
})
newArbre.save()
.then(resul... |
/*/ --------------------------------------------//
* ┌─────────────────────────────────────────┐
* │ |> Serverless API - Lambda Functions │
* └─────────────────────────────────────────┘
*
/*/
const db = require("../db");
const {
GetItemCommand,
PutItemCommand,
UpdateItemCommand,
DeleteItemCommand,
ScanC... |
$(function(){
attachEvent();
});
function addGene(){
var gn = $('#gene_name').val();
var gf = $('#gene_f_gene').val();
var gm = $('#gene_m_gene').val();
$.ajax({
url: "/genes/add_gene/",
type: "get",
dataType: "script",
data: {gene: {name: gn, f_gene: gf, m_gene: gm}}
});
}
function attachEvent(){
... |
"use strict";
/**
* @class
* @classdesc a test mock to represent an abstract module class
* @implements {EquivalentJS.Manager.Module.class}
* @typedef {Object} EquivalentJS.mock.AbstractModule
* @constructs
*/
EquivalentJS.define('EquivalentJS.mock.AbstractModule', new function () {
/**
* @description b... |
import React, {useState} from 'react';
import {
Pressable,
SectionList,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native';
import Ionicons from 'react-native-vector-icons/Ionicons';
import {screenBackgroundColor, tintColor, headerTextColor} from '../stylesheets/color-sheme';
import {createStac... |
/* global google */
import React, {useState, useEffect} from 'react';
//// for integration with python
import axios from 'axios';
import Street from './Street.jsx';
import MapDirectionsRenderer from './DirectionRenderer.jsx';
import PersistentDrawerRight from './Drawer.jsx';
import Button from '@material-ui/core/Button... |
import _ from 'underscore';
import d3 from 'd3';
import RiskOfBiasScore from 'riskofbias/RiskOfBiasScore';
import D3Visualization from './D3Visualization';
import RoBLegend from './RoBLegend';
class RoBBarchartPlot extends D3Visualization {
constructor(parent, data, options){
// stacked-bars of risk of... |
const expect = require("chai").expect;
const sinon = require("sinon");
const Plugins = require("eslint/lib/config/plugins");
const ModuleResolver = require("eslint/lib/util/module-resolver");
const eslintPatch = require("../lib/eslint-patch");
describe("eslint-patch", function() {
describe("patch", function() {
... |
import React, { Component } from 'react';
import css from './styles.scss';
import {} from 'prop-types';
import NavBarItems from 'assets/fr/navbar.json';
import {TweenMax} from 'gsap';
import MainNavButton from './components/MainNavButton';
import Link from '../components/Link'
class NavBarMobile extends Component {
... |
var LocalStrategy = require('passport-local').Strategy,
SL = require(process.cwd() + '/lib/happy/sqllib.js');
module.exports = {
initialize : function(server, Passport) {
},addlang : function(pgClient, data, cb){
var sql = 'INSERT INTO translates.lang_t (lang,name) VALUES ($1,$2)';
pgCli... |
const router = require('express').Router()
const {Product, User} = require('../db/models')
module.exports = router
router.get('/', async (req, res, next) => {
try {
const products = await Product.findAll()
res.json(products)
} catch (err) {
next(err)
}
})
router.post('/', async (req, res, next) => {... |
const formToJSON = elements => [].reduce.call(elements, (data, element) => {
data[element.name] = element.value;
return data;
}, {});
function submitForm(form, url) {
document.querySelectorAll('button').forEach(btn => btn.disabled = true);
const opt = {
timeOut: 2000
};
const postData... |
import React, { Component } from 'react';
import './App.css';
import ReactMapboxGl, { Popup } from "react-mapbox-gl";
const Map = ReactMapboxGl({
accessToken: "pk.eyJ1IjoiYmxpc2h0ZW4iLCJhIjoiMEZrNzFqRSJ9.0QBRA2HxTb8YHErUFRMPZg"
});
const INITIAL_CENTER = [20, -2];
const INITIAL_ZOOM = [9];
class App extends Compon... |
hvar fs = require('fs');
var fd = fs.openSync('veggie.txt', 'r');
var veggie = "";
do{
var buf = new Buffer(5);
buf.fill();
var bytes = fs.readSync(fd, buf, null, 5);
console.log('read %d bytes', bytes);
veggie += buf.toString();
}while(bytes>0);
fs.closeSync(fd);
console.log('Veggies: ' + veggi... |
import css from './index.css'
import React, { Component } from 'react';
import Logo from '../logo';
export default class NavBar extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div id = 'nav-bar'><Logo/></div>
)
}
} |
//make SVG compatibility
SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function (toElement) {
return toElement.getScreenCTM().inverse().multiply(this.getScreenCTM());
};
$(function () {
// split pane
$('div.split-pane').splitPane();
//add nano scrol... |
import React from "react"
import styled from "styled-components"
import BodyBurnLogo from "../../svgs/BodyBurnLogo"
import WhatIsBodyBurnCopy from "./Copy/WhatIsBodyBurnCopy"
import Fourteen from "../Shared/FourteenDayTrialHeader"
import { above } from "../../styles/Theme"
const HeadlineContent = () => {
return (
... |
// 第一个动画效果
function animate(element){
element.onmouseover=function(){
this.style.color= " #efb336";
this.children[1].style.display = 'block';
}
element.onmouseout = function(){
this.style.color= "#666";
this.children[1].style.display = 'none';
}
}
//
// 商品展示页 动画效果... |
import React from 'react'
import Paper from 'material-ui/Paper'
import {List, ListItem} from 'material-ui/List'
import Divider from 'material-ui/Divider'
import Subheader from 'material-ui/Subheader'
import Avatar from 'material-ui/Avatar'
import {grey400, darkBlack, lightBlack} from 'material-ui/styles/colors'
import ... |
import axios from './axios'
const Csrf = {
getCookie() {
axios.get("/csrf-cookie");
}
}
export default Csrf |
import React from "react";
import { Container, Grid, Header } from "semantic-ui-react";
import styled from "styled-components";
import SearchForm from "./SearchForm/SearchFormContainer";
const StyledContainer = styled(Container)`
&&& {
height: 100%;
min-height: 440px;
display: flex;
padding... |
const loggedUser = JSON.parse(localStorage.getItem("user"));
const initState = loggedUser ? {
loggedIn: true,
authError: null,
loggedUser
} : {};
const authReducer = (state = initState, action) => {
switch(action.type) {
case "LOGIN_SUCCESS":
console.log("login success");
return {
...state,
logged... |
import {createStore, combineReducers, applyMiddleware} from 'redux';
import movielistReducer from './reducers/movielistReducer';
import userReducer from './reducers/userReducer';
import thunk from 'redux-thunk';
import {composeWithDevTools} from 'redux-devtools-extension'
const middleware = [thunk];
const allReducers ... |
class DashboardInjector {
constructor(app) {
this.app = app;
this.subscriptions = {};
app.worker.addHandler("dashboard_update", (c, m) => this._onUpdate(c, m));
}
_onUpdate(ctx, msg) {
if (this.subscriptions[msg.id] === undefined) {
console.warn("No dashboard subscription for ", msg.id);
... |
import urlWithParams from '../../src/common/urlwithparams';
export default function localOrHive(src, params) {
src = src.toLowerCase();
if (window.location.hostname === '127.0.0.1') {
return urlWithParams(`${window.location.origin}/assets?path=${src}`, params);
} else {
// if (params && (params.reforged... |
(function ($) {
const password = $("#password");
let isChecked = false;
$("#show-password-btn").on("click", function () {
isChecked = !isChecked;
password.attr("type", isChecked ? "text" : "password");
$(this).text((isChecked ? "Hide" : "Reveal") + " Password");
});
})(window.jQuery);
|
module.exports={
api_secret_key:'metin'
}; |
const express = require("express");
const path = require("path");
const auth = require("http-auth");
const { body, validationResult } = require("express-validator/check");
var thesaurus = require("thesaurus-synonyms");
var natural = require("natural");
var tokenizer = new natural.WordTokenizer();
const router = expr... |
"use strict";
// require the express module
const express = require("express");
// require the router object (with all the defined routes) to be used in this file
const questionsRoutes = require("./questions.api");
const scoreRoutes = require("./scores.api")
// require the cors module
const cors = require("cors");
// c... |
import axios from 'axios';
import { formatListing } from '../helpers/formatValues';
import { FETCH_EVENTS } from './types';
import { SUBMIT_EVENT } from './types';
import { JOIN_EVENT } from './types';
import { FETCH_SINGLE_EVENT } from './types';
import { QUIT_EVENT } from './types';
import { REMOVE_EVENT } from './ty... |
// components/pannel-box/pannel-box.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: String,
content: String,
imgPath: String
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
itemClick() {
this.triggerEvent('itemClick', {}, {})
}
}
})
|
import React, { Component } from "react";
import Typewriter from "typewriter-effect";
import { Link } from "react-router-dom";
import "./Home.css";
class Home extends Component {
constructor(props) {
super(props);
this.state = {
type: "",
showBorder: true,
};
}
render() {
const style... |
BEER.MyStockMasterViewModel = function (data) {
var self = this;
self.Yeasts = new BEER.ViewModels.Yeast();
self.Malts = new BEER.ViewModels.Malt();
self.Hops = new BEER.ViewModels.Hop();
self.myMalts = new BEER.ViewModels.MyMalts();
self.myHops = new BEER.ViewModels.MyHops();
self.myYeast... |
import React, { Component } from 'react';
import { Card, CardImg, CardText, CardBody,
CardTitle } from 'reactstrap';
import { DISHES } from './../shared/dishes.js';
//CardImgOverlay,
class DishDetail extends Component {
componentDidMount(){
console.log('Dishdetail Component componentDidMount is Invoke... |
import request from 'supertest';
import cheerio from 'cheerio';
import { createTestHarness } from '../../testUtils/testHarness';
const macroWrapper = `{% from './components/view-expandable-section/macro.njk' import viewExpandableSection %}
{{ viewExpandableSection(params) }}`;
describe('view-e... |
import {SERVICE_URLS} from '../constants/serviceUrl';
import * as types from '../constants/actiontypes';
import axios from 'axios';
import toastr from 'toastr';
let uploadFile = (token, acceptedFiles) =>{
const url = SERVICE_URLS.ACCOUNT_SETTINGS;
var config = {
headers: {'Authorization':'Token '+tok... |
const net = require('net');
const chat = require('./chat');
const chatRoom = new chat();
const server = net.createServer(client => {
client.setEncoding('utf-8');
chatRoom.add(client);
client.on('data', message => {
chatRoom.send(client, message);
});
client.on('close', () => {
chatRoom.remove(client)... |
import React, { useContext } from 'react'
import UserAvatar from './UserAvatar'
import { UserContext } from '../App'
function useStates() {
const user = useContext(UserContext)
return (
<div className = 'user-states'>
<div>
<UserAvatar user={ user}/>
{user.n... |
//Importer fastifer
const fastify = require('fastify')({
logger: true
});
// Import Os pour pouvoir recuper le hostname qui nous seras utile par la suite.
const os = require("os");
// Creation du enpoint rest qui renvoie l'objet json ci-dessous
fastify.get('/', async (request, reply) => {
reply.type('applica... |
const express = require("express");
const router = express.Router();
/**
* Express router for /logout
*
* clear session and redirect to home page
*/
const logout = router.get('/logout',(req, res)=> {
req.logout();
//req.session.destroy();
req.session = null;
res.redirect('/');
});
module.exports = ... |
import React from 'react';
import {Button, ButtonGroup, Icon, Slider} from '@blueprintjs/core';
import {formatTime} from '../common/utils';
export default function (bundle) {
bundle.use(
'recorderStart', 'recorderStop', 'recorderPause', 'recorderResume',
'playerStart', 'playerPause', 'playerSeek',
'ge... |
import BaseView from './base';
export default class ItemView extends BaseView {}
|
import React from 'react'
import {useSelector} from 'react-redux'
import {currencyFormatter} from '../../actions/currencyFormatter'
const CashBalance = () => {
const balance = useSelector(state => state.currentUserReducer.currentUser.attributes.balance)
return (
<span id ='balance'>
{'CASH BALANCE: US... |
const layer = layui.layer
const form = layui.form
const laypage = layui.laypage
let q = {
pagenum: 1, // 页码值,默认请求第一页的数据
pagesize: 2, // 每页显示几条数据,默认每页显示2条
cate_id: '', // 文章分类的 Id
state: '' // 文章的发布状态
}
// 渲染表格
function initTable() {
$.ajax({
method: 'GET',
data: q,
url: '/my/... |
#!/usr/bin/env node
const yargs = require('yargs');
const { argv } = yargs;
const fs = require('fs');
const chalk = require('chalk');
yargs
.usage('Usage: $0 <command> [options]')
.example(
'$0 --template="./templatest/sample.tsx" --output="components/Form/"',
'Write sample.tsx with strings replaced to output ... |
import React from "react";
import { Link } from "react-router-dom";
export const MailButton = () => {
return (
<Link to="/contact" >
<button className="social-media-icon contact-icon">
<svg xmlns="http://www.w3.org/2000/svg" height="64" width="64" viewBox="0 0 64 64"><title>lett... |
(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/consultants/headimgs/main" ], {
"07af": function(n, t, e) {
function a(n) {
return n && n.__esModule ? n : {
default: n
};
}
Object.defineProperty(t, "__esModule", {
value: !... |
import React from "react";
function SubTestimonial(props) {
return (
<div className="subTest-wrapper">
<div className="subTest-icon">
<i class="fas fa-quote-left"></i>
</div>
<div className="subTest-quote">{props.quote}</div>
<div className="subTest-img">
<img src={props.i... |
import clsx from 'clsx';
const KPI = ({ className }) => {
return (
<div
className={clsx(
className,
'p-12 shadow-xl rounded-md flex justify-center items-center'
)}>
<div className="h-17 w-17 rounded-full bg-icoBlue-200 mr-5"></div>
... |
var AWS = require('aws-sdk');
AWS.config.update({region: 'us-east-1'});
var dynamodb = new AWS.DynamoDB();
var fs = require('fs');
var obj = JSON.parse(fs.readFileSync('import.json', 'utf8'));
var crypto = require('crypto');
var toadd = [];
obj.forEach(function(data) {
for(var obj in data.questions) {
var... |
/**
* @param {number[][]} graph
* @param {number[]} initial
* @return {number}
*/
let DSU = function(n) {
this.size = [];
this.root = [];
this.infected = [];
for (let i = 0; i < n; i++) {
root[i] = i;
}
this.find = function(x) {
if (root[x] != x) {
root[x] = find(root[x]);
}
return... |
/*
* Copyright 2017 PhenixP2P Inc. Confidential and Proprietary. All Rights Reserved.
* Please see the LICENSE file included with this distribution for details.
*/
import React from 'react';
import {PropTypes} from 'prop-types';
import styles from '../../styles/controls.css';
const LatencyText = ({lag}) => (
<di... |
const request = require('request');
const config = require('../config');
const defaultClient = request.defaults({
headers: {
Accept: 'application/json',
},
timeout: config.rest.timeout,
});
exports.defaultClient = defaultClient;
|
//функция столкновения астероида с элементом переданным в функции
function crashAsteroid(getAsteroid, element) {
//если положение астероида заходит на переданный элемент
if (getAsteroid.offsetTop + getAsteroid.offsetWidth > element.offsetTop &&
getAsteroid.offsetLeft + getAsteroid.offsetWidth > el... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.