text stringlengths 7 3.69M |
|---|
function runTest()
{
FBTest.openNewTab(basePath + "css/nestedRules/atMediaStyleEditing.html", function(win)
{
FBTest.openFirebug(function()
{
var panel = FBTest.selectPanel("stylesheet");
FBTest.selectPanelLocationByName(panel, "atMediaStyleEditing.html");
/... |
import lesson2 from '../lesson2';
const {
sum,
sumAll,
pow,
random,
} = lesson2.task;
describe('sum function', () => {
it('should work with 2 numbers', () => {
expect(sum(10, 20)).toBe(30);
expect(sum(-10, 20)).toBe(10);
});
it('should throw exception if one of the arguments in not numeric', ()... |
$(()=>{
$.ajax({
type: "get",
url: "../../api/listB.php",
// data: "data",
dataType: "json",
success: function (response) {
console.log(response);
}
});
}) |
import React, { Component } from 'react'
import { Redirect } from 'react-router-dom'
export default class Connexion extends Component {
state = {
pseudo: '',
goToApp: false
}
goToApp = event => {
event.preventDefault()
this.setState({ goToApp: true })
}
handleChan... |
import React from "react";
import "react-native-gesture-handler";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import Search from "../screens/Tabs/Search";
import Notifications from "../screens/Tabs/Notifications";
import Profile from "../screens/Tabs/Profile";
import { View } from "react-n... |
var username = document.querySelector('.input__name');
var email = document.querySelector('.input__email');
var password = document.querySelector('.input__password');
var repassword = document.querySelector('.input__repassword');
var submit = document.querySelector('.btn');
var checkbox = document.getElementById("ter... |
/**
* 这里是登录表单
* @type {[type]}
*/
var loginModule = angular.module("loginModule", []);
loginModule.controller('loginCtrl', function($scope, $http, $rootScope, AUTH_EVENTS, AuthService) {
$scope.userInfo = {
username: '',
password: ''
};
$scope.loginfail = false;
$scope.login = function(userInfo) {
AuthServ... |
//Agregar un nuevo trayecto
$(document).on("pagecreate", function () {
$("#add").click(function () {
nextId++;
var content = "<div data-role='collapsible' id='set" + nextId + "' data-collapsed='false'><h3>Trayecto " + nextId + "</h3>"
+ "<div>"
+ "<tabl... |
const path = require('path')
/**
* Configure Storybook.
*
* @see https://storybook.js.org/docs/react/configure/overview
*/
module.exports = {
reactOptions: {
fastRefresh: true,
strictMode: true
},
stories: [
'../components/**/**/*.stories.@(js|mdx)',
'../docs/**/**/*.stories.@(mdx)'
],
ad... |
import React from 'react';
const ErrorGenerator = ({ action }) => (
<p>
<button onClick={() => action('ACTION_ERROR_IN_PUT')}>Action erro in put</button>{' '}
<button onClick={() => action('ACTION_ERROR_IN_SELECT')}>Action erro in select</button>{' '}
<button onClick={() => action('ACTION_ERROR_IN_CALL_S... |
"use strict";
var archDevRequire = require("@walmart/electrode-archetype-react-app-dev/require");
var mergeWebpackConfig = archDevRequire("webpack-partial").default;
var cdnLoader = archDevRequire.resolve("@walmart/cdn-file-loader");
module.exports = function () {
return function (config) {
return mergeWebpackC... |
module.exports.createAccessControlList = function(serviceLocator) {
var
acl = {};
function addResource(resource, description) {
if (acl[resource] === undefined) {
serviceLocator.logger.verbose('Adding resource \'' + resource + '\' to access control list');
acl[resource] = {
description: description,
... |
// meteor add webapp
// meteor add ostrio:spiderable-middleware
import { WebApp } from 'meteor/webapp';
import Spiderable from 'meteor/ostrio:spiderable-middleware';
WebApp.connectHandlers.use(new Spiderable({
rootURL: 'http://example.com',
serviceURL: 'https://render.ostr.io',
auth: 'APIUser:APIPass'
}));
|
import React, {Component} from 'react';
export default class PalindromeView extends Component {
render() {
return(
<div>
{this.props.s.map((f) => ([
<ul key={f.id}>
<h4 key={f.nameId}>{f.filename} </h4>
<p key={f.countId}> Count: {f.palindromeCount}</p>
{f.... |
import React from 'react'
import {TitleBar} from "./TitleBar"
import axios from "axios"
const terrainMap = {
'O' : {color: 'blue'},
'B' : {color: 'burlywood'},
'G' : {color: 'lightgreen'},
'R' : {color: 'lightblue'},
'F' : {color: 'darkgreen'}
}
export class AppComponent extends React.Component ... |
function titleCase(title, minorWords) {
return title.split(' ').map(function(element) {
return element.toLowerCase()[0].toUpperCase().concat(element.substr(1, element.length).toLowerCase());
}).join(' ');
}
console.log(titleCase('the quick brown fox'));
|
/**
* 店铺地址
*/
import React, { Component, PureComponent } from 'react';
import {
StyleSheet,
Dimensions,
View,
Text,
Button,
Image,
ScrollView,
TouchableOpacity
} from 'react-native';
import { connect } from 'rn-dva';
import Header from '../../components/Header';
import CommonStyle... |
const features = {};
function broadcastFeatures() {
Object.keys(localStorage).filter(key => key.startsWith('_feature.') && key !== '_feature._enabled')
.forEach(feature => features[feature] = JSON.parse(localStorage.getItem(feature)))
chrome.runtime.sendMessage({event: 'featureDiscovery', features});
... |
// Auth
export const AUTH = 'AUTH';
export const LOGOUT = 'LOGOUT';
export const ERROR = 'ERROR';
// Box
export const ADD_TO_BOX = 'ADD_TO_BOX';
export const REMOVE_FROM_BOX = 'REMOVE_FROM_BOX';
export const INCREASE_PRODUCT_AMOUNT = 'INCREASE_PRODUCT_AMOUNT';
export const DECREASE_PRODUCT_AMOUNT = 'DECREASE_PRODUCT... |
//! ################################################################
//! Copyright (c) 2004 Amazon.com, Inc., and its Affiliates.
//! All rights reserved.
//! Not to be reused without permission
//! $Change: 1312631 $
//! $Revision: 1.1 $
//! $DateTime: 2007/03/02 09:47:36 $
//! #################################... |
import React from 'react';
// components
import QuizHeader from './QuizHeader';
import Questions from './Questions';
import QuizResults from './QuizResults';
const Main = React.createClass({
render() {
return (
<div className="container quiz">
<div className="col-xs-12 col-sm-9 col-md-9 col-lg-8 col-centere... |
// Copyright 2017 Joseph W. May. 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... |
import helper from '../../../../common/common';
import {fetchDictionary2, setDictionary,fetchDictionary} from '../../../../common/dictionary';
import {buildEditDialogState} from '../../../../common/state';
import {createContainer} from '../EditPageContainer';
import showDialog from '../../../../standard-business/showDi... |
'use strict'
/* Global Imports */
import { dbUser } from '../db-api/'
import { Success, Error } from '../util'
import { createToken } from '../services'
import Debug from 'debug'
/* Config Vars */
const debug = new Debug('nodejs-hcPartnersTest-backend:controllers:auth')
const register = async (req, res) => {
try {... |
var gameport = process.env.PORT || 3000;
var express = require('express');
// var verbose = false;
var app = express();
var http = require('http');
var server = http.Server(app);
var io = require('socket.io')(server);
var GachaServer ... |
(function() {
function Message($firebaseArray) {
var Message = {};
var ref = firebase.database().ref().child("messages");
var messages = $firebaseArray(ref);
var date = new Date();
var datePost = date.toDateString();
Message.getByRoomId = function(roomId){
//filter message by room ID
... |
import React, { Component } from 'react';
import { withStyles } from '@material-ui/core/styles';
import { Autocomplete } from '@material-ui/lab';
import PersonIcon from '@material-ui/icons/Person';
import AddIcon from '@material-ui/icons/Add';
import {
Box,
Button,
CircularProgress,
Dialog,
DialogActions,
D... |
import React from "react";
import { Grid, Button } from "@material-ui/core";
import { connect } from "react-redux";
import { EgretTextField, EgretSelect } from '../../egret'
import { COLORS } from '../../app/config'
const SELECT_DATA = [
{ id: 1, name: 'Commercial Real Estate' },
{ id: 2, name: 'Cannabis Applicatio... |
import React, { PureComponent } from 'react';
import { Redirect } from 'react-router-dom';
import { logout } from '../auth/auth-helper';
export default class Logout extends PureComponent {
render() {
logout(() => console.debug('logged out'));
return <Redirect to="/" />;
}
}
|
// Manages the layout of the dashboard
import DashMath from './dash-math.js'
let dragCoordOffset
function coordsInPixels({ x, y }, dashMath) {
return {
x: x * dashMath.unitSize,
y: y * dashMath.unitSize
}
}
function showGridGuide($guide = $('.dashboard-grid-square')) {
if ($guide) {
$guide.removeC... |
import React, { Component } from "react";
import Home from "./contentSections/home";
import Idea from "./contentSections/idea";
import About from "./contentSections/about";
import Contact from "./contentSections/contact";
class Content extends Component {
render() {
return (
<div className="content">
... |
const mongoose = require('mongoose');
const patientSchema = new mongoose.Schema({
firstName: {type: String},
lastName: {type: String},
DOB: {type: Date, default: Date.now},
contact: {type: String},
residentAddress: {type: String},
emergencyNo: {type: String}
})
const patient = mongoose.model('... |
/*global JSAV, document */
// Written by Cliff Shaffer
// Based on earlier material written by Sushma Mandava and Milen John
// variable xPosition controls the horizonatl position of the visualization
$(document).ready(function() {
//"use strict";
var av_name = "NestedQuery3";
var av = new JSAV(av_name);
var co... |
$().ready(function(){
$(validForm());
$(validPassForm());
initHide();
$("li[id='li-info']").click(function(){
if ($("#Comp-UserType").val()=="0"){
showPersonal();
}else {
showCompnay();
}
});
$("li[id='li-pass']").click(function(){
showUpdatePass();
});
$("#save").click(function(){
if(!val... |
/**
* Copyright (c) Benjamin Ansbach - all rights reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
const P_CODE = Symbol('code');
const P_MESSAGE = Symbol('message');
class ResultError {
constructor(code, message) {
... |
module.exports = {
theme: {
extend: {
spacing: {
'80': '70vh',
},
container: {
center: true,
},
colors: {
primaryColor: '#003366',
secondaryColor: '#777777',
thirdColo... |
const Promise = require("bluebird");
const stringify = Promise.promisify(require("csv-stringify"));
const writeFile = Promise.promisify(require("fs").writeFile);
class Output {
writeContents(args){
return this.write(args);
}
}
class CSVWrite extends Output{
constructor(content, csvFile){
super()... |
(function(){
var root=this;
var UI = {};
var AlertFieldType = {
Boolean: "boolean",
String: "string",
Number: "number",
Select: "select"
};
UI.AlertFieldType = AlertFieldType;
UI.showAlert = function(alert) {
var window=COSAlertWindow.new();
... |
// Cuando una función recibe un callback no es más que una función
// que se va a ejecutar después en cierto punto del tiempo
const getUsuarioById = ( id, callback ) => {
const usuario = {
id,
nombre: 'Oswaldo'
}
// setTimeout() es una función que ejecuta un callback en cierto momento del... |
angular.module('ngApp.common', ['pascalprecht.translate'])
.factory("SessionService", function ($window, $state) {
function setUser(userInfo) {
$window.sessionStorage["userInfo"] = JSON.stringify(userInfo);
}
function getUser(userInfo) {
return $window.sessionStorage["userInfo"] ? JSON.parse... |
import React from 'react';
import BaseButton from '@material-ui/core/Button';
const Button = (props) => {
return (
<BaseButton {...props} style={{
borderRadius: '5rem',
paddingLeft: '1.8rem',
paddingRight: '1.8rem',
paddingTop: '0.5rem',
paddingBottom: '0.5rem',
...props.styl... |
import React, { useState } from "react";
import RacingBarChart from "./RacingBarChart";
import useInterval from "./useInterval";
const getRandomIndex = array => {
return Math.floor(array.length * Math.random());
};
const getRandomnumber = () => {
return Math.floor(Math.random() * (20 - 10 + 1)) + 10;
};
funct... |
/* Directive is not isolated, but it also doesn't use parents scope so we can isolated it if we want */
var tokki = angular.module("directives").directive("searchDtes", ["$modal",
function($modal){
return {
restrict: "E",
templateUrl: "components/searchDtes/searchDtes.html",
... |
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {test} from './action';
import './test.scss';
class Test extends Component{
constructor(props){
super(props);
//this.click = this.click.bind(this);
this.state = {
value: ''
}
}
c... |
document.write(" <link rel=\"stylesheet\" href=\"assets/js/jquery/jquery/jquery_ui_dialog/jquery-ui_pop.css\" />");
document.write("<script src=\"assets/js/jquery/jquery/jquery_ui_dialog/jquery-1.9.1.js\"></script>");
document.write("<script src=\"assets/js/jquery/jquery/jquery_ui_dialog/jquery-ui.js\"></script>... |
//number of ingrédients:
ingr = 0;
//number of steps:
stp = 0;
$(document).ready(function() {
$('.tabs').each(function(){
$(this).find('.tab-content').hide();
$($(this).find('ul li.active a').attr('href')).show();
$(this).find('ul li a').click(function() {
$(this).... |
let pokemons = [{
name: 'Pikachu',
imgSrc: '0000779_mgka-igruka-pokemon-pikau-20-sm.png'
},
{
name: 'Bulbasaur',
imgSrc: '1891758-001bulbasaur.png'
},
{
name: 'Grookey',
imgSrc: 'CI_NSwitch_PokemonSwordShield_Grookey_image500w.png'
},
{
nam... |
const mongoose = require('mongoose');
const userSchema = new mongoose.Schema({
email: {
type: String,
match: /^\S+@\S+\.\S+$/,
required: true,
unique: true,
trim: true,
},
name: {
type: String,
maxlength: 128,
index: true,
trim: true,
},
mobile: {
type: String,
len... |
import React from 'react';
import { ProductConsumer } from '../context';
import { Link } from 'react-router-dom';
import { Modal } from 'react-bootstrap';
function MyModal() {
return (
<ProductConsumer>
{value => {
const { modalOpen, closeModal } = value;
const { title,... |
function shiftToRight(x, y) {
return Math.floor(x / 2 ** y);
}
const result = shiftToRight(4666, 6);
console.log(result);
// shiftToRight(80, 3) ➞ 10
// shiftToRight(-24, 2) ➞ -6
// shiftToRight(-5, 1) ➞ -3
// shiftToRight(4666, 6) ➞ 72
// shiftToRight(3777, 6) ➞ 59
// shiftToRight(-512, 10) ➞ -1
|
Backbone.Router.prototype._swapView = function (newView, callback) {
newView.hide(function () {
this._currentView = newView;
this.$rootEl = this.$rootEl || $('<div>').appendTo($('body'));
this.$rootEl.empty().append(newView.$el);
newView.render().show(callback, 200);
}.bind(this), 200);
};
|
import React, { Component } from 'react';
import {Link} from "react-router-dom";
import {
WraperHeader,
HeaderFenli,
Fenli,
IconTag,
SearchBar,
Inpu ,
KeFu,
IconTags,
Searc
} from "./style.js";
class Header extends Component{
render(){
var styled = {
display... |
//Copyright 2012, John Wilson, Brighton Sussex UK. Licensed under the BSD License. See licence.txt
// An ObserverEvent object is responsible for deciding if an event is triggered.
// tiPoint is duration in seconds the moveable object has to be in the hotspot for.
// eventCh is the % (0-100) chance of the event actuall... |
/* Gulp and plugins */
var gulp = require('gulp');
var concat = require('gulp-concat');
var minify = require('gulp-minify');
var imagemin = require('gulp-imagemin');
var shell = require('gulp-shell');
//var sourcemaps = require('gulp-sourcemaps');
// var uglify = require('gulp-uglify');
// var rename = require('gulp-re... |
var map = function(){
var key = this.actiontype + this.user._id;
var value;
if(this.actiontype != 'purchase'){
value = {
p100: this.price >= 100? 1 : 0,
p50: this.price >= 50? 1 : 0,
view:0
};
}else{
value = {
view: 1,
... |
var data = require("../data.json");
exports.editBudget = function(request, response) {
var budget = request.query.budget;
var savings = request.query.savings;
//edit value to most recent (budget)
data.budget[0] = budget;
//edit value to most recent (percentage of savings)
data.savings[0] = sa... |
import React from 'react';
import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid';
import '../styles/grid.scss'
import EventCard from './eventCard';
const CenteredGrid=(props)=>{
if(props){
return (
<div className="root">
<Grid container spacing=... |
// var expect = require('chai').expect;
var request = require('request');
var server = require('../index');
const chai = require("chai");
const chaiHttp = require("chai-http");
const { expect } = chai;
chai.use(chaiHttp);
describe('Local', () => {
it ('Home page local', (done) => {
request('http://localhos... |
// Main.js used to run and test functions
var firebase = require("../firebase/config");
require("firebase/auth");
var login = require("../model/account/LogIn");
var signup = require("../model/account/SignUp");
var Users = require("../model/Users");
async function main() {
var current_user;
current_user = await sig... |
import React, { useContext, useEffect, useState } from "react";
import Sidebar from "../../../Shared/Sidebar/Sidebar";
import { UserContext } from "../../../../App";
import "./Bookinglist.css";
const Bookinglist = () => {
const [loggedInUser, setLoggedInUser] = useContext(UserContext);
const { name, email } = { ..... |
import config from './config'
export default class EditorAction {
constructor(editor, adorsList) {
this.editorClass = editor
this.adorsArr = adorsList
this.textArea = $(editor.htmlContainer).find('textarea')
this.codeMirror = null
this.textArea.on('froalaEditor.commands.afte... |
export default {
// 为当前模块开启命名空间
namespaced: true,
/// 模块的 state 数据
state: () => ({
// 购物车的数组,用来存储购物车中每个商品的信息对象
// 每个商品的信息对象,都包含如下 6 个属性:
// { goods_id, goods_name, goods_price, goods_count, goods_small_logo, goods_state }
cart: JSON.parse(uni.getStorageSync('cart') || '[]')
}),
// 模块的 mutations 方法... |
/*Given a string S and a string T, find the minimum
window in S which will contain all the characters in
T in complexity O(n). */
/*Example:
Input: S = "ADOBECODEBANC",
T = "ABC"
Output: "BANC" */
/*Note:
If there is no such window in S that covers all characters in T, return the empty string "".
If there is such wi... |
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = process.env.PORT || 3000;
app.use(bodyParser.urlencoded({extended:false}));
app.use(bodyParser.json());
//conexion bdd
const mongoose = require('mongoose');
const user = 'test';
const pwd = 'MuEgUE3GSZ58... |
const body = document.querySelector('body');
const btn = document.querySelector('button');
const colors = ['#36D1DC', '#FF512F', '#b92b27', '#1565C0', '#f12711', '#f5af19', '#52c234', '#DD2476']
const changecolors = function(){
let genColor = Math.trunc(Math.random()*6)
body.style.background = colors[genColor]... |
class ClienteEspecial extends Cliente {
constructor(nome_cliente, cpf, conta) {
super(nome_cliente, cpf, conta);
this._dependentes = new Array();
}
inserir(dependente) {
this._dependentes.push(dependente);
}
remover(clienteCpf) {
this._dependentes.splice(this._depende... |
import './DinnerSupplies.css';
import SilverWare from '../SilverWare/SilverWare';
function DinnerSupplies ({guestList}) {
console.log('In DinnerSupplies Component with:', guestList);
let count = guestList.length;
return (
<>
<h2>Dinner Supplies</h2>
<SilverWare name="Spoons" count={count} />... |
/* 🤖 this file was generated by svg-to-ts*/
export const EOSIconsHdrWeak = {
name: 'hdr_weak',
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm12-2c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s... |
import React, { useState } from 'react';
import { connect } from 'react-redux';
import DeleteIcon from '@material-ui/icons/Delete';
import CreateIcon from '@material-ui/icons/Create';
import { editTopic, deleteTopics } from '../actions';
const TopicTitle = (props) => {
const [content, setcontent] = useState({ name:... |
import React from 'react';
import { Button, Checkbox, Modal } from 'semantic-ui-react';
/**
* Displays information about how to use the app and what its purpose is.
*
* @return {*} Jsx to display the component.
* @constructor
*/
const IntroView = () => {
return (
<div
style={{
textAlign: 'cent... |
let button = document.querySelector("input")
let div = document.querySelectorAll("div")
let tab = [-2, 1, 4]
let result = []
const additionne = (x) => {
for (let i = 0; i < tab.length; i++) {
x = tab[i]
result[i] = x + 2
}
}
const affiche = () => {
additionne()
for (let i = 0; i < tab.le... |
import { Section } from "./App.styled";
import { Form } from "../Form/Form";
import Filter from "../Filter/Filter";
import { useFetchContactsQuery } from "../../redux/contactSlice";
import { ContactItem } from "../ContactItem/ContactItem";
import { useState } from "react";
import { Toaster } from "react-hot-toast";
ex... |
import React from 'react';
import './AppFooter.scss';
import PropTypes from 'prop-types';
export default function AppFooter({ repoUrl }) {
return (
<footer className="app-footer">
<a
className="app-footer__inner nes-text is-disabled"
target="_blank"
rel="noopener noreferrer"
... |
var rexpath = {};
rexpath.init = function(window) {
/* inject global `rexpath`. may be bad manner. */
window.rexpath = rexpath;
/* for node.js unit test... there may be other proper way.. */
rexpath.window = window;
var document = rexpath.window.document;
var HTMLDocument = rexpath.window.HTMLDocument;
v... |
module.exports = function() {
var a = document.createElement('div');
a.textContent = "Hello word !";
return a;
}; |
import React, { Component } from 'react';
import { View, Dimensions } from 'react-native';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { NavigationActions } from 'react-navigation';
import Animation from 'lottie-react-native';
import anim from 'kitsu/assets/animation/kitsu.json';
... |
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import { toastr } from 'react-redux-toastr';
import {
Modal as BSModal,
FormGroup,
FormControl,
ControlLabel,
InputGroup,
Button,
} from 'rea... |
// import _ from 'lodash'
import { actionTypes } from './actions'
const state = {
data: [],
paginatedData: [],
current_page: 1,
page_size: 10
}
export default (state = {}, action) => {
switch(action.type) {
case actionTypes.GET_PRODUCTS:
return { ...state, data: action.paylo... |
//tabs.js
import React from 'react';
import {
View, Text,
TouchableOpacity
} from 'react-native';
import s from './style'
const tw = (omanagerTab,tab)=>omanagerTab===tab?[s.bfwTap,s.bfw]:s.bfw
const bf = (omanagerTab,tab)=>omanagerTab===tab?[s.bf,s.bfTap]:s.bf
const Tabs = ({omanagerTab,switchOmanagerTab}... |
$(document).ready(function() {
"use strict";
var av_name = "CFLPumpingEx3FS";
var av = new JSAV(av_name);
var Frames = PIFRAMES.init(av_name);
// Frame 1
av.umsg("Prove that $L = \\{a^jb^k: k = j^2\\}$ is not a CFL.");
av.displayInit();
// Frame 2
av.umsg(Frames.addQuestion("winL"));
av.step();
... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.globalErrorHandler = void 0;
var enums_1 = require("../enums");
var custom_errors_1 = require("../errors/custom-errors");
exports.globalErrorHandler = function (err, req, res, next) {
if (err instanceof custom_errors_1.CustomError)... |
import React, { useState, useContext } from "react";
import { TokenContext } from "../contexts/TokenContext";
import { PageHeader, Typography, Avatar, Menu, Dropdown, Space } from "antd";
import { UserOutlined, DownOutlined } from "@ant-design/icons";
import { Redirect } from "react-router-dom";
const { Text } = Typog... |
// const { workerData, parentPort } = require('worker_threads');
var speech = require('@google-cloud/speech');
var path = require('path');
var ffmpeg = require('fluent-ffmpeg');
const client = new speech.SpeechClient({
projectId: 'aja-transcriber',
keyFilename: './aja.json'
});
let transcribe = function (toTr... |
import React,{ useState, useEffect } from 'react'
import {Link} from 'react-router-dom'
import { useHistory } from 'react-router-dom'
const Signup = ()=>{
const history=useHistory()
const [name,setname]=useState("")
const [email,setemail]=useState("")
const [password,setpassword]=useState("")
const... |
/*********************新房日志***************************/
import {onPost,onGet} from "../main";
//新房平台【添加操作】记录日志
export const houseAddLog = params =>{
return onPost('sso/main/newHouseAddLog',params);
}
//新房【修改操作】记录日志
export const houseUpdateLog = params =>{
return onPost('sso/main/newHouseUpdateLog',params);
}
// 新房【... |
var cc = require('couch-client');
var coll = cc("http://localhost:4000/coll");
for (var i=32; i<=126; i++) {
coll.save({"x": String.fromCharCode(i)}, function(err, doc) {
if (err) throw err;
console.log("saved %s", JSON.stringify(doc));
});
};
|
import React, { useContext, useMemo, useState } from 'react';
import queryString from 'query-string';
import { useLocation } from 'react-router-dom';
import { useForm } from '../../../hooks/useForm';
import { ProductCard } from '../products/ProductCard'
import { getProducts } from '../../../selectors/getProducts';
impo... |
import React from "react";
import { Link } from "react-router-dom";
import Login from "./Login";
const Register = (props) => {
const onsubmit = () => {
// localStorage.setItem();
props.history.push("/login");
};
return (
<div>
<form style={{ border: "1px solid #ccc" }}>
<div className="... |
const VueCompColors = {
template: `
<div style="height: 100%">
<i class="fa fa-arrow-left back-arrow" @click="router.go(-1)"></i>
<centered>
<div style="height: 60vh; width: 60vw; border-radius: 20px" v-bind:style="{ 'background-color': backgroundColor }"></div>
</centered>
</div>
... |
export default {
apiKey: "AIzaSyAhWJ6CzJL3kLcJvZB2nsN-aodarnn7iFc",
authDomain: "pupigram.firebaseapp.com",
databaseURL: "https://pupigram.firebaseio.com",
projectId: "pupigram",
storageBucket: "pupigram.appspot.com",
messagingSenderId: "1045620088441",
appId: "1:1045620088441:web:b5a23d41d8... |
$(document).ready(function() {
/// Collapser
if($(window).width() < 767) {
let x = $("#cut");
x.collapser({
mode: 'lines',
truncate: 8
});
}
///Animate Scroll
$(".container-dots>ul>li>a").on('click.smothscroll',function(e){
e.preventDefault();
var hash = $(this).attr('href');
var offset = $(hash... |
function getFirstSelector(selector) {
return document.querySelector(selector);
}
function nestedTarget() {
return document.querySelector('#nested .target')
}
function increaseRankBy(n) {
const ranks = document.querySelectorAll('.ranked-list li')
for (var i = 0, l = ranks.length; i < l; i++) {
var integer = par... |
export const API_KEY = "AIzaSyC1Q8T48RfHH5LZxp9D-Fer7y3wRkoAt94";
export default API_KEY; |
import React from 'react';
import { connect } from 'react-redux';
import { filterAnecdotes } from '../reducers/filterReducer';
const Filter = (props) => {
const handleChange = (event) => {
event.preventDefault();
const filterText = event.target.value;
props.filterAnecdotes(filterText);
};
const style... |
// Variables
// Selecting the form element
const form = document.querySelector("#form");
// Get the value from the input
const imageInput = document.querySelector("#image");
const topTextInput = document.querySelector("#top-text");
const bottomTextInput = document.querySelector("#bottom-text");
form.addEventListener(... |
define(['phaser', 'js/models/System.js'],
function (Phaser, System) {
var missions = function () {
};
missions.prototype = {
init: function (configFromStates, mapsFromStates, skillsFromStates) {
// On récupère les informations depuis le JSON
this.gameObject = JSON.parse(configFromStates);
this.ma... |
require('../config');
const db = require('../db/db');
const express = require('express');
const app = express();
const path = require('path');
// routes
app.use(require('./routes/index'));
app.use(express.static(path.resolve(__dirname, '../public')));
// Conectar a la BD
db.conectar().then((resp) => {
consol... |
const request = require("supertest");
const app = require("../src/preloadSetup");
const User = require("../models/user");
const {
preloadDatabaseSetup,
userOne,
userOneId
} = require("./fixtures/dbPreload");
// jests global lifecycle methods beforeEach(() => {...}) and afterEach(() => {...})
beforeEach(preloadD... |
import React, { Component } from "react";
import axios from "axios";
class Contact extends Component {
state = { name: "" };
memberInsert = () => {
const send_param = {
name: this.nameE.value,
email: this.emailE_Contact.value,
pw: this.pwE_Contact.value,
comments: this.commentsE.value
... |
'use strict'
/*
* Create the function `cutFirst` that takes a string and remove the 2 first characters
* Create the function `cutLast` that takes a string and remove the 2 last charcters
* Create the function `cutFirstLast` that takes a string
* and remove the 2 first charcters and 2 last characters
*
* @notions... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.