text stringlengths 7 3.69M |
|---|
import React, { Component } from 'react';
import { withRouter, Link } from 'react-router-dom'
import { Layout, Menu , Avatar, Icon, Button, message } from 'antd';
import { Query, Mutation } from 'react-apollo';
// Queries
import GET_USER from '../../queries/GET_USER';
import QUERY_USER from '../../queries/QUERY_USER';
... |
//循环添加不同行业标准的item
$(function(){
$.ajax({
url : "/BZCX/icstype/showTypeByTree",
type : "post",
async : true,
success : function(res) {
var classfiy_item=$('.classfiy_modules')
classfiy_items=eval("("+res.data+")");
var classfiy... |
const opencage_apikey = '42463996dd094ffd8cc8fbebe5b5d09d'
module.exports = opencage_apikey; |
angular.module("EcommerceModule").factory("MainpageService", function($http){
var returnValue = {};
var BASEURL = "http://localhost:8080/";
var httpGetData = function(URL){
return $http.get(URL);
}
var httpGetDataWithParam = function(URL, config){
return $http.get(URL, config);
}
var httpPost = function(URL,... |
import {createStore, combineReducers} from 'redux';
import ChatReducer from './reducers/chat';
import UserReducer from './reducers/user';
import BrowserReducer from './reducers/browser';
var reducers = combineReducers({
ChatReducer: ChatReducer,
UserReducer: UserReducer,
BrowserReducer: BrowserReducer
});... |
const status = {
}
|
'use strict';
var gulp = require('gulp'),
browserify = require('browserify'),
fs = require('fs');
gulp.task("jsDist", function() {
return browserify('./test/index.src.js', { debug: true})
.bundle().pipe(fs.createWriteStream('./test/index.js'));
});
//Serveur local
gulp.task('devServer', functio... |
var async = require('async')
, config = require('./config')
, exec = require('child_process').exec
, fs = require('fs')
, nitrogen = require('nitrogen');
var user = new nitrogen.User({
nickname: 'user',
email: process.env.NITROGEN_EMAIL,
password: process.env.NITROGEN_PASSWORD
});
var service = ne... |
import Vue from 'vue'
import VueEventBus from 'vue-event-bus'
import Footer from '@/components/Footer'
describe('Footer.vue', () => {
it('should render correct contents', () => {
Vue.use(VueEventBus)
const Constructor = Vue.extend(Footer)
const vm = new Constructor().$mount()
expect(vm.$el.querySelec... |
import React from "react";
import {ScrollView, Text, View} from "react-native";
export default class array_api extends React.Component {
render() {
return (<ScrollView>
<Text>length</Text>
</ScrollView>)
}
} |
import FlightSegments from './FlightSegments';
export default FlightSegments; |
import styled, { keyframes } from 'styled-components'
import { theme } from '@styles'
const { flat, fonts, borderRadius, fontSizes } = theme
export const StyledToast = styled.div`
border: 2px solid transparent;
background-color: ${flat.dark.background};
border-radius: ${borderRadius};
width: 100%;
box-shadow... |
import authService from "../../services/authService.js";
import furnitureService from "../../services/furnitureService.js";
import { allMyFurniture } from "./myFurnitureTemplate.js";
async function getView(context) {
let userId = authService.getUserId();
let items = await furnitureService.getMyFurniture(userId... |
import Vue from 'vue';
import upperCamelCase from 'uppercamelcase';
import objectPath from 'object-path';
import A1 from './a1';
console.log('Vue in a.js', Vue);
upperCamelCase('foo-bar');
console.log('A1 in a.js', A1, objectPath);
export default {
name: 'A'
};
|
import React from 'react';
import { Switch, Route } from 'react-router-dom';
import { ConnectedRouter } from 'react-router-redux';
import Users from '../components/users/list.component';
import AddUser from '../components/users/add.component';
/** Shared Elements */
import Header from "../components/shared/header/head... |
import * as actions from './actions'
import * as mutations from './mutations'
const moduloUsuario = {
state: () => ({
usuario: null,
idListaCreada: null,
listas: [],
listaSeleccionada: null,
}),
mutations,
actions,
};
export default moduloUsuario; |
(function () {
'use strict';
/**
* @ngdoc object
* @name bienenFuerDasVolk.controller:BienenFuerDasVolkCtrl
*
* @description
*
*/
angular
.module('bienenFuerDasVolk')
.controller('BienenFuerDasVolkCtrl', BienenFuerDasVolkCtrl);
function BienenFuerDasVolkCtrl() {
var vm = this;
... |
import React, { useState } from 'react'
import { makeStyles } from '@material-ui/core/styles'
import TextField from '@material-ui/core/TextField'
import Button from '@material-ui/core/Button'
function LoginForm () {
const [email, setEmail] = useState('')
const [password, setPassword] = useState('')
const handle... |
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
});
module.exports = {
plugins: [
{
resolve: "gatsby-plugin-tidio-chat",
options: {
tidioKey: process.env.TIDIO_PUBLIC_KEY,
enableDuringDevelop: false,
},
},
],
};
|
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import Layout from './Layout';
import Landing from './Landing';
import Capture from './Capture';
const Routes = (
<Route path="/" component={Layout}>
<IndexRoute component={Landing} />
<Route path="sign-up" component={Capture} />
... |
import home from '../view/home.html'
const config = ($routeProvider) => {
$routeProvider.
when('/home', {
templateUrl: home,
controller: 'testCtrl'
})
}
config.$inject = ['$routeProvider']
export default config
|
// @desc This is the filter on Admin Order Component filtering completed, processing and pending orders
// @author Sylvia Onwukwe
import React from "react";
import Paginations from "../../components/Pagination/Pagination";
class Filter extends React.Component{
render (){
return (
<Paginations
pages={[
... |
const { Event} = require('../event/schema');
const { SpeakerInputType } = require('../speaker/schema');
const { GraphQLObjectType, GraphQLList } = require('graphql');
const Event = require('../../controller/eventController');
const mutation = new GraphQLObjectType({
name: 'EventMutation',
description: 'Mutations f... |
function capitaliseFirstLetter(str) {
return str[0].toUpperCase() + str.slice(1);
}
// Array Remove - By John Resig (MIT Licensed)
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, r... |
module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage information shou... |
import React from 'react';
const NotFound = () =>{
return(
<h1>Whoops .This page does'nt exist</h1>
)
}
export default NotFound; |
// Your code here
//var Person = function (age, name) {
// this._age = age;
// this._name = name;
//};
//Person.prototype.introduce = function () {
// return "My name is " + this._name + ". I am " + this._age + " years old.";
//};
//var Student = function (age, name, Class) {
// Person.apply(this,... |
import React, { Component } from 'react';
import AppItem from './AppItem';
import { Settings } from '../services/Settings';
class AppList extends Component {
settings = new Settings();
constructor(props) {
super(props);
this.state = {
apps: []
}
this.loadAppList()... |
// object inheritance
var Vehicle = function (name)
{
this.name = name;
this.nameUpper = name.toUpperCase();
// this.start= function()
// {
// return this.name+" is starting";
// }
}
Vehicle.prototype.start= function()
{
return this.name+" is starting";
}
/*
When new Vehicle() is ca... |
import { REQUEST_CARS, RECEIVE_CARS } from '../actions/cars'
const initialState = { items: [], isFetching: false }
const cars = (state = initialState, action) => {
switch (action.type) {
case REQUEST_CARS:
return Object.assign({}, state, {isFetching: true})
case RECEIVE_CARS:
return Object.assig... |
import React from 'react';
import './App.css';
import Game from './Game';
export const CELL_VALUE = 'X';
export const getRandom = (max, min) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
class App extends React.Component {
render() {
return <Game />;
}
}
export default App;
|
const express = require('express')
const router = express.Router()
const authController = require('../controllers/auth')
const route = '/auth'
module.exports = (server) => {
router.post('/register', authController.register)
router.get('/login', authController.login)
router.get('/logout', authController.log... |
import { Button } from "react-bootstrap";
import "./NewPollButton.css";
import { Plus } from "react-bootstrap-icons";
function NewPollButton(props) {
return (
<Button
className="btn-newpoll-position btn btn-success rounded-circle"
style={{ width: "50px", height: "50px", font: "2em sans-serif" }}
... |
import * as THREE from 'three'
import Tools from './Tools'
import { ConvexBufferGeometry } from './thirdparty/ConvexGeometry'
/**
* This is the base class for `MorphologyPolyline` and `MorphologyPolycylinder`.
* It handles the common features, mainly related to soma creation
*/
class MorphologyShapeBase extends TH... |
var arr=[3, 'a', 'a', 'a', 2, 3, 'a', 3, 'a', 2, 4, 9, 3];
var counts = {};
for(i in arr){
if(!counts.hasOwnProperty(arr[i])) counts[arr[i]]={item:arr[i],count:1};
else {
var c = counts[arr[i]].count;
counts[arr[i]]={item:arr[i],count:c+1};
}
}
console.log(counts);
var large = 0;
var elm = {};
for(i in counts)... |
import React, { useEffect, useState } from "react";
import { useSelector } from "react-redux";
import { Container, Ul, Li } from "./style";
import PostCard from "../../../postCard";
import NewPostButton from "./NewPostButton";
import PostModal from "../../../postModal";
import LoadingScreenCard from "../../../loadingS... |
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
Dimensions,
ScrollView,
} from 'react-native';
const TILE_SIZE = 20;
const BOARD_WIDTH = (Dimensions.get('window'... |
$(document).ready( function() {
$("#iSearchSecret").on('click', function(){
var recherche = $(this).val();
$('tbody#listeSecrets').html("");
$.ajax({
url: '../SM-home.php?action=R',
type: 'POST',
data: $.param({'Search_Secrets': recherche}),
... |
import withSession from "plugins/next-session";
const ApiSession = async (req, res) => {
let user = req.session.get("user");
// console.log(user);
return user ? res.json({ loggedIn: true, ...user }) : res.json({ loggedIn: false });
};
export default withSession(ApiSession);
|
import React from 'react';
import ItemCmt from "@/components/itemCmt";
//创建评论组件
class ItemList extends React.Component{
constructor(){
super();
this.state = {
itemList:[
{id:1,name:"zhangsan",content:"一楼"},
{id:2,name:"lisi",content:"沙发"},
{id:3,name:"wangwu",content:"板凳"}
... |
/*
* deepspeechWrapper.js by Aaron Becker
* Manages real-time speech recognition for CarOS using Mozilla's DeepSpeech recognition engine
*
* Dedicated to Marc Perkel
*
* Copyright (C) 2018, Aaron Becker <aaron.becker.developer@gmail.com>
*
* I know that I could have made a stab at implementing this myself, but oh well ... |
var Sites, imgurAlbum, basicMatch, stripUrl, getUrls;
var urlArray = [];
Sites = {};
imgurAlbum = {
isAlbum: null,
id: null,
index: null,
cached: {},
images: function() {
if (this.id && this.isAlbum)
return this.cached[id].images;
},
captions: function() {
if (this.id && this.isAlbum)
... |
const config = require('./config/config')
const { initDb } = require('./config/database')
initDb(config.firebase_creds)
const express = require('express')
const passport = require('passport')
const app = express()
const bodyParser = require('body-parser')
const router = require('./routes/router')
const validateIdToken ... |
// RxJS v6+
import { interval } from "rxjs";
import { sample } from "rxjs/operators";
//emit value every 1s
const source = interval(1000);
//sample last emitted value from source every 2s
const example = source.pipe(sample(interval(2000)));
//output: 2..4..6..8..
const subscribe = example.subscribe(val => console.log(... |
import { message } from 'antd';
import {
find,
update,
} from '../services/category';
export default {
namespace: 'category',
state: {
isLoading: false,
list: [],
},
effects: {
*find(_, { call, put }) {
yield put({
type: 'setLoading',
... |
import Tarea from '../models/Tarea';
import Proyecto from '../models/Proyecto';
import { validationResult } from 'express-validator';
const crearTarea = async(req, res) => {
const errores = validationResult(req);
if(!errores.isEmpty()){
return res.status(400).json({errores: errores.array()});
}
... |
var router = require('express').Router();
var authMiddleware = require('../auth/middlewares/auth');
router.use(authMiddleware.hasAuthadmin);
router.use('/home', require('./home/routes'));
router.use('/hotlines', require('./hotlines/routes'));
router.use('/hotlines/addhotline', require('./hotlines/routes'));
router.... |
import React , { Component } from 'react';
import RightSidebar from './RightSidebar';
import AuthorBookLists from './AuthorBookLists';
import GenreBookLists from './GenreBookLists';
import { toggleElementClass } from 'Utils/toggle';
/**
* @class SortSidebar
* @extends { React.Component }
* @description renders the ... |
// as_jsfunclib.js: useful javascript function set,
// written / assembled by Alexander Selifonov <as-works@narod.ru>
// V 1.006.114 last change: 28.02.2008
var noajax = 'No XmlHttpRequest in Your browser !';
var postcont = 'application/x-www-form-urlencoded; charset=UTF-8';
var HttpRequestExist = true;
functi... |
class _Main {
static function main (args : string[]) : void {
// we cannot introduce "X -> Y" style type declaration, e.g.:
var add = (x : number, y : number) : number -> x -> y;
}
}
|
import React, { Component } from "react";
import MapContainer from "./EventMapContainer";
class EventMapComponent extends Component {
render() {
return (
<React.Fragment>
<MapContainer coords={this.props.coords} />
</React.Fragment>
);
}
}
export default EventMapComponent;
|
import React, {useEffect} from 'react';
import Loader from 'components/Loader/Loader';
import { useSelector, useDispatch } from 'react-redux';
import { Link, useParams } from 'react-router-dom';
import './MovieDetail.scss';
import { actFetchMovieDetail } from './module/actions';
export default function MovieDetail(pro... |
describe('Cloud Functions', () => {
let storageFileToRTDB
let adminInitStub
let admin
before(() => {
admin = require('firebase-admin')
adminInitStub = sinon.stub(admin, 'initializeApp')
storageFileToRTDB = functionsTest.wrap(
require(`${__dirname}/../../index`).storageFileToRTDB
)
})
... |
'use strict';
/**/
/*
var config = {
host: '192.168.0.21',
port: 22,
username: 'iojs',
privateKey: fs.readFileSync('/Users/zensh/.ssh/id_rsa')
};
*/
var gulp = require('gulp'),
concatCss = require('gulp-concat-css'),
minifyCss = require('gulp-minify-css'),
rename = require(... |
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Auth from '../../authenticate/containers/Auth'
const auth = new Auth();
class NavBar extends Component {
render() {
return (
<div>
<Link to={'/'}>Home</Link>
<Link to={'/about-us'}>About Us</Link>
... |
KISSY.config('modules', {
'kg/xscroll/1.1.8/plugin/scrollbar': { requires: ['node', 'base', 'anim', 'kg/xscroll/1.1.8/util']}
}); |
function aegismarked(text)
{
//Example
text = text.replace(/<startexample>/g,'<div class="panel panel-default example"> \r\n \
<div class="panel-body" style="padding:0px;padding-top:15px;"><small style="padding-left:15px;" class="text-muted">EXAMPLE</small>\r\n<div style="padding-left:15px;">').rep... |
const express = require('express')
const router = express.Router()
const jwt = require('jsonwebtoken')
router.get('/jwt', (req, res) => {
let username = process.env.JWT_USERNAME || 'iot'
let password = process.env.JWT_PASSWORD || 'iot1234'
let secretkey = process.env.SECRET_KEY
let iss = process.env.ISS;
let s... |
const express = require("express"),
cookieParser = require("cookie-parser"),
path = require("path"),
cluster = require("cluster"),
net = require("net"),
farmhash = require("farmhash"),
helmet = require("helmet"),
passport = require("passport"),
keys = require("./config/keys"),
log = require("./config/... |
/*
get php fallback file for production
*/
var gulp = require('gulp');
var phpFallbackTask = function() {
return gulp.src([
'./index.php',
])
.pipe(gulp.dest('production/')); // place php fallback in root directory
};
gulp.task('phpFallbackTask', phpFallbackTask);
module.exports = ph... |
function wikiAPI() {
var searchTerm = document.getElementById('searchTerm').value;
var xhr = new XMLHttpRequest();
var url = "https://en.wikipedia.org/w/api.php?action=query&origin=*&format=json&generator=search&gsrnamespace=0&gsrlimit=30&gsrsearch=" + searchTerm;
xhr.open('GET', url);
xhr.onload = ... |
//Languages
//Dependencies
export default {
users : ["users","χρήστες"],
user : ["user","χρήστης"],
groups : ["groups","Ομάδες"],
cars : ["cars"],
category : ["category","Κατηγορία"],
categories : ["categories","sioth9eah"],
priceLists :["pricelists","sfopas",],
name : ["name","Κατηγ... |
const { Router: createRouter } = require('express');
const { checkAccess } = require('../middlewares');
const logoutRouter = createRouter();
logoutRouter.get('/', checkAccess, async (req, res) => {
const { session } = req;
await session.destroy();
res.json({
response: true
});
});
exports.logoutRouter... |
import React from "react";
import { usePromiseTracker } from "react-promise-tracker";
import Loader from "react-loader-spinner";
import "./spinner.css";
export const Spinner = (props) => {
const { promiseInProgress } = usePromiseTracker();
return (
promiseInProgress && (
<div className="lds-spinner"><... |
var _ = require('lodash');
var React = require('react');
var ReactBootstrap = require('react-bootstrap');
var Input = ReactBootstrap.Input;
var ExternalOrderSelector = React.createClass({
propTypes: {
externalOrders: React.PropTypes.object,
},
getDefaultProps: function() {
return {
externalOrders:... |
function create(inputArray) {
let contentDiv = document.getElementById("content");
for (let i = 0; i < inputArray.length; i++) {
let div = document.createElement("div");
let p = document.createElement("p");
p.textContent = inputArray[i];
p.style.display = "none";
div.appendChild(p)... |
import percent from './../util/percent';
class Armor {
constructor(props) {
this._absorption = props.absorption || 0;
this._name = props.name;
}
/**
*
* @returns {number}
*/
get absorption() {
return this._absorption || 0;
}
/**
* @returns {String}... |
// JavaScript Document
// Carousel //
$('#myCarousel').carousel({
interval: 3000,
})
/*************** Mega menu slide down on hover with carousel ****************/
$(document).ready(function(){
$(".dropdown").hover(
function() {
$('.dropdown-menu', this).not('.in .dropdown-men... |
"use strict";
require("run-with-mocha");
const assert = require("assert");
const PlaybackStateType = require("../../src/types/PlaybackStateType");
describe("types/PlaybackStateType", () => {
it("Symbol.hasInstance", () => {
[
PlaybackStateType.UNSCHEDULED_STATE, "unscheduled",
PlaybackStateType.SCH... |
/**
* @properties={type:12,typeid:36,uuid:"09E244B7-8DCB-4331-8ADF-CC47A08A05FD"}
*/
function datafesta_string()
{
return datafesta.substring(0, 2) + '/' + datafesta.substring(2, 4) + '/' + globals.TODAY.getFullYear();
}
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import './TextInput.scss';
const TextInput = React.forwardRef((props, ref) => {
const { id, name, type, value, label, rootClassName, error, disabled, onChange } = props;
return (
<div
className={className... |
// // 1차풀이 (시간복잡도...)
// function solution(n) {
// if(n==2){
// return 1;
// }
// var j = 3;
// var result = 1;
// for(j; j<=n; j++){
// var count = 0;
// var i=3;
// for(i; i<j; i++){
// if(j%i == 0){
// break;
// ... |
const fs = require('fs');
const path = require('path');
const connection = require('./connection');
const sorter = require('../common/sorter');
const _recordVersion = async (params, session) => {
await session.run('MATCH (v:__db_versions) DETACH DELETE (v)');
await session.run(`CREATE(:__db_versions $placehold... |
var Sky = require("./sky");
var Vector = require("./vector");
var extend = require("./utils").extend;
global.emojiBoids = emojiBoids;
/**
*
*/
function emojiBoids(selector, options) {
/**
* Options include
* - Emoji subset
* - Turns ... TODO
* - Interval (ms)
* - Pizza
*/
sele... |
/**
* @license
* Copyright 2016 Google Inc.
*
* 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 applicable law ... |
/**
* Created by zhualex on 16/2/8.
*/
$(function(){
$('#login_btn_submit').click(function(){
//提交登陆:
var account_id=$('#account_id').val();
var password=$('#password').val();
var img_verity=$('#img_verity').val();
if ($.trim(account_id).length<1 ){
alert('账号名、密码不能为空'... |
import React, { useState, useEffect } from "react";
import hero from "../../assets/hero.jpg";
import { FcGoogle } from "react-icons/fc";
import axios from "axios";
import { createHashHistory } from "history";
import AddForm from '../Home/AddPaper';
import { BrowserRouter as Router, Redirect } from "react-router-dom";
... |
// module untuk pairing clock-clock per orang per hari
let ClockPairing = (function() {
let telat5;
let telat15;
let tidakClockOut;
function _toMiliSeconds(time) {
let timeParts = time.split(":");
let h = timeParts[0] ? +timeParts[0] * 60 * 60 * 1000 : 0;
let m = timeParts[1] ? +timeParts[1] * 60 ... |
// web.js
var express = require("express");
logfmt = require("logfmt");
fs = require("fs");
hbs = require("express3-handlebars").create();
publications = require("./routes/publications.js");
var app = express();
process.on('uncaughtException', function (err) {
console.log('Caught exception: ' + err);
app.use... |
const isProduction = process.env.NODE_ENV === 'production';
module.exports = Object.freeze({
PRODUCTION: isProduction,
AUTH_CODE_LIFE: 10 * 60 * 1000, // 10 min
ACCESS_TOKEN_LIFE: 60 * 60 * 1000, // 1h
REFRESH_TOKEN_LIFE: 24 * 60 * 60 * 1000, // 1d
SESSION_SECRET: isProducti... |
var cheerio = require('cheerio');
exports.kuwo = {
searchUrl: 'http://sou.kuwo.cn/ws/NSearch',
songUrl: 'http://antiserver.kuwo.cn/anti.s?format=mp3|aac&type=convert_url&response=url',
parse: function(body, key, pn) {
var $ = cheerio.load(body),
$list = $('.m_list ul li'),
$... |
import React from 'react';
import CartItem from '../cart-item/';
import {selectcartItems} from '../../store/cart/cart.selectors.js';
import {closecart} from '../../store/cart/cart.actions.js';
import {connect} from 'react-redux';
import {withRouter} from 'react-router-dom';
import {createStructuredSelector} from 'resel... |
/// <reference path="../../lib/jquery-1.11.3.js" />
/// <reference path="../../lib/Q.mini.js" />
/*
* Q.UI.adapter.jquery.js
* author:devin87@qq.com
* update:2017/12/25 13:44
*/
(function (undefined) {
"use strict";
var window = Q.G,
isFunc = Q.isFunc,
isObject = Q.isObject,
isArray... |
// BEGIN-SNIPPET dynamic-data-immutable.js
import Component from "@ember/component";
import { action } from "@ember/object";
export default class DynamicDataImmutableObjectsComponent extends Component {
tagName = "";
bars = [
{ id: 1, value: 100 },
{ id: 2, value: 50 },
{ id: 3, value: 70 },
];
@... |
import React, {Component} from 'react';
import { connect } from 'react-redux';
class Intro extends Component {
state = {
animateOut: false
}
intervals = [];
componentDidMount() {
this.intervals.push(setTimeout(() => {
this.setState({animateOut: true});
}, 4800));
if (this.props.isHost)... |
/*
TeventDispatcher
_eventTypes: { type1:[listener1, listener2 ...], type2:[listener1, listener2 ...], ...}
*/
uses("panjs.core.events.Tevent");
__CLASSPATH__="panjs.core.events.TeventDispatcher";
defineClass("TeventDispatcher", "panjs.core.Tobject", {
_listeners: null,
constructor: function(arg... |
/**
* Created by Bram on 4/11/2014.
*/
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var CategorieSchema = new Schema({
naam: {type: String}
//,beginDatum: {type: Date}
//,eindDatum:{type: Date}
});
CategorieSchema.path('naam').required(true, 'Naam mag niet leeg zijn');
//Categorie... |
var app = angular.module('app', ["ngRoute", 'ngMaterial']);
/**
* Configure the Routes
*/
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider
// Home
.when("/", {templateUrl: "vistas/home.html"})
.when("/contact", {templateUrl: "vistas/contact.html"})
// .when("/admin", {template... |
function byId(id){
return typeof id === "string" ?document.getElementById(id):id
}
function byTagName(elem,obj) {
return (obj || document).getElementsByTagName(elem);
}
function byClass(sClass, oParent) {
var aClass = [];
var reClass = new RegExp("(^| )"+sClass+"( |$)");
var aElem = byTagName("*", oParent);
... |
function DashboardCtrl($scope, $rootScope, $http, $modal, $stateParams, SweetAlert, authService, timeAgo, Constants) {
$scope.ShowType = $stateParams.show;
$scope.getRandomInt = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
$rootScope.$on('logon', function... |
const helper = require('./helper');
const lib = require('./lib');
const cors = require('cors');
const constants = require('./constants');
const Redis = require("ioredis");
const redisClient = new Redis();
function handleError(e, res) {
console.error(e);
res.status(500).json({
error: e.toString()
... |
import React, { Component } from "react";
import Router from "next/router";
import api from "./api";
import AuthService from "./AuthService";
import { getCookie, setCookie } from "./Cookies";
import cookie from "js-cookie";
import localStorage from "local-storage";
export default function withOutAuth(NoAuthComponent) {... |
const getMood = (mood) => {
// eslint-disable-next-line default-case
switch (mood) {
case 1:
return "awful";
case 2:
return "bad";
case 3:
return "okay";
case 4:
return "good";
case 5:
return "awesome";
}
};
const locale = {
checkInHeading: () => "Check in with... |
// Quinton Ashley
// https://www.youtube.com/watch?v=E7o1UpHH0c0
function setup() { //0 0:03
createCanvas(windowWidth, windowHeight);
example0();
}
function drawCaterpillar() { //1 0:08
// initialize variables
var radius = 50;
// draw line
ellipse(50, 50, radius, radius); //2 0:14 4
ellipse(i, i, radius, radius... |
window.addEventListener('load', function(){
let forms = document.querySelector('.LoginForm');
let email = document.querySelector('#email');
let password = document.querySelector('#password');
let pEmail=document.querySelector('#errorEmail')
let pPassword=document.querySelector('#errorPassword')... |
(function (cjs, an) {
var p; // shortcut to reference prototypes
var lib={};var ss={};var img={};
lib.ssMetadata = [
{name:"card cow_girl_atlas_1", frames: [[0,0,1954,1663]]},
{name:"card cow_girl_atlas_2", frames: [[0,0,1638,1417]]},
{name:"card cow_girl_atlas_3", frames: [[0,0,1450,1388]]},
{name:"card cow_g... |
const mongoose = require('mongoose');
const db = mongoose.connection;
mongoose.connect("mongodb://localhost:27017/test",{
useNewUrlParser: true,
useUnifiedTopology: true
})
db.on('error', console.error.bind(console, 'connection error:'))
db.once('open', (success)=>{
console.log('connected db: test')
... |
//load required modules
var esprima = require('esprima');
var estraverse = require('estraverse');
var traverseJS = require('./TraverseJS.js');
module.exports.build = function(data) {
//build the ast
var ast = esprima.parse(data, {
loc: true
});
//the abstraction that will contain all instruc... |
let heading = document.querySelector(".heading");
// let headingText = "Welcome to 30 days of JavaScript";
heading.innerText = "Welcome to 30 days of JavaScript";
let button = document.querySelector(".button");
button.innerText = "Learn Python";
button.addEventListener("click", replaceLanguage);
function replaceLangu... |
// all "require" better to include all at top
require('dotenv').config()
var express = require('express')
var morgan = require('morgan')
var app = express()
app.use(morgan('combined'))
app.use(express.json({
limit: '10mb',
extended: true
}));
var router = require('./routes/main-route')
//static folder (e.g.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.