text stringlengths 7 3.69M |
|---|
import { URLPATTERN } from "./constants";
const verifyUrl = url => URLPATTERN.test(url);
const getVideoId = url => url.replace(URLPATTERN, '$1');
const getVideoDetails = async url => {
const res = await fetch(`https://www.youtube.com/oembed?url=${url}&format=json`);
const data = await res.json();
return data;... |
import React from 'react'
const PopularCard = () => {
return (
<div className="col-12 col-md-6 col-lg-4 classCard mb-2 rounded">
<img src="img/image1.jpg" className="img-fluid" alt="" />
<div className="classTite p-2">
<h6>Categorie</h6>
<span>Nb de c... |
/**
* App升级
* @constructor
*/
function AppUpgrade(main) {
this.main = main;
this.pageIndex = 1;
this.dataMap = new Map();
let that = this;
this.pagination = new Pagination(function (pageIndex) {
that.findList(pageIndex);
});
}
/**
* 查询数据列表
* @param pageIndex
*/
AppUpgrade.prototyp... |
const emojiClasses = [
emojiReplacer.classNames['emoji'],
emojiReplacer.classNames['translation']
];
let menuShown = false;
function showMenu(shouldShow) {
const content = shouldShow ? 'show' : 'hide';
menuShown = shouldShow;
browser.runtime.sendMessage({
'type': 'context-menu',
'content': content
});
}
f... |
// Preguntar nombre y apellido
var names= prompt("¿cual es tu nombre y apellido?");
//Obteniendo primera inicial
var firstInitial = names.slice(0,1);
//Buscando segunda inicial
var secondInitialPosition = names.indexOf(" "+ 1);
//obteniendo segunda inicial
var secondInitial = names.slice(secondInitialPosition, secondIn... |
// Бургер меню
let menu = document.querySelector(".menu");
document.querySelector(".burger").onclick = () => {
menu.classList.toggle("active");
};
window.onscroll = () => {
menu.classList.remove("active");
};
$(function () {
// Плавный скролл
$(".menu a").on("click", function (event) {
event.preventDef... |
define([
'common/collections/single-timeseries'
],
function (Collection) {
describe('Single Timeseries collection', function () {
var collection;
beforeEach(function () {
collection = new Collection([], {
denominatorMatcher: 'foo',
numeratorMatcher: 'bar',
valueAttr: '_end'
... |
/**
* Created by lusiwei on 2016/9/26.
*/
'use strict';
import React from 'react'
import FilmCard from '../FilmCard'
import TicketCard from '../TicketCard'
import config from '../../config/base'
import {connect} from 'react-redux'
class Cart extends React.Component {
render() {
return (
<di... |
var path = require('path')
var px2rem = require('postcss-px2rem')
var postcss = px2rem({
remUnit: 40,
remPrecision: 8
})
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
chainWebpack: config => {
config.resolve.alias
.set('com*', resolve('./src/components'))
.set(... |
import { createSelector } from "reselect";
const selectSearchPanelHeader = (state) => state.searchPanelHeader;
export const selectSearchPanelQueryValue = createSelector(
[selectSearchPanelHeader],
(searchPanelHeader) => searchPanelHeader.query
);
export const selectSearchPanelHeaderItemsByQuery = createSelector(... |
import React from 'react'
const Footer = () => {
return (
<div>
<p style={{textAlign:'center', marginTop:'10px'}}>Copyright 2021</p>
</div>
)
}
export default Footer
|
// Dice roll function that takes in value of the dice selected from the drop down
// and displays the number on the web page
diceRoll = () => {
var dieSize = document.getElementById("diceType").value;
var roll;
if (dieSize === "Select") {
document.getElementById("demo").innerHTML = "Please select a... |
import React, { Component } from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faUserCircle, faPhoneAlt, faEnvelope, faMapMarkerAlt, faBirthdayCake } from '@fortawesome/free-solid-svg-icons';
class SubInfo extends Component {
render() {
return (
<div classNa... |
import React from "react"
import { ReactComponent as Home } from "../../images/home-icon.svg"
import { ReactComponent as Inbox } from "../../images/inbox-icon.svg"
import { ReactComponent as Explore } from "../../images/explore-icon.svg"
import { ReactComponent as Notifications } from "../../images/notifications-icon.s... |
import { ContactsPlugin } from './contacts';
import { MyWalletsPlugin } from './my-wallets';
import { ReceiveFundsPlugin } from './receive-funds';
import { SendFundsPlugin } from './send-funds';
import { TransactionHistoryPlugin } from './transaction-history';
export const plugins = [
MyWalletsPlugin,
TransactionH... |
var x=0, y=0;
$( document ).ready(function() {
$(".box").click(function(){
if ($(this).hasClass("red") && !$(this).hasClass("clicked")) {
$(this).addClass("clicked");
$(this).css("background", "red");
x++;
document.getElementById('scoreRed').innerHTML = x;
... |
import router from 'express'
const router = Router()
router.length('/', (req, res, next) => {
res.render('index', {title: 'Express'})
})
export {
router
} |
function caps()
{
var x = document.getElementById("usr");
x.value = x.value.toUpperCase();
var alpha = /^[A-Za-z]+$/;
if(x.value.match(alpha))
{
document.getElementById("id1").innerHTML = "";
}
else if(x.value ==="" || x.value === null)
{
document.getElementById("id1").innerHTML ="do not leave it empty!";
... |
let gameSurvivor;
let gameZombies;
function drawSurvivor(survivor) {
line(0, 0, survivor.x, survivor.y);
}
function drawZombie(zombie) {
circle(zombie.x, zombie.y, 35);
}
function drawZombies(zombies) {
zombies.forEach(zombie => drawZombie(zombie));
}
// Pure functions
function createSurvivor() {
return p5... |
/*
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.2/material.indigo-pink.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.2/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
className="mdl-but... |
import React from 'react';
import './sign-in-out.style.scss';
import SingIn from '../../components/sign in/signin.comp';
import Signup from '../../components/sign-up/sign-up.comp'
const Signiout= ()=>(
<div className="sign-in-out">
<SingIn/>
<Signup/>
</div>
)
export default Signiout; |
var picIndex = 1//图片编号
var itemArr = []//每列高度
var loadImgSrc = 'http://jrgzuoye.applinzi.com/%E4%BD%9C%E4%B8%9A%E5%AE%89%E6%8E%92/jscode/JS9-jqueryajax/loading.gif'
appendImg(makeImg(24))//打开浏览器加载18张图片并按照瀑布流规则放在页面中
//当滚到页面底部时,加载更多图片
$(window).on('scroll', function () {
if ($(window).scrollTop() + $(window).height()... |
;(function(window) {
var View = class View {
constructor(setEventListeners) {
this.cache = {}
this.setEventListeners = setEventListeners
}
cacheDOM() {
this.cache.results = document.querySelector('.gallery-results')
this.cache.form = document.querySelector('.search')
this.ca... |
import { combineReducers } from 'redux';
import homeData from './homeReducer';
import mapData from './mapReducer';
const appReducer = combineReducers({
homeData:homeData,
mapData:mapData
})
const rootReducer = (state, action) => {
if (action.type === 'USER_LOGGED_OUT') {
state = undefined
... |
import React from 'react';
import styled from 'styled-components';
import axios from 'axios';
import { useHistory } from 'react-router-dom';
const url =
'http://ec2-13-209-5-166.ap-northeast-2.compute.amazonaws.com:8000/api/vote?';
function CandidateVotes({ candidate, flipVoteFlag, rank, loginCookie }) {
let hist... |
$(document).ready(function() {
$('#datatable').DataTable();
$('#scheduled').toggle();
$('#schedule').click(function(){
$('#scheduled').toggle();
});
$('#message').on('input keyup change click', function(){
var nochar = $(this).val().length;
$('.messagecounter').html("No of... |
const orderName = document.getElementById('order_name');
const total = document.getElementById('_price');
const image = document.getElementById('images');
const orderInfo = document.querySelector('.order-info');
const person = document.getElementById('person');
const increaseDecValue = document.getElementById('inc... |
const pagination = require('pagination');
let paginator;
let m_rowsPerPage;
module.exports = {
create: (prelink, current, rowsPerPage, totalResult) => {
m_rowsPerPage = rowsPerPage;
paginator = new pagination.TemplatePaginator({
prelink: prelink, current: current, rowsPerPage: rowsPerPa... |
/**
* Router module
* @param app:object, express app
*/
module.exports = (app) =>{
app.get('/',(req, res)=>{
res.send("<h1>This is minicube k8 cluster version of simple node app!</h1>");
});
app.get('/login',(req, res)=>{
res.send("So you want to login here?");
});
app.get('/logout',(req, res... |
const path = require('path');
const fs = require('fs');
class Events {
constructor() {
this.cache = {};
this.cachePath = path.join(__dirname, 'cache');
this.cacheTXPath = path.join(this.cachePath, 'tx');
fs.exists(this.cachePath, (exists) => {
if (!exists) {
... |
var app = new Vue({
el: '#app',
data: {
NT: 0,
US: 30.475,
JPY: 0.2645,
CNY: 4.356,
HKD: 3.781,
dateTime: '2018/11/24-AM:10:48'
},
computed: {
japan: function() {
return this.NT / this.JPY;
},
usa: function(){
... |
import React from 'react';
import { connect } from 'react-redux';
import {
Form, Input, Button, Row, Col
} from 'antd';
import CustomBreadcrumb from '@/components/BreadCrumb';
import { updateProfile } from '../../store/reducers/user/actions';
import items from './items';
const { Item } = Form;
const formItemLayout ... |
// Created by Vince Chang
import React, { Component } from 'react';
import './App.css';
import Game from './Game';
class App extends Component {
/* =========================================================================
* Function Name: render
* Task: This function will render a Game component
*
* The pur... |
kompair
.service('sharedProperties', ['$state', SharedProp]);
function SharedProp($state) {
var oSharedObj = {
bSingedIn: false,
sSignedInUserId: null,
oCompair: null,
ChangeStateTo: function(sState) {
$state.go(sState);
}
}
return oSharedObj;
}
|
var restify = require('restify');
var async = require('async');
function fd42 (opts) {
var self = this;
self.url = opts.url;
self.user = opts.user;
self.pass = opts.pass;
self.subnet_name = opts.subnet_name;
self.host = opts.host;
self.client = restify.createJsonClient({
url: self.url
});
sel... |
'use strict';
var fs = require('fs');
var assert = require('chai').assert;
var tv4 = require('tv4');
var schemaFile = './vega-embed-schema.json';
var schema = JSON.parse(fs.readFileSync(schemaFile));
var res = './test/resources/';
function error_msg(desc, e) {
return desc + ': ' + JSON.stringify(e, function(key, v... |
const bunyan = require('bunyan');
const path = require('path');
const fs = require('fs');
const config = require('../config');
const {URL} = require('url');
// hack, see below
// const BUNYAN_TO_STACKDRIVER = {
// 60: 'CRITICAL',
// 50: 'ERROR',
// 40: 'WARNING',
// 30: 'INFO',
// 20: 'DEBUG',
// 10: 'DEBU... |
angular.module('emailController',['userServices'])
.controller('emailCntrl',function ($routeParams,$timeout,$route,User) {
var app = this;
User.activateAccount($routeParams.token).then(function(data) {
app.successMsg = false;
app.errorMsg = false;
if(data.data.success){
app.successMsg = data.data.message;
... |
const body = document.body;
const level = document.querySelectorAll('.menu-item');
const selectLevel = (item) => {
level.forEach((item) => item.classList.remove("selected"));
item.target.classList.add("selected");
};
level.forEach((item) => item.addEventListener("click", selectLevel));
const startButton = do... |
// eslint-disable-next-line no-restricted-imports
import jQuery from 'jquery';
import { compare as compareVersions } from '../core/utils/version';
import errors from '../core/utils/error';
import useJQueryMethod from './jquery/use_jquery';
var useJQuery = useJQueryMethod();
if (useJQuery && compareVersions(jQuery.fn.j... |
class FormScript {
constructor(inStartVal, inVals, inClass, inSelector)
{
this.StartVals = inStartVal;
this.inputvals = inVals;
this.inputClass = inClass;
this.selector = inSelector;
this.ChangePasswordType = true;
}
StartVals;
inputvals;
inputClass;
... |
import React from 'react'
import ReactDOM from 'react-dom';
import StarInfoWrapper from '../styles/StarInfo/StarInfoWrapper.js'
import Stars from '../styles/StarInfo/Stars.js'
import Reviews from '../styles/StarInfo/Reviews.js'
const StarInfo = (props) => (
<StarInfoWrapper>
{/* <Star /> Placeholde... |
import styled from 'styled-components';
import fibonacci_bg from '../images/fibonacci.png' ;
export const FlexContainer = styled.section`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
`;
export const AppBG = styled.div`
position: fixed;
top: 0;
left: 0;
height:... |
var isSidebarOut = 0;
var sidebarbusy = 0;
var isTestBoxOut = 0;
var sidebarForceReject = 0;
var adminValidated = 0;
var adminSidebarWidth = 250;
var buttonWidth = 15;
adminSidebarWidthWithButton = (adminSidebarWidth + buttonWidth) + "px";
function sideBarTurbolinksLoad(sideBarIsOut){
if (sideBarIsOut ... |
'use strict';
/**
* @ngdoc service
* @name seedApp.previewService
* @description
* # previewService
* Service in the seedApp.
*/
angular.module('seedApp')
.service('previewService', function ($mdDialog) {
// AngularJS will instantiate a singleton by calling "new" on this function
// This service is for... |
import { PubSub } from 'apollo-server-express';
import { chatUsers as model } from '../../models/chat_users';
import { userApi as modelUser } from '../../models/user_api';
import { getTokenUser, addNewUser, updateUser } from './utils'
const pubsub = new PubSub();
const
CHAT_USER = 'CHAT_USER',
CHAT_USERS_ONLINE =... |
// let Animal = {};
// let Cat = Object.create(Animal);
// let fluffy = Object.create(Cat);
// console.log(fluffy instanceof Animal);
// class Animal {}
// class Cat extends Animal {}
// let fluffy = new Cat();
// console.log(fluffy instanceof Object);
// console.log(Object.getPrototypeOf(fluffy));
// function Animal... |
/**
* 使用http模块接收客户端请求消息
*
* 演示QueryString模块的使用 参考文档http://nodejs.cn/
* node interpreter: C:\Program Files (x86)\nodejs\node.exe
*
*/
const http = require('http');
const url = require('url');
//创建一个Web服务器 —— 创建一个面包售货员
const server = http.createServer();
//让Web服务器能够处理客户端连接请求——岗前培训
server.on('request', function(... |
var s = 'abb'
for(let i of s){
console.log(i);
}
var s1 = '';
console.log(s.indexOf('b'));
console.log(s.slice(1)); |
import React, { useState } from 'react';
import { Message } from "./message";
export function Checkbox(props) {
return <div>
<h3>Estado</h3>
<div style={{
display: 'flex',
fontSize: '1.4rem',
width: 450,
}}>
<label htmlFor="check1">
... |
const events = require('events');
var emitter = new events.EventEmitter;
emitter.once('tick', () => {
let timeStamp = Date.now();
emitter.on('tick', () => console.log((Date.now() - timeStamp) / 1000 + '"'));
})
setInterval(() => emitter.emit('tick'), 1000) |
import { createContext } from 'preact';
import { useContext, useMemo } from 'preact/hooks';
export { ClientRPC } from './client-rpc';
export { GradingService } from './grading';
export { VitalSourceService } from './vitalsource';
/**
* Directory of available services.
*
* The directory is a map of service class to... |
//VARIABLES
const apiKey = '5de7cfe50c166403acf5dd4f68334d90';
const searchInput = document.querySelector('#search');
const searchSubmit = document.querySelector('#submit');
const randomBtn = document.querySelector('#RandomMovie');
const resultHeading = document.querySelector('#result-heading');
const movieElm = docu... |
/* eslint-disable flowtype/require-valid-file-annotation */
/* eslint-env detox/detox, jest */
import { Date } from 'core-js'
import { launchAppWithPermissions } from '../utils.js'
// FUNCTIONS
// const sleep = milliseconds => new Promise(resolve => setTimeout(resolve, milliseconds))
const genUsername = () => 'TU' +... |
//http://www.mapdevelopers.com/geocode_tool.php
console.log(dbPokemons);
var pokemons = JSON.parse(dbPokemons);
console.log(pokemons);
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 19,
center: new google.maps.LatLng(-30.865341,-51.800741),
mapTypeId: 'sat... |
'use strict';
module.exports = [
'./node_modules/normalize.css/normalize.css',
'./node_modules/slick-carousel/slick/slick.css',
'./node_modules/magnific-popup/dist/magnific-popup.css',
'./node_modules/lightgallery/dist/css/lightgallery.min.css',
'./node_modules/lightslider/dist/css/lightslider.min.css'
];
|
import React, { useState } from "react";
import { withRouter } from "react-router-dom";
//------------------------------------------------- Images ---------------------------------------------------
import Quizs from "../ButtonBasesImages/Quizs.jpg";
import Assignments from "../ButtonBasesImages/Assignments.jpg";
imp... |
'use strict'
const Startup = use('App/Models/Startup')
class HomeController {
async render({ view }) {
try {
const allStartups = await Startup
.query()
.has('votes')
.withCount('votes')
.fetch()
... |
/**
* The MIT License (MIT)
* Copyright (c) 2016, Jeff Jenkins.
*/
const React = require('react');
import { Link } from 'react-router';
const SearchItem = React.createClass({
propTypes: {
item: React.PropTypes.object.isRequired,
onSelect: React.PropTypes.func.isRequired
},
/**
* @return {object}
... |
import '../../../../scripts/common/app'
import Payment from '../../../../models/ecommerse/payment'
import formItems from './form/form-items'
import Order from '../../../../models/ecommerse/order'
import View from '../../../../views/domain/create.vue'
import Constant from '../../../../configs/constant'
const create = a... |
'use strict';
(function() {
class MainController {
constructor($http, $scope, socket, chatService, $state, $rootScope, Auth) {
var self = this;
this.$http = $http;
this.$state = $state;
this.chatService = chatService;
this.Auth = Auth;
// Display Variables
this.posts = this.posts || []... |
export const studentsList = (state = null, action) => {
if (action.type === 'STUDENTs-LIST') {
return action.payload
}
return state
}
|
tour_bus_33_interval_name = ["高鐵嘉義站","故宮南院","高鐵嘉義站","南靖火車站","後壁火車站","白河轉運站","白河水庫","寶泉橋","關子嶺"];
tour_bus_33_interval_stop = [
["高鐵嘉義站"],
["故宮南院"],
["高鐵嘉義站"],
["南靖火車站"],
["後壁火車站"],
["白河轉運站"],
["白河水庫"],
["寶泉橋"],
["關子嶺"]
];
tour_bus_33_fare = [
[26],
[26,26],
[33,26,26],
[70,55,37,26],
[90,74,57,26,26],
[109,94,76,39,26,... |
(() => {
angular.module('kemia-app')
.directive('chemHeader', chemHeader)
chemHeader.$inject = []
function chemHeader() {
return {
restrict: 'E',
templateUrl: 'frontend/src/chem-header/chem-header.html',
controller: 'loginController',
controllerAs: 'lc'
}
}
})()
|
import React, { Component } from 'react';
import { easePolyOut } from 'd3-ease';
import Animate from 'react-move/Animate';
export default class Stripes extends Component {
state = {
stripes:[
{
background: '#F58426',
//background: '#98c5e9',
left... |
var _viewer = this;
_viewer.tabHide("TS_KCGL_UPDATE");
//设置卡片只读
if(_viewer.opts.readOnly){
_viewer.readCard();
}
_viewer.getBtn("stop").click(function() {
if(_viewer.getItem("KC_STATE").getValue() != 6){
_viewer.getItem("KC_STATE").setValue(6);
_viewer._saveForm();
}
});
|
import Basket from "../../utils/basket";
describe("basket", () => {
it("adds product to basket", () => {
const b = new Basket();
expect(b.products()).toHaveLength(0);
b.add({ name: "Produkt 1" });
expect(b.products()).toHaveLength(1);
});
it("removes products from basket", () => {
const b... |
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
const home =()=>import('../components/home');
const about=()=>import('../components/about');
const test=()=>import('../components/test');
const routes =[
{
path: '/',
redirect:'/home'
},
{
path: '/home',
meta:{
title:"... |
var assert = require('assert');
var util = require('../util.js');
var DummyVersionGraph = require('../dummyVersionGraph.js');
var AppBase = require('../appBase.js');
var EvalEnv = require('../evalEnv.js');
var HashDB = require('../hashDB.js');
var DummyKVS = require('../keyvalue.js');
describe('AppBase', function(){
... |
const { save } = require("../../modules/exports");
module.exports.run = async (bot, message, args) => {
const memory = require("../../memory/"+message.guild.id+".json");
if (memory.tables[args[0]] == undefined) {
return message.reply("Either the table you have referenced doesn't exist, or you have mi... |
const Person = require('./Person')
const UnyPerson = require('./Uniperson')
const Guardian =require('./Guardian')
const Student =require('./Student')
const Employee = require('./Employee')
const Teacher = require('./Teacher')
const Stuff = require('./Stuff')
module.exports={
Person,
UnyPerson,
Guardian,
... |
var mongoose = require("mongoose");
var importGoodSchema = mongoose.Schema({
manufactureId: {type: String, required: '{PATH} is required!'},
userId: {type: String, required: '{PATH} is required!'},
dayImport: {type: String, required: '{PATH} is required!'},
numberBill: {type: String, required: '{PATH} ... |
const axios = require('axios');
const axiosInstance = axios.create({
});
class BackendMockClient{
constructor(){
this.baseUrl = 'http://localhost:8080/client/'
; }
async updateAuthSessionWithRoles(auth, roles){
return await axiosInstance.post(`${this.baseUrl}session/user/roles`,{
... |
import { graphql } from 'react-apollo'
import gql from 'graphql-tag'
import imageFragment from '../fragments/image'
const editImage = gql`
mutation editImage($id: ID!, $title: String, $description: String) {
editImage(id: $id, title: $title, description: $description) {
...ImageFragment
}
}
${image... |
// Lo creo sin $ para evitar sobreescribir los preparados por angular
eventsApp.factory('eventData', function($resource) {
var resource = $resource('/data/event/:id', {id:'@id'}, {"getAll": {method: "GET", isArray: true, params: {something: "foo"}}});
return {
getEvent: function() {
// return ... |
import React, { Component } from 'react';
import axios from 'axios';
class EduOrgAppCreate extends Component {
getStyleEduOrg1 = () => {
return {
Color : '#f4f4f4',
//backgroundColor : '#003366'
}
}
ss = () =>{
return{
//textAlign:'left',
// backgroundC... |
var app = require('http').createServer(handler)
var io = require('socket.io')(app);
var fs = require('fs');
var najax = require('najax');
var url_ajax = "datos.php";
app.listen(80);
function handler (req, res) {
fs.readFile(__dirname + '/index.html',
function (err, data) {
if (err) {
res.writeHead(500);
... |
const express = require('express')
const router = express.Router()
const{
getclasses,
getclass,
postclass,
putclass,
deleteclass
}= require('./controller')
router.route('/').get(getclasses).post(postclass)
router.route('/:id').get(getclass).put(putclass).delete(deleteclass)
module.exports = r... |
angular.module('app', ['ngRoute'] );
angular
.module('app')
.controller('main', ['$scope', '$route', '$routeParams', '$location', function($scope, $route, $routeParams, $location){
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
$scope.limit = 10
$scope.hel... |
const createDivisor = require("./helper.js").createDivisor;
// Long-processing time block function
function greatestCommonDivisor(a, b) {
let lowest = Math.min(a, b), greatest = Math.max(a, b),
aDivisor = null, bDivisor = null, commonDivisor = null;
for(i = lowest; i > 0; i--) {
aDivisor = createDivisor... |
let rightSideList = document.createElement('ul');
rightSide.appendChild(rightSideList);
rightSideList.classList.add('right-side__list');
for(let i=0; i<Friends.List.length; i++){
let rightSideListItem = document.createElement('li');
rightSideList.appendChild(rightSideListItem);
rightSideListItem.cla... |
import { sortBy } from 'lodash';
/**
* The order to use when deciding which platform to display first.
*/
const platformOrder = {
usage: 1,
react: 2,
scss: 3,
ios: 4,
android: 5,
};
const getPlatformByPathname = pathname => {
const splitPathname = pathname.split('/');
// If input is `/c... |
//Set Environments
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
//Create my Model Schema
var uploadSchema = new Schema({
name: String,
service_type: Number,
ip: String,
link: String,
created_at: Date
});
mongoose.model('upload', uploadSchema, 'uploads'); //Define my schema to a Model and set... |
import { Conditions } from "../../common";
var mapping_codes = {
'clear-day': Conditions.ClearSky,
'clear-night': Conditions.ClearSky,
'partly-cloudy-day': Conditions.FewClouds,
'partly-cloudy-night': Conditions.FewClouds,
'cloudy': Conditions.BrokenClouds,
'rain': Conditions.Rain,
'... |
import constantRouterComponents from './constantRouterComponents'
import Main from "_c/main";
import exampleMenuData from "./exampleMenuData";
/**
* 动态生成菜单
* @param permissionList
* @returns Router
*/
export const generatorDynamicRouter = (permissionList) => {
let menuData = [], pageNode = {
path: '/page',
... |
import React from 'react';
import Logo from '../../assets/images/logo.png';
import { MdClose, MdDehaze } from "react-icons/md";
import { Link } from 'react-router-dom';
import './index.css';
function getData() {
return JSON.parse( localStorage.getItem("dadosUsuario") ) || null;
}
function handleMenuShow () {
... |
import React from 'react'
import {Link} from 'react-router-dom'
import {auth} from './firebase'
import {withRouter} from 'react-router-dom'
const navBar = ({history}) => {
const cerrarSesion = () =>{
auth.signOut().then(()=>{
history.push("/")
})
}
return (
<div>
<nav classN... |
import {
StyleSheet
} from 'react-native'
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'stretch'
},
content: {
flex: 1,
justifyContent: 'flex-start',
alignItems: 'center',
paddingTop: 50
},
... |
var React = require('react');
var AdminStore = require('../../../stores/AdminStore');
var AdminActions = require('../../../actions/adminActions');
var Link = require('react-router').Link;
var dateFormat = require('dateformat');
var Requests = React.createClass({
contextTypes: {
router: React.PropTypes.object... |
define([
'extensions/mixins/safesync',
'backbone'
],
function (SafeSync, Backbone) {
describe('SafeSync', function () {
describe('sync', function () {
beforeEach(function () {
spyOn(Backbone, 'ajax');
SafeSync.trigger = jasmine.createSpy();
});
it('escapes HTML characters i... |
import React, { Component, createRef } from 'react';
import propTypes from 'prop-types';
import createVisualization from './create-visualization';
import './visualizer.scss';
class VisualizerComponent extends Component {
constructor(props) {
super(props);
this.containerElement = createRef();
}
... |
import React, { useRef } from 'react';
import './style/add.css';
export const Add = (props)=>{
const {addNewBook} = props;
const formData = useRef();
const onSubmitForm = async(e)=>{
e.preventDefault();
await addNewBook(formData.current)
}
return(
<div className="add-main... |
module.exports = function(router) {
require('./users')(router);
require('./devices')(router);
require('./user')(router);
}; |
$(document).ready(function () {
var str=" ( 23 + 32 - sin ( 20 + 3 ) ) "
var str1=str.split(" ")
var str2=str1.split('(')
alert(str)
alert(str1)
alert(str2)
}); |
'use strict';
const File = require('./file');
const Path = require('path');
const SASS = require('node-sass');
/**
* Render an SCSS stylesheet
*/
class Style {
/**
* Create an Express handler function to serve stylesheets
* @return {Function}
*/
static serve() {
return function(req, res, next) {
... |
import React from "react";
const Appointment = props => {
return (
<div>
<table className="table table-striped" style={{ marginTop: 20 }}>
<thead>
<tr>
<th>Appointment Date</th>
<th>Doctor</th>
<th>Type</th>
<th>Status</th>
<th>C... |
import React from 'react';
import {connect} from 'react-redux';
class Selector extends React.Component {
render() {
return (
<div className="">
<ul className="list-group">
{
this.props.list.map((item) => {
i... |
import Vue from 'vue'
import VueRouter from 'vue-router'
import store from '../store'
import user from './user'
import admin from './admin'
import category from './category'
import product from './product'
import tag from './tag'
import search from './search'
const home = () => import('../pages/home.vue')
const notFou... |
'use strict'
const { maybeRequire } = require('../../util')
class NativeCpuProfiler {
constructor (options = {}) {
this.type = 'wall'
this._pprof = maybeRequire('pprof')
this._samplingInterval = options.samplingInterval || 10 * 1000
}
start () {
// pprof otherwise crashes in worker threads
... |
(function () {
'use strict';
var uptime = {
'el': document.getElementById('uptime')
};
uptime.controller = function () {
var ctrl = this;
ctrl.data = {};
uptime.el.addEventListener('uptime', function (event) {
var body = event.detail;
body.hosts.forEach(function (host) {
ho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.