code
stringlengths
2
1.05M
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2014 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * Creates a new Circle object with the center coordinate specified by the x and y parameters and the diameter specifie...
/*Write a script that allocates array of 20 integers and initializes each element by its index multiplied by 5. Print the obtained array on the console.*/ var size = 20, product = [size]; for (var i = 0; i <= size; i += 1) { product[i] = i * 5; } console.log(product.join(', '));
/** * Kegs Store. * A store for the Keg List view. */ import Immutable from 'immutable'; import { ReduceStore } from 'flux/utils'; import dispatcher from '../dispatcher'; // array of keg objects -> Immutable Map function kegsToMap(kegs = []) { return new Immutable.Map().withMutations((map) => { kegs.forEac...
import JsFile from 'JsFile'; const {Document} = JsFile; export default function b () { const el = Document.elementPrototype; el.properties.tagName = 'SPAN'; el.style.fontWeight = 'bold'; return { data: { children: [el] } }; }
module.exports = { release: { branch: 'master', }, plugins: [ '@semantic-release/npm', '@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', [ '@semantic-release/github', { assets: ['dist/**'], }, ], [ '@semantic-release/git',...
/*! * Module dependencies */ var Command = require('./util/command'), project = require('./util/project'), cordova = require('cordova'), util = require('util'); /*! * Command setup. */ module.exports = { create: function(phonegap) { return new LocalPluginListCommand(phonegap); } }; f...
function Box(id) { this.id = id; this.files = null; this.elem = document.getElementById(id); this.elem.addEventListener("dragenter", this.onDragEnter(this), false); this.elem.addEventListener("dragleave", this.onDragLeave(this), false); this.elem.addEventListener("dragover", Box.stop, false); this.elem.a...
{ "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "Unnamed: 0": 0, "Incident Number": 130900063, "Date": "03\/31\/2013", "Time": "11:18 AM", "Police District": 4.0, "Offense 1": "MOTOR VEHICLE THEFT", "...
//============================================================================= // rpg_windows.js v1.4.0 //============================================================================= //----------------------------------------------------------------------------- // Window_Base // // The superclass of all windows wit...
import { app, ipcMain } from 'electron' import { mainLog } from '@zap/utils/log' import sanitize from '@zap/utils/sanitize' /** * @class ZapController * * The ZapController class coordinates actions between the the main and renderer processes. */ class ZapController { /** * constructor - Create a new ZapContr...
import angular from 'angular'; import extractors from './extractors/extractors.module'; import model from './model/model.module'; import requests from './requests/requests.module'; import utils from './utils/utils.module'; import links from './links.srv'; import storage from './storage.srv'; import endpoints from './...
/***Generated Resource **/ var resource = require('resource'); var MedicalSpecialty = resource.define('MedicalSpecialty'); MedicalSpecialty.schema.description = "Any specific branch of medical science or practice. Medical specialities include clinical specialties that pertain to particular organ systems and their re...
/**! * * Copyright (c) 2015-2017 Cisco Systems, Inc. See LICENSE file. * @private */ export { default as default } from './node';
version https://git-lfs.github.com/spec/v1 oid sha256:4c851fce1a74f0c1c7b4c90fc5af6a0086e7f0fd7babc217f2c03f0829dc552d size 260841
var assert = require('chai').assert, GedcomX = require('../../'); describe('Attribution', function(){ it('Create plain', function(){ var newAttr = new GedcomX.Attribution(), attr = GedcomX.Attribution(); assert.instanceOf(newAttr, GedcomX.Attribution, 'An instance of Attribution is not returne...
const webpack = require('webpack'); const path = require('path'); const HWP = require('html-webpack-plugin'); const BSWP = require('browser-sync-webpack-plugin'); const NIWP = require('npm-install-webpack-plugin'); module.exports = { /* entry point */ entry: "./src/app.js", // default: ./src/app.js /* output optio...
'use strict' module.exports = { description: "A basic React component", generateReplacements(args) { let propTypes = ""; let defaultProps = ""; if(args.length) { propTypes = "__name__.propTypes = {"; defaultProps = "\n getDefaultProps() {\n return {"; for(let index in arg...
"use strict"; // exports.index = (req, res) => { // res.render('index', {message: 'hello!!'}); // }; // // exports.partials = (req, res) => { // const filename = req.params.filename; // const path = "partials/" + filename; // if(filename) res.render(path); // }; /********** **********/ const router ...
module.exports.getAnswer = function(req,res){ var Problem = require('../models/problem.js'); Problem.find({_id:req.params.id},function(err,data){ console.log(data[0].answers); res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'PATCH, DELETE...
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), errorHandler = require('./errors.server.controller'), Firebaseauth = mongoose.model('Firebaseauth'), _ = require('lodash'); /** * Create a Firebaseauth */ exports.create = function(req, res) { var firebaseauth = new Firebaseauth(r...
/** * Test async injectors */ import expect from 'expect'; import configureStore from 'store.js'; import { memoryHistory } from 'react-router'; import { put } from 'redux-saga/effects'; import { fromJS } from 'immutable'; import { injectAsyncReducer, injectAsyncSagas, getAsyncInjectors, } from 'utils/asyncInj...
define(function() { return { draw: function(context, t) { var x = this.getNumber("x", t, 100), y = this.getNumber("y", t, 100), radius = this.getNumber("radius", t, 50), startAngle = this.getNumber("startAngle", t, 0), endAngle = this.getNumber("endAngle", t, 360), drawFromCenter = this.getBo...
/** * Created by allen on 02/06/2015. */ import React from "react"; import _Store from "../../../stores/_Store"; import TaskList from "../../shared/TaskList/TaskList"; import Anchor from "../../shared/elements/Anchor.js"; const defaultProps = { title : "The super mega awesome to do list", toDoS...
module.exports = function(config){ config.set({ basePath : './', files : [ 'app/bower_components/angular/angular.js', 'app/bower_components/angular-route/angular-route.js', 'app/bower_components/angular-mocks/angular-mocks.js', 'app/components/**/*.js', 'app/services*/*.js', ...
/* * jQuery UI Selectable 1.8.18 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Selectables * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js ...
import doe from'../../_lib/doe/main/doe.mjs' import EventEmmiter from'../../_lib/EventEmmiter/main/EventEmmiter.mjs' function createFileButton(textContent='Upload'){ let e=new EventEmmiter e.n=doe.button(textContent,{onclick:async()=>{ e.emit('file',await getFile(e)) }}) return e } async functio...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var twoPI = (Math.PI * 2); var halfPI = (Math.PI * 0.5); var oneAndHalfPI = (twoPI * 0.75); /** * From which quadrant are we looking out ? * @param {number} rot * @return {IQuadrant} flags */ exports.getQuadrant = function (rot) { var ...
var webpack = require("webpack"); var config = require("./webpack.client.js"); var hostname = process.env.HOSTNAME || "localhost"; var port = 8080; config.cache = true; config.debug = true; config.devtool = "source-map"; config.entry.unshift( "webpack-dev-server/client?http://" + hostname + ":" + port, "web...
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the license found in the LICENSE file in * the root directory of this source tree. * * @flow */ import {Point} from 'atom'; import {Observable} from 'rxjs'; import { editorScrollTopDebounced, obse...
(function () { "use strict"; angular.module('ngSeApi').factory('seaUserSetting', ['SeaRequest', function seaUserSetting(SeaRequest) { var request = new SeaRequest('user/{uId}/setting'); function list(uId) { return request.get({ uId: uId ...
angular.module('starter', ['ionic', 'starter.services', 'starter.controllers']) .config(function($stateProvider, $urlRouterProvider) { // Ionic uses AngularUI Router which uses the concept of states // Learn more here: https://github.com/angular-ui/ui-router // Set up the various states w...
// Concrete Model Editor // // Copyright (c) 2010 Martin Thiede // // Concrete is freely distributable under the terms of an MIT-style license. Concrete.Clipboard = Class.create({ // if a storageElement is specified, the data is stored as textContent of this element initialize: function(storageElement) { ...
(function UMDish(name, context, definition) { context[name] = definition.call(context); if (typeof module !== "undefined" && module.exports) { module.exports = context[name]; } else if (typeof define === "function" && define.amd) { define(function reference() { return context[name]; }); } })("Primus", w...
'use strict' function BinaryHeap(orderFlag, scoring) { // Set the order flag - default to MIN this.orderFlag = BinaryHeap.MIN; if(orderFlag === BinaryHeap.MAX) { this.orderFlag = BinaryHeap.MAX; } this.scoring = scoring; this.array = []; } // Add value to the heap and re-order BinaryHeap.prototype.push = func...
/** * @fileoverview Rule to flag enforce return values * @author Nicholas C. Zakas * * Copyright JS Foundation and other contributors, https://js.foundation * Copyright 2017 Thomas Grainger <eslint-plugin-better@graingert.co.uk> * * Permission is hereby granted, free of charge, to any person obtaining a copy * ...
var EventEmitter = require('events').EventEmitter; Object.keys(promises) .forEach(function (promise) { StateMachine.Promise = promises[promise]; describe('Event emitter: ' + promise, function () { it('should emit events (new object)', function (done) { var states = []; var fsm = Stat...
const path = require('path'); const chalk = require('chalk'); const childProcess = require('child_process'); const phantomjs = require('phantomjs-prebuilt'); const binPath = phantomjs.path; const phantomjsRunnerDir = path.dirname(require.resolve('qunit-phantomjs-runner')); const isUrl = uri => uri.match(/^http(s?):/) !...
/** * @class dr.shim {Deprecated} * @extends dr.node * shim has been deprecated, use dr.teem instead */
Package.describe({ summary: "Opt out of sending package stats", version: '1.0.5' }); Package.onUse(function (api) { // Empty. This package's presence tells the meteor tool to stop // sending package stats. });
var extend = require('util')._extend; var debug = require('debug')('studio:devtools'); module.exports = DevToolsBackend; function DevToolsBackend() { } var sampleCpuProfile = loadExampleJsonSync('sample.cpuprofile'); var sampleHeapSnapshot = loadExampleJsonSync('sample.heapsnapshot'); var COMMANDS = { 'Worker.can...
/** * @license AngularJS v1.6.1 * (c) 2010-2016 Google, Inc. http://angularjs.org * License: MIT */ (function(window, angular) {'use strict'; var ELEMENT_NODE = 1; var COMMENT_NODE = 8; var ADD_CLASS_SUFFIX = '-add'; var REMOVE_CLASS_SUFFIX = '-remove'; var EVENT_CLASS_PREFIX = 'ng-'; var ...
// Return a random integer between the supplied // minimum and maximum values (inclusive). var get_random_int = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }; // Return the l1 distance between two points. var distance_manhattan = function (a, b) { return Math.abs(a.x - b.x) ...
'use strict'; /* Directives */ angular.module('timelineApp.directives', []). directive('appVersion', ['version', function(version) { return function(scope, elm, attrs) { elm.text(version); }; }]);
/* global Class, _, logger */ /* jshint ignore:start */ import util.underscore as _; /* jshint ignore:end */ exports = Class(function () { 'use strict'; this.init = function (opts) { var i = opts.initCount || 0; this._models = []; this._obtained = {}; this._ctor = opts.ctor; _.times(i, this...
/*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under the MIT license */ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } +function ($) { 'use strict'; var version = $.fn.jquery.split(' ')[0].split('...
import React from 'react' import ReactDOM from 'react-dom' import { Provider } from 'react-redux' import { createStore, applyMiddleware, compose } from 'redux'; import thunk from 'redux-thunk'; import createTheStore from './utils/createTheStore' import App from './components/App' import signupReducer from './contain...
'use strict'; var assert = require('assert'); //var ascii-images = require('../'); // test 1 assert(true);
module.exports = [ { test: /\.jsx?$/, exclude: /(node_modules|bower_components)/, loaders: [ 'babel'] }, { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" }, { test: /\.(woff|woff2)$/, loader: "url?prefix=font/&limit=5000" }, { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mim...
import hasClass from './../hasClass'; export function clickList(e, store, catalog, pages) { if (hasClass(e.target,'projectBlock__up') || hasClass(e.target.parentNode,'projectBlock__up')) { let input = e.target; let id = input.closest('.block').getAttribute('data-block-id'); let subblockId =...
ngDescribe({ name: 'Test app-fiter-menu component', modules: 'app', element: '<app-fiter-menu></app-fiter-menu>', tests: function (deps) { it('basic test', () => { // }); } });
var melonService = function(beatsbucketPlayer_p) { var beatsbucketPlayer = beatsbucketPlayer_p; var melonUrl = "http://apis.skplanetx.com/melon"; var imageUrl = "http://image.melon.com/cm/album/images"; var appKey = "9ec9b7cf-811f-3c4e-8692-3282aa4f69d7"; var defaultLoadCount = 100; var melonAP...
/** * Definition for singly-linked list. * function ListNode(val) { * this.val = val; * this.next = null; * } */ /** * @param {ListNode} l1 * @param {ListNode} l2 * @return {ListNode} */ const ListNode = require('../_utils/list-node'); const addTwoNumbers = function (l1, l2) { let stack1 = [], sta...
import { click, find, visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; module('Acceptance | application', function(hooks) { setupApplicationTest(hooks); test('it works between route transitions', async function(assert) { await visit(...
import crypto from 'crypto'; import { validate, validators as v } from 'easevalidation'; import { Module } from 'oors'; import upperFirst from 'lodash/upperFirst'; import omitBy from 'lodash/omitBy'; import isNil from 'lodash/isNil'; import camelCase from 'lodash/camelCase'; import ms from 'ms'; import moment from 'mom...
// Angular Material Theme config app.config(CartTheming.factory);
(function($) { $.fn.myPlugin = function(settings) { var config = {'foo': 'bar'}; if (settings) $.extend(config, settings); this.each(function() { // element-specific code here }); return this; }; })(jQuery);
var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var __decorate = (this && this.__decorate) || function (decora...
import { toYAML, toJSON, capitalize, toTitleCase, slugify, existingUploadedFilenames, getDocumentTitle, getFilenameFromPath, getExtensionFromPath, trimObject, } from '../helpers'; describe('Helper functions', () => { it('should convert object to YAML string correctly', () => { let obj = { tit...
'use strict'; /** * autolap_trigger enum * * ****WARNING**** This file is auto-generated! Do NOT edit this file. */ const BaseType = require('../type'); const FieldTypes = require('../fieldTypes'); const ValuesMap = { 0: 'time', 1: 'distance', 2: 'position_start', 3: 'position_lap', 4: 'position_waypoint', ...
/** * Created by zhangruofan on 2016/9/20. */ import React, { Component, PropTypes } from 'react'; import { Form, Spin, Button, Input, InputNumber, DatePicker, message } from 'antd' import ImgUploader from '../ImgUploader' import { connect } from 'react-redux' import { ACTIVE } from '../../constants/api' import Map f...
const knex = require('./knex.js') const getAll = () => { return knex.select() .from('albums') .then(allAlbums => allAlbums) .catch(error => error ) } const getById = (id) => { return knex.select() .from('albums') .where('id', id) .then(album => album[0]) .catch(error => error) } ...
var glContext; function initialize() { // Get canvas, var glCanvas = document.getElementById("glCanvas"); // Context creation error listener, var errorMessage = "Couldn't create a WebGL context!"; function onContextCreationError(event) { if (event.statusMessage) errorMessage = event.statu...
import '@polymer/polymer/polymer-element.js'; const $_documentContainer = document.createElement('template'); $_documentContainer.setAttribute('style', 'display: none;'); $_documentContainer.innerHTML = `<dom-module id="shared-styles"> <template> <style> .card { margin: 24px; padd...
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *------------------------------------------------------------...
Package.describe({ name: 'studio127:tap-i18n-semantic-ui', summary: 'Semantic-UI User interface for the tap-i18n package', git: 'https://github.com/studio127/tap-i18n-semantic-ui', version: '0.4.1' }); Package.onUse(function(api) { api.versionsFrom('METEOR@0.9.1'); api.use("tap:i18n-ui@0.4.1"); api.use(...
var User = require('./../models/user'); var Organization = require('./../models/organization'); var Shelter = require('./../models/shelter'); var ProfileController = { index: function(req, res) { if (req.user.stage == 0){ res.render('profile/index'); }else{ res.redirect('profile/' + req.user._id)...
import 'isomorphic-fetch'; /* eslint-disable no-unused-vars */ /* /////////////////////////////////////////////////////////////////////////// Create Lesson Details /////////////////////////////////////////////////////////////////////////// */ /* ///////////////////////////////////////////////...
function get_element(id) { if(id){ var element = document.getElementById(id); }else{//nedostali jsme id objektu, ve kterem chceme hledat prvky tridy var element = document.getElementsByTagName('body')[0];//prohledame cely dokument } return element; }
"use strict"; /** * @fileoverview This file is generated by the Angular 2 template compiler. * Do not edit. * @suppress {suspiciousCode,uselessCode,missingProperties} */ /* tslint:disable */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ...
var app = require('app'); // Module to control application life. var BrowserWindow = require('browser-window'); // Module to create native browser window. // Report crashes to our server. require('crash-reporter').start(); // Keep a global reference of the window object, if you don't, the window will // be closed a...
const F = { MD5_KEY : 'dreamcup', }; export default F;
// Regular expression that matches all symbols in the Ideographic Description Characters block as per Unicode v4.1.0: /[\u2FF0-\u2FFF]/;
(function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prot...
/** * write something to debug line */ function debugLine(html,addRandom, addHtml){ if(html === true) html = "true"; if(html === false) html = "false"; var output = html; if(typeof html == "object"){ output = ""; for(name in html){ var value = html[name]; output += " " + name + ": " + va...
const repl = require('repl'); const pkg = require('../package'); function setupEval(run) { return function planeEval(cmd, context, filename, callback) { callback(null, run(cmd)); }; } module.exports = function runner(run) { // eslint-disable-next-line no-console console.log(`✈ plane.js REPL, version: ${pk...
angular.module('bootApp') .controller('authController', authCtrl); authCtrl.$inject = ['$http', 'authFactory']; function authCtrl ($http, authFactory){ var auth = this; auth.greeting = "hello world"; auth.register = function (){ if(auth.registerPassword != auth.confirmPassword){ console.log(...
typeSearchIndex = [{"p":"main","l":"RemoveText"}]
#!/usr/bin/env node require('../lib/commands/main-info.js');
var ShadersModule = { name: "Shaders", enabled: false, tab_name: "Shaders", bigicon: "imgs/tabicon-shaders.png", icons: { }, preferences: { //persistent settings overlay_graph: false }, init: function() { if( !LS.GraphMaterial ) return; LiteGUI.Inspector.widget_constructors["f...
/*************************************************************************************************** * ViewModel: Diagnosis * Author(s): Imran Esmail * Description: Handles the business logic for the diagnosis section of the patient * record. This includes the Diagnosis and Plans & Instructions ****...
import './styles.css'; import React from 'react'; import {render} from 'react-dom'; import Immutable from 'immutable'; import Root from './containers/root'; import configureStore from './store/configureStore'; import storage from './libs/storage'; import {setHistory} from './actions' main(); function main() { ...
/** * * AVIONIC * Propelling World-class Cross-platform Hybrid Applications ✈ * * Copyright 2015 Reedia Limited. All rights reserved. * * 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 w...
'use strict'; var BaseModel = require('model-toolkit').BaseModel; var DeliveryOrderItemFulfillment = require('./delivery-order-item-fulfillment'); module.exports = class DeliveryOrderItem extends BaseModel { constructor(source) { super('delivery-order-item', '1.0.0'); //Define Properties ...
define(['text!./addModal.tpl.html', './AddModalModel', 'css!./addModal.css'], function (addModalTpl, AddModalModel) { 'use strict'; return Marionette.LayoutView.extend({ id: "authority-userPermission-addModal-" + _.now(), className: 'modal hide fade authority-userPermission-addModal', se...
import Ember from 'ember'; import LinearScale from 'ember-d3-components/utils/scales/d3-linear-scale'; const { Controller } = Ember; export default Controller.extend({ xScale: LinearScale.create({domain: [0, 100], range: [0, 440]}), yScale: LinearScale.create({domain: [100, 0], range: [0, 430]}), rScale: Linear...
var mirrorKey = require('mirrorkey'); module.exports = mirrorKey({ TAB_AND_ORIGIN_SCOPED: null, ORIGIN_SCOPED: null, PAGE_SCOPED: null }, 'lower-case');
version https://git-lfs.github.com/spec/v1 oid sha256:3c94508e7ee0ef81a00002de1e2fdf8cefc37690dc3bd7fe433178e87688ae33 size 23300
'use strict' describe('test low hands', function () { var Poker = DISBRANDED.Poker, Hand = Poker.Hand it('should find a straight when aces are low', function () { var result = Hand.findStraight({ cards: ['AS', '4C', 'QH', '4D', '3D', '5H', '2C'], low: Poker.ACE_TO_FIVE_LOW }) expect(...
import express from 'express'; import validate from 'express-validation'; import expressJwt from 'express-jwt'; import paramValidation from '../../config/server/param-validation'; import authCtrl from '../controllers/auth.controller'; import config from '../../config/server/env'; const router = express.Router(); // es...
var dbCtrl = require('../controllers/dbCtrl.js'); var util = require('../controllers/utilCtrl.js'); exports.upvote = function(req, res) { dbCtrl.vote('up', req.params.meal, req.params.date) .then(function(vote) { res.send(200, 'Your vote has been counted.'); }, function(err) { res.send(400, err)...
require.config({ baseUrl: './js', paths: { 'angular': '../../vendors/angular/angular', 'angular-route': '../../vendors/angular-route/angular-route', 'domReady': '../../vendors/requirejs-domready/domReady', 'jquery' : '../../vendors/pearsonstrap-0.9.0/js/jquery', 'modern...
/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.0.0-rc5-master-76c6299 */ (function( window, angular, undefined ){ "use strict"; /** * @ngdoc module * @name material.components.gridList */ angular.module('material.components.gridList', ['material.core']) .directiv...
/* global d3 */ /* exported blockChart */ 'use strict'; function blockChart() { var me = { width: 600, height: 400, margin: {left: 10, top: 10, right: 10, bottom: 10}, x: function(d) { return d.x; } }; function init(selection) { selection.each(function() { var svg = d3.select(this); svg.append('...
'use strict'; var async = require('async'), nconf = require('nconf'), user = require('../user'), groups = require('../groups'), topics = require('../topics'), posts = require('../posts'), notifications = require('../notifications'), messaging = require('../messaging'), plugins = require('../plugins'), utils =...
/** * @module RandomHexTests */ var randomHex = require('../lib/random-hex'); var expect = require('chai').expect; describe('random-hex', function () { context('generate()', function () { before(function () { this.color1 = randomHex.generate(); this.color2 = randomHex.generate(); }); it('generates a h...
'use strict' const jwt = require('jwt-simple') const moment = require('moment') const config = require('../config') function createToken (user) { const payload = { sub: user._id, iat: moment().unix(), exp: moment().add(14, 'days').unix() } return jwt.encode(payload, config.SECRET_TOKEN) } function...
import Attachment from '../models/attachment.model' /** * @api {get} /attachment/:id Get Attachment * @apiDescription Pipes Attachment * @apiName AttachmentPipe * @apiGroup Attachment * @apiParam {String} id Attachment unique ID. * @apiSuccessExample Success-Response: * {} */ exports.getAttachment = (req, res,...
export default (value) => { const textArea = document.createElement('textarea'); textArea.value = value; document.body.appendChild(textArea); textArea.select(); try { document.execCommand('copy'); } catch (err) { console.error(err); // eslint-disable-line no-console } document.body.removeChild...
class Arquivo { constructor(nome, tamanho, tipo) { this._nome = nome; this._tamanho = tamanho; this._tipo = tipo; } get nome() { return this._nome; } get tamanho() { return this._tamanho; } get tipo() { return this._tipo; } }
'use strict'; var _utilJs = require('../util.js'); /** @test {AbstractDoc} */ describe('AbstractDoc:', function () { /** @test {AbstractDoc#@unknown} */ it('has unknown tag.', function () { var doc = global.db.find({ name: 'MyClass1' })[0]; _utilJs.assert.equal(doc.unknown.length, 1); _utilJs.assert....