code stringlengths 2 1.05M |
|---|
/**
*
* @authors leomYili
* @date 2016-04-14 09:24:44
* @version v1.0
*/
(function() {
var source1 = '<div class="page-header">' +
'<h1 class="text-center"><%=#name%><small><%=#small%><i class="glyphicon glyphicon-bookmark"></i></small></h1>' +
'</div>' +
'<p class="lead"><... |
function Tree(root){
this.root = root;
this.isAnimating = false;
this.traQueue = [];
}
Tree.prototype.traverseDF = function(callback){
(async function recurse(currentNode){
var children = Array.from(currentNode.childNodes).filter((item)=>item.nodeType===1);
for (var i = 0; i < children.length; i++) {
await ... |
(function () {
'use strict';
module.exports = function (GLOBAL, gulp) {
var zip = require('gulp-zip');
var rename = require('gulp-rename');
return function () {
return gulp.src(GLOBAL.dirs.themeforest + '/build/**/*')
.pipe(zip(GLOBAL.themeName + '.build.zi... |
"use strict";
describe("enrich_test", function () {
var enrich = require("./enrich");
it("enrich_onstep", function () {
var enriched = enrich({
a() {
this.a = 1;
},
b() {
return this.a + 1;
},
});
return enri... |
function count(){
let i = 0;
setInterval(() => {
if(i < 10){
i++;
console.log(i);
}else{
return false;
}
},1000)
}
count();
|
'use strict';
/*
*
* Bar chart using echarts
*
*/
import React from 'react';
import BaseEchart from './BaseEchart';
class Bar extends BaseEchart {
constructor(props) {
super(props);
this.defaultOptions = {
tooltip : {
trigger: 'axis',
axisPointer :... |
'use strict';
var sprintf = require('sprintf-js').sprintf;
var header = require('./format/header');
var utils = require('./format/utils');
module.exports = function(pri, args, showHeader) {
var outputtext = '';
if( showHeader !== false ) {
outputtext += header(args);
}
outputtext += '..\n.. ***** ... |
/**
* Function: CatmullClarkSubdivisionOneIteration
* Description: Runs one iteration of Catmull-Clark subdivision on a body.
* Parameters:
* body {Body} the body
* Returns:
* {Body} the result
*/
JSM.CatmullClarkSubdivisionOneIteration = function (body)
{
function AddOriginalVertices (body, result, adjacencyInfo)
{
... |
var GridStore = require('./gridstore').GridStore,
ObjectID = require('bson').ObjectID;
/**
* A class representation of a simple Grid interface.
*
* @class Represents the Grid.
* @param {Db} db A database instance to interact with.
* @param {String} [fsName] optional different root collection for GridFS.... |
var PORT = 3113;
var fsapi = require('../lib/fsapi')({
developerKey: 'NNNN-NNNN-NNNN-NNNN-NNNN-NNNN-NNNN-NNNN',
userAgent: "node-fsapi-example-express/0.1.0",
referenceHost: "https://sandbox.familysearch.org",
callbackURL: "http://127.0.0.1:"+PORT+"/auth/familysearch/callback"
});
var express = require('expre... |
'use strict';
const _ = require('lodash');
const Influx = require('..');
const client = new Influx('http://127.0.0.1:8086/mydb');
// select code,spdy,type from ajax where spdy = '0' and time >= now() - 3h and use <= 300 limit 2
{
const reader = client.query('http');
reader.addField('code', 'spdy', 'type');
reade... |
var ids=[];
var oldid=0;
var ClassForModel=function(){
};
function loader()
{
$.get('http://localhost:3030/inbox',function(res)
{
if(!$.isEmptyObject(res))
{
console.log(res);
arr2=res;
for(var i in arr2){
if(ids.indexOf(arr2[i]._id)==-1){
var message=arr2[i... |
var dep1 = require('./dep1');
var lodash = require('lodash');
console.log("This is inside main.js");
dep1.sayHello();
console.log(lodash.uniqueId());
|
import PropTypes from 'prop-types';
import React from 'react';
import { compose, pure, setPropTypes } from 'recompose';
import { flow, camelCase, upperFirst, kebabCase } from 'lodash';
import Placeholder from '@ui/Placeholder';
import * as Icons from './icons';
const pascalCase = string => flow(camelCase, upperFirst)... |
'use strict';
var test = require('tape');
var sinon = require('sinon');
var resizeCursor = require('resize-cursors');
var Store = require('../lib/store');
var helpers = require('../lib/helpers');
var createEl = require('./spec_util').createEl;
var getCursorState = helpers.getCursorState;
function cursorStyle(state) {... |
// @flow
import logger from 'debug'
import { Observable } from 'rxjs'
const debug = logger('smtApp:createStateStreams')
const createInitialstateReq$ = (client: Function) =>
Observable.create(observer => {
debug('Requesting initial state...')
client.record.snapshot('knx/initialBusState', (error, record) => ... |
'use strict';
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var StatsPlugin = require('stats-webpack-plugin');
module.exports = {
entry: [
path.join(__dirname, 'client/main.js'... |
/**
* Return a function that lazily
* requires a block only when
* it is invoked and caches
* it for future re-use
*
* @param path
* @returns {Function}
*/
module.exports = function (require, path) {
var worker = '';
return function (a, b, c, d, e, f, g) {
if (!worker) {
worker = require(p... |
// Music player requires
var child = require('child_process');
var Player = function (songPath) {
this.songPath = songPath;
console.log("Going to open song file " + songPath);
}
Player.prototype.play = function () {
if (process.platform == 'darwin') {
Player.song = child.exec("afplay " + this.songPath, func... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _promise = require('babel-runtime/core-js/promise');
var _promise2 = _interopRequireDefault(_promise);
exports.default = neo;
var _util = require('./util');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj ... |
var classHelix_1_1Glob_1_1ColumnInfo =
[
[ "dbtype", "classHelix_1_1Glob_1_1ColumnInfo.html#a259f55cf98b6aada1d0a441b197000df", null ],
[ "name", "classHelix_1_1Glob_1_1ColumnInfo.html#ae34bf89bff5abec72f1b8f544db26f15", null ],
[ "nullable", "classHelix_1_1Glob_1_1ColumnInfo.html#aa60903c8d6c57ca84e16e7f5e... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$(document).ready(function(){
$(function(){
$('#chat-messages-box').slimScroll({
height: '370px',
start: 'bottom'
});
});
$(function(){
$('#notification-messages-box').slimScroll({
... |
var Crop = require("../../lib/functions/crop");
var Base = require("../../lib/functions/base");
describe("functions.Crop", function() {
var regexp = Crop.regexp;
it("should delegate the generate method to base", function() {
sinon.stub(Base, "regexpGenerate").withArgs(Crop, regexp,"/an/url").returns("hello wo... |
export default {
apiUrl: 'http://yoursite.com/api/'
};
const siteConfig = {
siteName: 'EncontrAR',
siteIcon: 'ion-flash',
footerText: 'EncontrAR ©2017'
};
const themeConfig = {
topbar: 'themedefault',
sidebar: 'themedefault',
layout: 'themedefault'
};
const language = 'english';
const AlgoliaSearchConfig... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var TypeCode;
(function (TypeCode) {
TypeCode[TypeCode["Unknown"] = 0] = "Unknown";
TypeCode[TypeCode["String"] = 1] = "String";
TypeCode[TypeCode["Boolean"] = 2] = "Boolean";
TypeCode[TypeCode["Integer"] = 3] = "Integer";
... |
'use strict';
angular.module('myApp.private', ['myApp.backend', 'myApp.authentication', 'myApp.common', 'myApp.config', 'ui.bootstrap', 'ui.router' ])
.config(function($stateProvider, USER_ROLES) {
$stateProvider.state('private', {
url: '/private',
component: 'private',
abstract: true,
data: {
aut... |
const Order = require('../models/order')
const Q = require('q')
const ObjectID = require('mongodb')
.ObjectID
module.exports = function OrdersLogic(TransactionsLogic) {
let saveOrder = (order) => {
return new Order(order)
.save()
}
let getOrders = (query) => (Order.find(query))
let removeOrder = (... |
module.exports = function (api) {
api.cache.forever()
const presets = [
'@babel/preset-env',
'@babel/preset-react'
]
const plugins = [
["@babel/plugin-proposal-decorators", { legacy: true }],
'@babel/plugin-transform-runtime',
["@babel/plugin-proposal-class-properties", { loose: true }],
... |
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this n... |
//Problem 3. Deep copy
function clone(obj){
if (typeof obj !== 'object') {
return obj;
}
var cloned = {};
for (var prop in obj) {
cloned[prop] = clone(obj[prop]);
}
return cloned;
}
console.log(clone(25));
console.log(clone({name: 'Ivan', age: 55})); |
/*jslint node: true */
'use strict';
var gulp = require('gulp');
gulp.watch = require('gulp-watch');
gulp.traceur = require('gulp-traceur');
gulp.task('dev', function(){
gulp.watch('./src/**', function(files){
files
.pipe(gulp.traceur({experimental: true}))
.pipe(gulp.dest('./build'));
});
gul... |
"use strict";
var Layout;
(function (Layout) {
Layout.button = function (inheritor) {
var self = Layout.contentHost(inheritor || this);
self.type = 'button';
self.addProperty('isDisabled',{get:true,set:true,'default':false})
self.addProperty('pointerOverStyle');
self.addProp... |
/**
* SPDX-FileCopyrightText: © 2017 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: MIT
*/
const MultiTester = require('../../../../../scripts/MultiTester');
const rule = require('../../../lib/rules/destructure-requires');
const parserOptions = {
parserOptions: {
ecmaVersion: 6,
sourceType: 'm... |
version https://git-lfs.github.com/spec/v1
oid sha256:91f52c243e5d2ab888856ca9bbe23315b1d66703f1a9a1d9b5ef8f6bae38c581
size 21433
|
'use strict';
const React = require('react');
const pt = require('./../prop-types');
const {routeTo} = require('./../flux/action');
const RouteStore = require('./../flux/route-store');
const internationalize = require('./../mixins/internationalize');
const debug = require('./../mixins/dev-tools');
const displayName = '... |
function fn() {
var config = karate.callonce('callonce-config-called.feature');
return config;
}
|
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modi... |
const mongoose = require('mongoose');
let VoteSchema = new mongoose.Schema({
'username': String,
'repo': String,
'cog': String,
'IPs': Array,
});
module.exports = mongoose.model('Vote', VoteSchema);
|
version https://git-lfs.github.com/spec/v1
oid sha256:d99008f13f576c3760d72e6f67902ef87b85e36144878e87ea417b71672886f0
size 9346
|
var path = require('path');
module.exports = {
entry: './static/entry.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'js/app.js'
},
loaders: [
{ test: /\.purs$/,
loader: 'purs',
query: { output: 'output' } },
{ test: /\.js$/,
exclude: /node_modules/,
loader... |
/*
* PSI Evaluation module GUI 0.6
*
* Author: James Montgomery (james.montgomery at anu.edu.au)
*
* Developed as part of the Protocols and Structures for Inference project: http://psi.cecs.anu.edu.au
*/
define(['jquery','underscore','backbone','psi.client','psi.common-ui','psi.evaluation','psi.forms','psi.sch... |
var CONFIG =
{
"name": "Dynamic Network of Speakers",
"name_short": "DNS",
"client_name": "",
"version": {
"major": 1,
"minor": 0,
"revision": 0
},
"log_level":"INFO",
"log_file": "./dns.log",
"speaker_prefix": "speaker_",
"website_prefix": "site_",
"use_b... |
let CollectionSetup = Organizations.utility.CollectionSetup;
// Collection Name
const COLLECTION_NAME = 'organizations';
/**
* SetupOrganizations Component
*
* @class SetupOrganizations
*/
class SetupOrganizations {
/**
* @constructor
*
* @param {App} app Organizations App
* @param {Object} ... |
'use strict';
module.exports = function(grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
grunt.initConfig({
// Set this variables for different projects
projectName: 'h-op... |
import React from "react";
import { Provider } from "react-redux";
import Helmet from "react-helmet";
import universal from "react-universal-component";
import { withSiteData } from "react-static";
import {
Grid,
LinearProgress,
Chip,
AppBar,
Toolbar,
Typography
} from "@material-ui/core";
import {
MuiT... |
version https://git-lfs.github.com/spec/v1
oid sha256:224223ebf1f3b0e9593b8406e6a4b2ea4855dd818654e058860b4d221695ee9b
size 4121
|
/**
* Main Util Module
*/
angular.module('util',[]); |
var convert = require('../lib');
var testItems = require('./test-items');
/*global describe,it,expect*/
describe('Testing js2xml.js:', function () {
describe('No options supplied (fallback to defaults):', function () {
var options = {};
testItems('js2xml', options).forEach(function (test) {
it(test.... |
import React from 'react'
import Link from 'next/link'
import Editor from '../components/NextEditor'
class MultipleEditors extends React.Component {
render () {
return (
<React.Fragment>
<Link href='/'>
<a>Go to Home</a>
</Link>
<hr />
<Editor slateKey='foo' defaul... |
var searchData=
[
['startpoint',['startPoint',['../interface_fractal_tree_1_1_moving_branch.html#afbf74eadb94a987e4f845e77b8d0b964',1,'FractalTree.MovingBranch.startPoint()'],['../class_fractal_tree_1_1_moving_branch_impl.html#a360370cd5f0fb613596cb8d0fe942ffe',1,'FractalTree.MovingBranchImpl.startPoint()']]],
['st... |
var AppViewModel = can.DefineMap.extend({
sessionPromise: {
value: function(){
return can.ajax({
url: "/api/session"
});
}
},
email: "string",
password: "string",
signUp: function(event){
event.preventDefault();
this.sessionPromise = can.ajax({
url: "/api/users",
... |
;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'jquery.request'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('jquery'), require('jquery.request'));
} else {
root.jQuery = factory(root.jQuery, root.jQuery.Request... |
import chai from 'chai';
const { expect } = chai;
import isFixed from 'src/popper/utils/isFixed';
describe('utils/isFixed', () => {
let node;
beforeEach(() => {
node = document.createElement('div');
document.body.appendChild(node);
});
afterEach(() => {
document.body.removeChild(node);
});
i... |
'use strict';
/**
* Module dependencies.
*/
var should = require('should'),
mongoose = require('mongoose'),
User = mongoose.model('User'),
FabricStockReport = mongoose.model('FabricStockReport');
/**
* Globals
*/
var user, fabricStockReport;
/**
* Unit tests
*/
describe('Fabric stock report Model Unit Tests... |
require('@babel/register');
const fs = require('fs');
const pkg = require('../package');
//settings schema
const schema = require('../settings-schema');
const properties = schema.properties;
const expectedSettings = Object.keys(properties);
//renderer settings
const settings = require('../src/configuration/rendererSe... |
try {
// Initialise the Blue Ocean app.
const init = require('./init.jsx');
init.initialize(() => {
// start the App
require('./main.jsx');
});
} catch (e) {
console.error('Error starting Blue Ocean.', e);
}
|
import Entity, { printMessage, action, time, state } from "Entity";
function formatMoney(amount) {
return amount.toFixed(2);
}
export class Till extends Entity {
name() {
return 'till'
}
actions() {
return [
action(
"Look.",
() => {
printMessage(`There is $${formatMone... |
const cppIsPalindrome = require('palindrome');
const PALINDROME_IMPL = {
/**
* c++ palindrome approach
*
* Third party MIT library
* https://github.com/zzarcon/palindrome
*
* Forked to add some tests :)
* https://github.com/seriousben/palindrome/tree/add-tests
*
* It ignores spaces
*/
... |
import React, { Component } from 'react'
import * as R from 'ramda'
import { connect } from 'react-redux'
import { compose, mapProps, setDisplayName } from 'recompose'
import { StyleSheet, View, FlatList } from 'react-native'
import { getEditingProductsIds } from 'Coopcon/data/order/selectors'
import Product from './co... |
import gulp from 'gulp';
import del from 'del';
import args from './util/args';
gulp.task('clean', ()=>{
return del(['server/public', 'server/views'])
});
|
/*
*
* Copyright (c) 2006-2011 Sam Collett (http://www.texotela.co.uk)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Version 1.3.1
* Demo: http://www.texotela.co.uk/code/jquery/numeric/
*
*/
(func... |
$.fn.ajaxGetLink = function(target){
var collection = this;
this.each(function(){
$(this).click(function(){
target.load( this.href );
return false;
})
});
}
$.fn.ajaxForm = function(){
this.unbind('submit').submit(function(){
data = $(this).serializeArray();
$.post(this.action, data... |
function triggerCancelEvent(curThis, value) {
$(curThis).html(value);
$(curThis).removeClass('isActive');
$(curThis).click(function(e2) { hasClicked(this, e2); });
}
function triggerSaveEvent(curThis, newValue) {
$(curThis).html($(curThis).find('input')).append($('<img src="/load.gif" class="loader" />'));
... |
var bignum = require('bignum');
var prime_size = 128;
function pq() {
var p = bignum.prime(prime_size);
var q = bignum.prime(prime_size);
this.p = p;
this.q = q;
this.pq = p.mul(q);
this.t = p.sub(1).mul(q.sub(1));
}
var a = new pq();
var b = new pq();
var c = new pq();
var d = new pq();
var N ... |
// BACKUP OF THIS FILE IS CALLED: AdsInclude-050114.js
// this entire file will be deleted after 050514
// contents stripped out on 050214
|
var config;
if(process.argv.length == 2){
config = require("cson").load("config.cson");
} else {
config = require("cson").load(process.argv[2]);
}
var TutorServer = require("@tutor/server");
var express = require("express");
config.modules = []
var restAPI = null;
var startServer = function(restAPI){
// load ... |
/**
* @namespace Utils classes and functions.
*/
dwv.utils = dwv.utils || {};
/**
* @function Capitalise the first letter of a string.
*/
dwv.utils.capitaliseFirstLetter = function(string)
{
return string.charAt(0).toUpperCase() + string.slice(1);
};
/**
* @function Clean string.
*/
dwv.utils.cleanString = ... |
/*!
* Mowe Gallery v1.0.0 (http://letsmowe.org/)
* Copyright 2013-2015 Noibe Developers
* Licensed under MIT (https://github.com/noibe/villa/blob/master/LICENSE)
*/
var main = document.getElementById('main');
var hero = document.getElementById('hero-gallery');
var gallerySlides = document.getElementById('hero-gall... |
'use strict';
// Utilities:
var angular = window.angular;
// Dependencies:
require('../Search/Search');
require('../../Core/Core');
var ControlPanel = angular.module('ControlPanel', ['Core', 'Search']);
module.exports = ControlPanel;
|
module.exports = {
init: function( req, res ) {
dc = require( './dCore' );
nsmarty = require( 'nsmarty' );
var route = cur_route;
if ( cur_route === 'home' ) {
route = ''
}
var templates = [];
/* clear cache */
nsmarty.clearCache('./master.tpl');
/* Get route templates */
dc.get... |
/*
*
* enabled on flag 'enable_idle_timeout'
* js script is only loaded when the flag is enabled
*
*/
// 600,000ms = 10 minutes
var timeoutLength = 600000;
var pretimeoutLength = 300000;
var timeoutTimer = setTimeout(runtimeout, timeoutLength);
var pretimeoutTimer = setTimeout(preruntimeout, pretimeoutLength);
$("bo... |
import React, { Component, PropTypes } from 'react';
import styles from '../styles';
function Prompt (props) {
return (
<div className="jumbotron col-sm-6 col-sm-offset-3 text-center" style={styles.transparentBg}>
<h1>{props.header}</h1>
<div className="col-sm-12">
<form onSubmit={props.onSub... |
/*global define, setTimeout, console*/
define([
'scalejs!core',
'./appbarBindings',
'text!./appbar.html',
'knockout',
'scalejs.mvvm'
], function (
core,
appbarBindings,
appbarViews,
ko
) {
'use strict';
var registerBindings = core.mvvm.registerBindings,
... |
export const ic_sync_disabled_twotone = {"viewBox":"0 0 24 24","children":[{"name":"path","attribs":{"d":"M0 0h24v24H0V0zm0 0h24v24H0V0z","fill":"none"},"children":[]},{"name":"path","attribs":{"d":"M10 6.35V4.26c-.66.17-1.29.43-1.88.75l1.5 1.5c.13-.05.25-.11.38-.16zM20 12c0-2.21-.91-4.2-2.36-5.64L20 4h-6v6l2.24-2.24C1... |
import { BaseTool } from './BaseTool';
import globals from '../globals'
export class FillTool extends BaseTool {
constructor(ctx) {
super(ctx)
}
draw(pos, color) {
this.ctx.fillStyle = color
this.ctx.fillRect(pos.x, pos.y,1,1);
}
onLeftMouseDown(pos) {
this.startColor = this.ctx.getImageData(... |
module.exports.readFile = function(filepath) {
return ['cat', filepath];
};
module.exports.scanWiFi = function() {
return ['iwinfo', 'wlan0', 'scan'];
};
module.exports.getWifiInfo = function() {
return ['ubus', 'call', 'iwinfo', 'info', '{"device":"wlan0"}'];
};
module.exports.getIPAddress = function() {
retur... |
/*! bootmetro 2013-09-07 */
/*!
* jQuery Charms Plugin
* Original author: @aozora
* Licensed under the MIT license
*/
(function($, window, document, undefined){
// undefined is used here as the undefined global
// variable in ECMAScript 3 and is mutable (i.e. it can
// be changed by someone else). undefi... |
// Tuneshuffle datastore module
const constants = require('./constants'),
uuid = require('uuid'),
DataStore = require('nedb'),
users = new DataStore({
filename: `${constants.DB.DATA_DIR}/${constants.DB.COLLECTIONS.USER}`,
autoload: true
}),
tracks = new DataStore({
filename:... |
Package.describe({
summary: 'Accounts Templates styled for Twitter Bootstrap.',
version: '1.12.4',
name: 'kevbuk:useraccounts-bootstrap',
git: 'https://github.com/kevb/bootstrap.git',
});
Package.on_use(function(api, where) {
api.versionsFrom('METEOR@1.0');
api.use([
'templating',
'underscore',
... |
"use strict";
var should = require('should');
var V4Validator = require('../../src/factory')();
describe('max', function() {
it('should not pass without the max argument', function (done) {
var data = {
field_1: 'hello',
field_2: 5,
field_3: ['hello', 'hey', 'hi', 'yo'... |
var searchData=
[
['readme',['README',['../md__d_1__g_i_t__the_connected_m_c_u__labs_bkarachok_lab5__s_p_i__o_l_e_d__r_e_a_d_m_e.html',1,'']]],
['readme_2emd',['README.md',['../_r_e_a_d_m_e_8md.html',1,'']]],
['rgbfillpat',['rgbFillPat',['../_fill_pat_8c.html#a651dbe94e170632c5ecae14a3874c5a3',1,'rgbFillPat():... |
//! moment.js locale configuration
//! locale : german (de)
//! author : lluchs : https://github.com/lluchs
//! author: Menelion Elensúle: https://github.com/Oire
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :
typeof define === 'function... |
import axios from 'axios'
import { Message } from 'element-ui'
import store from '@/store'
import { getToken } from '@/utils/auth'
// 创建axios实例
const service = axios.create({
baseURL: process.env.BASE_API, // api的base_url
timeout: 5000 // 请求超时时间
})
// request拦截器
service.interceptors.request.use(config => {
// D... |
'use strict';
const { Router } = require('express');
const router = Router();
router.use(require('./restaurantRoute'));
router.use(require('./userRoute'));
router.use(require('./reviewRoute'))
router.get('/', (req, res)=> {
res.json({
"title": "Similar Tastes Nashville API",
"restaurants": "https://simil... |
const expect = require('chai').expect;
const destroy = require('../../lib/destroy').bind(null, function (data) {
return data;
});
describe('#destroy', function () {
it('should return data and code 204', function () {
var output = destroy({});
expect(output.code).to.equal('204');
expect(output.data).t... |
import { GroupLayer } from '../layers/GroupLayer'
import { copyDeep } from '../utilitiesObject'
import { Debug } from '../Debug'
import { LayerFactory } from './LayerFactory'
import { Attributions } from '../Attributions'
/**
* @typedef {object} LayerConfig
* @property {object.<string, ButtonConfig>} menus
* @prope... |
/**
* React Starter Kit for Firebase
* https://github.com/kriasoft/react-firebase-starter
* Copyright (c) 2015-present Kriasoft | MIT License
*/
let count = 0;
const listeners = new Set();
let notification;
export default {
listen(cb) {
listeners.add(cb);
return () => listeners.delete(cb);
},
notif... |
(function() {
var restangular = angular.module('restangular', []);
restangular.provider('Restangular', function() {
// Configuration
var Configurer = {};
Configurer.init = function(object, config) {
object.configuration = config;
/**
* Those are HTTP safe methods for which there is no need to pass... |
(function ($) {
"use strict";
$.fn.tautocomplete = function (options, callback) {
// default parameters
var settings = $.extend({
width: "500px",
columns: [],
onchange: null,
norecord: "No Records Found",
dataproperty: null,
... |
/*!
* Jaspe
* Copyright(c) 2017 - 2018 Quentin SAIEB
* MIT Licensed
*/
'use strict'
function parallel (tasks, callback) {
let index = 0
let completed = 0
let results = {}
const errors = []
const length = tasks.length
if (length === 0) {
callback(null)
}
while (index < length) {
tasks[ind... |
import React from 'react'
import { action as MetaAction, AppLoader } from 'mk-meta-engine'
import config from './config'
import utils from 'mk-utils'
import { fromJS } from 'immutable'
import extend from './extend'
class action {
constructor(option) {
this.metaAction = option.metaAction
this.extend... |
/*global KhanUtil */
"use strict";
var av, // The JSAV object
answerArr = [], // The (internal) array that stores the correct answer
cloneArr = [], // Copy of (internal) array at start of exercise for reset
jsavArr, // The array that the user manipulates (JSAV object)
currArr, ... |
/* eslint-disable max-classes-per-file */
const pagination = require('./library/pagination');
const symPrivate = Symbol('dp-node.private');
class Finisher {
constructor(controller) {
this[symPrivate] = controller;
}
notfound(body) {
return this[symPrivate].finishWithCode(404, body);
}
invalid(body)... |
$(document).ready(function(){
$( ".left-bar" ).click(function() {
$( "#left-contet" ).animate({
left: "+=50",
height: "toggle"
}, 5000, function() {.
});
});
});
|
// Set the require.js configuration for your application.
require.config({
// Initialize the application with the main application file.
deps: ['app'],
paths: {
// JavaScript folders.
plugins: 'js/plugins',
// Libraries.
'jquery': '../resources/vendor/jquery/dist/jquery',
'handlebars': '../... |
var sp = require('../lib/libspotify');
var testutil = require('./util');
var session = null;
exports.links = {
setUp: function(cb) {
testutil.getDefaultTestSession(function(s) {
session = s;
cb();
});
},
'track link from search': function(test) {
var search ... |
Meteor.methods({
newFollowerNotification: function (followingId) { // initiated by the follower
check(followingId, String);
var follower = Meteor.user();
if (!follower) return;
var notificationData = {
follower: { '_id': follower._id, 'name': follower.profile.name }
};
// notify user ... |
IntlMessageFormat.__addLocaleData({locale:"haw",pluralRuleFunction:function(a,e){return e?"other":1==a?"one":"other"}}); |
angular.module('HomepageModule', ['ngMaterial', 'mdColorPicker', 'ngAnimate']);
|
'use strict';
var _phantom = require('./phantom');
var _phantom2 = _interopRequireDefault(_phantom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports.create = function (args) {
return Promise.resolve(new _phantom2.default(args));
}; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.