code stringlengths 2 1.05M |
|---|
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Bid Schema
*/
var BidSchema = new Schema({
bidder: {
type: Schema.ObjectId,
ref: 'User',
required: 'Please specify bidder'
},
amount: {
type: Number,
required: true
},
ti... |
const urls = require('../../../../../src/lib/urls')
const selectors = require('../../../../selectors')
const { assertBreadcrumbs } = require('../../support/assertions')
const archived = require('../../../../sandbox/fixtures/v4/pipeline-item/archived.json')
const { assertProjectDetails } = require('../../support/pipelin... |
'use strict';
const assert = require('assert');
const app = require('../../../src/app');
describe('todos service', function() {
it('registered the todos service', () => {
assert.ok(app.service('todos'));
});
});
|
window.pdfMake = window.pdfMake || {}; window.pdfMake.fonts = {"Crushed":{"normal":"Crushed.ttf","bold":"Crushed.ttf","italics":"Crushed.ttf","bolditalics":"Crushed.ttf"}}; |
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
connect = require('gulp-connect');
gulp.task('sass', function() {
return sass('publ... |
var woopsaUtils = require('../woopsa-utils');
var exceptions = require('../exceptions')
/**
* Default timeout for the WaitNotification method in
* milliseconds (normally it is 5000)
* @type {Number}
*/
var DEFAULT_WAIT_NOTIFICATION_TIMEOUT = 5000;
/**
* The amount of time, in minutes, before a subscription
* c... |
$(document).ready(function () {
$("#search-icon").click(function() {
$("#search form").slideDown(function() {
$(this).find("input[type=text]").focus();
})
return false;
});
}); |
import {SyncController} from "../../wargame-helpers/Vue/sync-controller";
import Vue from "vue";
export class AirborneSyncController extends SyncController{
constructor(){
super();
}
specialHexes(){
this.sync.register("specialHexes", function(specialHexes, data) {
debugger;
... |
// 测试用户的认证过程
import chai,{expect} from 'chai'; // eslint-disable-line
const should = chai.should(); // eslint-disable-line
import mongoose from 'mongoose';
import {Order} from '../models';
const model_list = [Order];
import {ClearDataForTest,db_connect_string,server} from './lib';
import moment from 'moment';
const o... |
import { filter, sumBy, map, find } from 'lodash';
import moment from 'moment';
import translations from '../constants/translations';
export const filterCurrentEvents = (events) => {
return filter(events, (e) => {
const eventDate = moment(e.date);
const currentDate = moment();
return eventDate.month() =... |
/*
* @Author: justinwebb
* @Date: 2015-09-20 14:37:46
* @Last Modified by: justinwebb
* @Last Modified time: 2015-09-24 22:05:50
* @Purpose: Demonstrate the following:
* -- The ability to access to a public API and successfully retrieve
* data from it;
* -- The ability to display that data on a page using only nati... |
var utils = require('./utils')();
function step5a(result){
if( result.stats.measure > 1){
utils.checkEnding(result, 'e', '');
}
if(result.stats.measure === 1 && utils.cvcCheck(result) === false){
utils.checkEnding(result, 'e', '');
}
}
function step5b(result) {
if( result.stats.mea... |
var AccessTokenModel = require("./node_modules/reso-api-oauth2-server/libs/mongoose").AccessTokenModel;
var AuthorizationCodeModel = require("./node_modules/reso-api-oauth2-server/libs/mongoose").AuthorizationCodeModel;
var ClientModel = require("./node_modules/reso-api-oauth2-server/libs/mongoose").ClientModel;
var... |
'use strict';
angular.module('csyywx')
.controller('SetSalaryCtrl', function($scope, utils, UserApi, userConfig, settingService) {
UserApi.getSalaryDay({sessionId: userConfig.getSessionId()})
.success(function(data) {
if(+data.flag === 1) {
$scope.active = data.data.salaryDay;
$scope.extraInterest ... |
// ------------------------------
// location
// ------------------------------
/**
* Get location items
*/
export const LOCATION_GET_ITEMS = "LOCATION_GET_ITEMS";
export function location_getItems() {
return {
type: LOCATION_GET_ITEMS,
};
}
/**
* Got location items successfuly
* @param {array} payload :... |
var reddit = require('../index.js');
// reddit._addSimpleRequest = function(name, endpoint, method, args, constArgs, callback)
reddit._addSimpleRequest("del", "del", "POST", ["id"], null, "_noResponse");
reddit._addSimpleRequest("edit", "editusertext", "POST", ["thing_id", "text"], {"api_type": "json"}, "_modifySingle... |
Settings = {
indicatorNames: [
'Broadband subscription charge as a percentage of GDP per capita PPP (0-1 Mbps)',
'Broadband subscription charge as a percentage of GDP per capita PPP (>1-4 Mbps)',
'Broadband subscription charge as a percentage of GDP per capita PPP (>4-10 Mbps)',
'Broadband subscriptio... |
var ProjectForm = React.createClass({displayName: "ProjectForm",
getInitialState: function() {
return ({ tags: [], members: [], formErrors: {}});
},
handleSubmit: function(e) {
e.preventDefault();
var data = new FormData();
var IMG_MIMES = ['image/jpeg', 'image/pjpeg', 'image/png', 'image/bmp', 'image/svg+xm... |
define([
'jquery',
'underscore',
'backbone',
'text!templates/exams/entermark.html'
], function($, _, Backbone, markTpl){
var Entry = Backbone.View.extend({
markTpl: _.template(markTpl),
tagName: 'tr',
events: {
'submit .save-mark' : 'saveMark',
'dblclick .exam-score' : 'editMark',
'click .editM... |
/**
* Returns a predicate that negates the given one.
* @example
* const isEven = n => n % 2 === 0;
* const isOdd = _.not(isEven);
*
* isOdd(5) // => true
* isOdd(4) // => false
*
* @memberof module:lamb
* @category Logic
* @since 0.1.0
* @param {Function} predicate
* @returns {Function}
*/
function not (... |
import Controller from 'octosmashed/controllers/index';
export default Controller;
|
(function () {
'use strict';
const $ = require('jquery');
/**
* @param Base
* @param {$rootScope.Scope} $scope
* @param {$mdDialog} $mdDialog
* @return {LoginByDeviceCtrl}
*/
const controller = function (Base, $scope, $mdDialog) {
class LoginByDeviceCtrl extends Base ... |
const _ = require('lodash');
const config = require('../../../shared/config');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');
const logging = require('@tryghost/logging');
const models = require('../../models');
const mail = require('../mail');
const messages = {
setupAlreadyComp... |
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
app: ["babel-polyfill",'./src/main.js']
},
output: {
path: config.... |
/**
* Created by Administrator on 2015/4/25.
*/
var addLacator = function (protractor) {
protractor.By.addLocator('buttonTextSimple', function (buttonText, opt_parentElement, opt_rootSelector) {
var using = opt_parentElement || document,
buttons = using.querySelectorAll('button');
ret... |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0635",
"\u0645"
],
"DAY": [
"\u... |
/**
* Created by easub on 2017/2/16.
*/
import React from 'react';
import { merge } from 'lodash';
import styled from 'styled-components';
import { RaisedButton } from 'material-ui';
import EffectComponents from 'components/EffectsComponents';
import EditContent from './EditContent';
const Content = styled.div`
... |
var app = app || {};
(function(){
app.TestButton = React.createClass({displayName: "TestButton",
handleClick: function() {
this.props.submitTestTask(this.props.btnType);
},
render: function() {
return ( React.createElement("button", {onClick: this.handleClick,
... |
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
var app2 = new Vue({
el: '#app-2',
data: {
message: '页面加载于 ' + new Date()
}
})
var app3 = new Vue({
el: '#app-3',
data: {
seen: true
}
})
var app4 = new Vue({
el: '#app-4',
data: {
todos: [{
... |
function recomputeAccelerations()
{
for( var i = 0; i < N_ATOMS; ++i )
{
atoms[i].acceleration.x = 0.0;
atoms[i].acceleration.y = 0.0;
}
for( var i = 0; i < N_ATOMS; ++i )
{
for( var j = i+1; j < N_ATOMS; ++j )
{
var to = atoms[i].position.sub( atoms[j].p... |
var __run=function(){
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[modul... |
import React, {Component} from 'react';
import ContainerCharts from './containers/container-charts/index'
import ContainerMap from './containers/container-map/index'
import HomePage from './pages/homepage/index'
//import Charts from './pages/chart/index'
//import Maps from './pages/page-maps/index'
import Registrati... |
(function(){
"use strict";
module.exports.posts = require('./api/posts');
module.exports.themes = require('./api/themes');
module.exports.adminthemes = require('./api/adminthemes');
module.exports.labels = require('./api/labels');
module.exports.postsinfo = require('./api/postsinfo');
modul... |
#!/usr/bin/env node
require('dotenv').load()
var test = require('tape')
var Snapchat = require('../')
var Session = require('../models/session')
var StringUtils = require('../lib/string-utils')
var SNAPCHAT_USERNAME = process.env.SNAPCHAT_USERNAME
var SNAPCHAT_PASSWORD = process.env.SNAPCHAT_PASSWORD
var SNAPCHAT_GM... |
//#ifndef __lang_Base__
//#define __lang_Base__
/**
* Bootstrap JavaScript Library
* (c) 2006 - 2011 Juerg Lehni, http://lehni.org/
*
* Bootstrap is released under the MIT license
* http://bootstrapjs.org/
*
* Inspirations:
* http://dean.edwards.name/weblog/2006/03/base/
* http://dev.helma.org/Wiki/JavaScript... |
describe("jB.siteUrl", function () {
var dynUrlRegexp = /(.*\/tests).*/g;
var match = dynUrlRegexp.exec(window.location.href);
beforeEach(function () {
jB.clearConfig();
jB.setConfig('segmentSiteRoot', 'tests');
});
it("should be able to retrieve right site url", function () {
... |
/**
* File : webpack.config.js
* Todo :
* author: wind.direction.work@gmail.com
* Created by wind on 17/2/28.
*/
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var tools = require('./tools');
//一些常用的路径
var ROOT_PATH = path.resolve(__dirname);
... |
'use strict';
var React = require('react');
module.exports = {
propTypes: {
xAccessor: React.PropTypes.func,
yAccessor: React.PropTypes.func
},
getDefaultProps: function getDefaultProps() {
return {
xAccessor: function xAccessor(d) {
return d.x;
},
yAccessor: function yAcc... |
//audio time progress bar JQuery Plugin
/**
* @module MusicPlayer
*/
(function ($) {
/**
* Class which provides methods to fill content of time progress bar for JQuery plugin.
* @class TimeProgressBarObj
* @static
*/
var TimeProgressBarObj = {
/**
* Holds current object of this JQuery pl... |
'use strict';
angular.module('app.controllers')
.controller('nameDisplay',[function() {
}]);
|
// flow-typed signature: 7ddc48858cc858bdd2e3df86126c3e50
// flow-typed version: <<STUB>>/eslint-config-rackt_v^1.1.1/flow_v0.37.4
/**
* This is an autogenerated libdef stub for:
*
* 'eslint-config-rackt'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share y... |
"use strict"
const crypto = require('crypto');
const Game = require('./game_api');
let GameAPI = Game.API;
let LocalTest = exports;
LocalTest.API = class LocalTestAPI extends GameAPI {
constructor(global_config, api_config, bot) {
super(global_config, api_config, bot);
this.house_edge = 0.01;
... |
/**
* Generates a random Base64 encoded character string
*
* @method byte
* @param {Object} gen - The genator object passed from json-schema-faker
* @return {string} - A base64 encoded string of characters
*/
function byte(gen) {
var randomWord = gen.faker.random.words();
var buff = new Buf... |
'use strict';
const { messages, ruleName } = require('..');
const { stripIndent } = require('common-tags');
testRule({
ruleName,
config: [true],
fix: true,
accept: [
{
code: 'a { top: 0; }',
description: 'unitless zero',
},
{
code: 'a { padding: calc(0px +\n 0px); }',
description: 'ignore calc',... |
import React from 'react';
import FccIcon from './FccIcon';
import Header from './Header';
const AppHeader = props => {
return (
<div className="App-header">
<Header >{props.headerText}<FccIcon /> {props.appName}</Header>
</div>
)
};
export default AppHeader; |
try {
require('./box_shadows.css');
} catch (e) {
} |
(function() {
'use strict';
angular
.module('<%= appname %>')
.run(checkAuth);
/**
* This function will check if a given state requires the user to be authenticated.
* If it does require authentication, and use not authenticated then will be redirected.
*/
/** @ngInject */
function checkAut... |
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.ex... |
define(['jquery', 'backbone', 'bootstrap-dialog', 'underscore', 'bootstrap', 'datePicker', 'jscookie'], function($, Backbone, BootstrapDialog, Cookie){
var LoginView = Backbone.View.extend({
events: {
'submit .form-signin' : 'login',
},
templateName: 'LoginTemplate',
initialize: function(){
... |
/**
* Fuse.js v5.1.0 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2020 Kiro Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
'use strict';
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof C... |
import React from 'react';
import renderer from 'react-test-renderer';
import Header from '../';
describe('Header', () => {
it('renders correctly', () => {
const header = renderer.create(
<Header />
).toJSON();
expect(header).toMatchSnapshot();
});
});
|
/**
* Roundcube Webmail Client Script
*
* This file is part of the Roundcube Webmail client
*
* @licstart The following is the entire license notice for the
* JavaScript code in this file.
*
* Copyright (C) 2005-2015, The Roundcube Dev Team
* Copyright (C) 2011-2015, Kolab Systems AG
*
* The JavaScript code... |
import React from 'react';
import { shallow, mount } from 'enzyme';
import Login from '../lib/components/Login/Login';
describe('Login', () => {
let wrapper;
beforeEach(() => {
wrapper = shallow(<Login />)
})
it.skip('should exist', () => {
expect(wrapper).toBeDefined()
})
it.skip('should have ... |
import { calculateOutput, getInitialInput, CONSTANT_TAX, LINEAR_TAX, PROGRESSIVE_TAX } from "../src/Calculator";
import "babel-polyfill";
describe("CalculateOutput", function() {
let input = getInitialInput();
it("returns output properly on default input", function() {
expect(calculateOutput(getInitialInput()... |
//Template loader
//see http://berzniz.com/post/24743062344/handling-handlebars-js-like-a-pro
//resulting terminal command: handlebars templates/ >> js/resources/templates.js
//TODO: compile all templates into templates.js
Handlebars.getTemplate = function(name) {
if (Handlebars.templates === undefined || Hand... |
import React from "react"
import { Link } from "gatsby"
import styled from 'styled-components'
import FlexBox from './FlexBox'
export default function Header({ routes, currentPath, image }) {
return (
<StyledHeader>
<StyledNav>
<FlexBox
as='ol'
alignItems='center'
jus... |
const WPAPI = require('wpapi');
const waterfall = require('async/waterfall');
const moment = require('moment');
const Promise = require('promise');
const fs = require('fs');
const request = require('request');
const lib = require('./lib');
const keystoneCategories = require('../../data/cate... |
/* The MIT License (MIT)
*
* Copyright (c) 2015 VIMOC Technologies
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* ... |
(function () {
'use strict';
/* jshint -W098 */
// The Package is past automatically as first parameter
module.exports = function (Gallery, app, auth, database) {
app.get('/api/gallery/example/anyone', function (req, res, next) {
res.send('Anyone can access this');
});
app.get('/api/gallery... |
import { fromJS } from 'immutable';
import cheerio from 'cheerio';
import r from 'rethinkdb';
// Constants
import { DB_HOST, DB_PORT } from '../constants/configurations.js';
export function parseHeaderCookie(headers, cookieMap) {
let immutableMap = fromJS(cookieMap);
headers['set-cookie'].forEach((cookie) => {
... |
Package.describe({
name: "nova:events",
summary: "Telescope event tracking package",
version: "1.2.0",
git: "https://github.com/TelescopeJS/Telescope.git"
});
Package.onUse(function(api) {
api.versionsFrom("METEOR@1.0");
api.use([
'nova:core@1.2.0',
'nova:posts@1.2.0', // needed to track posts ... |
'use strict';
var _ = require('lodash');
var UAParser = require('ua-parser-js');
module.exports = function (options) {
var defs = {path: '$useragent'};
var opts = _.merge({}, defs, options || {});
return function (page, model, params, next) {
var parser = new UAParser();
if (!page.app.derby.util.isSer... |
//Recursive solution - DP
function fibonacci(num){
if (num === 1 || num === 2){
return 1;
}
if (num > 2){
return fibonacci(num - 1) + fibonacci(num - 2);
}
}
//Non Recursive solution
function fib(num){
var n1 = 1,
n2 = 1,
n = 1;
for (var i = 3; i<=num; i++){
... |
function GroCurveFit(url, auth, auth_cb, timeout, async_job_check_time_ms, async_version) {
var self = this;
this.url = url;
var _url = url;
this.timeout = timeout;
var _timeout = timeout;
this.async_job_check_time_ms = async_job_check_time_ms;
if (!this.async_job_check_... |
// Load modules
var Fs = require('fs');
var Path = require('path');
var Boom = require('boom');
var Async = require('async');
var Response = require('./response');
var File = require('./file');
var Utils = require('./utils');
var Schema = require('./schema');
// Declare internals
var internals = {};
exports.handl... |
module.exports = {
type: 'react-component',
build: {
externals: {
'react': 'React'
},
global: '',
jsNext: true,
umd: false
}
}
|
var nomore = false;
function getStatsLooper() {
getStatsWrapper(function(results) {
results.forEach(function(result) {
Object.keys(getStatsParser).forEach(function(key) {
if (typeof getStatsParser[key] === 'function') {
getStatsParser[key](result);
... |
/*global phantom:true*/
(function() {
'use strict';
var fs = require('fs');
// The temporary file used for communications.
var tmpfile = phantom.args[0];
// The page .html file to load.
var url = phantom.args[1];
// Extra, optionally overridable stuff.
var options = JSON.parse(phantom.args[2] || "{}");
// Default o... |
import Ember from 'ember';
import DS from 'ember-data';
/**
* Transforms ``Object`` (frontend) <-> JSON (backend).
*
* It adds support for using object as a model property type.
*
* @module transforms/object
* @author Jakub Liput
* @copyright (C) 2016 ACK CYFRONET AGH
* @license This software is released under... |
import { types as t } from "@babel/core";
import escope from "eslint-scope";
import { Definition } from "eslint-scope/lib/definition";
import OriginalPatternVisitor from "eslint-scope/lib/pattern-visitor";
import OriginalReferencer from "eslint-scope/lib/referencer";
import { getKeys as fallback } from "eslint-visitor-... |
(function(){
'use strict';
angular.module('angularTodo',[]);
var apl = angular.module('angularTodo');
apl.controller("mainController",['$scope','$http', function(s,h){
s.formData = {};
s.todos = [];
//Cuando se cargue la página, pide del API todas las tareas
h.get('/api/todos')
.success(function(data) ... |
var FacebookStrategy = require('passport-facebook').Strategy,
TwitterStrategy = require('passport-twitter').Strategy,
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
userService = require('../apis/userService'),
fileUtils = require('../utils/fileUtils'),
settings ... |
var fs = require("fs");
var express = require("express");
var vhost = require("vhost");
//Get the list of directories in the example directory
//so we know where to direct requests
var apps = fs.readdirSync("./examples/");
//Are we running locally?
var local = fs.existsSync("./.local");
//Set url string handlers ap... |
import keyBy from 'lodash/keyBy';
import omit from 'lodash/omit';
import * as actions from './userActions';
const initialState = {
// Map<FilePublicId, File>
files: {},
// Whether a file is uploading.
// Map<FileName, Bool>
fileUploadIsLoading: {},
fileUploadError: null,
filesFetchError: null,
filesFe... |
import React, { PropTypes } from 'react';
import cx from 'classnames';
import Link from '../Link';
import v from '../../src/styles/variables.css';
import g from '../../src/styles/grid.css';
import z from '../../src/styles/aesthetics.css';
import s from './BreadCrumbs.css';
class BreadCrumbs extends React.Component {
... |
// Regular expression that matches all symbols with the `Hex_Digit` property as per Unicode v8.0.0:
/[0-9A-Fa-f\uFF10-\uFF19\uFF21-\uFF26\uFF41-\uFF46]/; |
const BinaryTreeIterator = require("./BinaryTreeIterator");
// const binaryTreeTraverse = (node, callback, some) => {
// if (node === null) {
// return false;
// }
// let ret;
// ret = binaryTreeTraverse(node.left, callback, some);
// if (some && ret) {
// return true;
// }
/... |
module.exports = xor
function xor(a, b) {
if (!Buffer.isBuffer(a)) a = new Buffer(a)
if (!Buffer.isBuffer(b)) b = new Buffer(b)
var res = []
if (a.length > b.length) {
for (var i = 0; i < b.length; i++) {
res.push(a[i] ^ b[i])
}
} else {
for (var i = 0; i < a.length; i++) {
res.push(a... |
"use strict";
const TsReader = require("../reader");
const TsDescriptorBase = require("./base");
const TsDescriptorCompatibility = require("./compatibility");
const TsCarouselDescriptors = require("../carousel_descriptors");
class TsDescriptorDownloadContent extends TsDescriptorBase {
constructor(buffer) {
... |
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
var database = require('../../../app/model/database');
var config = require('../../../config');
database.init(config.test.database);
describe('database', function() {
it('should let me... |
/**
* @class Oskari.mapframework.bundle.myplacesimport.Flyout
*/
Oskari.clazz.define('Oskari.mapframework.bundle.myplacesimport.Flyout',
/**
* @method create called automatically on construction
* @static
* @param {Oskari.mapframework.bundle.myplacesimport.MyPlacesImportBundleInstance} instance
... |
import { combineReducers } from 'redux'
const data = (state = {}, action) => {
switch (action.type) {
case 'FETCH_REGISTRATION_SUCCESS':
return action.payload
case 'SIGN_OUT_SUCCESS':
return {}
default:
return state
}
}
const isFetching = (state = false, action) => {
switch (action... |
'use strict';
module.exports = {
app: {
title: 'MEAN.JS',
description: 'Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js',
keywords: 'mongodb, express, angularjs, node.js, mongoose, passport'
},
port: process.env.PORT || 3000,
secure: process.env.SECURE || false,
templateEngine: 'swig',
... |
(function (window, angular, undefined) {
'use strict';
angular
.module('module.gallery')
.controller('GalleryCaptureCtrl', function ($scope, User, $ionicModal, PhotoService, GallerySetting,
ParseImageService, $state, Gallery, GalleryForm, Loading) {
$scope.map = {
center: {
ce... |
export Panel from './Panel';
export Filter from './Filter';
export DraggableFilter from './DraggableFilter';
export FilterDragPreview from './FilterDragPreview.js';
export SearchBar from './SearchBar';
|
game.TitleScreen = me.ScreenObject.extend({
/**
* action to perform on state change
*/
onResetEvent: function() {
me.game.world.addChild(new me.Sprite(0, 0, me.loader.getImage('title-screen')), -10); // TODO
me.input.bindKey(me.input.KEY.ENTER, "start");
gam... |
export const reduce = actions => (state, action) => {
try {
return actions[action.type](state, action)
} catch (e) {
return state
}
}
|
var profiles = require('./profiles'); // note .js suffix is optional
console.log("load and replace...");
profiles = JSON.stringify(profiles).replace(/name/g, 'fullname');
console.log(profiles);
console.log("parse and set...");
profiles = JSON.parse(profiles);
profiles.felix.fullname = "Felix Geisendörfer";
console.lo... |
module.exports = {
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
... |
/**
* test/models/validators/user.test.js
* 对用户数据的验证逻辑进行测试
* @author heroic
*/
/**
* Module dependencies
*/
var async = require('async'),
should = require('should');
var models = require('../../db').models;
var User = models.User;
var data = require('../../fixtures/data.json');
describe('models/validators/use... |
import { Tool } from "./Tool";
import { generateActionId } from "../Actions";
export class ViewPortDragging {
constructor(parentTool, board, dragEventName) {
this.parentTool = parentTool;
this.board = board;
this.dragEventName = dragEventName;
this.enabled = false;
this.drag_mouse_start = null;
... |
import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h("path", {
d: "M19.65 9.04l-4.84-.42-1.89-4.45c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08l4.15-2.5 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4... |
var canvas = document.getElementById("the-game");
Movement = {
UP: 1,
DOWN: 2,
LEFT: 3,
RIGHT: 4,
CONTINUE: -1
}
//heuristic 1
function lineDistance(a, b)
{
var xs = 0,
ys = 0;
xs = b.x - a.x;
xs = xs * xs;
ys = b.y - a.y;
ys = ys * ys;
return Math.sqrt( xs + ys );
}
//heuristic 2
func... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.8/esri/copyright.txt for details.
//>>built
define({inputTitle:"\u062a\u0639\u064a\u064a\u0646 \u0627\u0644\u0648\u0642\u062a"}); |
const {Scene, Polyline} = spritejs;
const container = document.getElementById('stage');
const scene = new Scene({
container,
width: 1200,
height: 600,
// contextType: '2d',
});
const layer = scene.layer();
const line = new Polyline({
pos: [250, 50],
points: [0, 0, 100, 100, 200, 0, 300, 100, 400, 0, 500, 1... |
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: config.locationType
});
Router.map(function() {
// this.resource('friend', function(){ });
this.route('friends', function() {
this.route('new');
this.route('show', { path: ':friend_id'});... |
/*global $, _, PageData, Chart, Utils */
function PageController () {
this.DARK = 'dark'
this.LIGHT = 'light'
this.chartObjects = []
// default values are first
this.OPTIONS = {
type: ['column', 'line'],
rounding: ['on', 'off']
}
this.EDITABLES = ['title', 'note']
this.$body = $('body')
thi... |
'use strict';
var app = angular.module('shiftContentApp');
/**
* Content type routes
* Defines routing under content type editor namespace that includes managing
* types, editing types, managing fields and their attributes.
*/
app.config(function ($routeProvider, viewsBase) {
var router = $routeProvider;
var ... |
import deepFreeze from 'deep-freeze';
import { websocketConnected, websocketDisconnected } from '../ui-common/App/connectedActions';
import appReducer from './appReducer';
it('na začátku', () => {
const stateBefore = undefined;
const stateAfter = appReducer(stateBefore, {});
expect(stateAfter).toMatchSnapshot()... |
/*
* React.js Starter Kit
* Copyright (c) Konstantin Tarkus (@koistya), KriaSoft LLC
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import cp from 'child_process';
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.