text stringlengths 7 3.69M |
|---|
'use strict'
const PomodoroType = require('../models/pomodoro_type.model')
// Create and save the new PromodoroType
exports.create = (req, res) => {
PomodoroType.create({
title: req.body.title || 'Untitle pomodoro',
time: req.body.time || '25min'
}, function(err, pomodoro_type) {
if(er... |
import React from 'react';
import './App.css';
import 'typeface-lato';
import 'typeface-fira-code';
import 'aos/dist/aos.css';
import AOS from 'aos';
import FrontPage from "./Pages/FrontPage";
import FeaturedProjects from "./Pages/FeaturedProjects";
import NavBar from "./Components/NavBar";
import {useTransition, anima... |
/*
* ISC License
*
* Copyright (c) 2018, Andrea Giammarchi, @WebReflection
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE I... |
var Browser = require('browser');
module.exports.get = function (assert) {
var browser = new Browser;
var executed = 0;
browser
.get('https://192.168.0.5')
.tap(function (storage, response, data) {
executed++;
assert.deepEqual(storage, {});
assert.ok(/coo... |
import React, { Component } from "react";
import { FaSmile } from "react-icons/fa";
import "./smile.css";
class Smile extends Component {
render() {
return (
<div className="bouncy-smile">
<FaSmile />
</div>
);
}
}
export default Smile;
|
import { faAddressBook, faCalendar, faChevronDown, faSquare } from "@fortawesome/free-solid-svg-icons"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { useRef, useState } from "react"
import DatePicker from './UI/DatePicker'
import moment from 'moment'
const CustomInput = ({post}) => {
cons... |
//REDUCERS
import {SET_NEW_GAME, SET_GUESS, TOGGLE_INFO} from '../actions';
export const initialState = {
guesses: [],
feedback: 'Make your guess!',
correctAnswer: Math.floor(Math.random() * 100) + 1,
showInfoModal: false
}
export const guessReducer = (state=initialState, action) => {
if (action.type =... |
// Model for current day's data
const mongoose = require('mongoose');
const RecentDataSchema = new mongoose.Schema({
recordDate: {
type: Date,
required: true
},
violationCount: {
type: Number,
required: true
},
headcount: {
type: Number,
required: tru... |
var config = require('../../config');
var post = require('../../models/post');
var category = require('../../models/category');
// Show create page
exports.showCreatePost = function(req, res, next) {
// Fetch category data
category.findAll()
.then(function(categories) {
res.render('admin/create_post', {
... |
module.exports = {
// devServer: {
// host: '0.0.0.0',
// port: 8080,
// publicPath: '/', //这里解决静态资源引用路径问题
// // 设置代理
// proxy: {
// "/api": {
// // 登录接口 账号admin 密码123456
// target: 'https://result.eolinker.com/AfMQniX89802140bb73e4... |
let day = prompt('Please enter the day: ');
let message;
if (day == 'monday' || day == 'wednesday' || day == 'thursday') {
message = 'There is single session';
} else if (day == 'saturday') {
message = 'There is double session';
} else if (day == 'sunday' ||day == 'tuesday' || day == 'friday') {
message = 'There ... |
import React from 'react';
const DonateText = () => {
return (
<>
<p>freeCodeCamp is a highly efficient education nonprofit.</p>
<p>
In 2019 alone, we provided 1,100,000,000 minutes of free education to
people around the world.
</p>
<p>
Since freeCodeCamp's total b... |
//参数说明:
//nameContainer : 存放所选名称的容器的name
//valueContainer : 存放所选值的容器的name
//defaultState : 节点的默认开闭状态 1为开,其他值为闭合
function ShowPaymentTree(nameContainer, valueContainer, defaultState) {
if ($("#dvMain_org").length == 0) {
$("body").append('<div id="dvMain_org" style="padding:5px 5px 5px 5px;overflow-x:hidde... |
import React from 'react';
import axios from 'axios';
import moment from 'moment';
import Tags from './Tag';
import '../css/info.css';
export default class Info extends React.Component {
constructor() {
super()
this.state = {
age: '',
gender: '',
orientation: '',... |
/*
* productGroupSearchController.js
*
* Copyright (c) 2017 HEB
* All rights reserved.
*
* This software is the confidential and proprietary information
* of HEB.
*/
'use strict';
/**
* The controller for the product group search.
*
* @author vn75469
* @since 2.15.0
*/
(function () {
var app = ... |
const connection = require('../database/connection');
class Usuario{
login(info){
const sql = `SELECT id FROM usuario WHERE login="${info.login}" AND senha="${info.password}"`;
return new Promise ((resolve, reject) => {
connection.query(sql,null, (error, results) => {
if(error){
reje... |
import './OneCity.css';
import axios from 'axios';
import React, {useEffect, useState} from 'react';
import runtimeEnv from '@mars/heroku-js-runtime-env';
function OneCity (props) {
const env = runtimeEnv();
const APIKEY = env.REACT_APP_APIKEY;
const APIURL = "https://cors-anywhere.herokuapp.com/openweatherma... |
import axios from 'axios';
import { createAction, createActions } from '../common';
import * as actionTypes from './actionTypes';
// createAction 会返回一个 FSA 规范的 action,该 action 会是一个对象,而不是一个 function
const setNews = createAction(actionTypes.NEWS_LIST_GET)
//same as const setNews = createAction(actionTypes.NEWS_LIST_G... |
const browser = require('./browser')
// const I = getActor();
class CodeceptMochawesomeLog{
getDate(){
const d = new Date();
const hh = d.getHours() < 10 ? `0${d.getHours()}` : d.getHours();
const mm = d.getMinutes() < 10 ? `0${d.getMinutes()}` : d.getMinutes();
const ss = d.getSec... |
'use strict';
function userController($scope, $http) {
$scope.message = 'Hello';
$http.get("/api/things")
.then( function(r) {
$scope.message = r.data;
});
console.log($http);
}
angular.module('myangularApp')
.controller('UserController', userController)
.config(function($routeProvider) {
$routePr... |
(function() {
'use strict';
angular
.module('newlotApp')
.factory('PasswordResetFinish', PasswordResetFinish);
PasswordResetFinish.$inject = ['$resource', 'SERVER_BACKEND'];
function PasswordResetFinish($resource, SERVER_BACKEND) {
var service = $resource(SERVER_BACKEND + 'api... |
import React, { Component } from 'react';
import { string } from 'prop-types';
import io from 'socket.io-client';
import Display from './Display';
const socket = io();
const generateId = () => {
let id = '';
for (let i = 0; i < 10; i++) {
const randomNumber = Math.floor(Math.random()*10);
id += randomNu... |
import React, { Component } from 'react';
import {
ButtonToolbar,
DropdownButton,
ButtonGroup,
Dropdown,
Button,
Col,
Row,
Form
} from 'react-bootstrap';
import '../Editor.css'
class Toolbar extends Component {
constructor(props) {
super(props);
this.state = {documentName: ''};
this.docu... |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModu... |
import {
Link,
} from "react-router-dom";
function MenuPrincipal() {
return (
<nav>
<h1>BurgerQueen</h1>
<ul>
<li>
<Link to = "/">Login</Link>
</li>
<li>
<Link to = "/mesero">Mesero</Link>
</li>
<li>
... |
const express = require('express');
const app = express();
const async = require('async');
const con = require('./index').con;
const { create } = require('express-handlebars');
// TODO: for instructor.js
function getMyCurrentlyTaughtClasses(id, con) { // TODO: Akbar, you can move this
/*
Purpose: Retrieves an... |
// 1. Center Point
// function coordinate(x1, y1, x2, y2) {
// var diog1 = Math.sqrt(x1 * x1 + y1 * y1);
// var diog2 = Math.sqrt(x2 * x2 + y2 * y2);
// if (diog1 <= diog2) {
// console.log("(" + x1 + " , " + y1 + ")");
// }
// else {
// console.log("(" + x2 + " , " + y2 ... |
angular.module('PatientApp.init').controller('setupCtr', [
'$scope', 'App', 'Storage', '$ionicLoading', 'AuthAPI', 'CToast', 'CSpinner', 'LoadingPopup', function($scope, App, Storage, $ionicLoading, AuthAPI, CToast, CSpinner, LoadingPopup) {
return $scope.view = {
refcode: '',
emptyfield: '',
de... |
// SCROLL DOWN FOR DIRECTIONS
var user;
document.addEventListener('DOMContentLoaded', function() {
var loggedInUser = localStorage.getItem('username');
if (loggedInUser != null ){
document.getElementById('hello').innerText = `Hi, ${loggedInUser}!`;
document.getElementById('hello').style.display = 'block';
u... |
// MODULES is a mapping from strings to module records.
// This map will be mutated by the compilation process.
var MODULES = {};
|
export const RECEIVE_NODE = "RECEIVE_NODE";
export const RECEIVE_TRANSACTION = "RECEIVE_TRANSACTION";
export const RECEIVE_USER_NODE = "RECEIVE_USER_NODE";
export const RECEIVE_INITIAL = "RECEIVE_INITIAL";
export const receiveNode = (node) => ({
type: RECEIVE_NODE,
node
});
export const receiveTransaction = (txn)... |
/******************
ROUTER
*******************/
APP.router = (function () {
function init() {
routie({
'home': function () {
APP.render.home();
},
'pullrefresh': function () {
APP.render.pullrefresh();
},
'book... |
(function () {
appModule.controller('common.views.navigations.index', [
'$scope', '$modal', '$templateCache', 'abp.services.app.navigation', 'uiGridConstants',
function ($scope, $modal, $templateCache, navService, uiGridConstants) {
var vm = this;
$scope.$on('$viewContentLo... |
export const PUSH_DATA_CARDS = 'cards/pushData';
export const ADD_TO_COMPARE_CARDS = 'cards/addToCompare';
export const FLIP_CARD = 'cards/flipCard';
|
const context = document.querySelector("canvas").getContext("2d");
context.canvas.height = 400;
context.canvas.width = 1220;
var character = new character();
const square = {
height: 32,
jumping: true,
width: 32,
x: 0,
xVelocity: 0,
y: 0,
yVelocity: 0
};
|
import moment from 'moment';
import forge from 'node-forge';
import Global from '@/global';
import Encrypt from '@/modules/native/encrypt';
import Log from '@/modules/common/logger';
import FileManager from '@/modules/common/fileManager';
import _Request from '@/modules/common/request';
/**
* 请求
*
* @export
* @cla... |
var maxNumberUtente;
var numUtente;
// BONUS
var level= prompt("Scegli la difficoltà: 1,2 o 3");
switch(level){
case "3":
maxNumberUtente= 50;
break;
case "2":
maxNumberUtente = 80;
break;
default:
maxNumberUtente =100;
}
listaNumUtente = maxNumberUtente - 16;
// Il computer deve gener... |
define([
'jquery',
'underscore',
'backbone',
'text!templates/alert.html',
'bootstrapAlert',
], function($, _, Backbone, alertTemplate) {
var AlertView = Backbone.View.extend({
className: "row",
alertTemplate: _.template(alertTemplate),
events: {
"click .close" : "close",
},
... |
import { useState, useContext, useEffect } from "react";
import ConnectionContext from "../ConnectionContext";
import PublicGameItem from "./PublicGameItem";
import { FaUsers } from "react-icons/fa";
import "./PublicGames.scss";
function PublicGames({ setGameId, closeModal }) {
const [publicGames, setPublicGames] = ... |
/**
* Created by gavin on 16/4/12.
*/
'use strict';
var account = require('./account.js');
var ipcEvents = require('./ipcEvents.js');
module.exports.init = function (settings) {
ipcEvents.init(settings);
account.init(settings);
};
|
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(props) {
super(props)
this.state = {
items: [
{ name: "name1", description: "description 1" },
{ name: "name2", description: "description 2" },
{ name: "name3", description: "de... |
'use strict';
/* https://github.com/angular/protractor/blob/master/docs/toc.md */
describe('E2E: ngSeedApp', function() {
var ptor;
beforeEach(function() {
browser.get('http://127.0.0.1:8000/app');
ptor = protractor.getInstance();
});
it('should load the home page', function() {
... |
import React from 'react';
import { ScrollView, Dimensions, ActivityIndicator, Alert } from 'react-native';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { Container } from '../../components/container';
import { Trip } from '../../components/trip';
import { QuestionsList } fr... |
var a = 'a';
var b = function() {};
var c = () => {};
var d = async () => {};
module.e = 'e';
module.f = function() {};
module.g = async function() {};
module.h = () => {};
function i() {
}
class Person {
static foo = bar;
getName() {
}
}
foo(function callback() {
})
c();
module.e();
export function... |
var validate = require( LIB_DIR + 'validations/sessions' );
var Application = require( './application' );
var Controller = Application.extend( validate );
var locale_users = require( LANG_DIR + 'en/users' );
var User = Model( 'User' );
module.exports = Controller.extend({
init : function ( before, af... |
import React from "react";
import { Link } from "react-router-dom";
const NotFound = () => {
return(
<div className="notfound">
<h1>Página não encontrada :(</h1>
<h2>Sentimos muito pelo incoveniente</h2>
<div>
<p>Algumas razões para isso acontecer:</p>
... |
/* eslint-env jest */
const { setupServer, setupModels, stopServer } = require('../test/integration-setup.js')()
describe('Test include', () => {
const STATUS_OK = 200
let server
let instances
let sequelize
beforeEach(async () => {
const { server: _server, sequelize: _sequelize } = await setupServer()... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class SceneComponents extends SupCore.Data.Base.ListById {
constructor(pub, sceneAsset) {
super(pub, SceneComponents.schema);
this.configsById = {};
this.sceneAsset = sceneAsset;
const system = (this.sceneAs... |
const mongoose = require('mongoose')
const logger = require('./loggerLib')
const Response = require('./generateResponseLib')
const util = require('./utilityLib')
const fs = require('fs')
//Importing the models here
const UserModel = mongoose.model('User')
let putOrGetFilePath = (req, res, request_type) => {
if ... |
import React from 'react';
import {
AsyncStorage,
View,
Image,
ToastAndroid,
} from 'react-native';
import { Container, Content, Button, Text, H3, Icon, FooterTab, Footer } from 'native-base';
import { LogoTitle, Menu } from '../../../components/header';
import { addPicture, addArchive } from '../../.... |
const { NODE_ENV } = process.env;
const isDev = NODE_ENV !== 'production';
export const errorCodes = {
USER_DATA_INVALID: 1,
EXPENSE_DATA_INVALID: 2,
BAD_REQUEST: 400,
NOT_AUTHORISED: 401,
FORBIDDEN: 403,
NOT_FOUND: 404,
INTERNAL_SERVER_ERROR: 500,
};
export const createError = (code, title, detail, thr... |
import React from 'react'
import css from '../../../lib/css/'
import styles from './styles.js'
import Carousel from 'nuka-carousel'
export default ({
involvementTitle = '',
involvement = '',
carousel = [],
aboutTitle = '',
about = ''
}) => (
<article className={css(styles.root)}>
<div className={css(s... |
/*
* warehouseComponent.js
*
* Copyright (c) 2017 HEB
* All rights reserved.
*
* This software is the confidential and proprietary information
* of HEB.
*/
'use strict';
/**
* CasePack ->warehouse page component.
*
* @author s753601
* @since 2.8.0
*/
(function () {
angular.module('productMainte... |
/**
* @namespace
* @constructor
* @param {vonline.Base array} object
* @param {integer} x
* @param {integer} y
*/
vonline.TranslateCommand = function(objects, x, y) {
this.objects = objects;
this.x = x;
this.y = y;
}
vonline.TranslateCommand.prototype.execute = function() {
for (var i = 0, len = this.objects... |
(function() {
App.Controllers.UserProfiles = Ember.Namespace.create();
App.UserProfilesController = Ember.Table.TableController.extend({
hasHeader: true,
hasFooter: false,
numFixedColumns: 0,
numRows: 2,
rowHeight: 30,
selection: null,
selectionChanged: Ember.observer(function() {
... |
var canvas = document.getElementById('gameCanvas');
var canvasCtx = canvas.getContext('2d');
canvas.width = 800;
canvas.height = 600;
var ballX = 50;
var ballY = 50;
var ballSpeedX = 5;
var ballSpeedY = 5;
var padOneY = 250;
var padTwoY = 250;
var padHeight = 100;
var padWidth = 15;
var playOne = 0;
var playTwo = 0... |
import React from 'react';
import { Form, Button, Row, Col } from 'antd';
import FormSwitch from './FormSwitch';
function Notifications() {
const layout = {
labelCol : { span: 16 },
wrapperCol : { span: 8 }
};
const tailLayout = {
wrapperCol : { offset: 8, span: 16 }
};
return (
<Row justify="center">
... |
'use strict'
import express from 'express'
import asyncify from 'express-asyncify'
import chalk from 'chalk'
import debug from 'debug'
import db from './db'
export default (opts) => {
let services, Client
const app = asyncify(express.Router())
app.use('*', async (req, res, next) => {
if (!services) {
... |
console.log("===================>>> script_6.js <<<===================")
const entrepreneurs = [
{ first: 'Steve', last: 'Jobs', year: 1955 },
{ first: 'Bill', last: 'Gates', year: 1955 },
{ first: 'Mark', last: 'Zuckerberg', year: 1984 },
{ first: 'Jeff', last: 'Bezos', year: 1964 },
{ first: 'Elon', last: ... |
"use strict";
const mods = [
"shellfish/mid",
"shellfish/high",
"shell/mime-registry"
];
require(mods, function (mid, high, mimeReg)
{
var VC_PROPERTIES = ["SOURCE",
"KIND",
"FN",
"N",
"NICKNAME",
... |
/**
* @ngdoc service
* @name navigationService
* @module app
* @description A service which holds the navigation items present in the application.
*/
(function (angular) {
angular.module('app')
.factory('navigationService', function () {
return {
navItems: [
... |
const mongoose = require("mongoose");
const redis = require("redis");
const util = require("util");
const keys = require("../config/keys");
const client = redis.createClient({
host: keys.redisHost,
port: keys.redisPort,
retry_strategy: () => 1000
});
client.get = util.promisify(client.get);
const exec = mongoose.... |
// pages/product/product.js
const requestUrl = 'https://gwserv.ddsoucai.com/ddsc-app/app/resource'
Page({
/**
* 页面的初始数据
*/
data: {
loading: false,
RECOMMEND_HEADER: [],
RECOMMEND_ACTIVITY: [],
APP_HOME_BOTTOM: [],
RECOMMEND_BANNER: [],
RECOMMEND_NOTICE: []
},
/**
* 生命周期函数--监听页... |
// function PopIt() {
// var popover = document.getElementById('popover');
// popover.style.display = 'block';
// return "Are you sure you want to leave?";
// }
function UnPopIt() {}
$(document).ready(function() {
//window.onbeforeunload = PopIt;
//$("input[type=submit] , a").click(func... |
function favImage (img) {
var favorites = document.getElementById("favArea");
favorites.appendChild(img);
var list = document.getElementById("bulletText");
var listElem = document.createElement("li");
var listItem = document.createTextNode(`Moved ${String(img.alt)} to favorites.`);
listElem.app... |
export const globalReducer = (state, action) =>{
const { type, payload } = action;
switch(type){
case 'ADD_TRANSACTION':
console.log(payload);
return{
...state,
transactions: [payload, ...state.transactions]
}
case 'REMOVE_TRAN... |
require('./TriviaChoice.styl');
import React, { PropTypes, Component } from 'react';
import { connect } from 'react-redux';
import { TriviasActions } from '../../actions/';
import { spring, Motion } from 'react-motion';
import { fastEaseOut, fastEaseOutElastic } from '../../constants/SpringPresets';
class TriviaChoice... |
(function() {
'use strict';
angular
.module('bq')
.directive('a', function(notify, dataService, $ionicPopup) {
return {
restrict: 'E',
link: function(scope, elem, attrs) {
//if (attrs.ngClick || attrs.href === '' || attrs.href === '#') {
if (attrs.href && attrs.hr... |
var originalText = "";
function storeOriginal() {
originalText = document.forms["textAwesome"]["input"].value;
}
function getFonts(){
var fonts = ['Arial', 'Batang', 'Cursive', 'Courier', 'Monospace', 'Symbol','Times New Roman', 'Verdana'];
var begin = '<option value=\"';
var middle = '\">';
var end = ... |
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
//配置mint-ui
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
Vue.use(MintUI)
import Axios fro... |
import React from "react";
//CSS
import "./Section3.css";
//Images
import IllustrationLaptop from "../../../assets/images/illustration-laptop-mobile.svg";
const Section3 = () => {
return (
<section className="section section3">
<div className="content-wrapper">
<img
className="img-illustr... |
// pages/register/bindVip.js
const app = getApp();
const config = require("../../../utils/config.js");
const util = require("../../../utils/util.js");
const registerService = require("../../../service/registerService.js");
const intervalDuration = 60;
Page({
/**
* 页面的初始数据
*/
data: {
height: null,
i... |
var Util = require('../util');
var Base = require('../base');
var clsPrefix;
var containerCls;
var loadingContent = "Loading...";
var upContent = "Pull Up To Refresh";
var downContent = "Release To Refresh";
var PULL_UP_HEIGHT = 60;
var HEIGHT = 40;
/**
* A pullup to load plugin for xscroll.
* @constructo... |
export default function PersonalDetails(props) {
const { user, nextStep, handleChange } = props;
const handleNext = (e) => {
e.preventDefault();
nextStep();
};
return (
<div className="w-full flex justify-center items-center">
<form>
<div className="lg:grid grid-cols-2 lg:space-x-3">... |
import React from "react";
import Users from "./users";
const DashboardProfile = () => (
<div className="container">
<div>
<i className="fas fa-user-circle" />
<p>@no_name</p>
</div>
<table>
<thead>
<tr>
<th>Tweets</th>
<th>Following</th>
<th>Follow... |
/*global beforeEach, afterEach, expect*/
'use strict';
const path = require('path');
const sinon = require('sinon');
const AliyunProvider = require('../../provider/aliyunProvider');
const AliyunPackage = require('../aliyunPackage');
const Serverless = require('../../test/serverless');
describe('WriteFilesToDisk', ... |
import React from 'react';
import './index.css';
import { Typography } from 'antd';
const { Title } = Typography;
class ShowImages extends React.Component {
shouldComponentUpdate(newprops){
if (this.props.data===newprops.data){
return false;
}
return true;
}
render() {... |
'use strict';
import tabs from './modules/tabs';
import modal from './modules/modal';
import cards from './modules/cards';
import formSender from './modules/formsender';
import calculator from './modules/calculator';
import slider from './modules/slider';
import timer from './modules/timer';
import hamburger from './m... |
const express = require('express');
const http = require('http');
const port = process.env.PORT || 3000 || 8080;
const app = express();
app.use(express.static('view'));
app.use(express.static('arquivos-css'));
app.use(express.static('img'));
app.use(express.static('fontes'));
app.use(express.static('arquivos-js'));
... |
// Склейка вебпак конфигураций
const merge = require('webpack-merge');
const baseConfig = require('./webpack.base.conf.js');
const devConfig = require('./webpack.dev.conf.js');
const buildConfig = require('./webpack.build.conf.js');
const prodConfig = require('./webpack.prod.conf.js');
const testConfig = require('./web... |
/*
David Jensen
SDI Section #3
Video: Ternary Operators
2015/01/20
*/
//alert("Testing to see if the JS file is attached to the HTML.");
//Syntax of Ternary Operators.
/*
if(condition){
do if true;
}else{
do if false;
}
(condition) ? do if true : do if false;
*/
/*
var gpa = 48;
//i... |
const Vendor = require('./vendor')
const errorHandler = require('../common/errorHandler')
Vendor.methods(['get','post','put','delete'])
Vendor.updateOptions({new: true, runValidators: true})
Vendor.after('post', errorHandler).after('put', errorHandler)
module.exports = Vendor |
const {Schema,model} = require('mongoose');
const MarketplaceSchema = Schema({
description:{
type:String,
required :true
},
status:{
type: Boolean,
default : true,
required : true
},
type:{
type:String,
required : ['true','Role is required.']... |
$(document).ready(function(){
$.username = $("#username_").val();
$.token = $("#token_").val();
$.ws = 'core/helpers/Request.php';
$("#logout").click(function(e){
fnLogout();
});
fnLogout = function() {
$.ajax({
url: $.ws,
type: 'POST',
data: {action: 'logout'},
dataType... |
const greedyMakeChange = (n, nominals = [25, 10, 5]) => {
nominals.sort((a, b) => b - a)
let res = [];
if (n < nominals[0]) {
return "There is no such answer"
}
let i = 0
while (n) {
if (n - nominals[i] >= 0) {
n -= nominals[i]
res.push(nominals[i])
... |
export const BASE_URL = "https://nodeshop97.herokuapp.com/";
|
/**
* A cache storing shared resources associated with a device. The resources are removed
* from the cache when the device is destroyed.
*
* @ignore
*/
class DeviceCache {
/**
* Cache storing the resource for each GraphicsDevice
*
* @type {Map<import('./graphics-device.js').GraphicsDevice, any>... |
var https = require("https");
//print out Message
function printMessage(city, temp, summary) {
var message = " Current temperature for " + city + " is " + temp + " and it is " + summary;
console.log(message);
}
//Print out Error Messages
function printError(error) {
console.error(error.message);
}
function g... |
import {useState} from 'react';
import './App.css';
import axios from 'axios'
function App() {
const [location, setLocation] = useState('');
const [date, setDate] = useState('')
const [description, setDescription] = useState('');
async function handleSubmit(e){
e.preventDefault();
let latitude, lon... |
/**
* Created by Andrew on 9/13/2015.
*/
String.prototype.format = function() {
var formatted = this;
for( var arg in arguments ) {
formatted = formatted.replace("{" + arg + "}", arguments[arg]);
}
return formatted;
};
var utils = {
isEmpty: function (str) {
return (!str || 0 === ... |
"use strict";
const countryChina = "Китай";
const countryChili = "Чили";
const countryАustralia = "Австралия";
const countryIndia = "Индия";
const countryJamaica = "Ямайка";
let price;
let message;
const userCountry = prompt(
"Введите страну, куда необходимо совершить доставку"
);
if (userCountry === null) {
al... |
import AppError from '../errors/AppError';
class SessionController {
constructor(user) {
this.User = user;
}
async show(id) {
const user = await this.User.findById(id);
return user;
}
async store({ name, email }) {
let user = await this.User.findOne({ email });
if (user) {
retur... |
function tables(n) {
for(let i =1; i<=10; i++)
console.log(`${n} * ${i} = ${n*i}` )
}
tables(2) |
import React from "react";
import "./Courses.css";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCartPlus } from "@fortawesome/free-solid-svg-icons";
const Courses = (props) => {
const courseInfo = props.singleCourse;
const { name, image, instructor, price, rating } = courseInfo;
r... |
$(function () {
init();
grid("#grid", "#toolbar");
//添加辅料事件
$("#addfl").on("click", function () {
content("添加辅料", "insertRow", true);
})
//搜索
$("#seek").on("click", function () {
$('#grid').datagrid('load', {
AccessoryName: $('#searchname').val(),
... |
var TemplateCollection = Movie.extend(Movie.Collection, {
name : 'template'
});
|
import { combineEpics } from 'redux-observable'
import counterEpics from '__counter/epics'
export default combineEpics(counterEpics)
|
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
import { initializeAppCheck, ReCaptchaV3Provider } from "firebase/app-check";
import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore... |
import React from 'react'
import Up from 'react-icons/lib/fa/chevron-up'
import Down from 'react-icons/lib/fa/chevron-down'
const Table = ({ tableData, sortedBy, order, handleHeaderClick }) =>
<div id="table-show-container">
<table id="table-body">
<thead>
<tr>
{
tableData[0].... |
import React, { Component } from "react";
import PropTypes from "prop-types";
import styled from "styled-components";
class Collapse extends Component {
constructor(props) {
super(props);
this.state = {
height: 0
};
}
componentDidMount() {
this.updateHeight();
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.