text
stringlengths 2
6.14k
|
|---|
var axon = require("axon");
// usage node worker.js ID
// e.g. node worker.js 1
var id = process.argv[2] || 0;
var ps = require("./persec").createPerSec("worker_" + id);
var pull = axon.socket("pull");
pull.connect(4000);
pull.format("json");
// Sink the work log to the server
var push = axon.socket("push");
push.connect(4002);
push.format("json");
pull.on("message", function (msg) {
ps.incr();
msg.worker = id;
msg.persec = ps.persec();
msg.delay = Date.now() - msg.date;
console.log("%j", msg);
push.send(msg);
});
|
// @flow
import { remote } from 'electron';
export default class ImageGenerator {
static findImage(resourceType: string) {
let dir = '';
if (process.env.NODE_ENV === 'development') {
dir = '../assets/azure/';
} else {
dir = `${remote.app.getAppPath()}../../assets/azure/`;
}
switch (resourceType) {
case 'Microsoft.Web/serverfarms':
return `${dir}Azure App Service_COLOR.png`;
case 'Microsoft.Web/sites':
return `${dir}Azure App Service - Web App_COLOR.png`;
case 'Microsoft.Insights/components':
return `${dir}Azure Application Insights_COLOR.png`;
case 'Microsoft.Storage/storageAccounts':
return `${dir}Azure Storage.png`;
case 'Microsoft.EventHub/namespaces':
return `${dir}Azure Event Hubs_COLOR.png`;
case 'Microsoft.Network/trafficManagerProfiles':
return `${dir}Azure Traffic Manager_COLOR.png`;
case 'Microsoft.Network/trafficManagerProfiles/azureEndpoints':
return `${dir}Azure Traffic Manager.png`;
case 'Microsoft.NotificationHubs/namespaces':
return `${dir}Azure Notification Hubs_COLOR.png`;
case 'Microsoft.Resources/deployments':
return `${dir}Unidentified feature object_COLOR.png`;
case 'Microsoft.Network/networkInterfaces':
return `${dir}Azure Virtual Network.png`;
case 'Microsoft.Network/virtualNetworks':
return `${dir}Azure Virtual Network_COLOR.png`;
case 'Microsoft.Network/publicIpAddresses':
return `${dir}Azure Virtual Network.png`;
case 'Microsoft.Network/publicIPAddresses':
return `${dir}Azure Virtual Network.png`;
case 'Microsoft.Network/networkSecurityGroups':
return `${dir}Azure Virtual Network.png`;
case 'Microsoft.Compute/virtualMachines':
return `${dir}Azure Virtual Machine_COLOR.png`;
case 'Microsoft.Network/applicationGateways':
return `${dir}Azure Application Gateway_COLOR.png`;
case 'Microsoft.Search/searchServices':
return `${dir}Azure Search_COLOR.png`;
case 'Microsoft.ContainerService/containerServices':
return `${dir}Azure Container Service_COLOR.png`;
case 'Microsoft.Web/sites/domainOwnershipIdentifiers':
return `${dir}Azure App Service - Web App (was Websites).png`;
case 'Microsoft.Automation/automationAccounts':
return `${dir}Azure Automation_COLOR.png`;
case 'Microsoft.Compute/availabilitySets':
return `${dir}Azure Virtual Machines - Availability Set_COLOR.png`;
case 'Microsoft.ApiManagement/service':
return `${dir}Azure API Management_COLOR.png`;
case 'Microsoft.Backup/BackupVault/registeredContainers/protectedItems':
return `${dir}Azure Backup_COLOR.png`;
case 'Microsoft.Backup/BackupVault':
return `${dir}Azure Backup - Recovery Vault.png`;
case 'Microsoft.AnalysisServices/servers':
return `${dir}Analysis Service.png`;
case 'Microsoft.Authorization/locks':
return `${dir}Azure Acitve Directory Access Control.png`;
case 'Microsoft.Batch/batchAccounts':
return `${dir}Azure Batch.png`;
case 'Microsoft.Cdn/profiles':
return `${dir}Azure Content Delivery Network (CDN)_COLOR.png`;
case 'Microsoft.CognitiveServices/accounts':
return `${dir}Azure Cognative Services_COLOR.png`;
case 'Microsoft.ContainerInstance/containerGroups':
return `${dir}Azure Container Service.png`;
case 'Microsoft.ContainerRegistry/registries':
return `${dir}Azure Container Service_COLOR.png`;
case 'Microsoft.DataFactory/dataFactories':
return `${dir}Azure Data Factory_COLOR.png`;
case 'Microsoft.DataLakeAnalytics/accounts':
return `${dir}Azure Data Lake Analytics_COLOR.png`;
case 'Microsoft.DataLakeStore/accounts':
return `${dir}Azure Data Lake Store_COLOR.png`;
case 'Microsoft.DocumentDB/databaseAccounts':
return `${dir}Azure DocumentDB_COLOR.png`;
case 'Microsoft.DomainRegistration/domains':
return `${dir}Azure DNS_COLOR.png`;
case 'Microsoft.DevTestLab/labs':
return `${dir}Azure DevTest Labs_COLOR.png`;
case 'Microsoft.HDInsight/clusters':
return `${dir}Azure HDInsight_COLOR.png`;
case 'Microsoft.Devices/IotHubs':
return `${dir}Azure IoT Hub.png`;
case 'Microsoft.Devices/IotHubs/eventHubEndpoints/ConsumerGroups':
return `${dir}Azure IoT Hub.png`;
case 'Microsoft.KeyVault/vaults':
return `${dir}Azure KeyVault_COLOR.png`;
case 'Microsoft.Network/loadBalancers':
return `${dir}Azure Load Balancer (feature)_COLOR.png`;
case 'Microsoft.Cache/Redis':
return `${dir}Azure Cache Redis Product icon_COLOR.png`;
case 'Microsoft.PowerBI/workspaceCollections':
return `${dir}Power BI Embedded.png`;
case 'Microsoft.Logic/integrationAccounts':
return `${dir}Logic Apps_COLOR.png`;
case 'Microsoft.StorSimple/managers':
return `${dir}Azure StorSimple_COLOR.png`;
case 'Microsoft.Sql/servers':
return `${dir}Azure SQL Database (generic)_COLOR.png`;
case 'Microsoft.StreamAnalytics/streamingjobs':
return `${dir}Azure Stream Analytics_COLOR.png`;
case 'Microsoft.ServiceBus/namespaces':
return `${dir}Azure Service Bus_COLOR.png`;
case 'Microsoft.ServiceFabric/clusters':
return `${dir}Azure Service Fabric_COLOR.png`;
case 'Microsoft.RecoveryServices/vaults':
return `${dir}Azure Site Recovery _COLOR.png`;
case 'Microsoft.Scheduler/jobCollections':
return `${dir}Azure Scheduler.png`;
case 'Microsoft.MachineLearning/commitmentPlans':
return `${dir}Azure Machine Learning_COLOR.png`;
case 'Microsoft.Media/mediaservices':
return `${dir}Azure Media Services _COLOR.png`;
default:
return `${dir}Unidentified feature object_COLOR.png`;
}
}
}
|
const Boom = require('boom');
const base64url = require('base64url');
const uuid = require('uuid/v4');
const get = require('lodash/get');
const epochTime = (date = Date.now()) => Math.floor(date / 1000);
async function getSession(req, res) {
const ctx = this.app.createContext(req, res);
return this.Session.get(ctx);
}
async function setProviderSession(req, res, {
account,
ts = epochTime(),
remember = true,
clients = [],
} = {}) {
const session = await getSession.call(this, req, res);
Object.assign(session, {
account,
loginTs: ts,
});
if (!remember) session.transient = true;
clients.forEach((clientId) => {
session.sidFor(clientId, uuid());
});
await session.save();
return session;
}
exports.register = function (server, pluginOptions, next) {
server.auth.scheme('oidc_session', () => {
return {
async authenticate(request, reply) {
if (!request.state._session) {
const authorization = get(request, 'headers.authorization', '');
const tokenString = authorization ? authorization.split(' ')[1] : null;
if (request.query.id_token_hint || tokenString) {
// only do this when cookies aren't present and some token hint is provided or whatever
const parts = String(request.query.id_token_hint || tokenString).split('.');
const token = {
header: JSON.parse(base64url.decode(parts[0])),
payload: JSON.parse(base64url.decode(parts[1])),
};
try {
const session = await setProviderSession.call(server.plugins['open-id-connect'].provider, request.raw.req, request.raw.res, {
account: token.payload.sub
});
reply.continue({
credentials: session,
});
} catch(e) {
reply(e);
}
} else {
reply(Boom.unauthorized(null, 'oidc_session'));
}
} else {
try {
var session = await request.server.plugins['open-id-connect'].provider.Session.find(request.state._session);
if (!session.accountId()) {
reply(Boom.unauthorized(null, 'oidc_session'));
} else {
reply.continue({
credentials: session,
});
}
} catch(e) {
reply(e);
}
}
}
};
});
next();
};
exports.register.attributes = {
name: 'oidc-session-scheme',
version: '1.0.0'
};
|
define(['mac/roman'], function(macRoman) {
'use strict';
function open(item) {
return item.getBytes().then(function(bytes) {
var dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
var pos = dv.getUint16(0, false);
var obj = {
top: dv.getInt16(pos, false),
left: dv.getInt16(pos + 2, false),
bottom: dv.getInt16(pos + 4, false),
right: dv.getInt16(pos + 6, false),
isPlural: !!bytes[pos + 8],
// unknown: 4 bytes
accuracy: bytes[pos + 13],
value: bytes[pos + 14],
type: bytes[pos + 15],
damage: bytes[pos + 16],
attackType: bytes[pos + 17],
numberOfUses: dv.getUint16(pos + 18, false),
returnToRandomScene: !!bytes[pos + 20],
// unknown: 1 byte
};
pos += 22;
obj.sceneOrOwner = macRoman(bytes, pos + 1, bytes[pos]);
pos += 1 + bytes[pos];
obj.clickMessage = macRoman(bytes, pos + 1, bytes[pos]);
pos += 1 + bytes[pos];
obj.operativeVerb = macRoman(bytes, pos + 1, bytes[pos]);
pos += 1 + bytes[pos];
obj.failureMessage = macRoman(bytes, pos + 1, bytes[pos]);
pos += 1 + bytes[pos];
obj.useMessage = macRoman(bytes, pos + 1, bytes[pos]);
pos += 1 + bytes[pos];
obj.sound = macRoman(bytes, pos + 1, bytes[pos]);
pos += 1 + bytes[pos];
item.setDataObject(obj);
});
}
return open;
});
|
import { NgModule, InjectionToken } from '@angular/core';
import { FirebaseApp, AngularFireModule } from 'angularfire2';
import { AngularFirestore } from './firestore';
export var EnablePersistenceToken = new InjectionToken('EnablePersistenceToken');
export function _getAngularFirestore(app, enablePersistence) {
return new AngularFirestore(app, enablePersistence);
}
export var AngularFirestoreProvider = {
provide: AngularFirestore,
useFactory: _getAngularFirestore,
deps: [FirebaseApp, EnablePersistenceToken]
};
export var FIRESTORE_PROVIDERS = [
AngularFirestoreProvider,
{ provide: EnablePersistenceToken, useValue: false },
];
var AngularFirestoreModule = (function () {
function AngularFirestoreModule() {
}
AngularFirestoreModule.enablePersistence = function () {
return {
ngModule: AngularFireModule,
providers: [
{ provide: EnablePersistenceToken, useValue: true },
AngularFirestoreProvider
]
};
};
AngularFirestoreModule.decorators = [
{ type: NgModule, args: [{
imports: [AngularFireModule],
providers: [FIRESTORE_PROVIDERS]
},] },
];
AngularFirestoreModule.ctorParameters = function () { return []; };
return AngularFirestoreModule;
}());
export { AngularFirestoreModule };
//# sourceMappingURL=firestore.module.js.map
|
Template['quickForm_plain-fieldset'].helpers({
idPrefix: function () {
return this.atts["id-prefix"];
},
submitButtonAtts: function plfsQuickFormSubmitButtonAtts() {
var qfAtts = this.atts;
var atts = {};
if (typeof qfAtts.buttonClasses === "string") {
atts['class'] = qfAtts.buttonClasses;
}
return atts;
}
});
|
'use strict';
var fs = require('fs');
var _ = require('underscore');
var HrStopwatch = require('./utils/hr-stopwatch');
var Excel = require('../excel');
var inputFile = process.argv[2];
var outputFile = process.argv[3];
var wb = new Excel.Workbook();
var passed = true;
var assert = function(value, failMessage, passMessage) {
if (!value) {
if (failMessage) console.error(failMessage);
passed = false;
} else {
if (passMessage) console.log(passMessage);
}
};
// assuming file created by testBookOut
wb.xlsx.readFile(inputFile)
.then(function() {
console.log('Loaded', inputFile);
wb.eachSheet(function(sheet) {
console.log(sheet.name);
});
var ws = wb.getWorksheet('Sheet1');
assert(ws, "Expected to find a worksheet called sheet1");
ws.getCell('B1').value = new Date();
ws.getCell('B1').numFmt = 'hh:mm:ss';
ws.addRow([1, 'hello']);
return wb.xlsx.writeFile(outputFile);
})
.then(function() {
assert(passed, "Something went wrong", "All tests passed!");
})
.catch(function(error) {
console.error(error.message);
console.error(error.stack);
});
|
'use strict';
app.controller('NetworkCtrl', function($scope, $route, dataService, timerService) {
var loadData = function () {
console.log("Getting Network Data");
dataService.getData("/network/chart/usdHash/60", function(data){
$scope.config = data;
console.log(data);
});
};
loadData();
// timerService.register(loadData, $route.current.controller);
// $scope.$on("$routeChangeStart", function () {
// timerService.remove($route.current.controller);
// });
});
|
#pragma strict
var frames : Texture2D[];
var framesPerSecond = 10.0;
function Start () {
}
function Update () {
var index : int = Time.time * framesPerSecond;
index = index % frames.Length;
GetComponent.<GUITexture>().texture = frames[index];
}
|
import { foo } from './test';
import 'sass/index'; // Import CSS
/*
Ensure polyfills only load on older browsers
*/
// Covers all IE versions and Safari < 11
const browserSupportsAllFeatures = window.Promise && window.fetch;
if (browserSupportsAllFeatures) {
initialise();
} else {
// See 'Code Splitting' documentation for Webpack (https://webpack.js.org/guides/code-splitting-require/#dependencies)
require.ensure([], function() {
require('./polyfills.js');
initialise();
});
}
/*
Main function
*/
function initialise() {
console.debug('Test', foo());
console.warn('Fill in the index.js file'); // eslint-disable-line
}
|
// import TestContainer from '../index';
import expect from 'expect';
// import { shallow } from 'enzyme';
// import React from 'react';
describe('<TestContainer />', () => {
it('Expect to have unit tests specified', () => {
expect(true).toEqual(false);
});
});
|
import getLogger from '../src/logger';
describe('logger', () => {
let log = null;
let testConsole = {
count: 0,
lastMessage: '',
log: (message) => {
testConsole.lastMessage = message;
testConsole.count++;
}
};
beforeAll(() => {
log = getLogger({
output: testConsole.log
});
});
it('is defined', () => {
expect(log).toBeDefined();
});
it('.debug is a function', () => {
expect(typeof log.debug).toBe('function');
});
it('.debug does not log for default log level (info)', () => {
log.debug('message', { key: 'value' });
expect(testConsole.count).toBe(0);
});
it('.info is a function', () => {
expect(typeof log.info).toBe('function');
});
it('.info does log for default log level (info)', () => {
log.info('message', { key: 'value' });
expect(testConsole.count).toBe(1);
expect(testConsole.lastMessage).toBe('[info]: "message", {"key":"value"}');
});
it('.warn is a function', () => {
expect(typeof log.warn).toBe('function');
});
it('.error is a function', () => {
expect(typeof log.error).toBe('function');
});
it('.fatal is a function', () => {
expect(typeof log.fatal).toBe('function');
});
describe('isLogLevelApplicable', () => {
const checkLogLevel = (level, configuredLevel, value) => {
let logger = getLogger({ logLevel: configuredLevel });
expect(logger.isLogLevelApplicable(level)).toBe(value);
};
it('is true for debug when configured log level is debug', () => checkLogLevel('debug', 'debug', true));
it('is true for info when configured log level is debug', () => checkLogLevel('info', 'debug', true));
it('is true for fatal when configured log level is debug', () => checkLogLevel('fatal', 'debug', true));
it('is false for debug when configured log level is info', () => checkLogLevel('debug', 'info', false));
it('is true for debug when configured log level is abcdef', () => checkLogLevel('debug', 'abcdef', true));
it('is false for error when configured log level is fatal', () => checkLogLevel('error', 'fatal', false));
it('is true for fatal when configured log level is fatal', () => checkLogLevel('fatal', 'fatal', true));
});
});
|
/* global angular */
(function() {
'use strict';
var services = angular.module('wordbook.services', []);
services.factory('User', function($q, $http) {
var email,
isAuthenticated;
return {
authCheck: function() {
var deferred = $q.defer();
if (typeof isAuthenticated === 'undefined') {
$http.get('/auth/check').then(function(result) {
isAuthenticated = result.data.isAuthenticated;
deferred.resolve(isAuthenticated);
});
} else {
deferred.resolve(isAuthenticated);
}
return deferred.promise;
},
login: function(email, password) {
var deferred = $q.defer(),
data = { email: email, password: password };
$http.post('/auth/login', data).then(function(result) {
if (result.data.isAuthenticated) {
email = email;
isAuthenticated = true;
deferred.resolve();
} else {
isAuthenticated = false;
deferred.reject();
}
});
return deferred.promise;
},
logout: function() {
var deferred = $q.defer();
$http.post('/auth/logout').then(function(result) {
if (!result.data.isAuthenticated) {
email = null;
isAuthenticated = false;
deferred.resolve();
} else {
deferred.reject();
}
});
return deferred.promise;
},
isAuthenticated: function() {
return isAuthenticated;
}
};
});
services.factory('Words', function($http) {
return {
put: function(wordData) {
var id = wordData._id;
if (id && wordData._rev) {
delete wordData._id;
return $http.put('/api/words/' + id, wordData);
}
return $http.post('/api/words', wordData);
},
latest: function() {
return $http.get('/api/words/latest');
},
search: function(query) {
return $http.get('/api/words/search?q=' + query);
}
};
});
})();
|
'use strict'
const createMovieController = require('./movie')
module.exports = {
createMovieController
}
|
const vec3 = require('../math/vec3')
const fromPointAxisNormal = require('./fromPointAxisNormal')
/** Creates a new connector, with the connection point moved in the direction of the axis
* @param {Number} distance the distance to extend the connector to
* @param {connector} connector the connector to extend
* @returns {connector} a normalized connector
*/
const extend = (distance, connector) => {
const newpoint = vec3.add(connector.point, vec3.scale(distance, vec3.unit(connector.axis)))
return fromPointAxisNormal(newpoint, connector.axis, connector.normal)
}
module.exports = extend
|
/**
* This entry point of Webpack configuration
*/
switch (process.env.NODE_ENV) {
case 'prod':
case 'production':
module.exports = require('./config/webpack.prod.js')({env: 'production'});
break;
case 'test':
case 'testing':
module.exports = require('./config/webpack.test.js')({env: 'test'});
break;
default:
module.exports = require('./config/webpack.dev.js');
break;
}
|
module.exports = function(grunt) {
grunt.initConfig({
"seajs_build" : {
options : {
outputPath : "build"
, seajsBasePath : "js" // a path that points to the same location as `Sea.js's base`
// relative to GruntFile.js
// Following options' value is their default value
, path : "."
// a folder that is relative to `seajsBasePath`, files within the folder will be added ID.
, scheme : null
// `scheme` type:
// String, {{filename}} is replace by the file path, relative to `seajsBasePath`.
// Function : function( FILENAME ) { return ID; }
// Falsy, the ID is FILENAME.
, alias : null
// Use `alias` to map PATH (relative to `seajsBasePath`) to ID, if :
// 1. The dependency is not found within the TARGET's path.
// 2. The dependency's path is not relative path.
// Otherwise, use `scheme` to determine the ID
, recursive : true
// If true, add ID for files in subfolder.
, buildType : "merge_only"
// Possible values :
// "all"
// Build and output all files in TARGET, then output the merged file.
// "merge_only"
// Only merged file ( specified in `TARGET's files` ) will be created in `outputPath`
// "exclude_merge"
// Output the merged file. Then output those not merged files.
}
// Target `main`
// A build_cmd TARGET does :
// 1. use `scheme` and `alias` to add ID for each CMD module file within `path`
// 2. concat CMD into one file.
, main : {
options : { path : "." }
// `files` is used to determine what files should be merge to one file.
// See https://github.com/gruntjs/grunt/wiki/Configuring-tasks#files
// Parameters :
// `src` is relative to GruntFile
// `dest` is relative to options.outputPath
// `concatDeps` ( default:false ): If true, include all dependencies into one file, recursively.
, files : [
{
src : "js/main.js"
, dest : "js/main.js"
, filter : "isFile"
, concatDeps : true
}
]
}
}
});
grunt.loadTasks('../../tasks');
grunt.registerTask("default", ['seajs_build']);
}
|
'use babel'
// Copyright 2018 Etheratom Authors
// This file is part of Etheratom.
// Etheratom is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Etheratom is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Etheratom. If not, see <http://www.gnu.org/licenses/>.
import { AtomSolidityView } from './ethereum-interface-view';
import Web3Env from './web3/web3';
import configureStore from './helpers/configureStore';
import { CompositeDisposable } from 'atom';
export class Etheratom {
constructor(props) {
this.subscriptions = new CompositeDisposable();
this.atomSolidityView = new AtomSolidityView();
this.modalPanel = null;
this.loaded = false;
this.store = configureStore();
}
activate() {
require('atom-package-deps').install('etheratom', true)
.then(function() {
console.log('All dependencies installed, good to go');
});
this.subscriptions.add(atom.commands.add('atom-workspace', {
'eth-interface:toggle': ((_this) => {
return function() {
_this.toggleView();
};
})(this),
'eth-interface:activate': ((_this) => {
return function() {
_this.toggleView();
};
})(this)
}));
this.modalPanel = atom.workspace.addRightPanel({
item: this.atomSolidityView.getElement(),
visible: false
});
// Initiate env
this.load();
}
deactivate() {
this.modalPanel.destroy();
this.subscriptions.dispose();
this.atomSolidityView.destroy();
}
load() {
this.loadWeb3();
this.loaded = true;
}
loadWeb3() {
if(this.Web3Interface) {
return this.Web3Interface;
}
this.Web3Interface = new Web3Env(this.store);
this.subscriptions.add(this.Web3Interface);
return this.Web3Interface;
}
toggleView() {
if(this.modalPanel.isVisible()) {
return this.modalPanel.hide();
} else {
return this.modalPanel.show();
}
}
}
|
//const requestHandler = require('../../lib/request_handler');
describe('requestHandler', function() {
});
|
'use strict'
const Sequelize = require('sequelize')
const Cryptr = require('cryptr')
module.exports = function (sequelize) {
const Survey = sequelize.define('Survey', {
id: {
type: Sequelize.STRING,
primaryKey: true,
unique: true,
defaultValue: Sequelize.UUIDV4
},
charity: {
type: Sequelize.STRING,
allowNull: false
},
company: {
type: Sequelize.STRING,
allowNull: false
},
individual: {
type: Sequelize.STRING,
allowNull: false
}
}, {
getterMethods: {
urn: function () {
const cryptr = new Cryptr(global.ABIBAO.config('ABIBAO_API_GATEWAY_CRYPTO_CREDENTIALS'))
return 'abibao:database:survey:' + cryptr.encrypt(this.id)
},
urnCampaign: function () {
const cryptr = new Cryptr(global.ABIBAO.config('ABIBAO_API_GATEWAY_CRYPTO_CREDENTIALS'))
return 'abibao:database:campaign:' + cryptr.encrypt(this.campaign)
},
urnCharity: function () {
const cryptr = new Cryptr(global.ABIBAO.config('ABIBAO_API_GATEWAY_CRYPTO_CREDENTIALS'))
return 'abibao:database:charity:' + cryptr.encrypt(this.charity)
},
urnCompany: function () {
const cryptr = new Cryptr(global.ABIBAO.config('ABIBAO_API_GATEWAY_CRYPTO_CREDENTIALS'))
return 'abibao:database:company:' + cryptr.encrypt(this.company)
},
urnIndividual: function () {
const cryptr = new Cryptr(global.ABIBAO.config('ABIBAO_API_GATEWAY_CRYPTO_CREDENTIALS'))
return 'abibao:database:individual:' + cryptr.encrypt(this.individual)
}
},
timestamps: true,
paranoid: true,
underscored: false,
freezeTableName: true,
tableName: 'surveys'
})
return Survey
}
|
/**
* The placeholder object used in partial application.
* @memberof module:lamb
* @alias module:lamb.__
* @category Special properties
* @see {@link module:lamb.partial|partial}, {@link module:lamb.partialRight|partialRight}
* @see {@link module:lamb.asPartial|asPartial}
* @since 0.57.0
* @type {Object}
*/
export default {};
|
import axios from 'axios';
import { GET_AUTH } from '../constants/constants.js';
export function getAuth(username) {
console.log()
let url = axios.post('/auth/getUrl', {username})
.then(url => {
console.log("URL",url.data);
location.href = url.data;
})
return {
type: GET_AUTH,
payload: url
};
};
|
/**
* Gets a channel for the bot to write to.
*/
let Settings = require('./settings'),
State = require('./state');
module.exports = function(client){
let settings = Settings.instance(),
state = State.instance();
if (!settings.values.giveawayChannelId){
state.add('settings.giveawayChannelId', `The current giveaway channel ${settings.values.giveawayChannelId} does not exist. Please reset the channel using "@[botname] channel" in the channel you want to use.`);
return null;
}
for (let channel of client.channels.array()){
if (channel.id === settings.values.giveawayChannelId)
return channel;
}
state.add('settings.giveawayChannelId', `The current giveaway channel ${settings.values.giveawayChannelId} does not exist. Please reset the channel using "@[botname] channel" in the channel you want to use.`);
return null;
};
|
import * as mutations from "./mutations";
export default class Sunflower{
static pieceName = "Sunflower";
static sprite = "Sunflower.png";
static description = "A sunflower that Zeek can pick to gain 50 points.";
sprite = "Sunflower.png";
constructor(){
//Just putting it here
}
update(board, ownPos, dt){
//Does nothing
return [];
}
collide(board, playerPos, ownPos, dir){
const mutation = [];
//Eat piece and increment score
mutation.push(mutations.deletePiece(ownPos));
mutation.push(mutations.move(playerPos, ownPos));
mutation.push(mutations.incrementScore(50));
return mutation;
}
}
|
var WebSocket = require('ws');
var LightningMaps = function() {
var REMOTE_ENDPOINT = 'ws://ws.lightningmaps.org';
this.ws = new WebSocket(REMOTE_ENDPOINT);
return this;
};
LightningMaps.prototype.on = function(event, callback) {
this.ws.on(event, callback);
};
module.exports = LightningMaps;
|
const XlsxPopulate = require('xlsx-populate');
const cfg = require('./customers2.json')
const formatCell = require('./formatCell')
XlsxPopulate.fromFileAsync("./Customers10.xlsx")
.then(workbook => {
var usedRange = workbook.sheet("Sheet1").usedRange()
var startRow = usedRange.startCell().rowNumber()
startRow = startRow > 2? startRow : 2
const ws = workbook.sheet("Sheet1")
.range(startRow,
usedRange.startCell().columnNumber(),
usedRange.endCell().rowNumber(),
usedRange.endCell().columnNumber())
.value()
var beginRow = '(',
endRow = ')'
var SQL = 'insert into ' + cfg.schema + '.' + cfg.table + ' ';
SQL += beginRow + cfg.cols.map((col) => col.NAME).join(",") + endRow
SQL += ' values\n'
SQL += ws.map((row, rowNum) => {
return beginRow + cfg.cols.map(function(col, colNum) {
let opts = {
value: row[col.COL],
type: col.TYPE,
len: col.LEN,
allowNull: (col.NULLABLE == '1'),
numberToDate: XlsxPopulate.numberToDate,
colNum: colNum + 1,
rowNum: rowNum + startRow
}
return formatCell(opts)
}).join(',') + endRow
}).join(',\n')
console.log(SQL)
}).catch((error) => {
throw new Error('XlsxPopulate.fromFileAsync:' + error)
});
|
// window._ = require('lodash');
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/
//
// try {
// window.$ = window.jQuery = require('jquery');
//
// require('bootstrap-sass');
// } catch (e) {}
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/
//
// window.axios = require('axios');
//
// window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/**
* Next we will register the CSRF Token as a common header with Axios so that
* all outgoing HTTP requests automatically have it attached. This is just
* a simple convenience so we don't have to attach every token manually.
*/
// let token = document.head.querySelector('meta[name="csrf-token"]');
//
// if (token) {
// window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
// } else {
// console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
// }
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
// import Echo from 'laravel-echo'
// window.Pusher = require('pusher-js');
// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: 'your-pusher-key'
// });
|
require('babel-core/register')
var meta = require('../package.json'),
express = require('express'),
swig = require('swig'),
compress = require('compression'),
session = require('express-session'),
bodyParser = require('body-parser'),
lusca = require('lusca'),
path = require('path'),
app = module.exports = express(),
middleware = ['csrf', 'router', 'proxy', 'static', 'error']
var config = require('../config').default
var paths = config.get('utils_paths')
var content = ''
var globals = config.get('globals')
var indexPage = ''
if (config.get('env') === 'development') {
indexPage = 'http://' + config.get('server_host') + ':' + config.get('webpack_port') + '/public/index.html'
} else {
indexPage = paths.dist('public/index.html')
}
globals.process = {
env: {
NODE_ENV: globals.NODE_ENV
}
}
// Object.keys(globals).forEach(function(key, index) {
// content += 'window.' + key + '=' + JSON.stringify(globals[key]) + ';\n';
// });
// app.set('content', content);
// lazy load middlewares
middleware.forEach(function (m) {
middleware.__defineGetter__(m, function () {
return require('./middleware/' + m);
});
})
process.on('uncaughtException', function (err) {
(app.get('logger') || console).error('Uncaught exception:\n', err.stack)
})
// 使用swig作为模板引擎
app.engine('html', swig.renderFile)
app.set('name', meta.name)
app.set('version', meta.version)
app.set('port', config.get('server_port'))
app.set('root', paths.project())
app.set('views', path.resolve(__dirname, '../').replace(/\/+$/, ''))
app.set('view engine', 'html')
app.set('view cache', config.get('view_cache'))
app.set('logger', console)
app.enable('trust proxy')
swig.setDefaults({
tagControls: ['<%', '%>'],
cache: config.get('view_cache')
})
// parse application/x-www-form-urlencoded
// app.use(bodyParser.urlencoded({ extended: true }))
app.use(session({
secret: 'very-cool',
resave: true,
saveUninitialized: true
}))
// 打印配置信息~
// app.use(favicon(paths.dist('public/favicon.ico')))
// 关闭lusca的csrf,使用自定义的
app.use(lusca({
csrf: false,
xframe: 'SAMEORIGIN',
p3p: false,
xssProtection: true
}))
// app.use(middleware.csrf());
app.use(compress())
app.use(middleware.router({index: indexPage}))
app.use('/api', middleware.proxy(config.get('api_target')))
app.use(middleware.static(paths.dist()))
app.use(middleware.error())
if (require.main === module) {
app.listen(app.get('port'), function() {
console.log('[%s] Express server listening on port %d',
app.get('env').toUpperCase(), app.get('port'))
})
}
|
/** List of used languages */
const langList = [
{
title: 'Russian',
value: 'ru',
},
{
title: 'English',
value: 'eng',
},
{
title: 'Not selected',
value: 'any',
},
];
export default langList;
|
const got = require('got')
const CacheConf = require('cache-conf')
const pkg = require('../package.json')
const GOT_OPTIONS = {
json: true,
headers: {
'user-agent': `${pkg.name}/${pkg.version} (${pkg.homepage})`
},
useElectronNet: false
}
const CACHE_CONF = {
key: 'zazu-devdocs', // cache key prefix
maxAge: 86400000 // 1 day
}
const cache = new CacheConf()
/**
* Fetch the URL, cache the result and return it.
* Returns the cache result if it is valid.
*
* @param {string} url URL to fetch
* @param {string} cacheKey Cache key
* @return {Promise} Returns a promise that is fulfilled with the JSON result
*/
const fetch = (url, cacheKey) => {
const cachedResponse = cache.get(cacheKey, { ignoreMaxAge: true })
if (cachedResponse && !cache.isExpired(cacheKey)) {
return Promise.resolve(cachedResponse)
}
return new Promise((resolve, reject) => (
got(url, GOT_OPTIONS)
.then((response) => {
const data = response.body
cache.set(cacheKey, data, { maxAge: CACHE_CONF.maxAge })
resolve(data)
})
.catch((err) => {
if (cachedResponse) {
resolve(cachedResponse)
}
reject(err)
})
))
}
const fetchDocs = () => (
fetch('https://devdocs.io/docs/docs.json', `${CACHE_CONF.key}.docs`)
)
const fetchDoc = (slug) => (
fetch(`https://docs.devdocs.io/${slug}/index.json`, `${CACHE_CONF.key}.docs.${slug}`)
)
module.exports = {
docs: fetchDocs,
doc: fetchDoc
}
|
/*eslint no-unused-vars:0*/
import {device} from '../global';
/**
* Tw2RenderBatch base class
*
* @property {number} renderMode
* @property {Tw2PerObjectData} perObjectData
* @class
*/
export class Tw2RenderBatch
{
constructor()
{
this.renderMode = device.RM_ANY;
this.perObjectData = null;
}
/**
* Commits the batch
* @param {string} technique - technique name
*/
Commit(technique)
{
}
}
|
var Abstract = require('./abstract');
var util = require('util');
function EmailFilter() {
Abstract.call(this);
}
util.inherits(EmailFilter, Abstract);
EmailFilter.prototype._validate = function(value) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(value);
};
EmailFilter.prototype._sanitize = function(value) {
var exp = /[^a-zA-Z@0-9-_.]/g;
return value.replace(exp, '')
};
module.exports = EmailFilter;
|
(function () {
'use strict';
angular.module('app.bootstrapTutorial')
.run(bootstrapTutorialRoute);
bootstrapTutorialRoute.$inject = ['routerHelper'];
function bootstrapTutorialRoute(routerHelper) {
routerHelper.configureStates(getStates());
}
function getStates() {
return [
{
state: 'bootstrapTutorial',
config: {
url: '/bootstrapTutorial',
parent: 'private',
title: 'Bootstrap tutorial',
views: {
'main-content': {
templateUrl: 'demoApp/bootstrapTutorial/bootstrapTutorial.template.html',
controller: 'BootstrapTutorialController',
controllerAs: 'vm'
}
}
}
}
];
};
})();
|
'use strict'
const configure = require('./lib/configure')
module.exports = configure(({ ky }) => {
return options => {
options = options || {}
const searchParams = new URLSearchParams(options.searchParams)
if (options.flags != null) searchParams.set('flags', options.flags)
return ky.post('commands', {
timeout: options.timeout,
signal: options.signal,
headers: options.headers,
searchParams
}).json()
}
})
|
/**
* QueryBuilder
* Author: michael
* Date: 22.09.15.
* License: MIT
*/
'use strict';
const QueryBuilder = require('./../bin/QueryBuilder.js');
const assert = require("assert");
describe('QueryBuilder', function () {
describe('#createTable()', function () {
it('should create a table called testTable0815', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
let testData = new Map();
testData.set('testColumn1', 'VARCHAR(150)');
testData.set('testColumn2', 'INT');
builder.createTable('testTable0815', testData).then(val => {
done();
});
});
});
describe('#upsert()', function () {
it('should insert the testdata into the table', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
let testData = new Map();
for (let i = 0; i < 100; i++) {
testData.set(i, new Map([['testColumn1', i], ['testColumn2', i * 2], ['updated_at', new Date().toISOString()]]));
}
builder.upsert('testTable0815', testData).then(val => {
done();
});
});
});
describe('#insert()', function () {
it('should insert the testdata into the table', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
let testData = new Map();
for (let i = 0; i < 100; i++) {
testData.set(i, new Map([['testColumn1', i * 100], ['testColumn2', i * 200], ['updated_at', new Date().toISOString()]]));
}
builder.insert('testTable0815', testData).then(val => {
done();
});
});
});
describe('#update()', function () {
it('should update testColumn1 from 25 to 2000', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
builder.update('testTable0815', new Map([['update', new Map([['testColumn1', 2000]])], ['where', new Map([['testColumn1', 25]])]])).then(val => {
done();
});
});
});
describe('#select()', function () {
it('should find all rows from the table without conditions', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
builder.select('testTable0815').then(val => {
assert.equal(200, val.length);
done();
});
});
});
describe('#select()', function () {
it('should find all columns and rows from the table with matching conditions', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
builder.select('testTable0815', new Map([['where', new Map([['testColumn1', 50]])]])).then(val => {
assert.equal(1, val.length);
done();
});
});
});
describe('#select()', function () {
it('should find the columns id,updated_at,testColumn2,testColumn1 from the row where testColumn1 has the value 50', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
builder.select('testTable0815', new Map([['whereIn', new Map([['testColumn1', [50, 51]]])], ['select', ['id', 'updated_at', 'testColumn2', 'testColumn1']]])).then(val => {
assert.equal(2, val.length);
done();
});
});
});
describe('#rm()', function () {
it('should delete the row where testColumn1 has the value 75', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
builder.rm('testTable0815', new Map([['whereIn', new Map([['testColumn1', [76, 77]]])]])).then(val => {
assert.equal(2, val.affectedRows);
done();
});
});
});
describe('#truncate()', function () {
it('should truncate the table', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
builder.truncate('testTable0815').then(val => {
done();
});
});
});
describe('#dropTable()', function () {
it('should drop a table called testTable0815', function (done) {
let builder = new QueryBuilder('usertable200', {shouldQueryNow: true});
builder.drop('testTable0815').then(val => {
done();
});
});
});
});
|
import React from 'react'
import {JssProvider} from 'react-jss'
import jss from '../utils/jss'
import App from '../components/App'
const AppContainer = ({registry, ...props}) => (
<JssProvider jss={jss} registry={registry}>
<App {...props} />
</JssProvider>
)
AppContainer.propTypes = {
registry: React.PropTypes.shape({})
}
AppContainer.defaultProps = {
registry: undefined
}
export default AppContainer
|
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
this.route("root", {path: "/"});
this.route("login", {path: "/s/login"});
this.route("unpacking", {path: "/s/unpacking"});
this.route("invite", {path: "/s/invite/:token"});
this.resource('snow', {path: '/s'}, function() {
this.route('home', {path: '/'});
this.resource('metrics', function(){
this.route('show', {path: ':metric_id'});
});
this.resource('dashboards', function(){
this.route('new');
this.route('show', {path: ':dashboard_id'});
this.route('edit', {path: ':dashboard_id/edit'});
});
this.resource('integrations', function(){
this.route('new');
this.route('show', {path: ':integration_id'});
this.route('edit', {path: ':integration_id/edit'});
});
this.resource('users', function(){
this.route("show", {path: ":user_id"});
});
});
});
export default Router;
|
/* jshint camelcase: false */
module.exports = function (grunt) {
var jsFiles = ['*.js', 'src/**/*.js', 'tests/*.js', 'tests/spec/*.js'];
grunt.initConfig({
connect: {
uses_defaults: {}
},
jasmine: {
main: {
options: {
specs: ['tests/spec/**/*.js'],
vendor: ['tests/testConfig.js', 'tests/libs/dojo/dojo.js'],
host: 'http://localhost:8000'
}
}
},
jshint: {
files: jsFiles,
options: {
jshintrc: '.jshintrc'
}
},
watch: {
files: jsFiles,
tasks: ['jshint', 'jasmine:main:build'],
options: {
livereload: true
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jasmine:main:build', 'jshint', 'connect', 'watch']);
grunt.registerTask('travis', ['jshint', 'connect', 'jasmine']);
};
|
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const sqlite3 = require("sqlite3");
function createDatabaseAndTables(databaseFileName) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
const db = new sqlite3.Database(databaseFileName);
db.run(`CREATE TABLE IF NOT EXISTS formmailer_data (
id INTEGER PRIMARY KEY AUTOINCREMENT,
date DATETIME,
referrer TEXT,
form_name TEXT,
post TEXT,
user_message TEXT,
to_email TEXT,
ip TEXT
)`, (err) => {
db.close();
if (err) {
reject(err);
}
resolve();
});
});
});
}
exports.createDatabaseAndTables = createDatabaseAndTables;
function saveEmailToDB(databaseFileName, ip, post, referrer, formName, toEmail, sentMessage) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
const db = new sqlite3.Database(databaseFileName);
db.run(`INSERT INTO formmailer_data
(date, referrer, form_name, post, user_message, to_email, ip)
VALUES
(datetime(), $referrer, $form_name, $post, $user_message, $to, $ip)`, {
$form_name: formName,
$ip: ip,
$post: post,
$referrer: referrer,
$to: toEmail,
$user_message: sentMessage,
}, (err) => {
db.close();
if (err) {
reject(err);
}
resolve();
});
});
});
}
exports.saveEmailToDB = saveEmailToDB;
function loadSentEmailsInfo(databaseFileName) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
const db = new sqlite3.Database(databaseFileName);
db.all(`SELECT date, referrer, form_name, post, user_message, to_email, ip
FROM formmailer_data`, (err, rows) => {
db.close();
if (err) {
reject(err);
}
// tslint:disable-next-line:no-any
rows.forEach((r) => {
r.user_message = r.user_message.split("\n");
});
resolve(rows);
});
});
});
}
exports.loadSentEmailsInfo = loadSentEmailsInfo;
|
version https://git-lfs.github.com/spec/v1
oid sha256:3d17ef6f3a46e9bea81634f9e23d3e1df639c4704d7718473133ba20db57c134
size 2661
|
define({
"_widgetLabel": "Επεξεργασία",
"_featureAction_Edit": "Επεξεργασία",
"title": "Επιλέξτε ένα πρότυπο για τη δημιουργία στοιχείων",
"pressStr": "Πατήστε ",
"ctrlStr": " CTRL ",
"snapStr": " για να ενεργοποιηθεί η λειτουργία αγκίστρωσης",
"close": "Κλείσιμο",
"featureLayers": "Feature layers",
"searchTemplates": "Αναζήτηση προτύπων",
"noAvailableTempaltes": "Δεν υπάρχουν διαθέσιμα πρότυπα",
"noCanCreateLayerAreCurrentlyVisible": "Δεν υπάρχουν αυτή τη στιγμή ορατά θεματικά επίπεδα με δυνατότητα δημιουργίας.",
"layersAreInvisibleOrOutOfScaleRange": "Τα θεματικά επίπεδα είναι μη ορατά ή εκτός εύρους κλίμακας.",
"relatedTables": "Σχετικοί πίνακες:",
"relatedRecords": "Σχετικές εγγραφές:",
"noRelatedRecotds": "Δεν βρέθηκαν σχετικές εγγραφές.",
"startToDraw": "Κάντε κλικ για να αρχίσετε να σχεδιάζετε.",
"startToAddPoint": "Κάντε κλικ για προσθήκη σημείου",
"editRelatedFeature": "Επεξεργασία συσχετιζόμενου στοιχείου"
});
|
module.exports = function(skill, info, bot, message, db) {
bot.api.users.info({user: message.user}, (error, response) => {
var fuckArray = [
'off',
'ing',
'you',
'donut',
'shakespeare',
'linus',
'king',
'chainsaw',
'outside',
'madison',
'yoda',
'nugget',
'shutup',
'think'
];
var randomFuck = Math.floor(Math.random()*fuckArray.length);
let {name, real_name} = response.user;
bot.reply(message, 'http://foaas.com/' + fuckArray[randomFuck] + '/' + name + '/' + bot.identity.name);
})
//bot.reply(message, 'http://foaas.com/everyone/' + bot.identity.name);
//bot.reply(message, 'I understood this as ' + skill + ', but you haven\'t configured how to make me work yet! Tell your local code monkey to fill in the code module for ' + skill);
};
|
var onPageLoad = require('../shared/pageload');
var barChart = require('../shared/bar_chart');
$(function(){
onPageLoad('graphs');
// Load some dummy data and display it as a bar chart
barChart('#graph', 'data/data.tsv');
});
|
module.exports = {
livereload: {
options: {
livereload: true
},
files: [
'<%= appConfig.dev.path %>/components/bootstrap/{,*/}*.css',
'<%= appConfig.dev.path %>/styles/{,*/}*.css',
'<%= appConfig.dev.path %>/{,*/}*.html',
'<%= appConfig.dev.path %>/modules/**/{,*/}*.{css,js,html}',
'{.tmp,<%= appConfig.dev.path %>}/styles/*.css',
'{.tmp,<%= appConfig.dev.path %>}/views/{,*/}*.html',
'{.tmp,<%= appConfig.dev.path %>}/scripts/{,*/}*.js',
'<%= appConfig.dev.path %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
},
jade: {
files: [
'./app/modules/**/views/**/*.jade'
],
tasks: [
'jade:compile'
]
},
less: {
files: [
'<%= appConfig.dev.path %>/components/bootstrap/less/*.less',
'<%= appConfig.dev.path %>/styles/less/**/*.less',
'<%= appConfig.dev.path %>/modules/**/styles/**/*.less'
],
tasks: [
'less:css'
]
},
unitTests: {
files: [
'test*/unit/**/*.js',
'**/test*/unit/**/*.js'
]
},
e2eTests: {
files: [
'test*/e2e/**/*.js',
'**/test*/e2e/**/*.js'
],
tasks: [ 'protractor:singlerun' ]
}
};
|
module.exports = function ($) {
return function (databaseName) {
if (!$.databases[databaseName]) {
$.logger('Error: Database \''+databaseName+'\' not found');
return;
}
return $.databases[databaseName];
}
}
|
angular.module('angular-query-builder', [
'ngAnimate',
'templates-aqb',
'aqb.src.directives',
'aqb.src.helpers'
])
.factory('AppConfig', function () {
var maxConditions;
var maxGroups;
return {
setMaxConditions: function (max) {
maxConditions = max;
},
getMaxConditions: function () {
return maxConditions;
},
setMaxGroups: function (max) {
maxGroups = max;
},
getMaxGroups: function () {
return maxGroups;
}
};
});
|
var upvotebayApp = angular.module('upvotebayApp', [
'ngCookies',
'ngRoute',
'upvotebayControllers',
'upvotebayFilters'
]);
upvotebayApp.config(['$routeProvider', '$locationProvider',
function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider.
when('/', {
templateUrl: '/static/partials/my-profile.html',
controller: 'MyProfileCtrl'
}).
when('/u/:username', {
templateUrl: '/static/partials/user-profile.html',
controller: 'UserProfileCtrl'
}).
otherwise({
redirectTo: '/404'
});
}
]);
upvotebayApp.factory('LoginService', ['$cookieStore', function($cookieStore) {
var current_user = JSON.parse($cookieStore.get('current_user'));
$cookieStore.remove('current_user');
return {current_user: current_user};
}]);
|
'use strict';
var React = require('react');
var SvgIcon = require('../../svg-icon');
var EditorFormatStrikethrough = React.createClass({
displayName: 'EditorFormatStrikethrough',
render: function render() {
return React.createElement(
SvgIcon,
this.props,
React.createElement('path', { d: "M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z" })
);
}
});
module.exports = EditorFormatStrikethrough;
|
'use strict';
//Setting up route
angular.module('conferences').config(['$stateProvider',
function($stateProvider) {
// Conferences state routing
$stateProvider.
state('listConferences', {
url: '/conferences',
templateUrl: 'modules/conferences/views/list-conferences.client.view.html'
}).
state('createConference', {
url: '/conferences/create',
templateUrl: 'modules/conferences/views/create-conference.client.view.html'
}).
state('viewConference', {
url: '/conferences/:conferenceId',
templateUrl: 'modules/conferences/views/view-conference.client.view.html'
}).
state('editConference', {
url: '/conferences/:conferenceId/edit',
templateUrl: 'modules/conferences/views/edit-conference.client.view.html'
});
}
]);
|
var display = function(obj, edit, parent) {
if (obj === null) {
return null;
}
var ret = JSON.stringify(obj);
var cls = obj.thisisa;
var disp;
if (_.isArray(obj)) {
disp = obj.map(function(o) { return display(o, edit, "array"); });
} else if (_.isObject(obj)) {
disp = _.mapObject(obj, function(v) { return display(v, edit, obj.thisisa); });
} else {
disp = obj;
}
switch (obj.thisisa) {
case "want":
if (edit) {
switch (obj.type) {
case "key":
ret = '<span>WANT KEY</span>';
break;
case "node":
cls = "node";
var v = display({"thisisa": "want", "type": "type", "typs": ["merge", "node", "noderef", "or", "wildcard"]}, edit, obj.thisisa);
ret = '<table><tbody><tr><td><span class="key type">type</span></td><td>' + v + '</td></tr><tr><td>';
ret += '<span class="key is">is</span></td><td>' + v + '</td></tr><tr><td>';
ret += display({"thisisa": "want", "type": "key"}, edit, obj.thisisa);
ret += '</td><td>' + v + '</td></tr></tbody></table>';
break;
case "string":
ret = '<span>WANT STRING</span>';
break;
case "type":
ret = '<div class="select">';
ret += obj.typs.map(function(t) { return '<input type="radio" name="type-sel" value="' + t + '">' + t + '</input>'; }).join('');
ret += '<button onclick="dotypesel(event, \'' + parent + '\');">Select</button></div>';
break;
default:
ret = '<span class="err">Unknown Want Type "' + obj.type + '"</span>';
}
} else {
ret = '<span class="want-type">Unset ' + obj.type + '</span>';
} break;
case "function":
break;
case "grammar":
break;
case "langname":
ret = '<table><tbody><tr><td>Code:</td><td>' + disp.code + '</td></tr>';
ret += '<tr><td>Short Name:</td><td>' + disp.shortname + '</td></tr>';
ret += '<tr><td>Long Name:</td><td>' + disp.longname + '</td></tr></tbody></table>';
break;
case "list":
break;
case "morphologyrule":
break;
case "node":
ret = '<table><tbody>';
if ('type' in obj) {
ret += '<tr><td><span class="key type">type</span></td><td>' + disp.type + '</td></tr>';
}
if ('is' in obj) {
ret += '<tr><td><span class="key is">is</span></td><td>' + disp.is + '</td></tr>';
}
for (var k in _.omit(obj, 'thisisa', 'type', 'is')) {
ret += '<tr><td><span class="key">' + k + '</span></td><td>' + disp[k] + '</td></tr>';
}
ret += '</tbody></table>';
break;
case "noderef":
ret = '<span class="wildcard">' + disp.id + '</span>';
break;
case "or":
ret = '<ul><li>' + disp.options.join('</li><li>') + '</li></ul>';
break;
case "syntaxrule":
break;
case "wildcard":
ret = '<span class="wild">' + disp.id + '</span>';
break;
case "wordify":
break;
default:
if (_.isArray(obj)) {
ret = '<ul><li>' + disp.join('</li><li>') + '</li></ul>';
cls = "list";
} else if (_.isBoolean(obj)) {
cls = "boolean";
ret = '<span class="bool">' + obj + '</span>';
} else if (_.isString(obj) || _.isNumber(obj)) {
if (parent !== "node") {
return obj;
}
cls = "symbol";
ret = '<span class="value">' + obj + '</span>';
}
}
var s = '<div class="' + cls + '"><span class="header">' + cls + '</span><span class="showhide" onclick="showhide(event);">Show/Hide</span>';
if (edit) {
return s + '<span class="delete" onclick="delthing(event);">Delete</span><br>' + ret + '</div>';
} else {
return s + '<br>' + ret + '</div>';
}
}
var dotypesel = function(e, par) {
e.target.parentNode.parentNode.outerHTML = display({"thisisa": "want", "type": $('input[name="type-sel"]:checked').val()}, true, par);
}
var showhide = function(e) {
e.target.parentNode.lastElementChild.style.display = {"": "none", "none": ""}[e.target.parentNode.lastElementChild.style.display]
}
var parsediv = function(div) {
var dochild = function(d, tag, fn) {
return _.flatten(_.map(d.childNodes, function(n) { return n.tagName === tag ? _.map(n.childNodes, fn) : []; }), true);
};
var pd1st = function(n) { return parsediv(n.firstChild); }
var ret = {
"thisisa": div.className
};
switch (div.className) {
case "boolean":
ret = div.getElementsByClassName('bool')[0].innerHTML === "true" ? true : false;
break;
case "function":
break;
case "grammar":
break;
case "langname":
break;
case "list":
ret = dochild(div, "UL", pd1st);
break;
case "litdict":
break;
case "load":
break;
case "morphologyrule":
break;
case "node":
dochild(div, "TABLE", function(t) {
$.each(t.childNodes, function(i, tr) {
ret[tr.firstChild.firstChild.innerHTML] = pd1st(tr.childNodes[1]);
});
});
break;
case "noderef":
break;
case "or":
ret = {
"thisisa": "or",
"options": dochild(div, "UL", pd1st)
};
break;
case "symbol":
ret = div.getElementsByClassName('value')[0].innerHTML;
break;
case "syntaxrule":
break;
case "wildcard":
ret.id = div.getElementsByClassName('wild')[0].innerHTML;
break;
case "wordify":
break;
default:
ret = {
"thisisa": "unknown"
};
}
return ret;
}
var delthing = function(e) {
var d = e.target.parentNode;
if (d.parentNode.tagName === "LI") {
d = d.parentNode;
} else if (d.parentNode.tagName === "TD") {
d = d.parentNode.parentNode;
}
d.outerHTML = "";
}
|
var fs = require('fs')
var path = require('path')
var dotjson = require('dotjson')
var optimist = require('optimist')
.usage(require('heredoc')(function(){/*
Usage: $0 [options]
set module's registry to global default
$0
get module registry
$0 -r, --registry
set module registry
$0 -r, --registry <registry url>
get global registry
$0-g, --global
set global registry
$0 -g, --global <registry url>
*/}))
.alias('h','help')
.boolean('h')
.describe('h', 'show help')
.alias('r','registry')
.describe('r', 'gets or sets the current module\'s registry url')
.alias('l','licenseText')
.describe('l', 'The text to save in LICENSE as a SPDX-compatible license file')
.default('l', '(c) '+(new Date()).getFullYear()+' Jane Doe')
var argv = optimist.argv
if (argv.help) {
optimist.showHelp()
process.exit()
}
const LICENSE_FILENAME = 'LICENSE'
const LICENSE_VALUE = 'LicenseRef-LICENSE'
const LOCAL = path.resolve(process.cwd(), 'package.json')
if (argv.registry || argv.licenseText) {
if (argv.registry) {
dotjson.set(LOCAL, {
'publishConfig.registry': argv.registry
})
}
if (argv.licenseText) {
fs.writeFileSync(LICENSE_FILENAME, argv.licenseText)
dotjson.set(LOCAL, {
'license': LICENSE_VALUE
})
}
process.exit()
}
|
/**
DateUtil
--------
This module provides helper function to create request periods from
Javascript date objects.
Typically, you use the getPeriod(dates, granularity) function, which in
its turn calls an appropriate function, depending on the granularity.
The dates parameter can be either a single date, which returns a single
period (e.g. YYYYMMDD), or an array with two Dates (range), which returns
a period range, (e.g. YYYYMM-YYYYMM)
To parse a period into a date, use the getDate(period) function. This will
return a Date with the provided period. Periods without months or days will
have the missing value set to 1, i.e. getDate("2004") will return a the Date
2014-01-01.
**/
module.exports = {
getDate: getDate,
getDayPeriod: getDayPeriod,
getMonthPeriod: getMonthPeriod,
getPeriod: getPeriod,
getYearPeriod: getYearPeriod,
daysInMonth: daysInMonth,
parseISO: parseISO,
};
function _zeroPaddedString(number) {
if (number == null) { return ''; }
return (number < 10 ? '0' : '') + number;
}
function _periodFormat(year, month, day) {
if (month != null) { month ++; }
return _zeroPaddedString(year) + _zeroPaddedString(month) + _zeroPaddedString(day);
}
function periodsFormat(dates, func) {
if (!angular.isArray(dates)) { return func(dates); }
return dates.map(func).join('-');
}
function getYearPeriod(dates) {
return periodsFormat(dates, function(date) {
return _periodFormat(date.getFullYear());
});
}
function getMonthPeriod(dates) {
return periodsFormat(dates, function(date) {
return _periodFormat(date.getFullYear(), date.getMonth());
});
}
function getDayPeriod(dates) {
return periodsFormat(dates, function(date) {
return _periodFormat(date.getFullYear(), date.getMonth(), date.getDate());
});
}
// Returns a period for the provided date range, or single date.
// Will auto-calculate period style depending on granularity, unless force is
// set to true.
// E.g. when getting day granularity for a single date, the function will assume
// you want day values for the date's month.
function getPeriod(dates, granularity, forced) {
var isArray = angular.isArray(dates);
var isRange = (isArray && dates.length > 1);
if ((isArray && dates.length === 0) || dates === null || dates === undefined) {
return null;
}
if (granularity === 'month') {
return (isRange || forced) ? getMonthPeriod(dates) : getYearPeriod(dates);
}
if (granularity === 'day') {
return (isRange || forced) ? getDayPeriod(dates) : getMonthPeriod(dates);
}
if (granularity === 'week' && !isRange) {
// Special case. Week is no actual granularity. This returns a week period
// starting at the specified date. No checks are made to determine if the
// provided date actually is the first day in a week.
var start = (isArray) ? dates[0] : dates;
var end = new Date(start.getTime());
end.setDate(end.getDate() + 6);
return getDayPeriod([start, end]);
}
return getDayPeriod(dates);
}
function getDate(period) {
if (typeof period === 'number') { period = period.toString(); }
if (period === null || period === undefined || period.length < 4) { return null; }
var components = [parseInt(period.substr(0, 4), 10)];
var i = 0, len = period.length;
while (4 + (i * 2) < len) {
components[i + 1] = parseInt(period.substr(4 + (2 * i), 2));
i++;
}
return new Date(components[0], // hour
components[1] ? components[1] - 1 : 0, // month
components[2] || 1, // day
components[3] || 0, // hour
components[4] || 0, // min
components[5] || 0); // second
}
// Helper function for returning the number of days in a month
function daysInMonth(date) {
var d = new Date(date.getTime());
d.setMonth(d.getMonth() + 1);
d.setDate(0);
return d.getDate();
}
// IE and Safari fail at parsing ISO strings without : in time zone offset.
// This is a fix for that. This fix only accounts for whole hours in offset.
function parseISO(dateString) {
var timestamp = Date.parse(dateString);
if (!isNaN(timestamp)) {
return new Date(timestamp);
}
var date, offsetString, offset;
var components = dateString.slice(0,-5).split(/\D/).map(function(itm){
return parseInt(itm, 10) || 0;
});
components[1]-= 1;
offsetString = dateString.slice(-5);
offset = parseInt(offsetString, 10) / 100;
date = new Date(Date.UTC.apply(Date, components));
date.setHours(date.getHours() - offset);
return date;
}
|
'use strict';
// --- Get currently connected users
function getUsers(socket) {
var connected = socket.nsp.sockets;
var users = [];
for (var i=0; i<connected.length;i++) {
users.push(connected[i].bgsUser);
}
return {users: users};
}
// --- Get current user
function getUser(socket) {
return {user: socket.bgsUser};
}
module.exports = function(socket) {
// -- Send the new user to everyone else
socket.broadcast.emit('userJoined', getUser(socket));
// -- Currently connected users
socket.on('getUsers', function(){
socket.emit('hereAreTheUsers', getUsers(socket));
});
socket.on('disconnect', function(){
// -- Notify everyone that this user left
socket.broadcast.emit('userLeft', getUser(socket));
});
}
|
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
alias: {
'redux': path.join(__dirname, 'node_modules/redux')
},
extensions: ['', '.js']
},
module: {
loaders: [{
test: /\.js$/,
loaders: ['react-hot', 'babel'],
exclude: /node_modules/,
include: __dirname
}, {
test: /\.js$/,
loaders: ['babel'],
include: path.join(__dirname, '..', '..', 'src')
}, {
test: /\.css?$/,
loaders: ['style', 'raw'],
include: __dirname
}]
},
proxy: {
'/favicon.ico': {
target: 'http://192.168.99.100',
secure: false
}
}
};
|
version https://git-lfs.github.com/spec/v1
oid sha256:3e82b591edf72e430494420262a44ec71db66616a8c757c4509c59b5ca875a78
size 206789
|
const _ = require('lodash');
module.exports = (function(){
let bot,
redis,
config,
adminChannel;
function notify (message, channel, user) {
let [command, ...rest] = message.parts;
let msg = `*admin-notify* ${bot.makeMention(user)} sent: \n> ${rest.join(' ')}`;
const targetChannel = bot.getChannelGroupOrDMByName(adminChannel);
if (!_.isUndefined(targetChannel)) {
targetChannel.send(msg);
channel.send('Your message has been sent successfully. An admin should respond to you shortly.');
} else {
console.log('Invalid admin channel!', adminChannel);
return channel.send('sorry, I haven`t been configured properly to do that! Notify the owner of the group that ' +
'I need to be configured to know what the admin channel is.');
}
}
return function init (_bot, _config) {
bot = _bot;
config = _config;
redis = bot.redis;
adminChannel = config.adminChannel;
if (_.isUndefined(adminChannel)) {
console.log('adminChannel not defined!');
} else if (!_.includes(bot.channelList, adminChannel) && !_.includes(bot.groupList, adminChannel)) {
console.log('Invalid adminChannel:', adminChannel, 'I am not part of that channel. ' +
'I must be invited to that channel.');
}
bot.register({
pattern: {startsWith: '!admin'},
f: notify,
type: 'OUT',
eventType: 'message',
priority: 1000,
flags: {}
});
};
})();
|
import React from 'react'
import UsageStatistic from './UsageStatistic'
import DisableButton from './DisableButton'
import SettingsAccordion from './SettingsAccordion'
export default ({
statistics,
disabledHosts,
currentUrl,
compressionLevel,
convertBw,
onSiteDisable,
onSiteEnable,
disabledOnChange,
convertBwOnChange,
isWebpSupported,
compressionLevelOnChange
}) => (
<div>
<UsageStatistic
filesProcessed={statistics.filesProcessed}
bytesProcessed={statistics.bytesProcessed}
bytesSaved={statistics.bytesSaved}
/>
<DisableButton
disabledHosts={disabledHosts}
currentUrl={currentUrl}
onSiteDisable={onSiteDisable}
onSiteEnable={onSiteEnable}
/>
<SettingsAccordion
disabledHosts={disabledHosts}
convertBw={convertBw}
isWebpSupported={isWebpSupported}
compressionLevel={compressionLevel}
disabledOnChange={disabledOnChange}
convertBwOnChange={convertBwOnChange}
compressionLevelOnChange={compressionLevelOnChange}
/>
</div>
)
|
//= require "./selection"
(function( DOC, $ ){
if ( $.browser.msie )
{
function setBookmark()
{
var
$bookmark = $('#WysiHat-bookmark'),
$parent = $('<div/>'),
range = this._document.selection.createRange();
if ( $bookmark.length > 0 )
{
$bookmark.remove();
}
$bookmark = $( '<span id="WysiHat-bookmark"> </span>' )
.appendTo( $parent );
range.collapse(true);
range.pasteHTML( $parent.html() );
}
function moveToBookmark(element)
{
var
$bookmark = $('#WysiHat-bookmark'),
range = this._document.selection.createRange();
if ( $bookmark.length > 0 )
{
$bookmark.remove();
}
range.moveToElementText( $bookmark.get(0) );
range.collapse(true);
range.select();
$bookmark.remove();
}
}
else
{
function setBookmark()
{
var $bookmark = $('#WysiHat-bookmark');
if ( $bookmark.length > 0 )
{
$bookmark.remove();
}
$bookmark = $( '<span id="WysiHat-bookmark"> </span>' );
this.getRangeAt(0).insertNode( $bookmark.get(0) );
}
function moveToBookmark(element)
{
var
$bookmark = $('#WysiHat-bookmark'),
range = DOC.createRange();
if ( $bookmark.length > 0 )
{
$bookmark.remove();
}
range.setStartBefore( $bookmark.get(0) );
this.removeAllRanges();
this.addRange(range);
$bookmark.remove();
}
}
$.extend( Selection.prototype, {
setBookmark: setBookmark,
moveToBookmark: moveToBookmark
});
})(document,jQuery);
|
"use strict";
/* global describe it */
const { assert } = require("chai");
const { getCmdLineOpts } = require("../index");
describe("CmdLineOpts", () => {
describe("Option mgmtBus", () => {
it("should have mgmtBus entry", async () => {
assert.isTrue("bus" in getCmdLineOpts(), "getCmdLineOpts has property mgmtBus");
});
it("should parse URLs to RabbitMQ config correctly", async () => {
const exchange1 = "someExchange";
const queue1 = "someQueue";
const hostPart1 = "amqp://someloc.somehost.com:5672";
const uri1 = `${hostPart1}/${exchange1}/${queue1}`;
const cfg1 = getCmdLineOpts().bus.coerce(uri1);
const cfg1Expected = {
uri: hostPart1,
exchange: {
name: exchange1,
type: "topic",
options: {
durable: true
}
},
queue: {
name: queue1,
options: {
durable: true,
exclusive: false
}
}
};
assert.deepEqual(cfg1, cfg1Expected);
});
it("should parse URLs without queue to RabbitMQ config correctly", async () => {
const exchange1 = "someExchange";
const queue1 = "someQueue";
const hostPart1 = "amqp://someloc.somehost.com:5672";
const uri1 = `${hostPart1}/${exchange1}`;
const cfg1 = getCmdLineOpts({ queueName: queue1 }).bus.coerce(uri1);
const cfg1Expected = {
uri: hostPart1,
exchange: {
name: exchange1,
type: "topic",
options: {
durable: true
}
},
queue: {
name: queue1,
options: {
durable: true,
exclusive: false
}
}
};
assert.deepEqual(cfg1, cfg1Expected);
});
it("should parse URLs without exchange to RabbitMQ config correctly", async () => {
const exchange1 = "someExchange";
const queue1 = "someQueue";
const hostPart1 = "amqp://someloc.somehost.com:5672";
const uri1 = `${hostPart1}/${queue1}`;
const cfg1 = getCmdLineOpts({ exchangeName: exchange1 }).bus.coerce(uri1);
const cfg1Expected = {
uri: hostPart1,
exchange: {
name: exchange1,
type: "topic",
options: {
durable: true
}
},
queue: {
name: queue1,
options: {
durable: true,
exclusive: false
}
}
};
assert.deepEqual(cfg1, cfg1Expected);
});
it("should parse URLs without exchange and queue to RabbitMQ config correctly", async () => {
const exchange1 = "someExchange";
const queue1 = "someQueue";
const hostPart1 = "amqp://someloc.somehost.com:5672";
const uri1 = `${hostPart1}`;
const cfg1 = getCmdLineOpts({ exchangeName: exchange1, queueName: queue1 }).bus.coerce(uri1);
const cfg1Expected = {
uri: hostPart1,
exchange: {
name: exchange1,
type: "topic",
options: {
durable: true
}
},
queue: {
name: queue1,
options: {
durable: true,
exclusive: false
}
}
};
assert.deepEqual(cfg1, cfg1Expected);
});
it("should require URL to have correct protocol", async () => {
const url = "http://somehost.com:5672/ex1/q1";
assert.throws(getCmdLineOpts().bus.coerce.bind(null, url),
Error, /protocol must be amqp/);
});
it("should require URL to have exchange and queue info", async () => {
const url = "amqp://someloc.somehost.com:5672";
assert.throws(getCmdLineOpts().bus.coerce.bind(null, url),
Error, /exchange and queue must be given/);
});
it("should require URL to have exchange info", async () => {
const url = "amqp://someloc.somehost.com:5672/";
assert.throws(getCmdLineOpts().bus.coerce.bind(null, url),
Error, /exchange name must be given/);
});
it("should require URL to have queue info", async () => {
const url1 = "amqp://someloc.somehost.com:5672/ex1";
assert.throws(getCmdLineOpts().bus.coerce.bind(null, url1),
Error, /queue name must be given/);
const url2 = `${url1}/`;
assert.throws(getCmdLineOpts().bus.coerce.bind(null, url2),
Error, /queue name must be given/);
});
});
});
|
<!--ok>line1
/*<jdists>*/line1.2/*</jdists>*/
line2</ok-->
/*<jdists import="6.js" line3 />*/
/*<jdists clean id='ttc' import="5.js" line4>*/
console.log(line5);
/*</jdists>*/
/*<remove line7>
console.log(line8);
</remove>*/
(*<delphi line10>
console.log(line11);
</delphi>*)
(*<delphi line13="a&b3 ">*)
console.log(line14);
(*</delphi>*)
'''<release line16>'''
line14
'''</release>'''
'''<release line19>
test
/*<jdists import="line21.js">*/
line17</release>'''
/*<jdists import="line23.js">*/
console.log(line19);
/*</jdists>*/
/*<jdists import="line26.js">*/
/*<jdists import="line27.js">*/
/*<jdists import="line28.js">*/console.log(4);/*</jdists>*/
/*<jdists import="line29.js">*/console.log(5);/*</jdists>*/
console.log(line30);
/*</jdists>*/
line32/*</jdists>*/
line33
--[[<lua>]]
line35 = {}
--[[</lua>]]
--[[<lua>line38 = {}</lua>]]
|
"use strict";
const
hash = require("./hash"),
dom = require("./dom"),
svg = require("./svg"),
colors = require("./colors"),
gradients = require("./gradients"),
sequenceEditor = require("./sequence-editor").allocate(),
runIcon = require("./res/run.svg"),
aboutIcon = require("./res/email.svg"),
durationIcon = require("./res/power.svg"),
commonTextProperties = {
"font-family": "Arial",
fill: colors.text.step,
stroke: "url(#innerBorder)",
"stroke-opacity": 0.2,
"stroke-width": 0.001
},
buttonProperties = Object.assign({
"font-size": 0.2,
"text-anchor": "middle"
}, commonTextProperties),
digitProperties = Object.assign({
"font-size": 0.25,
"text-anchor": "middle"
}, commonTextProperties),
stepProperties = Object.assign({
"font-size": 0.15,
"text-anchor": "end"
}, commonTextProperties),
createButton = ({id, cx, y, label = "", r = 0.15, cy = 0.85, icon = ""}) => {
let result = [
svg.circle({id: id, r: r, cx: cx, cy: cy,
fill: colors.circle.light, stroke: "url(#innerBorder)", "stroke-width": 0.01})
],
r2 = 0.7 * r;
if (icon) {
result.push(svg.image({x: cx - r2, y: cy - r2, "xlink:href": icon, height: r2 * 2, width: r2 * 2}));
} else {
result.push(svg.text(Object.assign({x: cx, y: y}, buttonProperties), label));
}
return result;
},
createDigit = (x, baseId) => [
svg.rect({x: x - 0.1, y: -0.8, width: 0.2, height: 0.4,
fill: colors.circle.background, stroke: "url(#outerBorder)", "stroke-width": 0.01}),
svg.text(Object.assign({id: `dig${baseId}`, x: x, y: -0.52}, digitProperties), "")
].concat(
createButton({id: `inc${baseId}`, cx: x, x: x, y: -0.82, r: 0.08, cy: -0.89, label: "+"}),
createButton({id: `dec${baseId}`, cx: x, x: x, y: -0.26, r: 0.08, cy: -0.31, label: "-"})
),
refresh = (sequence, total) => {
let current = sequence[sequence.length - 1],
list;
dom.setText("total", total);
[0, 1, 3, 4].forEach((pos, digit) => {
dom.setText(`dig${digit}`, current.substr(pos, 1));
});
list = dom.clear("list");
sequence.forEach((time, index) => {
list.appendChild(svg.text(Object.assign({
x: -0.5 + 0.45 * (index % 4),
y: 0.15 * Math.floor(index / 4)
}, stepProperties), time));
});
hash.setSequence(sequenceEditor.get());
},
setup = () => {
document.body.appendChild(svg({
width: "100%",
height: "100%",
viewBox: "-1 -1 2 2",
style: `background-color: ${colors.background};`
}, [gradients()]
.concat(
createDigit(-0.7, 0),
createDigit(-0.45, 1),
svg.text(Object.assign({x: -0.1, y: -0.52}, digitProperties), ":"),
createDigit(-0.15, 2),
createDigit(0.1, 3),
svg.image({x: 0.2, y: -0.72, "xlink:href": durationIcon, height: 0.2, width: 0.2}),
svg.text(Object.assign({id: "total", x: 0.4, y: -0.57,
"font-size": 0.15, "text-anchor": "start"}, commonTextProperties), "00:00")
)
.concat(
createButton({id: "about", cx: -0.6, icon: aboutIcon}),
createButton({id: "remove", cx: -0.2, y: 0.90, label: "-"}),
createButton({id: "add", cx: 0.2, y: 0.92, label: "+"}),
createButton({id: "run", cx: 0.6, icon: runIcon}),
svg.g({id: "list"})
)
));
sequenceEditor.set(hash.getSequence());
sequenceEditor.on(refresh);
return {
inc0: () => sequenceEditor.inc(600),
dec0: () => sequenceEditor.dec(600),
inc1: () => sequenceEditor.inc(60),
dec1: () => sequenceEditor.dec(60),
inc2: () => sequenceEditor.inc(10),
dec2: () => sequenceEditor.dec(10),
inc3: () => sequenceEditor.inc(1),
dec3: () => sequenceEditor.dec(1),
add: () => sequenceEditor.get().length < 16 ? sequenceEditor.add() : 0,
remove: () => sequenceEditor.remove(),
run: () => hash.setMode("run"),
about: () => hash.setMode("about")
};
};
module.exports = {
setup: setup
};
|
import {
mapValues as _mapValues,
isFunction as _isFunction
} from 'lodash';
export class Interpolation {
constructor($interpolate, $parse) {
'ngInject';
this.$interpolate = $interpolate;
this.$parse = $parse;
this._errMessageStart = 'Interpolation: ';
}
/**
* Takes a template, string or object. Returns a stringified string,
* or throws SyntaxError if object can not be stringified.
*
* @param {string|object} template
* @returns {string}
* @private
*/
_convertTemplateToString(template) {
if (angular.isString(template)) {
return template;
}
try {
return JSON.stringify(template);
}
catch (e) {
const errMsg = `${this._errMessageStart} _convertTemplateToString:
Had a problem stringifying the provided template.
Value: ${template}
Error: ${e.message}`;
throw new SyntaxError(errMsg);
}
}
/**
* Takes a template string and tries to JSON.parse it into an object.
* If JSON.parse fails, it throws a SyntaxError
*
* @param {string} templateString
* @private
*/
_convertStringToObject(templateString) {
try {
return JSON.parse(templateString);
}
catch (e) {
const errMsg = `${this._errMessageStart} _convertStringToObject:
templateString could not be parsed to object.
Value: ${templateString}
Error: ${e.message}`;
throw new SyntaxError(errMsg);
}
}
/**
* Takes a template (string or object) and a state object, and interpolates the template
* based on state. It returns an (post-interpolated) object.
*
* @param {string|object} template
* @param {object} state
* @returns {Object}
*/
interpolate(template, state) {
if (angular.isString(template)) {
return this.$interpolate(template)(state);
}
const templateString = this._convertTemplateToString(template);
const interpolated = this.$interpolate(templateString)(state);
return this._convertStringToObject(interpolated);
}
/**
* Parse values in the form `fromState(expression)`
* which returns a function named `PARSE_ME`
* which returns an Angular expression (without {{ }})
*
* @param {string|Function} value
* @param {Object} context
* @returns {*}
*/
parseValue(value, context) {
if (_isFunction(value) && value.name === 'PARSE_ME') {
const expression = value();
if (_isFunction(expression)) {
return expression(context);
}
return this.$parse(expression)(context);
}
return value;
}
parseValues(object, context) {
return _mapValues(object, (value) => {
return this.parseValue(value, context);
});
}
}
|
/**
* @since 2017-03-18 12:02:48
* @author vivaxy
*/
import test from 'ava';
import * as init from '../init';
test('init should has correct exports', (t) => {
t.true(typeof init.command === 'string');
t.true(typeof init.describe === 'string');
t.deepEqual(init.builder, {});
t.true(typeof init.handler === 'function');
});
|
var express = require('express'),
router = express.Router(),
mongoose = require('mongoose'),
Article = mongoose.model('Article');
// get hbs.handlebars instance from express.js (to use the cache)
// or just use the global Handlebars instance ( require('handlebars') )
var hbs = null; // require('handlebars');
module.exports = function (app, config1, hbs1) {
app.use('/', app.exposeTemplates, router);
hbs = hbs1;
};
/* Home page */
router.get('/', function (req, res, next) {
// if user is already authenticated (e.g. logined) then go straight to the protected prifile page
if (req.isAuthenticated()) {
res.redirect('/protected/profile');
return;
}
Article.find(function (err, articles) {
if (err) return next(err);
res.render('home', {
title: 'Generator-Express MVC',
articles: articles,
//message: req.params.message,
message: req.query.message,
// Overwrite some handlebars options
//layout: 'secondLayout',
//helpers: {
// global_helper: function () {
// return 'Overwrite Helper';
// },
// specific_helper: function () {
// return 'Specific Helper';
// }
//},
//partials: {
// global_partial: function () {
// return 'Overwrite Global Partial';
// },
// shared_partial: function () {
// return 'Overwrite Shared Partial';
// },
// specific_partial: function () {
// return 'Specific partial';
// }
//},
// this can also be a promise instance that compile async
partials: Promise.resolve({
specific_partial: hbs.handlebars.compile('<h1>Specific partial</h1><p>{{message}}</p>')
})
});
});
});
|
//Import Jquery
import jQuery from 'jquery';
//use $ instead of jQuery
window.$ = jQuery;
import home from './home';
$(document).ready(() => {
new home({
"name": "Mayank"
});
});
|
/* global module:false */
module.exports = function(grunt) {
var port = grunt.option('port') || 8000;
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner:
'/*!\n' +
' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
' * http://lab.hakim.se/reveal-js\n' +
' * MIT licensed\n' +
' *\n' +
' * Copyright (C) 2013 Hakim El Hattab, http://hakim.se\n' +
' */'
},
qunit: {
files: [ 'test/*.html' ]
},
uglify: {
options: {
banner: '<%= meta.banner %>\n'
},
build: {
src: 'js/reveal.js',
dest: 'js/reveal.min.js'
}
},
cssmin: {
compress: {
files: {
'css/reveal.min.css': [ 'css/reveal.css' ]
}
}
},
sass: {
main: {
files: {
'css/theme/default.css': 'css/theme/source/default.scss',
'css/theme/beige.css': 'css/theme/source/beige.scss',
'css/theme/night.css': 'css/theme/source/night.scss',
'css/theme/serif.css': 'css/theme/source/serif.scss',
'css/theme/simple.css': 'css/theme/source/simple.scss',
'css/theme/sky.css': 'css/theme/source/sky.scss',
'css/theme/moon.css': 'css/theme/source/moon.scss',
'css/theme/solarized.css': 'css/theme/source/solarized.scss',
'css/theme/blood.css': 'css/theme/source/blood.scss'
}
}
},
jshint: {
options: {
curly: false,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
eqnull: true,
browser: true,
expr: true,
globals: {
head: false,
module: false,
console: false,
unescape: false
}
},
files: [ 'Gruntfile.js', 'js/reveal.js' ]
},
connect: {
server: {
options: {
port: port,
hostname:"0.0.0.0",
base: '.'
}
}
},
zip: {
'reveal-js-presentation.zip': [
'index.html',
'css/**',
'js/**',
'lib/**',
'images/**',
'plugin/**'
]
},
watch: {
main: {
files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
tasks: 'default'
},
theme: {
files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
tasks: 'themes'
}
}
});
// Dependencies
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-sass' );
grunt.loadNpmTasks( 'grunt-contrib-connect' );
grunt.loadNpmTasks( 'grunt-zip' );
// Default task
grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify', 'qunit' ] );
// Theme task
grunt.registerTask( 'themes', [ 'sass' ] );
// Package presentation to archive
grunt.registerTask( 'package', [ 'default', 'zip' ] );
// Serve presentation locally
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );
// Run tests
grunt.registerTask( 'test', [ 'jshint', 'qunit' ] );
};
|
import Reflux from "reflux";
const Actions = Reflux.createActions([
"addDomain",
"removeDomain"
]);
export default Actions;
|
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import Quote from '../Quote';
const findByClass = TestUtils.findRenderedDOMComponentWithClass;
const render = TestUtils.renderIntoDocument;
describe('Quote', () => {
it('renders', () => {
const block = render(
<Quote id={'0000'} type={'blockquote'} text={'hey'} />
);
const component = findByClass(block, 'arc-Editor-Block--blockquote');
expect(component).to.exist;
});
});
|
'use strict';
//Features inspired from Louis Sivillo: href="https://gist.github.com/lsiv568/5623361
var PictureController = angular.module('PictureController', []);
PictureController.directive('fileDropzone', function() {
return {
restrict: 'AE',
scope: {
file: '=',
fileName: '='
},
link: function(scope, element, attrs) {
var checkSize, isTypeValid, processDragOverOrEnter, validMimeTypes;
processDragOverOrEnter = function(event) {
if (event !== null) {
event.preventDefault();
}
event.originalEvent.dataTransfer.effectAllowed = 'copy';
event.originalEvent.dataTransfer.effectAllowed = 'copyMove';
return false;
};
validMimeTypes = attrs.fileDropzone;
checkSize = function(size) {
var _ref;
if (((_ref = attrs.maxFileSize) === (void 0) || _ref === '') || (size / 1024) / 1024 < attrs.maxFileSize) {
return true;
} else {
alert('File must be smaller than ' + attrs.maxFileSize + ' MB');
return false;
}
};
isTypeValid = function(type) {
if ((validMimeTypes === (void 0) || validMimeTypes === '') || validMimeTypes.indexOf(type) > -1) {
return true;
} else {
alert('Invalid file type. File must be one of following types ' + validMimeTypes);
return false;
}
};
element.bind('dragover', processDragOverOrEnter);
element.bind('dragenter', processDragOverOrEnter);
return element.bind('drop', function(event) {
var file, name, reader, size, type;
if (event !== null) {
event.preventDefault();
}
reader = new FileReader();
reader.onload = function(evt) {
if (checkSize(size) && isTypeValid(type)) {
return scope.$apply(function() {
scope.file = evt.target.result;
if (angular.isString(scope.fileName)) {
return scope.fileName = name;
}
});
}
};
file = event.originalEvent.dataTransfer.files[0];
name = file.name;
type = file.type;
size = file.size;
reader.readAsDataURL(file);
return false;
});
}
};
});
PictureController.controller('PicturesCtrl', function ($scope) {
$scope.image = null;
$scope.imageFileName = '';
$scope.removedEXIF = false;
$scope.pictureTitle='download.jpg';
$scope.pictureFormat='jpeg';
$scope.close = false;
$scope.closeTip = function(){
$scope.close = true;
}
});
|
describe("notifications", function() {
it("shows a red bell by default", function() {
expect(this.notifications.element(by.css(".fa-bell")).isDisplayed()).toBe(true);
expect(this.notifications.element(by.css(".fa-bell-o")).isDisplayed()).toBe(false);
});
describe("after being clicked", function() {
it("shows a default bell", function() {
expect(this.notifications.element(by.css(".fa-bell")).isDisplayed()).toBe(false);
expect(this.notifications.element(by.css(".fa-bell-o")).isDisplayed()).toBe(true);
});
beforeEach(function() {
this.notifications.element(by.css(".fa-bell")).click();
});
});
beforeEach(function() {
browser.get("/");
this.notifications = element(by.css(".notifications-icon"));
});
});
|
/**
* Local environment settings
*
* Use this file to specify configuration settings for use while developing
* the app on your personal system: for example, this would be a good place
* to store database or email passwords that apply only to you, and shouldn't
* be shared with others in your organization.
*
* These settings take precedence over all other config files, including those
* in the env/ subfolder.
*
* PLEASE NOTE:
* local.js is included in your .gitignore, so if you're using git
* as a version control solution for your Sails app, keep in mind that
* this file won't be committed to your repository!
*
* Good news is, that means you can specify configuration for your local
* machine in this file without inadvertently committing personal information
* (like database passwords) to the repo. Plus, this prevents other members
* of your team from commiting their local configuration changes on top of yours.
*
* In a production environment, you probably want to leave this file out
* entirely and leave all your settings in env/production.js
*
*
* For more information, check out:
* http://sailsjs.org/#/documentation/reference/sails.config/sails.config.local.html
*/
module.exports = {
/***************************************************************************
* Your SSL certificate and key, if you want to be able to serve HTTP *
* responses over https:// and/or use websockets over the wss:// protocol *
* (recommended for HTTP, strongly encouraged for WebSockets) *
* *
* In this example, we'll assume you created a folder in your project, *
* `config/ssl` and dumped your certificate/key files there: *
***************************************************************************/
// ssl: {
// ca: require('fs').readFileSync(__dirname + './ssl/my_apps_ssl_gd_bundle.crt'),
// key: require('fs').readFileSync(__dirname + './ssl/my_apps_ssl.key'),
// cert: require('fs').readFileSync(__dirname + './ssl/my_apps_ssl.crt')
// },
/***************************************************************************
* The `port` setting determines which TCP port your app will be *
* deployed on. *
* *
* Ports are a transport-layer concept designed to allow many different *
* networking applications run at the same time on a single computer. *
* More about ports: *
* http://en.wikipedia.org/wiki/Port_(computer_networking) *
* *
* By default, if it's set, Sails uses the `PORT` environment variable. *
* Otherwise it falls back to port 1337. *
* *
* In env/production.js, you'll probably want to change this setting *
* to 80 (http://) or 443 (https://) if you have an SSL certificate *
***************************************************************************/
port: process.env.PORT || 1337,
/***************************************************************************
* The runtime "environment" of your Sails app is either typically *
* 'development' or 'production'. *
* *
* In development, your Sails app will go out of its way to help you *
* (for instance you will receive more descriptive error and *
* debugging output) *
* *
* In production, Sails configures itself (and its dependencies) to *
* optimize performance. You should always put your app in production mode *
* before you deploy it to a server. This helps ensure that your Sails *
* app remains stable, performant, and scalable. *
* *
* By default, Sails sets its environment using the `NODE_ENV` environment *
* variable. If NODE_ENV is not set, Sails will run in the *
* 'development' environment. *
***************************************************************************/
environment: process.env.NODE_ENV || 'development',
};
|
import React from 'react';
import ReactDOM from 'react-dom';
import store from '../Store';
import { Provider } from 'react-redux';
import UserDetail from '../components/containers/UserDetail';
it('renders without crashing', () => {
const div = document.createElement('div');
/*ReactDOM.render(<Provider store={store}>
<UserDetail params={{id: 'techno'}} />
</Provider>, div);*/
});
|
define({
"transparencyLabel": "Gennemsigtighed",
"outline": "Kontur",
"fill": "Fyld (farve anvendes kun, når typografien er indstillet til massiv)",
"style": "Type",
"mandatoryLabel": "Obligatorisk evakueringsafstand",
"mandatoryButtonLabel": "Konfigurér indstillinger for Obligatorisk evakueringsafstand",
"safeLabel": "Sikker evakueringsafstand",
"safeButtonLabel": "Konfigurér indstillinger for Sikker evakueringsafstand",
"selectOpLayerLabel": "Vælg et operationelt lag for at opnå resultater",
"selectDefaultMeasurementLabel": "Vælg en standardmåleenhed",
"helpIconTooltip": "Listen med operationelle lag består af lag fra det aktuelle webkort, der er af geometritypen polygon.",
"lineStyles": {
"esriSLSDash": "Streg",
"esriSLSDashDot": "Streg-prik",
"esriSLSDashDotDot": "Streg-prik-prik",
"esriSLSDot": "Prik",
"esriSLSLongDash": "Lang streg",
"esriSLSLongDashDot": "Lang streg-prik",
"esriSLSNull": "Nul",
"esriSLSShortDash": "Kort streg",
"esriSLSShortDashDot": "Kort streg-prik",
"esriSLSShortDashDotDot": "Kort streg-prik-prik",
"esriSLSShortDot": "Kort prik",
"esriSLSSolid": "Udfyldt"
},
"fillStyles": {
"esriSFSBackwardDiagonal": "Baglæns",
"esriSFSCross": "Kryds",
"esriSFSDiagonalCross": "Diagonalt",
"esriSFSForwardDiagonal": "Frem",
"esriSFSHorizontal": "Vandret",
"esriSFSNull": "Nul",
"esriSFSSolid": "Udfyldt",
"esriSFSVertical": "Lodret"
},
"threatTypeLabel": "Trusselstype",
"symbologyLabel": "Symbologi",
"generalLabel": "Generelt",
"addThreatTypesLabel": "Tilføj trusselstype",
"threatTypeColLabel": "Trusselstype",
"actions": "Handlinger",
"newThreatTypePopupLabel": "Ny trusselstype",
"chooseDefaultThreatTypeIconLabel": "Vælg fra standard",
"mandatoryDistance": "Obligatorisk evakueringsafstand",
"safeDistance": "Sikker evakueringsafstand",
"units": "Enheder",
"chooseDefaultThreatLabel": "Vælg en standard-trusselstype",
"defaultThreatTypePopUpLabel": "Standard-trusselstyper",
"editThreatLabel": "Rediger trussel",
"defaultThreatTypeIconTooltip": "Liste over standard-trusselstyper",
"uniqueThreatTypeMsg": "Indtast unik trusselstype, en trusselstype med dette navn findes allerede.",
"requiredThreatTypeMsg": "Dette felt er obligatorisk.",
"unitMeasureLabel": "Afstand er i {0}",
"pipeBombLabel": "Rørbombe",
"suicideBombLabel": "Selvmordsbombe",
"briefcaseLabel": "Dokumentmappe",
"carLabel": "Bil",
"suvVanLabel": "SUV/VAN",
"smallDeliveryTruckLabel": "Lille varevogn",
"containerWaterTruckLabel": "Container-/vandlastbil",
"semiTrailerLabel": "Sættevogn"
});
|
ReachAlbert.controller('AdminController', ['$scope', '$state', '$stateParams', '$rootScope', '$filter', function($scope, $state, $stateParams, $rootScope, $filter){
$(window).resize();
$('title').html("Reach Albert | Admin Console");
$('.body-container').animate({scrollTop : 0}, 800);
$rootScope.bck_image = "connected.jpg";
$scope.$parent.current_tab = "admin";
$scope.message = {
text:'',
to: '',
};
var MSG_TEMPLATE = {
USER_IMAGE: '<div class="mrg10 message-user-image"></div>',
MESSAGE: '<div class="txt16 user-message"></div><div class="txt12 text-grey user-name"></div><div class="message-time txt12 text-grey"></div>'
}
var setMessage = function(key, data){
var MSG_CONTAINER = document.getElementById('message-container');
var div = document.getElementById(key);
if (!div) {
var container = document.createElement('div');
var FINAL_MSG_TEMPLATE = '<div class="message-box layout-row layout-align-start-center">';
if(data.from != 'Admin') {
FINAL_MSG_TEMPLATE += MSG_TEMPLATE.USER_IMAGE;
FINAL_MSG_TEMPLATE += '<div class="message-body text-left flex">'
FINAL_MSG_TEMPLATE += MSG_TEMPLATE.MESSAGE;
FINAL_MSG_TEMPLATE += '</div>'
}
else {
FINAL_MSG_TEMPLATE += '<div class="message-body text-right flex">'
FINAL_MSG_TEMPLATE += MSG_TEMPLATE.MESSAGE;
FINAL_MSG_TEMPLATE += '</div>'
FINAL_MSG_TEMPLATE += MSG_TEMPLATE.USER_IMAGE;
}
FINAL_MSG_TEMPLATE += '</div>'
container.innerHTML = FINAL_MSG_TEMPLATE;
div = container.firstChild;
div.setAttribute('id', key);
MSG_CONTAINER.appendChild(div);
}
div.querySelector('.message-user-image').style.backgroundImage = 'url('+data.image+')';
div.querySelector('.user-name').textContent = data.name || data.from;
div.querySelector('.message-time').textContent = $filter('date')(data.time, 'medium');
var messageElement = div.querySelector('.user-message');
messageElement.textContent = data.text;
messageElement.innerHTML = messageElement.innerHTML.replace(/\n/g, '<br>');
setTimeout(function() {div.classList.add('visible')}, 1);
MSG_CONTAINER.scrollTop = MSG_CONTAINER.scrollHeight;
MSG_CONTAINER.focus();
}
var clearMessages = function(){
var MSG_CONTAINER = document.getElementById('message-container');
while (MSG_CONTAINER.hasChildNodes()) {
MSG_CONTAINER.removeChild(MSG_CONTAINER.lastChild);
}
}
var loadMessages = function(ref) {
var db_ref = firebase.database().ref(ref);
db_ref.off();
db_ref.limitToLast(20).on('child_added', function(data){
setMessage(data.key, data.val());
});
db_ref.limitToLast(20).on('child_changed', function(data){
setMessage(data.key, data.val());
});
}
var getUsers = function() {
var db_ref = firebase.database().ref('references');
$scope.users = {};
db_ref.limitToLast(20).on('child_added', function(data){
$scope.users[data.key] = data.val();
$scope.$apply();
});
}
$scope.sendMessage = function() {
var currentUser = firebase.auth().currentUser;
if(currentUser && $scope.message.text != '' && $scope.message.to !=''){
var db_ref = firebase.database().ref('users/'+$scope.message.to+'/messages');
var message = {
text: $scope.message.text,
image: '/resources/images/logos/logo-large.jpg',
from: 'Admin',
time: new Date().getTime()
}
$scope.message.text = '';
db_ref.push(message).then().catch(function(error) {
console.error('Error writing new message to Firebase Database: ', error);
});
}
}
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
$scope.message.to = user.uid;
getUsers();
loadMessages('users/'+user.uid+'/messages');
}
});
$scope.getUserMessages = function(){
clearMessages();
loadMessages('users/'+$scope.message.to+'/messages');
}
}]);
|
$(document).ready(function() {
// Place JavaScript code here...
});
$( "#button" ).click(function() {
// Remove the error box
$(".alert-danger").css("display","none");
$("#buttonContainer").css("display","none");
$("#form").css("display","block");
});
|
var command = function (config) {
var async = require('async');
var AWS = require('aws-sdk');
var apiInfo = {};
AWS.config.region = config.region;
var lambda = new AWS.Lambda();
var cloudformation = new AWS.CloudFormation();
var rds = new AWS.RDS();
if (! config.name) {
console.error('Please provide a stack name as the first argument');
return;
}
var createStack = function (params, callback) {
var params = {
StackName: config.stackName,
Capabilities: [
'CAPABILITY_IAM',
'CAPABILITY_NAMED_IAM'
],
OnFailure: 'DELETE',
TemplateBody: JSON.stringify(require('../templates/object-storage.js')(config)),
TimeoutInMinutes: 30
};
cloudformation.createStack(params, function(err, data) {
if (err) {
console.log(err, err.stack);
}
else {
console.log('createStack', data);
callback();
}
});
}
var waitFor = function(state, params, callback) {
cloudformation.waitFor(state, params, function(err, data) {
if (err) {
console.log(err, err.stack);
}
else {
console.log('waitFor ' + state, data);
callback();
}
});
}
var describeStackResource = function (params, callback) {
cloudformation.describeStackResource(params, function(err, data) {
if (err) {
console.log(err, err.stack);
}
else {
console.log('describeStackResource', data);
callback(data);
}
});
}
var describeDBInstances = function (params, callback) {
rds.describeDBInstances(params, function(err, data) {
if (err) {
console.log(err, err.stack);
}
else {
console.log('describeDBInstances', data);
callback(data);
}
});
}
var updateFunction = function (params, callback) {
var exec = require('child_process').execSync;
exec('cd functions; zip -r ../functions.zip .');
var params = {
FunctionName: config.lambdaFnName,
ZipFile: require('fs').readFileSync('functions.zip')
};
lambda.updateFunctionCode(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
}
async.series([
function (callback) {
createStack({}, callback);
},
function (callback) {
waitFor('stackExists', {}, callback);
},
function (callback) {
waitFor('stackCreateComplete', {}, callback);
},
function (callback) {
describeStackResource({LogicalResourceId: 'Storage', StackName: config.stackName}, function (data) { apiInfo.dbPhysicalResourceId = data.StackResourceDetail.PhysicalResourceId; callback(); });
},
function (callback) {
describeDBInstances({DBInstanceIdentifier: apiInfo.dbPhysicalResourceId},
function (data) {
apiInfo.dbEndpoint = data.DBInstances[0].Endpoint;
var db_config = {
host : apiInfo.dbEndpoint.Address,
user : config.storage.user,
password : config.storage.password
}
require('fs').writeFileSync('functions/db_config.js', 'module.exports = ' + JSON.stringify(db_config));
callback();
});
},
function (callback) {
updateFunction({}, callback);
},
function (callback) {
console.log('Entry point ', 'https://' + apiInfo.restApiId + '.execute-api.' + AWS.config.region + '.amazonaws.com/dev/');
callback();
}
]);
}
module.exports = command;
|
import React from 'react';
import {<%= variable %>} from '../../src/<%= variable %>.jsx';
import TestUtils from 'react-addons-test-utils';
describe('<%= variable %>', () => {
it('has expected content with deep render', () => {
// This is a 'deep' render that renders children + all into an actual
// browser DOM node.
// https://facebook.github.io/react/docs/test-utils.html#renderintodocument
const rendered = TestUtils.renderIntoDocument(<<%= variable %> />);
// This is a real DOM node to assert on.
const divNode = TestUtils.findRenderedDOMComponentWithTag(rendered, 'div');
expect(divNode).to.have.property('innerHTML', 'This is my new component!');
});
it('has expected content with shallow render', () => {
// This is a 'shallow' render that renders only the current component
// without using the actual DOM.
// https://facebook.github.io/react/docs/test-utils.html#shallow-rendering
const renderer = TestUtils.createRenderer();
renderer.render(<<%= variable %> />);
const output = renderer.getRenderOutput();
expect(output.type).to.equal('div');
expect(output.props.children).to.contain('This is my new component');
});
});
|
const program = require('commander')
const winston = require('winston')
const express = require('express')
const bodyParser = require('body-parser')
const http = require('http')
const version = require('./version')
const path = require('path')
const fs = require('fs')
const ZFunk = require('./zfunk').ZFunk
const DAO = require('./dao').DAO
const rest = require('./rest').REST
const WS = require('./ws').WS
const security = require('./security').Security
'use strict'
module.exports = function () {
program
.version(version)
.option('-c, --com-port [port]', 'Set [port] for Z-Wave controller. Defaults to "/dev/ttyUSB0"', '/dev/ttyUSB0')
.option('-d, --db-path [path]', 'Set [path] for DB. Defaults to "~/.zfunk/db.json"', path.join(
process.env.HOME || process.env.USERPROFILE,
'.zfunk/db.json'
)
)
.option('-w, --web-port [port]', 'Set [port] for REST/WS service. Defaults to "3000"', 3000)
.option('-s, --secret-or-key [secret]', 'Set [secret] for authenticating web requests. Defaults to "ZFunk"', 'ZFunk')
.option('-u, --users [email1,email2,...]', 'Allow [emails...] to access API and print out tokens.',
function (val) {
return val.split(',')
}
)
.option('-m, --mount-path [path]', 'Set [path] to mount files for an UI')
.option('-v, --verbose', 'Increase verbosity')
.parse(process.argv)
// init logger, according to program args
var logger = new (winston.Logger)()
logger.add(winston.transports.Console, {
level: program.verbose ? 'debug' : 'info',
prettyPrint: true,
colorize: true,
silent: false,
timestamp: true
})
// create app directory
var appDir = path.join(process.env.HOME || process.env.USERPROFILE, '.zfunk')
if (!fs.existsSync(appDir)) {
fs.mkdirSync(appDir)
}
// init ZFunk
var zfunk = new ZFunk(logger, {
port: program.comPort,
ozw: {
Logging: false,
ConsoleOutput: false
}
})
/*
var zfunk = {
on: function(){},
run: function(){},
shutdown: function(){}
};
*/
// init DAO
var dao = new DAO(zfunk, logger, {
path: program.dbPath,
loki: {
autosave: true,
autosaveInterval: 5000
}
})
// create server
var app = express()
app.use(bodyParser.urlencoded({
extended: true
}))
app.use(bodyParser.json())
var server = http.Server(app)
// mount path
if (program.mountPath) app.use(express.static(program.mountPath))
// init WS
var ws = new WS(dao, zfunk, server, logger, {
})
// init Security
security(app, ws.io, logger, {
users: program.users,
jwt: {
secretOrKey: program.secretOrKey
// issuer: 'api.zfunk',
// audience: 'client.zfunk',
}
})
// init REST
rest(zfunk, dao, app, logger, {
})
// handle signals
var signals = { 'SIGINT': 2, 'SIGTERM': 15 }
Object.keys(signals).forEach(function (signal) {
process.on(signal, function () {
logger.info('Got %s, shutting down ZFunk...', signal)
// shutdown ZFunk properly
server.close()
zfunk.shutdown()
dao.shutdown()
process.exit(128 + signals[signal])
})
})
// run
zfunk.run()
// start server
logger.info('REST/WS server starting on port %s', program.webPort)
server.listen(program.webPort)
}
|
import React from 'react'
import { TransitionMotion, spring } from 'react-motion'
import Route from 'react-router/Route'
import Redirect from 'react-router/Redirect'
import Router from 'react-router-dom/BrowserRouter'
import Link from 'react-router-dom/Link'
const AnimationExample = () => (
<Router>
<div style={styles.fill}>
<ul style={styles.nav}>
<NavLink to="/10/90/50">Red</NavLink>
<NavLink to="/120/100/40">Green</NavLink>
<NavLink to="/200/100/40">Blue</NavLink>
<NavLink to="/310/100/50">Pink</NavLink>
</ul>
<div style={styles.content}>
<FadeRoute path="/:h/:s/:l" component={HSL}/>
</div>
<Route exact path="/" render={() => (
<Redirect to="/10/90/50"/>
)}/>
</div>
</Router>
)
const FadeRoute = ({ component: Component, ...rest }) => {
const willLeave = () => ({ zIndex: 1, opacity: spring(0) })
return (
<Route {...rest} children={props => (
<TransitionMotion
willLeave={willLeave}
styles={props.match ? [ {
key: props.history.location.pathname,
style: { opacity: 1 },
data: props
} ] : []}
>
{interpolatedStyles => (
<div>
{interpolatedStyles.map(config => (
<div
key={config.key}
style={{ ...styles.fill, ...config.style }}
>
<Component {...config.data}/>
</div>
))}
</div>
)}
</TransitionMotion>
)}/>
)
}
const NavLink = (props) => (
<li style={styles.navItem}>
<Link {...props} style={{ color: 'inherit' }}/>
</li>
)
const HSL = ({ match: { params } }) => (
<div style={{
...styles.hsl,
background: `hsl(${params.h}, ${params.s}%, ${params.l}%)`
}}>hsl({params.h}, {params.s}%, {params.l}%)</div>
)
const styles = {}
styles.fill = {
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0
}
styles.content = {
...styles.fill,
top: '40px',
textAlign: 'center'
}
styles.nav = {
padding: 0,
margin: 0,
position: 'absolute',
top: 0,
height: '40px',
width: '100%',
display: 'flex'
}
styles.navItem = {
textAlign: 'center',
flex: 1,
listStyleType: 'none',
padding: '10px'
}
styles.hsl = {
...styles.fill,
color: 'white',
paddingTop: '20px',
fontSize: '30px'
}
export default AnimationExample
|
var color = ["#CCCCCC","#333333","#990099"];
var mytitle = document.getElementById("title");
var rand = Math.floor(Math.random()*colors.length);
mytitle.style.borderColor = colors[rand];
|
import Button from './view';
import React, { forwardRef } from 'react';
import { connect } from 'react-redux';
import { selectUser, selectUserVerifiedEmail } from 'redux/selectors/user';
const mapStateToProps = (state) => ({
pathname: state.router.location.pathname,
emailVerified: selectUserVerifiedEmail(state),
user: selectUser(state),
});
const ConnectedButton = connect(mapStateToProps)(Button);
export default forwardRef((props, ref) => <ConnectedButton {...props} myref={ref} />);
|
var platform = 'rezel.monkieblankie.com';
var dbPort = 4101; // REST API for mq
var port = 4103; // websockets
var webSocketEndpoint = 'ws://rezel.monkieblankie.com:4103';
|
import {
ForbiddenException,
NotFoundException,
ServerErrorException,
} from '../../support/exceptions';
import { dbAdapter } from '../../models';
export function postAccessRequired(map = { postId: 'post' }) {
return async (ctx, next) => {
const forbidden = (reason = 'You can not see this post') => new ForbiddenException(reason);
const notFound = (reason = 'Post not found') => new NotFoundException(reason);
const { user: viewer } = ctx.state;
await Promise.all(
Object.keys(map).map(async (key) => {
if (!ctx.params[key]) {
throw new ServerErrorException(
`Server misconfiguration: the required parameter '${key}' is missing`,
);
}
const { [key]: postId } = ctx.params;
const post = await dbAdapter.getPostById(postId);
const author = post ? await dbAdapter.getUserById(post.userId) : null;
if (!post || !author.isActive) {
throw notFound();
}
const isVisible = await post.isVisibleFor(viewer);
if (!isVisible) {
if (!viewer && post.isProtected === '1' && post.isPrivate === '0') {
throw forbidden('Please sign in to view this post');
}
throw forbidden();
}
ctx.state[map[key]] = post;
}),
);
await next();
};
}
|
'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var moment = require('moment');
var yosay = require('yosay');
var JekyllAndYeti = yeoman.generators.Base.extend({
promptUser: function () {
var done = this.async();
this.log(yosay(
'Welcome to the ' + chalk.cyan('Jekyll and Yeti') + ' generator!' +
chalk.bgBlue('Jekyll, Foundation, Scss and Grunt!')
));
var prompts = [{
name: 'siteName',
message: 'What is your sites\'s title ?'
}, {
name: 'description',
message: 'A short description of your site',
default: 'No Description'
}, {
name: 'email',
message: 'What is your email address ?',
default: this.user.git.email
}, {
name: 'gitAcc',
message: 'Your Github account ?',
default: 'jekyll'
}, {
name: 'twitter',
message: 'Your Twitter username ?',
default: 'jekyllrb'
}, {
name: 'mainFolder',
message: 'Main Jekyll folder ?',
default: 'jekyll'
}, {
name: 'distFolder',
message: 'Final grunt output folder ? (Note: This is the output of processing the standard Jekyll "_sites" folder)',
default: 'dist'
}];
this.prompt(prompts, function (props) {
this.siteName = props.siteName;
this.description = props.description;
this.email = props.email;
this.gitAcc = props.gitAcc;
this.twitter = props.twitter;
this.mainFolder = props.mainFolder;
this.distFolder = props.distFolder;
done();
}.bind(this));
},
scaffoldFolders: function () {
this.mkdir(this.mainFolder);
this.mkdir(this.mainFolder + "/_posts")
},
copyMainFiles: function () {
this.copy("_index.md", this.mainFolder + "/index.md");
this.copy("_about.md", this.mainFolder + "/about.md");
this.copy("_gruntfile.js", "Gruntfile.js");
this.copy("_bower.json", "bower.json");
this.copy("_README.md", "README.md");
this.directory("_includes", this.mainFolder + "/_includes");
this.directory("_layouts", this.mainFolder + "/_layouts");
this.directory("_assets", this.mainFolder + "/assets");
this.directory("_scss", this.mainFolder + "/_scss");
this.directory("_blog", this.mainFolder + "/blog");
this.directory("css", this.mainFolder + "/css");
this.directory("js", this.mainFolder + "/js");
var context = {
site_name: this.siteName,
pkg_name: this.siteName.replace(/\s+/g, '-').toLowerCase(),
author_email: this.email,
site_description: this.description,
main_folder: this.mainFolder,
dist_folder: this.distFolder,
git_acc: this.gitAcc,
twitter: this.twitter
};
// Generate date/times for demo posts
var posts = ['post1', 'post2', 'post3'];
var post_times = {};
var hour = 0;
for (var i = 0; i < posts.length; i++) {
var obj = posts[i];
post_times[obj] = {
num_date: moment().subtract(hour, 'hours').format('YYYY-MM-DD'),
date_time: moment().subtract(hour, 'hours').format('YYYY-MM-DD HH:mm:ss')
};
hour += 2
}
// create demo posts with correct date times
this.template("_posts/welcome-to-jekyll.markdown", this.mainFolder + "/_posts/" +
post_times['post1'].num_date + "-welcome-to-jekyll.markdown", post_times['post1']);
this.template("_posts/and-foundation.markdown", this.mainFolder + "/_posts/" +
post_times['post2'].num_date + "-and-foundation.markdown", post_times['post2']);
this.template("_posts/with-yeoman.markdown", this.mainFolder + "/_posts/" +
post_times['post3'].num_date + "-with-yeoman.markdown", post_times['post3']);
this.template("_config.yml", this.mainFolder + "/_config.yml", context);
this.template("_package.json", "package.json", context);
this.template("_gruntfile.js", "Gruntfile.js", context);
this.template(".bowerrc", ".bowerrc", context);
//npm install && bower install
this.installDependencies();
}
});
module.exports = JekyllAndYeti;
|
export default class FlowController {
constructor(FlowService) {
this.FlowService = FlowService;
}
init() {
this.FlowService.getFlow().then(result => this.flow = result);
}
start() {
this.flow.execute();
}
step() {
this.flow.executeStep();
}
}
FlowController.$inject = ["FlowService"];
|
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights and
* limitations under the License.
*
* The Original Code is Bespin.
*
* The Initial Developer of the Original Code is Mozilla.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Bespin Team (bespin@mozilla.com)
*
* ***** END LICENSE BLOCK ***** */
dojo.provide("bespin.util.navigate");
dojo.require("bespin.client.settings");
// = Navigate =
//
// Simple wrapper to force navigation to a project URL without all using location.href
// ** {{{ bespin.util.navigate }}} **
//
// new up an object that will return public methods and hide private ones
(function() {
// ** {{{ Yup, you can be private }}} **
//
// Generic location changer
var go = function(url, newTab) {
if (newTab) {
window.open(url, "_blank");
} else {
location.href = url;
}
};
// ** {{{ Public }}} **
//
// Simple methods to construct URLs within Bespin and go to them
dojo.mixin(bespin.util.navigate, {
dashboard: function(newTab) {
var pathSelected = (new bespin.client.settings.URL()).get('fromDashboardPath');
if (pathSelected) {
go("dashboard.html#path="+pathSelected, newTab); // this contains the pathSelected parameter!
} else {
go("dashboard.html", newTab);
}
},
home: function(newTab) {
go("index.html", newTab);
},
quickEdit: function(newTab) {
go("editor.html#new=true", newTab);
},
editor: function(project, path, opts) {
var url = "editor.html#";
var args = [];
if (project) args.push("project=" + project);
if (path) args.push("path=" + path);
if (opts.newFile) args.push("new=true");
if (opts.content) args.push("content=" + escape(opts.content));
var selectedPath = bespin.page.dashboard.tree.getSelectedPath(true);
if (selectedPath) args.push('fromDashboardPath=' + selectedPath);
if (args.length > 0) url += args.join("&");
go(url, opts.newTab);
}
});
})();
|
define([
], function () {
"use strict";
/**
* Applies a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a
* single value
*
* @exports es5/Array/reduceRight
* @see {@linkcode https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight}
* @requiresJavaScriptVersion 1.8
*
* @param {function} callback - function to execute on each value in the array, taking four arguments:
* previousValue, currentValue, index, array
*
* @param {object} initialValue - object to use as the first argument to the first call of the callback.
*
*/
return Array.prototype.reduceRight;
});
|
import * as types from '../constants';
import ApiFailAction from './api_fail_action.js';
import API from '../utils/api.js';
// This action uses the Thunk middleware pattern: instead of returning a plain
// action object, it returns a function that takes the store dispatch fucntion —
// which Thunk automatically provides — and can then dispatch a series of plain
// actions to be handled by the store.
// This is how actions with side effects — such as API calls — are handled in
// Redux.
export function fetchFeedback(articleTitle, assignmentId) {
return function (dispatch) {
return API.fetchFeedback(articleTitle, assignmentId)
.then((resp) => {
dispatch({ type: types.RECEIVE_ARTICLE_FEEDBACK, data: resp, assignmentId: assignmentId });
})
// TODO: The Flux stores still handle API failures, so we delegate to a
// Flux action. Once all API_FAIL actions can be handled by Redux, we can
// replace this with a regular action dispatch.
.catch(response => (ApiFailAction.fail(response)));
};
}
export function postUserFeedback(assignmentId, feedback, userId) {
return function (dispatch) {
return API.createCustomFeedback(assignmentId, feedback, userId)
.then((resp) => {
dispatch({ type: types.POST_USER_FEEDBACK, data: resp, assignmentId: assignmentId, feedback: feedback, messageId: resp.id, userId: userId });
})
// TODO: The Flux stores still handle API failures, so we delegate to a
// Flux action. Once all API_FAIL actions can be handled by Redux, we can
// replace this with a regular action dispatch.
.catch(response => (ApiFailAction.fail(response)));
};
}
export function deleteUserFeedback(assignmentId, messageId, arrayId) {
return function (dispatch) {
return API.destroyCustomFeedback(assignmentId, messageId)
.then((resp) => {
dispatch({ type: types.DELETE_USER_FEEDBACK, data: resp, assignmentId: assignmentId, arrayId: arrayId });
})
.catch(response => (ApiFailAction.fail(response)));
};
}
|
// @flow
import {connect} from 'react-redux'
import Icon from '@conveyal/woonerf/components/icon'
import * as React from 'react'
import {
Grid,
Row,
Col,
Panel,
ListGroup,
ListGroupItem,
Button
} from 'react-bootstrap'
import {browserHistory} from 'react-router'
import {LinkContainer} from 'react-router-bootstrap'
import * as adminActions from '../actions/admin'
import * as organizationActions from '../actions/organizations'
import ApplicationStatus from './ApplicationStatus'
import ManagerPage from '../../common/components/ManagerPage'
import {getComponentMessages, isModuleEnabled} from '../../common/util/config'
import * as projectActions from '../../manager/actions/projects'
import OrganizationList from './OrganizationList'
import ServerSettings from './ServerSettings'
import UserList from './UserList'
import type {Project} from '../../types'
import type {AppState, ManagerUserState, RouterProps} from '../../types/reducers'
type Props = RouterProps & {
activeComponent: string,
fetchOrganizations: typeof organizationActions.fetchOrganizations,
fetchProjects: typeof projectActions.fetchProjects,
fetchServers: typeof adminActions.fetchServers,
fetchUsers: typeof adminActions.fetchUsers,
projects: Array<Project>,
user: ManagerUserState
}
class AdminPage extends React.Component<Props> {
messages = getComponentMessages('AdminPage')
componentWillMount () {
const {
activeComponent,
fetchUsers,
fetchProjects,
fetchOrganizations,
fetchServers
} = this.props
// Set default path to user admin view.
if (!activeComponent) browserHistory.push('/admin/users')
// Always load a fresh list of users on load.
fetchUsers()
// Always load projects to prevent interference with public feeds viewer
// loading of projects.
fetchProjects()
// Load orgs because they're needed both in org and user creation.
fetchOrganizations()
// Load servers if deployments are enabled.
if (isModuleEnabled('deployment')) fetchServers()
}
_getMainContent = (isApplicationAdmin: boolean): React.Node => {
const {activeComponent} = this.props
const restricted = <p className='text-center lead'>Restricted access</p>
switch (activeComponent) {
case 'users': return <UserList />
case 'organizations':
if (!isApplicationAdmin || isModuleEnabled('enterprise')) return restricted
else return <OrganizationList />
case 'logs':
return <ApplicationStatus />
case 'servers':
if (!isApplicationAdmin || !isModuleEnabled('deployment')) return restricted
return <ServerSettings editDisabled={false} />
default:
return null
}
}
_createLink = (to: string, label: string) =>
({to, children: <ListGroupItem>{label}</ListGroupItem>})
_getLinks = (isApplicationAdmin: boolean): React.Node[] => {
const links = [this._createLink('/admin/users', 'User management')]
// Do not show non-appAdmin users these application-level settings
if (isApplicationAdmin) {
if (!isModuleEnabled('enterprise')) {
links.push(this._createLink('/admin/organizations', 'Organizations'))
}
links.push(this._createLink('/admin/logs', 'Application logs'))
if (isModuleEnabled('deployment')) {
links.push(this._createLink('/admin/servers', 'Deployment servers'))
}
}
return links.map(link => (<LinkContainer key={link.to} {...link} />))
}
render () {
const { user } = this.props
const permissions = user && user.permissions
const isAdmin = permissions &&
(
permissions.isApplicationAdmin() ||
permissions.canAdministerAnOrganization()
)
const isApplicationAdmin = !!(permissions && permissions.isApplicationAdmin())
return (
<ManagerPage
ref='page'
title={this.messages('title')}>
<Grid>
<Row style={{ marginBottom: '18px' }}>
<Col xs={12}>
<h2>
<LinkContainer className='pull-right' to='/home'>
<Button>
Back to dashboard
</Button>
</LinkContainer>
<Icon type='cog' /> {this.messages('title')}
</h2>
</Col>
</Row>
<Row>
{isAdmin
? <div>
<Col xs={12} sm={3}>
<Panel>
<ListGroup fill>
{this._getLinks(isApplicationAdmin)}
</ListGroup>
</Panel>
</Col>
<Col xs={12} sm={9}>
{this._getMainContent(isApplicationAdmin)}
</Col>
</div>
: <div>
{user
? <p>{this.messages('noAccess')}</p>
: <h1
className='text-center'
style={{ marginTop: '150px' }}>
<Icon className='fa-spin fa-5x' type='refresh' />
</h1>
}
</div>
}
</Row>
</Grid>
</ManagerPage>
)
}
}
const mapStateToProps = (state: AppState, ownProps: RouterProps) => {
return {
activeComponent: ownProps.routeParams.subpage,
user: state.user
}
}
const {fetchServers, fetchUsers} = adminActions
const {fetchOrganizations} = organizationActions
const {fetchProjects} = projectActions
const mapDispatchToProps = {
fetchOrganizations,
fetchProjects,
fetchServers,
fetchUsers
}
export default connect(mapStateToProps, mapDispatchToProps)(AdminPage)
|
const Promise = require('bluebird');
const parseBoolean = (value) => value === 'on' ? true : value === 'off' ? false : null;
const parseProgramData = (data) => {
return data.filter((point) => point.active === 'on').map((point) => {
var hour = (point.t / 60) | 0;
var minute = point.t % 60;
return {
dow : [ 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa' ].indexOf(point.d),
time : ('00' + hour).slice(-2) + ':' + ('00' + minute).slice(-2),
temp : point.T
};
})
};
module.exports = {
pressure() {
return this.get('/system/appliance/systemPressure').then((r) => {
return { pressure : r.value, unit : r.unitOfMeasure };
});
},
status() {
return Promise.all([
this.get('/ecus/rrc/uiStatus'),
this.get('/system/sensors/temperatures/outdoor_t1'),
]).spread((status, outdoor) => {
var v = status.value;
return {
'user mode' : v.UMD,
'clock program' : v.CPM,
'in house status' : v.IHS,
'in house temp' : Number(v.IHT),
'boiler indicator' : { 'CH' : 'central heating', 'HW' : 'hot water', 'No' : 'off' }[v.BAI] || null,
'control' : v.CTR,
'temp override duration' : Number(v.TOD),
'current switchpoint' : Number(v.CSP),
'ps active' : parseBoolean(v.ESI),
'fp active' : parseBoolean(v.FPA),
'temp override' : parseBoolean(v.TOR),
'holiday mode' : parseBoolean(v.HMD),
'boiler block' : parseBoolean(v.BBE),
'boiler lock' : parseBoolean(v.BLE),
'boiler maintainance' : parseBoolean(v.BMR),
'temp setpoint' : Number(v.TSP),
'temp override temp setpoint' : Number(v.TOT),
'temp manual setpoint' : Number(v.MMT),
'hed enabled' : parseBoolean(v.HED_EN),
'hed device at home' : parseBoolean(v.HED_DEV),
'outdoor temp' : outdoor.value,
'outdoor source type' : outdoor.srcType,
};
});
},
location() {
return Promise.props({
lat : this.get('/system/location/latitude') .then((r) => Number(r.value)),
lng : this.get('/system/location/longitude').then((r) => Number(r.value)),
});
},
program() {
return Promise.props({
active : this.get('/ecus/rrc/userprogram/activeprogram').then((r) => r.value),
program1 : this.get('/ecus/rrc/userprogram/program1').then((r) => parseProgramData(r.value)),
program2 : this.get('/ecus/rrc/userprogram/program2').then((r) => parseProgramData(r.value)),
});
},
displayCode() {
return this.get('/system/appliance/displaycode').then((r) => {
return {
code : r.value,
description: {
'-H' : 'central heating active',
'=H' : 'hot water active',
'0C' : 'system starting',
'0L' : 'system starting',
'0U' : 'system starting',
'0E' : 'system waiting',
'0H' : 'system standby',
'0A' : 'system waiting (boiler cannot transfer heat to central heating)',
'0Y' : 'system waiting (boiler cannot transfer heat to central heating)',
'0E' : 'system waiting (boiler cannot transfer heat to central heating)',
'2E' : 'boiler water pressure too low',
'H07' : 'boiler water pressure too low',
'2F' : 'sensors measured abnormal temperature',
'2L' : 'sensors measured abnormal temperature',
'2P' : 'sensors measured abnormal temperature',
'2U' : 'sensors measured abnormal temperature',
'4F' : 'sensors measured abnormal temperature',
'4L' : 'sensors measured abnormal temperature',
'6A' : 'burner doesn\'t ignite',
'6C' : 'burner doesn\'t ignite',
'rE' : 'system restarting',
}[r.value]
};
});
},
setTemperature(value) {
var data = { value : Number(value) };
return Promise.all([
this.put('/heatingCircuits/hc1/temperatureRoomManual', data),
this.put('/heatingCircuits/hc1/manualTempOverride/status', { value : 'on' }),
this.put('/heatingCircuits/hc1/manualTempOverride/temperature', data),
]).then(() => {
return { status : 'ok' };
});
}
};
|
/**
* Format data into string.
*
* @param {*} data
* @param {function} cb
*/
exports.format = function (data, cb) {
var err;
try {
data = JSON.stringify(data);
} catch (e) {
err = e;
}
cb(err, data);
};
/**
* Parse data.
*
* @param {*} data
* @param {function} cb
*/
exports.parse = function (data, cb) {
var err;
if (typeof data !== 'string') return cb(null, data);
try {
data = JSON.parse(data);
} catch (e) {
err = e;
}
cb(err, data);
};
|
<div class="footer">
<p>This is Footer</p>
</div>
|
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function(){
// establish button
var button = new five.Button(2);
// establish led
var led = new five.Led(11);
button.on("press", function() {
led.on();
});
button.on("release", function(){
led.off();
});
});
|
describe('Skill controller', function() {
beforeEach(function() {
this.addMatchers({
toEqualData : function(expected) {
return angular.equals(this.actual, expected);
}
});
});
var allSkillList = [
{
"name" : "Wireshark",
"category" : "tooling",
"id" : "Wireshark",
},
{
"name" : "WS/SOAP",
"category" : "paradigm",
"id" : "WSSOAP",
},
{
"name" : "XSLT",
"category" : "prog",
"id" : "XSLT",
},
{
"name" : "YourKit Profiler",
"category" : "tooling",
"id" : "YourKitProfiler",
},
{
"name" : "YouTrack",
"description" : "http://www.jetbrains.com/youtrack/\n\nJetBrains Bugtracker mit Agile Project Management Support, etc...",
"id" : "YouTrack",
}
];
describe('ListCtrl', function(){
var scope, ctrl, skills, $httpBackend;
beforeEach(module('cvio'));
beforeEach(inject(function(_$httpBackend_, $rootScope, $controller) {
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('/api/skills').respond(allSkillList);
scope = $rootScope.$new();
scope.cv = {};
ctrl = $controller('SkillCtrl', {$scope: scope});
$httpBackend.verifyNoOutstandingExpectation();
$httpBackend.flush();
}));
it('should have loaded some items', function() {
expect(scope.skillItems).toEqualData(allSkillList);
});
it('the category filters for the main box should work', function() {
var categoryFilter = scope.byCategory('tooling');
scope.cv.skills = {};
expect(categoryFilter(allSkillList[0])).toBeTruthy();
expect(categoryFilter(allSkillList[1])).toBeFalsy();
scope.cv.skills = {"Wireshark": 1};
expect(categoryFilter(allSkillList[0])).toBeFalsy();
scope.cv.skills = {"Wireshark": 1};
});
it('the box filter for skill selection should work', function() {
var bySkillSelection = scope.bySkillSelection('beginner');
scope.cv.skills = {};
expect(bySkillSelection(allSkillList[0])).toBeFalsy();
scope.cv.skills = {"Wireshark": 1};
expect(bySkillSelection(allSkillList[0])).toBeTruthy();
scope.cv.skills = {"Wireshark": 2};
expect(bySkillSelection(allSkillList[0])).toBeFalsy();
bySkillSelection = scope.bySkillSelection('advanced');
scope.cvSkills = {"Wireshark": 2};
expect(bySkillSelection(allSkillList[0])).toBeTruthy();
bySkillSelection = scope.bySkillSelection('expert');
scope.cv.skills = {"Wireshark": 3};
expect(bySkillSelection(allSkillList[0])).toBeTruthy();
});
});
});
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ErrorCategory_1 = require("./ErrorCategory");
var ErrorDescription_1 = require("./ErrorDescription");
var ApplicationException_1 = require("./ApplicationException");
var ErrorDescriptionFactory = /** @class */ (function () {
function ErrorDescriptionFactory() {
}
ErrorDescriptionFactory.create = function (error) {
var description = new ErrorDescription_1.ErrorDescription();
if (error instanceof ApplicationException_1.ApplicationException) {
var ex = error;
description.category = ex.category;
description.status = ex.status;
description.code = ex.code;
description.message = ex.message;
description.details = ex.details;
description.correlation_id = ex.correlation_id;
description.cause = ex.getCauseString();
description.stack_trace = ex.getStackTraceString();
}
else {
error = error || {};
description.type = error.name;
description.category = ErrorCategory_1.ErrorCategory.Unknown;
description.status = 500;
description.code = "UNKNOWN";
description.message = error.message || error.toString();
description.stack_trace = error.stack;
}
return description;
};
return ErrorDescriptionFactory;
}());
exports.ErrorDescriptionFactory = ErrorDescriptionFactory;
//# sourceMappingURL=ErrorDescriptionFactory.js.map
|
import angular from 'angular';
import uirouter from 'angular-ui-router';
import routing from './places.config';
import PlacesService from './places.service';
import PlacesListController from './list/places.list.controller';
import PlacesCreateController from './create/places.create.controller';
import PlacesEditController from './edit/places.edit.controller';
export default angular.module('app.places',[])
.config(routing)
.service('PlacesService', PlacesService )
.controller('PlacesListController', PlacesListController)
.controller('PlacesCreateController', PlacesCreateController)
.controller('PlacesEditController', PlacesEditController)
.name;
|
/**
* @author Peter Kelley
* @author pgkelley4@gmail.com
*/
/**
* See if two line segments intersect. This uses the
* vector cross product approach described below:
* http://stackoverflow.com/a/565282/786339
*
* @param {Object} p point object with x and y coordinates
* representing the start of the 1st line.
* @param {Object} p2 point object with x and y coordinates
* representing the end of the 1st line.
* @param {Object} q point object with x and y coordinates
* representing the start of the 2nd line.
* @param {Object} q2 point object with x and y coordinates
* representing the end of the 2nd line.
*/
function doLineSegmentsIntersect(p, p2, q, q2) {
var r = subtractPoints(p2, p);
var s = subtractPoints(q2, q);
var uNumerator = crossProduct(subtractPoints(q, p), r);
var denominator = crossProduct(r, s);
if (uNumerator == 0 && denominator == 0) {
// They are coLlinear
// Do they touch? (Are any of the points equal?)
if (equalPoints(p, q) || equalPoints(p, q2) || equalPoints(p2, q) || equalPoints(p2, q2)) {
return true
}
// Do they overlap? (Are all the point differences in either direction the same sign)
return !allEqual(
(q.x - p.x < 0),
(q.x - p2.x < 0),
(q2.x - p.x < 0),
(q2.x - p2.x < 0)) ||
!allEqual(
(q.y - p.y < 0),
(q.y - p2.y < 0),
(q2.y - p.y < 0),
(q2.y - p2.y < 0));
}
if (denominator == 0) {
// lines are paralell
return false;
}
var u = uNumerator / denominator;
var t = crossProduct(subtractPoints(q, p), s) / denominator;
return (t >= 0) && (t <= 1) && (u >= 0) && (u <= 1);
}
/**
* Calculate the cross product of the two points.
*
* @param {Object} point1 point object with x and y coordinates
* @param {Object} point2 point object with x and y coordinates
*
* @return the cross product result as a float
*/
function crossProduct(point1, point2) {
return point1.x * point2.y - point1.y * point2.x;
}
/**
* Subtract the second point from the first.
*
* @param {Object} point1 point object with x and y coordinates
* @param {Object} point2 point object with x and y coordinates
*
* @return the subtraction result as a point object
*/
function subtractPoints(point1, point2) {
var result = {};
result.x = point1.x - point2.x;
result.y = point1.y - point2.y;
return result;
}
/**
* See if the points are equal.
*
* @param {Object} point1 point object with x and y coordinates
* @param {Object} point2 point object with x and y coordinates
*
* @return if the points are equal
*/
function equalPoints(point1, point2) {
return (point1.x == point2.x) && (point1.y == point2.y)
}
/**
* See if all arguments are equal.
*
* @param {...} args arguments that will be compared by '=='.
*
* @return if all arguments are equal
*/
function allEqual(args) {
var firstValue = arguments[0],
i;
for (i = 1; i < arguments.length; i += 1) {
if (arguments[i] != firstValue) {
return false;
}
}
return true;
}
|
const childProcess = require('child_process');
// Compare two images, returning the percentage of differing pixels.
module.exports = function compareImages(lhs, rhs) {
return new Promise((resolve, reject) => {
const compareCommand = `compare -metric ae "${lhs}" "${rhs}" null:`;
childProcess.exec(compareCommand, (err, _, stderr) => {
// Remember: imagemagick is odd here. Error code 1 means the images are
// different, not that the program failed. Also, stderr is used for
// output, even on success.
if (err && err.code !== 1) {
console.log(`child processes failed with error code: ${err.code}`);
return reject(err);
}
const differingPixels = parseInt(stderr, 10);
if (isNaN(differingPixels)) {
console.log(`returned differing pixels '${stderr}' cannot be parsed into a number`);
return reject(new Error(`Cannot parse returned differing pixels '${stderr}'`));
}
// Now get the differing pixels as a percentage.
const identifyCommand = `identify -format "%[fx:${differingPixels}*100/(w*h)]" "${lhs}"`;
return childProcess.exec(identifyCommand, (identifyErr, percentage) => {
if (identifyErr) {
console.log(`child processes failed with error code: ${identifyErr.code}`);
return reject(identifyErr);
}
const percentageDifference = parseInt(percentage, 10);
if (isNaN(percentageDifference)) {
console.log(`returned percentage '${percentage}' cannot be parsed into a number`);
return reject(new Error(`Cannot parse returned percentage '${percentage}'`));
}
return resolve(percentage);
});
});
});
};
|
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'assets/js/*.js',
'!assets/js/scripts.min.js'
]
},
less: {
dist: {
files: {
'assets/css/main.min.css': [
'assets/less/app.less'
],
'assets/css/wp-admin.css': [
'assets/less/wp-admin.less'
]
},
options: {
compress: true,
// LESS source map
// To enable, set sourceMap to true and update sourceMapRootpath based on your install
sourceMap: false,
sourceMapFilename: 'assets/css/main.min.css.map',
sourceMapRootpath: '/app/themes/jamacor/'
}
}
},
uglify: {
dist: {
files: {
'assets/js/scripts.min.js': [
'assets/js/plugins/bootstrap/transition.js',
'assets/js/plugins/bootstrap/alert.js',
'assets/js/plugins/bootstrap/button.js',
'assets/js/plugins/bootstrap/carousel.js',
'assets/js/plugins/bootstrap/collapse.js',
'assets/js/plugins/bootstrap/dropdown.js',
'assets/js/plugins/bootstrap/modal.js',
'assets/js/plugins/bootstrap/tooltip.js',
'assets/js/plugins/bootstrap/popover.js',
'assets/js/plugins/bootstrap/scrollspy.js',
'assets/js/plugins/bootstrap/tab.js',
'assets/js/plugins/bootstrap/affix.js',
'assets/js/plugins/*.js',
'assets/js/_*.js'
]
},
options: {
// JS source map: to enable, uncomment the lines below and update sourceMappingURL based on your install
// sourceMap: 'assets/js/scripts.min.js.map',
// sourceMappingURL: '/app/themes/jamacor/assets/js/scripts.min.js.map'
}
}
},
version: {
options: {
file: 'lib/scripts.php',
css: 'assets/css/main.min.css',
cssHandle: 'roots_main',
js: 'assets/js/scripts.min.js',
jsHandle: 'roots_scripts'
}
},
watch: {
less: {
files: [
'assets/less/*.less',
'assets/less/bootstrap/*.less'
],
tasks: ['less', 'version']
},
js: {
files: [
'<%= jshint.all %>'
],
tasks: ['jshint', 'uglify', 'version']
},
livereload: {
// Browser live reloading
// https://github.com/gruntjs/grunt-contrib-watch#live-reloading
options: {
livereload: false
},
files: [
'assets/css/main.min.css',
'assets/js/scripts.min.js',
'templates/*.php',
'*.php'
]
}
},
clean: {
dist: [
'assets/css/main.min.css',
'assets/css/wp-admin.css',
'assets/js/scripts.min.js'
]
}
});
// Load tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-wp-version');
// Register tasks
grunt.registerTask('default', [
'clean',
'less',
'uglify',
'version'
]);
grunt.registerTask('dev', [
'watch'
]);
};
|
module.exports = {
build: {
dest: '../../../dest',
},
scss: {
src: '../../../scss/materialDesign',
dest: '../../../urushi/material/style',
buildDest: '../../../dest/urushi/material/style'
},
js: {
src: {
rjs: [
'../../../urushi/*.js',
'../../../urushi/base/*.js'
],
uglify: [
'../../../urushi/material/**/*.js',
'../../../lib/**/*.js',
'../../../config/**/*.js',
'../../../test/**/*.js'
],
trans: [
'../../../urushi/material/**/*.html',
'../../../scss/materialDesign/font/*.eot',
'../../../scss/materialDesign/font/*.svg',
'../../../scss/materialDesign/font/*.ttf',
'../../../scss/materialDesign/font/*.woff',
'../../../test/**/*.html',
'../../../test/**/*.css',
'../../../util/jasmine/**/*.*'
]
},
dest: {
rjs: [
'../../../dest/urushi',
'../../../dest/urushi/base'
],
uglify: [
'../../../dest/urushi/material',
'../../../dest/lib',
'../../../dest/config',
'../../../dest/test'
],
trans: [
'../../../dest/urushi/material',
'../../../dest/urushi/material/style/font',
'../../../dest/urushi/material/style/font',
'../../../dest/urushi/material/style/font',
'../../../dest/urushi/material/style/font',
'../../../dest/test',
'../../../dest/test',
'../../../dest/util/jasmine'
]
},
rjs: {
baseUrl: './',
shim: {
'jqueryUi': ['jquery']
},
paths: {
// libraries
text: '../../../lib/js/text',
extend: '../../../lib/js/extend',
jquery: '../../../lib/js/jquery-2.1.1',
jqueryUi: '../../../lib/js/jquery-ui-1.11.4',
jqueryFileupload: '../../../lib/js/jquery.fileupload',
jqueryIframeTransport: '../../../lib/js/jquery.iframe-transport',
underscore: '../../../lib/js/underscore',
// urushi core objects.
addInputEventListener: '../../../urushi/base/addInputEventListener',
animation: '../../../urushi/base/animation',
browser: '../../../urushi/base/browser',
Deferred: '../../../urushi/base/Deferred',
event: '../../../urushi/base/event',
legacy: '../../../urushi/base/legacy',
node: '../../../urushi/base/node',
Promise: '../../../urushi/base/Promise',
removeInputEventListener: '../../../urushi/base/removeInputEventListener',
templateEngine: '../../../urushi/base/templateEngine',
xhr: '../../../urushi/base/xhr',
Urushi: '../../../urushi/Urushi',
// urushi module classes.
templateConfig: '../../../urushi/material/js/templateConfig',
materialConfig: '../../../urushi/material/js/materialConfig',
_Base: '../../../urushi/material/js/_Base',
_collectionMixin: 'urushi/material/js/_collectionMixin',
_CollectionWidgetBase: 'urushi/material/js/_CollectionWidgetBase',
_CollectionItemBase: 'urushi/material/js/_CollectionItemBase',
Alert: '../../../urushi/material/js/Alert',
Button: '../../../urushi/material/js/Button',
Checkbox: '../../../urushi/material/js/Checkbox',
ContextMenu: '../../../urushi/material/js/ContextMenu',
_ContextMenuItem: '../../../urushi/material/js/_ContextMenuItem',
Dialog: '../../../urushi/material/js/Dialog',
DropDown: '../../../urushi/material/js/DropDown',
Hamburger: '../../../urushi/material/js/Hamburger',
Input: '../../../urushi/material/js/Input',
Panel: '../../../urushi/material/js/Panel',
Radiobox: '../../../urushi/material/js/Radiobox',
Ripple: '../../../urushi/material/js/Ripple',
Textarea: '../../../urushi/material/js/Textarea',
Toast: '../../../urushi/material/js/Toast',
ToastManager: '../../../urushi/material/js/ToastManager',
ToggleButton: '../../../urushi/material/js/ToggleButton',
Tooltip: '../../../urushi/material/js/Tooltip'
// urushi module template.
// alertTemplate: '../../../urushi/material/template/alert.html',
// buttonTemplate: '../../../urushi/material/template/button.html',
// checkboxTemplate: '../../../urushi/material/template/checkbox.html',
// checkboxTransitionUnitTemplate: '../../../urushi/material/template/checkbox-transition-unit.html',
// checkboxRippleTransitionUnitTemplate: '../../../urushi/material/template/checkbox-ripple-transition-unit.html',
// contextMenuTemplate: '../../../urushi/material/template/context-menu.html',
// dialogTemplate: '../../../urushi/material/template/dialog.html',
// dropDownTemplate: '../../../urushi/material/template/drop-down.html',
// hamburgerTemplate: '../../../urushi/material/template/hamburger.html',
// inputTemplate: '../../../urushi/material/template/input.html',
// inputTransitionUnitTemplate: '../../../urushi/material/template/input-transition-unit.html',
// panelTemplate: '../../../urushi/material/template/panel.html',
// radioboxTemplate: '../../../urushi/material/template/radiobox.html',
// textareaTemplate: '../../../urushi/material/template/textarea.html',
// toastTemplate: '../../../urushi/material/template/toast.html',
// toastManagerTemplate: '../../../urushi/material/template/toast-manager.html',
// toggleButtonTemplate: '../../../urushi/material/template/toggle-button.html',
// toggleButtonTransitionUnitTemplate: '../../../urushi/material/template/toggle-button-transition-unit.html',
// tooltipTemplate: '../../../urushi/material/template/tooltip.html',
},
urlArgs: 'ver=beta'
}
},
styleDocco: {
src: '../../../scss/materialDesign',
dest: '../../../document/StyleDocco',
style: '../../../urushi/material/style',
},
jsdoc: {
jsonPath: '../node_modules/gulp-jsdoc/package.json',
option: {
'showPrivate': true,
monospaceLinks: true,
cleverLinks: true,
outputSourceFiles: true
},
template: {
path: './jsdoc-template/jsdoc3-bootstrap-master/',
footer: 'Generated with gulp',
copyright: 'Copyright WebItUp 2014',
navType: 'vertical',
theme: 'United',
linenums: true,
collapseSymbols: false,
inverseNav: false
},
src: '../../../urushi',
dest: '../../../document/urushi-reference',
prepare: './jsdoc-template/jsdoc3-bootstrap-master/static'
},
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.