code stringlengths 2 1.05M |
|---|
// load the configuration settings
var config = require('./config');
var self = {};
// the log singleton
var logObject = function() {
if ( logObject.prototype._singletonInstance ) {
return logObject.prototype._singletonInstance;
}
logObject.prototype._singletonInstance = this;
self = this;
... |
import * as Constants from '../constants';
export default function(parent, startVertex, endVertex) {
const startCoord = startVertex.geometry.coordinates;
const endCoord = endVertex.geometry.coordinates;
// If a coordinate exceeds the projection, we can't calculate a midpoint,
// so run away
if (startCoord[1... |
// not actually mocking wotblitz; providing a single instance, mimicking the bot code
const wotblitz = require('wotblitz')();
exports.commands = {
client: {
user: {
id: '0101',
username: 'testbot'
}
},
wotblitz: wotblitz
};
exports.createMessage = function(content, author, mentions) {
if (mentions && !(... |
'use strict';
module.exports = geojsonvt;
var convert = require('./convert'), // GeoJSON conversion and preprocessing
transform = require('./transform'), // coordinate transformation
clip = require('./clip'), // stripe clipping algorithm
wrap = require('./wrap'), // date line proce... |
'use strict';
var Trunc = require('lodash.trunc');
function capture(fn) {
var oldLog = console.log;
var oldWarn = console.warn;
var oldError = console.error;
console.log = function() {
fn('log', arguments);
oldLog.apply(console, arguments);
};
console.warn = function() {
... |
function sanitize(string) {
return string.replace(/[^\x00-\xFFF]|[\r\n]/g, '');
}
module.exports = sanitize;
|
var qunit = require("qunit");
homebridge = require("../../node_modules/homebridge/lib/api.js");
qunit.options.coverage = { dir: "/tmp/" };
qunit.run({
code : "index.js",
tests : [
'switchBinary',
'issue-48.js',
'issue-69.js',
'issue-72.js',
'issue-70.js',
'update-without-change.js'
].map... |
var HashTree = require('../../lib/hash-tree'),
path = require('path');
describe('Hash Tree', function() {
it('computes hashes', function( done ) {
HashTree(path.resolve(__dirname, '../')).computeHashes(function( err, nodes ) {
if (err) {
return done(err);
}
assert.property(nodes, 'un... |
/// <reference path="typings/tsd.d.ts"/>
var through = require('through');
var DependencyResolver = require('dependency-resolver');
var path = require('path');
function getFileReferences(contents) {
var regex = 'reference path="(.+)"';
var matches = contents.match(new RegExp(regex, 'g'));
if (!matches) {
... |
const os = require("os")
module.exports = {
args: [
{name: "name", message: "The source file's name"},
],
files: ({name}) => [
{
name: `${name}.c`,
content: ``
},
{
name: `${name}.h`,
content: `
#ifndef ${name.const... |
'use strict';
module.exports = function(config) {
config.set({
files: [
'https://code.jquery.com/jquery-3.1.1.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-route.min.js',
'https://cdnjs.c... |
import parent from '../render/dom/parent'
import { property } from '../render/static'
const injectable = {}
export default injectable
if (typeof window === 'undefined') {
Object.defineProperty(global.Element.prototype, 'value', {
configurable: true,
get () { return this.getAttribute('value') },
set (va... |
import { ipcRenderer } from 'electron'
import {
ADD_REQUEST,
ADD_RESPONSE,
UPDATE_FILTER,
GET_HTTP_MESSAGE_DETAILS_SUCCESS,
TOGGLE_FILTER_INPUT
} from '../../constants/actionTypes'
import {
REQUEST_HTTP_MESSAGE_DETAILS,
HTTP_MESSAGE_DETAILS,
HTTP_MESSAGE_REQUEST,
REQUEST_HTTP_MESSAGE_REQUEST
} from '.... |
var glob = require('glob')
module.exports = function globTests() {
return glob.sync('./test/spec/**/*.spec.{js,jsx}')
}
|
'use strict'
var _url = document.createElement('a')
module.exports = function (url) {
_url.href = url
return {
hash: _url.hash,
href: _url.href,
urlpath: _url.pathname,
search: _url.search,
host: _url.hostname,
port: _url.port
}
}
|
var eos = require('end-of-stream')
module.exports = each
function each (stream, fn, cb) {
var waiting = false
var error = null
var ended = false
stream.on('readable', onreadable)
read(null)
if (cb) eos(stream, {readable: true, writable: false}, done)
return stream
function done (err) {
error = e... |
const readline = require('readline');
const Spinner = function (text = '%s') {
if ('string' == typeof text) {
text = { text };
}
this._text = text.text || '';
this._list = text.spinners || function (
spin = (t) => ['|', '/', '-', '\\'][t % 4], list = []
) {
for (let n = 0; n ... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tiles = void 0;
var tile_size_1 = require("./tile-size");
var tile_sizes_1 = require("./tile-sizes");
var Tiles = /** @class */ (function () {
function Tiles() {
// #region Properties
this.showTiles = true;
... |
function getTypes (types) {
return function (raw) {
return types[raw.type]
}
}
module.exports = getTypes
|
'use strict'
let gulp = require("gulp");
let sourcemaps = require("gulp-sourcemaps");
let babel = require("gulp-babel");
let watch = require('gulp-watch');
let changed = require('gulp-changed');
let nodemon = require('gulp-nodemon');
let plumber = require('gulp-plumber');
let path = require('path');
let demon;
gulp.... |
'use strict';
/**
* Returns the result of applying concat to the result of applying a function to values.
*
* @param {array} vals - an array of values
* @param {function} fn
* @param {object} ctx
*
* @return {array}
*/
module.exports = function mapconcat(vals, fn, ctx) {
return Array.prototype.concat.apply([... |
export const ADD_REQUEST = 'ADD_REQUEST'
export const ADD_RESPONSE = 'ADD_RESPONSE'
export const GET_HTTP_MESSAGE_DETAILS_SUCCESS = 'GET_HTTP_MESSAGE_DETAILS_SUCCESS'
export const UPDATE_FILTER = 'UPDATE_FILTER'
export const TOGGLE_FILTER_INPUT = 'TOGGLE_FILTER_INPUT'
|
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import "../css/app.css"
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import deps wit... |
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var eslint = require('gulp-eslint');
var istanbul = require('gulp-istanbul');
var formatter = require('eslint-friendly-formatter');
var lint = ['gulpfile.js', 'index.js', 'utils.js'];
gulp.task('coverage', function() {
return gulp.src(lint.concat(['!gul... |
/**
* 分类栏条目
*/
import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import { Link } from 'react-router';
export default class CategoryBar extends Component {
render(){
const { text , active , link ,...other } = this.props;
return (
<li {...other}>
... |
/* Project architecture can be changed if the project grows - instead of using 'type' oriented
* architecture, i.e. to have directories such as 'controllers', 'services' etc.,
* we can use 'feature' oriented structure, where each feature has its own
* directory with all the needed components, e.g. feature for 'login... |
version https://git-lfs.github.com/spec/v1
oid sha256:8e85cd0bba914ed57ac03ce72804dbe6e83dbef37296bdcacb969c811c7aeecd
size 1568
|
//getter methods
console.log("Syntax: ");
console.log("The get syntax binds an object property \n to a function that will be called when that property is looked up.");
console.log("{get prop() { ... } }");
console.log("{get [expression]() { ... } }");
// prop: The name of the property to bind to the given function.
/... |
const AstNode = require('./ast-node');
class ForLoopBodyWithValue extends AstNode {
type() {
return 'for_loop_body_with_value';
}
/**
* @param {ParseContext} context
* @return {AstNodeParseResult}
*/
parse(context) {
const tm = context.sourceTextManager();
tm.whitespace();
const v = ... |
// task browserSync
const gulp = require('gulp');
const config = require('../gulp.config');
const path = require('path');
const browserSync = require('browser-sync').create();
const browserSyncTask = () => {
browserSync.init(config.tasks.browserSync);
let watchableTasks = [
'scripts',
'html',
... |
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'YouTube',
prepareImgLinks:function (callback) {
var res = [],
repl = 'http://i1.ytimg.com/vi/$1/0.jpg';
function decodeQueryString(queryString) {
var keyValPairs = queryString.split("&"), param... |
import _ from 'lodash'
export const composite = (commands) => {
if (!Array.isArray(commands)) { return commands; }
if (commands.length === 1) { return commands[0]; }
return {
'composite': _.chain(commands).reduce((o, v, idx) => { o[idx] = v; return o; }, {}).value()
};
};
export const addElement = (json) ... |
const Program = require('../models/Program'),
Campus = require('../models/Campus'),
fixtures = require('node-mongoose-fixtures');
/**
* GET /
* Home page.
*/
exports.index = (req, res) => {
//load programs
Program.find({}, (err, programs) => {
if(err) return console.error(err);
res.render('home... |
var relationsMapper = require('./map_relations');
var Promise = require('bluebird');
var DEFAULT_LIST_RELATIONS = require('./constants').LIST_RELATIONS;
var DEFAULT_ITEM_LIST = require('./constants').ITEM_TYPE_LIST;
var SAMPLE_DATA = require('./data-demo');
var CLOUD_TOPIC_PREFIX = require('./topics_constants').CLOU... |
'use strict';
var fs = require('fs'),
request = require('request'),
wikiParser = require('./wikiparser'),
_ = require('lodash');
var fns = {
getSlugNameFor: function(str) {
var slug = str.replace(/\s+/g, '-').toLowerCase();
return slug;
},
extendWithJSONs: function(series) {
for (var se... |
'use strict';
const _ = require('lodash');
const Parse = require('../lib/parse');
const Account = Parse.Object.extend('account');
const querystring = require('querystring');
module.exports = app => {
/**
* 用户相关
*/
class UserService extends app.Service {
constructor(ctx) {
super(ctx);
t... |
/*
* The MIT License (MIT)
* Copyright (c) 2016 Jim Liu
*
* 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, modify... |
var log = console.log
, Alice = require( '../' )
, ed = Alice()
, path = null
;
// same edge
ed.add( 1, 2 );
ed.add( 2, 1, true );
ed.add( 1, 2, true );
// vertex loop
ed.add( 2, 2 );
ed.cut( 2, 2 );
// same edge
ed.add( 2, 1, true );
ed.cut( 1, 2 );
ed.add( 1, 2 );
ed.cut( 2, 1 );
// add some edges... |
(function () {
'use strict';
var $$compile = null,
$$rootScope = null,
scope = null;
describe('minItems validation directive', function () {
beforeEach(function () {
module('dynamic-forms');
inject(function ($compile, $rootScope) {
$$rootSc... |
'use strict';
/**
* Scales an image or video to fill the screen in one dimension, preserving its
* aspect ratio.
*
* Serves as a polyfill for the CSS object-fit: contain property if it is not
* supported (mostly for IE).
*
* Should be applied to an <img> or <video> tag or a <div ng-bind-html> that
* will load ... |
(function(module){
'use strict';
//this comment set up here to turn off eslint warnings about unused vars
/*global issues issueView helpers d3Chart:true*/
//set up constructor for easier use of data
function RepoIssue (opts){
this.repoOwner = opts.html_url.split('/')[3];
this.repoName = opts.html_... |
import { combineReducers } from 'redux';
import graph from './graph';
export default combineReducers({
graph
});
|
const PlotCard = require('../../plotcard');
const GameActions = require('../../GameActions');
class ThePrinceWhoCameTooLate extends PlotCard {
setupCardAbilities(ability) {
this.action({
title: 'Search your deck',
phase: 'standing',
handler: context => {
... |
/**
* A simple styled li element
*/
import styled from 'styled-components';
const Li = styled.li`
`;
export default Li;
|
/**
* Async is a utility module which provides straight-forward, powerful functions
* for working with asynchronous JavaScript. Although originally designed for
* use with [Node.js](http://nodejs.org) and installable via
* `npm install --save async`, it can also be used directly in the browser.
* @module async
*/... |
!function(a){"function"==typeof define&&define.amd?define(a):a()}(function(){var a="";return window.location.origin||(""!==window.location.port&&(a=":"),window.location.origin=window.location.protocol+"//"+window.location.hostname+a+window.location.port),{}}); |
var http = require("http").createServer(handler); // handler will be the function with req, res as in previous example, just separated
var io = require("socket.io").listen(http); // socket.io for permanent connection between server and client
var fs = require("fs"); // variable fo "file system", i.e. fs
var firmata = r... |
var gulp = require('gulp');
var phpspec = require('gulp-phpspec');
var run = require('gulp-run');
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');
gulp.task('test', function() {
gulp.src('spec/**/*.php')
.pipe(run('clear'))
.pipe(phpspec('', { 'verbose': 'v', notify: true... |
export const selectGallery = (gallery) => ({
type: 'SELECT_GALLERY',
gallery
})
|
// moment.js locale configuration
// locale : tibetan (bo)
// author : Thupten N. Chakrishar : https://github.com/vajradog
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['../moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = fa... |
/**
* Created by JinWYP on 7/27/16.
*/
var expect = require('chai').expect;
var colorConverter = require('../../../business-libs/colorConverter');
describe('Color Code Converter', function() {
describe('RGB to Hex conversion', function() {
it('converts the basic colors', function() {
va... |
/*jslint node: true*/
/*jslint nomen: true*/
"use strict";
var
React = require('react'),
ActionBindingMixin = require('../mixins/ActionBindingMixin'),
serialize = require('form-serialize');
module.exports = React.createClass({
mixins: [ActionBindingMixin],
render: function () {
return React.createEle... |
var Easel = require('easel');
var app = new Easel();
app.server.start();
|
/* eslint-env mocha, jest */
import getActualComponentFactory from '../../lib/testUtils';
import Task from '../Task';
const defaultProps = {
index: 0,
color: 'red',
text: 'a cool task',
estimation: '60',
due: '',
repeat: '',
done: false,
onRequestDo() {},
onRequestDelete() {},
onRequestSnackbar() ... |
import React from 'react'
import { ScrollView, StyleSheet, View } from 'react-native'
import { Video as ExpoVideo } from 'expo'
import VideoPlayer from '@expo/videoplayer'
import { Ionicons } from '@expo/vector-icons'
import PropTypes from 'prop-types'
import { Colors } from 'constants'
const styles = StyleSheet.crea... |
import Ember from 'ember';
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import page from '../../../pages/components/kinetic-form/radios';
import sinon from 'sinon';
const { run, set, get } = Ember;
moduleForComponent('kinetic-form/radios', 'Integration | Compon... |
// Copyright 2012 Ofir Picazo. All Rights Reserved.
/**
* @fileoverview Foundation object, fill one per suit to complete the game.
*
* @author ofirpicazo@gmail.com (Ofir Picazo)
*/
goog.provide('solitario.game.Foundation');
goog.require('goog.dom.dataset');
goog.require('solitario.game.Card');
goog.require('soli... |
(function() {
"use strict";
define(
function() {
var interactiveToolConfig = new function() {
var self = this;
//This is the default value for the textbox that holds the value of the number of units to buffer in the buffering tool
self.def... |
module.exports.generator = function () {
// This should return a new bite code in the form of a String
}
|
export const encodeArrayForUrl = (values) => {
const encodedValues = values.map(encodeURIComponent)
return encodedValues.join(',')
}
export const getArrayFromUrlParam = (urlParam) => {
const encodedValues = urlParam.split(',')
return encodedValues.map(decodeURIComponent)
}
export const buildQueryForUrl = (fil... |
import defaultCardConfig from '../defaultCardConfig';
/**
* Maps room to limited set of properties for export (room as file download).
*
* @param room
* @return {undefined|{stories: *, exportedAt: number, roomId}}
*/
export function mapRoomExportDto(room) {
if (!room) {
return undefined;
}
return {
... |
//9.2.1
//Pseudocode -------------------------------------------
//create function to make a new list,
// that takes a string and split it and create a object with the splited words
//go through each element inside the object
//display the list
//create a function that adds an item with quantity to the list.
//if the ... |
import chalk from 'chalk'
import moment from 'moment'
import Table from 'cli-table'
import bugger from 'debug'
const debug = bugger('todo:util')
/**
* Format console.log calls for readability and structure
* @param {String} data message to be logged
*/
function log(data) {
let time = moment().format('MM/DD hh:m... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.8/esri/copyright.txt for details.
//>>built
define(["require","exports","../2d/engine/webgl/Geometry","./GeometryUtils"],function(m,n,p,r){Object.defineProperty(n,"__esModule",{value:!0});m=function(){functio... |
import React from 'react'
import { filter, get } from 'lodash'
import utils from '~/utils'
import Filter from '~/components/filter/Filter'
import InfiniteScroll from '~/components/infinite-scroll/InfiniteScroll'
import RepositoryCard from '~/components/repository-list/repository-card/RepositoryCard'
/**
* The Reposit... |
module.exports = {
push: {
options: {
recursive: true,
src: '<%= vars.wplocal %>',
dest: '<%= vars.wpremote %>',
host: 'n72f3258732714@p3nlpaas001.shr.prod.phx3.secureserver.net',
delete: true,
exclude: [
'node_modules',
'.gitignore',
'grunt',
'.git',
'gruntfile.js',
'.DS_S... |
exports.seed = function(knex, Promise) {
return knex('users')
.del()
.then(function() {
// Inserts seed entries
return knex('users').insert([
{
id: 1,
first_name: 'Steve',
last_name: 'Morse',
email: 'steve@gmail.com',
hashed_password:
... |
"use strict";
let ImageVol = require('./ImageVol');
const DEFAULTS = {
// declare size of input
// output Vol is of size 128x128x4 here
input: {
type: 'input',
out_sx: 128,
out_sy: 128,
out_depth: 4
},
conv: [
// the first layer will perform convolution with 16 kernels, each of size ... |
function StrUtils(stdlib, ffi, heap){
"use asm";
var buffer = new stdlib.Uint16Array(heap);
var log = ffi.log;
function strlen(){
var i = 0;
var length = 0;
while(buffer[i << 1 >> 1] | 0 != 0){
log((i | 0) >> 0);
log((buffer[i << 1 >> 1] | 0) >> 0 );
i = ((i + 1) | 0);
... |
import { merge, omit } from 'lodash'
export { account } from './account'
export { files } from './files'
export { projects } from './projects'
// Updates an entity cache in response to any action with response.entities.
export function entities (state = { users: {}, projects: {} }, action) {
if (action.response && a... |
function editCustomer(router,connection){
var self=this;
self.handleRoutes(router,connection);
}
editCustomer.prototype.handleRoutes = function(router,connection){
router.post('/editCustomer',function(req,res){
var sessionCode = req.body.sessionCode;
var idCustomer = req.body.idCustomer;
var name = r... |
const array = [1, 42, 7, 9, 13, 10, 20, 35, 45, -7, -3, 0, 4, -1, 15];
Array.prototype.find = function(isOk) {
const len = this.length;
for(let i = 0; i < len; i += 1) {
if(isOk(this[i], i, this)) {
return this[i];
}
}
}
Array.prototype.findIndex = function(isOk) {
const len = this.l... |
module.exports = function resolve(vector) {
if (Array.isArray(vector.direction)) {
var dimensions = vector.direction.length + 1
var result = new Array(dimensions)
for (var dimension = 1; dimension <= dimensions; dimension++) {
var axis = vector.magnitude
for (var i = 1; i <= dimension; i++) {
... |
'use strict';
const reactions = require('./reactions.js');
class Rule {
constructor(expression, reaction) {
this.expression = expression;
this.reaction = reaction;
}
}
class Rules {
constructor() {
this.rules = [];
}
add(rule) {
this.rules.push(rule);
}
length() {
return this.rule... |
/* @flow */
import React from 'react'
export function withDOM<T>(cb: (el: Element) => T): T {
var div = document.createElement('div')
document.body.appendChild(div)
var result = cb(div)
document.body.removeChild(div)
return result
}
export function cleanHtml(html: string): string {
return html.replace(/... |
var path = require('path');
var EventEmitterPrototype = require('events').EventEmitter.prototype;
var colors = require('colors');
var utils = require('./utils');
var extend = utils.extend;
var dateFormat = utils.dateFormat;
var pagerun = {};
pagerun.mode = 'product'; // default mode: product (product | test | debug)
... |
/* Set the defaults for DataTables initialisation */
$.extend( true, $.fn.dataTable.defaults, {
"sDom": "<'row'<'col-sm-12'<'pull-right'f><'pull-left'l>r<'clearfix'>>>t<'row'<'col-sm-12'<'pull-left'i><'pull-right'p><'clearfix'>>>",
"sPaginationType": "bs_normal",
"oLanguage": {
"sLengthMenu": "Show _ME... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fetchPushCertificates = exports.ensureAppId = exports.fetchAppleCertificates = exports.validateCredentialsForPlatform = exports.removeCredentialsForPlatform = exports.updateCredentialsForPlatform = exports.getCredentialsForPlatform ... |
var test = require('tape');
var sinon = require('sinon');
var consts = require('../src/constants');
var playerSync = require('../src/playerSync/controller');
var THREE = require('three');
var testId = 'id1';
var testId2 = 'id2';
var initialPosition = consts.playerSync.AVATAR_INITIAL_POSITION;
var initialPositionVector... |
import React from "react"
import Header from "../components/Header"
import Button from "../components/Button"
import { Div, P, Span } from "../components/Base"
import Img from "../images/Hangout"
import Layout from "../components/Layout"
export default function Meetings() {
return (
<Layout
pageTitle="Meet... |
import React from 'react'
export default React.createClass ({
render() {
return (
<span>
<h2> {this.props.name} </h2>
</span>
)
}
})
|
"use strict";
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const userSchema = new Schema({
/*
* The UTC datetime that the user account was created on Twitter.
*
* Example: "created_at": "Mon Nov 29 21:18:15 +0000 2010"
*/
created_at: String,
/*
* When tru... |
'use strict';
module.exports = {
app: {
title: 'FrogBan',
description: 'A KanBan system for FogBugz using MeanJS',
keywords: 'KanBan, FogBugz, MeanJS'
},
port: process.env.PORT || 3000,
templateEngine: 'swig',
sessionSecret: 'MEAN',
sessionCollection: 'sessions',
assets: {
lib: {
css: [
'public/l... |
(function (ang) {
var app = ang.module('app');
app.config(function ($resourcesProvider, $stateProvider, $urlRouterProvider) {
// Resources
$resourcesProvider.init({
resources: {
Users: {
route: '/api/v1/users/:userId?:query'
},
Logout: {
route: '/auth/v1/logout'
}
}
... |
import React, { Component } from 'react';
import './App.css';
import Articles from './components/Articles';
class App extends Component {
constructor(props) {
super(props)
this.state = {sortOrder: "VOTES"}
}
handleTopClick = () => {
this.setState({sortOrder: "VOTES"})
}
handleNewestClick = ()... |
'use strict';
const SwiftTransformStream = require('swift-transform').Transform;
const pTry = require('p-try');
class IteratorCallerStream extends SwiftTransformStream {
constructor(iterator, concurrency) {
super({ objectMode: true, concurrency });
this._iterator = iterator;
this._count =... |
// preview and play in JSBin - http://jsbin.com/aviyuf/edit#source
//loggging for JSBin
var log = function(msg){
if (document.getElementById('log')) {
document.getElementById('log').innerHTML = document.getElementById('log').innerHTML + "<br/>" + msg;
}
};
/* helper functions */
var getProp = function(prop... |
/* jshint esversion: 6, mocha: true, node: true */
'use strict';
const utils = require('../lib/utils');
const Promise = require('bluebird');
const assert = require('assert');
const avro = require('avsc');
suite('utils', function () {
suite('promisify', function () {
const svc = avro.Service.forProtocol({
... |
ActiveNavigation = {
bootstrap: function() {
this.create_main_menu();
this.create_sub_menus();
this.attach_events();
},
create_main_menu: function() {
chrome.contextMenus.removeAll();
chrome.contextMenus.create({
id: 'active_navigation_content_menu',
title: 'Active Navigation',
contexts: ['page']
... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import classnames from 'classnames';
import styleShape from 'react-style-proptype';
import { themr } from 'react-css-themr';
import { round, range } from '../utils/utils';
import { SLIDER } from '../identifie... |
/**
* @file Option
*
* @author Leo Wang(leowang721@gmail.com)
*/
var _ = require('lodash');
var React = require('react-native');
var {
PickerIOS,
View,
Text,
TouchableOpacity,
} = React;
var FormElement = require('./FormElement');
var ICON = {
checkbox: '□▣',
radio: '○◉'
};
var styles =... |
class ehstorshell_ehstorfolder_1 {
constructor() {
}
// System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
CreateObjRef() {
}
// bool Equals(System.Object obj)
Equals() {
}
// int GetHashCode()
GetHashCode() {
}
// System.Object GetLifetimeService()
... |
IonicBBS.controller("LoginCtrl",function($scope,$rootScope){
console.log("app..");
//表单部分
$scope.fm = {
// userName : "",
// passWord : ""
}
$scope.login = function(){
console.log("login...");
}
}); |
/**
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var numConstants = require('../../constants/numerical');
var BADNUM = numConstants.BADNUM;
var LOG_CLIP = numCo... |
/**
* class InteractiveBehavior < Behavior
*
* `Physics.behavior('interactive')`.
*
* User interaction helper.
*
* Used to get mouse/touch events and add a mouse grab interaction.
*
* Additional options include:
* - el: The element of the renderer. What you input as the `el` for the renderer.
* - moveThrottl... |
/**
* meta 配置
* hidden=true表示在导航上默认不展示
* requiresAuth=true 表示需要身份验证即需要登录
* scrollTop=true 切换路由时,页面滚动到顶部,默认是true
* type: resource/node 对应的侧边栏
*/
import Vue from 'vue'
import Router from 'vue-router'
import Views from '@/views/index'
import store from '../store'
import nodeRoute from './node'
import resourceRoute f... |
export const api_key = "dc6zaTOxFJmzC";
|
import {expect} from 'chai';
import formatCurrency from '../../../frontend/src/lib/format_currency';
describe('formatCurrency', () => {
it('should return $12.34', () => {
expect(formatCurrency(12.34)).to.equal('$12.34');
});
it('should return $12,345.67', () => {
expect(formatCurrency(12345.67)).to.equ... |
/*
python_runner:
Python code runner.
*/
var currentPythonContext = null;
function PythonInterpreter(context, msgCallback) {
this.context = context;
this.messageCallback = msgCallback;
this._code = '';
this._editor_filename = "<stdin>";
this.context.runner = this;
this._maxIterations = 4000;
... |
const MongoClient = require('mongodb').MongoClient;
const config = require('./../config');
const dbName = config.DB_NAME;
let currentConnection = null;
async function connect() {
if (currentConnection === null) {
currentConnection = await MongoClient.connect(config.DB_URL, {
useNewUrlParser: true,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.