code stringlengths 2 1.05M |
|---|
const riot = require('gulp-riot');
const gulp = require('gulp');
const concat = require("gulp-concat");
const less = require('gulp-less');
const sourcemaps = require("gulp-sourcemaps");
const through = require('through2');
const uglify = require('gulp-uglify');
const util = require('gulp-util');
const babel = require('... |
(function() {
'use strict';
angular
.module('vmsFrontend')
.filter('customFieldDataToText', customFieldDataToText);
/** @ngInject */
function customFieldDataToText($filter, $log) {
var filter = function(input, type, metadata) {
var transformedInput;
switch (type) {
case 'RADIO... |
function ImapUserProfileTranslator() {
}
ImapUserProfileTranslator.prototype.getMatchPatterns = function() {
return [ '^acct:((imap)|(gmail)):.+', '/user/.+' ];
}
ImapUserProfileTranslator.prototype.translate = function( uri, owner, rawDoc, callback ) {
try {
// Translated to fields more or less compliant with the ... |
$(function() {
initNav();
comments();
});
function initNav() {
var triggers = $('.trigger-subnav');
var chevron = $('.chevron');
var greenbar = $('#greenbar');
window.navOpen = false;
$('body').addClass('navClosed');
$('.subnav-item').attr('tabindex', -1);
triggers.click(function(e) {
var target ... |
'use strict';
const { Thing } = require('abstract-things');
const { PowerPlug, PowerOutlet } = require('abstract-things/electrical');
const MiioApi = require('../device');
const Power = require('./capabilities/power');
module.exports = class extends Thing
.with(PowerPlug, PowerOutlet, MiioApi, Power)
{
static get t... |
'use strict';
var _ = require("underscore");
var pReg = "\\((.*?)\\)";
var bReg = "\\[(.*?)\\]";
var s = "\\s*";
var feReg = "\\..*$";
var fullRegs = [];
//e.g [真珠貝] マナタマプラス .zip
fullRegs[0] = new RegExp( bReg + s + "(.*?)" + s + feReg);
//e.g [真珠貝] マナタマプラス (ラブプラス).zip
fullRegs[1] = new RegExp( bReg + s + "(.*?... |
import {Observable} from '@reactivex/rxjs'
import counterStore from './counterStore'
import routerStore from './routerStore'
// You can enter more stores here
export default Observable.combineLatest(counterStore,
routerStore,
(counterStor... |
import { setAnalyticsUser } from 'utils/analytics'
// ======================================================
// Default Redux + Firebase Config used for all environments
// (for react-redux-firebase & redux-firestore)
// Note: Differs from src/config.js which is environment specific config
// ==========================... |
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm4.29 12.89c.39.39.39 1.02 0 1.41-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0a.9959.9959 0 0 1 0-1.41L10.59 1... |
'use strict';
//Survs service used to communicate Survs REST endpoints
angular.module('survs').factory('Survs', ['$resource',
function($resource) {
return $resource('survs/:survId', { survId: '@_id'
}, {
update: {
method: 'PUT'
}
});
}
]); |
/**
* @license Copyright (c) 2012, Viet Trinh All Rights Reserved.
* Available via MIT license.
*/
/**
* All application tests.
*/
define([ 'test/framework/application/application_test',
'./test_express_server_application',
'qunit',
'underscore',
'./auto_register_pages_context_convention_test',
'./... |
/** @module smoke
* @memberof testcases
* @description TEST: basic tests around the pipeline. This includes creating and running a pipeline job, validating
* the activity view for empty and populated state. Further we validate the detail page with very basic matchers.
* We then try to press the "run" button on the ... |
module.exports = {
'"unhandledRejection" event should be emitted if there is no onRejected callback' : function(test) {
var defer = Vow.defer(),
promise = defer.promise(),
listener = function(reason, promise) {
test.strictEqual(reason, 'err');
test.ok(... |
SearchSource.defineSource('groups', function(searchText, options) {
var options = {sort: {isoScore: -1}, limit: 20};
if(searchText) {
var regExp = buildRegExp(searchText);
var selector = {groupname: regExp};
var search = Groups.find(selector, options).fetch();
return search;
... |
import React from 'react';
import PropTypes from 'prop-types';
import Pulsar from './pulsar';
import { div } from 'glamorous';
const StyledDiv = div({ padding: 20 });
const SandBox = () => {
return (
<StyledDiv className="sand-box">
<Pulsar />
</StyledDiv>
);
};
SandBox.propTypes = {};
export defa... |
angular.module('ntt.TreeDnD')
.directive(
'treeDndNodes', ['$parse',function ($parse) {
return {
restrict: 'A',
replace: true,
link: function (scope, element, attrs) {
scope.$nodes_class = '';
scope.$type = 'TreeDnDNodes';
... |
(function (context) {
"use strict";
var TheGraph = context.TheGraph;
TheGraph.config.graph = {
container: {},
groupsGroup: {
className: "groups"
},
edgesGroup: {
className: "edges"
},
iipsGroup: {
className: "iips"
},
nodesGroup: {
className: "nodes"
}... |
import request from '../lib/request';
/**
* Sends a request to GitHub to create a label
*
* @name createLabel
* @function
* @param {Object} server the server configuration object
* @param {String} server.api the api endpoint to connect to
* @param {String} server.token the api token to use
* @param {String} s... |
angular.module('rxDataTable')
/**
*
* @ngdoc directive
* @name rxDataTable.paginate:rxPaginate
* @restrict E
* @description
* Directive that takes in the page tracking object and outputs a page
* switching controller
*
* @param {Object} page-tracking This is the page tracking service instance to
* be used for... |
/*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy ... |
(function() {
"use strict";
Neo.Classes.Image = Neo.Classes.UIComponent.extend({
EMPTY_IMAGE: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC\
1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=",
init: function(config) {
this.img = null;
this._src = Neo.ifNull(config.src, thi... |
import React, { Component, PropTypes } from 'react';
import { vec2 as Vec2 } from 'gl-matrix';
import NumberInput from './numberInput';
export default class VectorInput extends Component {
handleChange(pos, e) {
let vec = Vec2.create();
if (this.props.value) Vec2.copy(vec, this.props.value);
vec[pos] = ... |
$(document).ready(function(){
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$('.thank').magnificPopup({
type: 'inline',
removalDelay: 500,
callbacks: {
beforeOpen: function() {
this... |
$(document).ready(function() {
initialize();
});
var innerInitialize = function() {
// Create the canvas and context
initCanvas($(window).width(), $(window).height());
// initialize the camera
camera = new Camera();
// create the editor object and all its business
app = new Editor();
in... |
/*
======================================================================
skypos.js
Ernie Wright 2 June 2013
====================================================================== */
function skypos_transform( pos, now, w, h )
{
var coord = [ pos.ra, pos.dec ];
Astro.precess( Astro.JD_J2000, now.jd, coord );
... |
//! moment.js locale configuration
//! locale : French (Canada) [fr-ca]
//! author : Jonathan Abourbih : https://github.com/jonbca
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define ==... |
import React from 'react';
import { mount } from 'enzyme';
import Wave from '../wave';
import ConfigProvider from '../../config-provider';
import mountTest from '../../../tests/shared/mountTest';
import { sleep } from '../../../tests/utils';
describe('Wave component', () => {
mountTest(Wave);
afterEach(() => {
... |
const tape = require('tape')
const pull = require('pull-stream')
const Muxrpc = require('../')
const manifest = { hello: 'sync' }
const api = {
hello (n) {
if (this._emit) this._emit('hello', n)
if (process.env.TEST_VERBOSE) console.log('hello from ' + this.id)
return n + ':' + this.id
}
}
tape('give ... |
/**
example :
in parent controller:
$scope.page = {
"pageNumber" : 1,
"pageSize" : 10
};
Ajax response
$scope.conditionSearch = function(){
resource.get(params,function(data){
if(data.returnCode === '0'){
... |
import ReactDOM from 'react-dom';
import {createStore} from 'redux';
import React, { Component, PropTypes } from 'react';
class CSVTable extends Component {
constructor() {
super();
}
render() {
let data = this.props.data.data;
let keys=d3.keys(data[0]);
return (
<table>
<thead... |
angular.module('waterfall', ['ngSanitize'])
.factory('waterfall', function(){
'use strict';
// find the distances of all upstream path
function upstream(node){
if(node.upstream)
return node.upstream;
// if this is a head node
if(node.previous.length === 0)
return node.upstream = [0];
node.upstream ... |
'use strict';
/**
* Module dependencies.
*/
var express = require('express'),
morgan = require('morgan'),
bodyParser = require('body-parser'),
session = require('express-session'),
compress = require('compression'),
methodOverride = require('method-override'),
cookieParser = require('cookie-parser'),
helmet =... |
var util = (function() {
var u = {};
u.random = function(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
u.locate = function(id) {
var element = document.getElementById(id);
return {left : parseInt(element.style.left.replace('px', '')),
bottom : parseInt(element.styl... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.8/esri/copyright.txt for details.
//>>built
define({basic:"\u05e6\u05d5\u05e8\u05d5\u05ea \u05d1\u05e1\u05d9\u05e1\u05d9\u05d5\u05ea",preview:"\u05ea\u05e6\u05d5\u05d2\u05d4 \u05de\u05e7\u05d3\u05d9\u05de\u05... |
/*
Title: BrianCh.uk Home Screen Javascript ThreeJS Animation v1
Author: Brian Chuk (brianch.uk)
Copyright: 2015, Brian Chuk - All rights reserved (you have permission to use it, just tell me :D)
I would use some of my other animations for the background, but I've found that it was too distracting haha.
Test use... |
import factory from '../octicon.js';
// This is an auto-generated ES2015 icon from the modularize script. Please do not modify this file.
var screenFull = factory('screen-full', 14, 16, {"fill-rule":"evenodd","d":"M13 10h1v3c0 .547-.453 1-1 1h-3v-1h3v-3zM1 10H0v3c0 .547.453 1 1 1h3v-1H1v-3zm0-7h3V2H1c-.547 0-1 .453-1 ... |
const merge = require('webpack-merge');
const { resolve } = require('path');
const nodeExternals = require('webpack-node-externals');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
con... |
App.Utils = {
BorderRadius: function() {
// adds a border-radius to the browsers without its support
if(!Modernizr.borderradius){
loadScript('/js/jquery.corner.js', function(){
$('[data-border-radius]').each(function(){
$(this).corner('round ' + $(this).data('border-radius'));
});
});
... |
(function (svgext) {
'use strict';
/**
* Defines rectangle constructor options
*
* @typedef {Object} rectOpts
* @prop {Number} x
* @prop {Number} y
* @prop {Number} width
* @prop {Number} height
* @prop {Boolean} [isDraggable=true]
*/
/**
* Defines coordin... |
(function() {
var socket = io.connect(window.location.hostname + ":" + window.location.port + '/tweets');
socket.on('tweet', function(data){
if (!data.retweeted_status) {
var template = $("#tweet-template").clone().removeAttr("id").removeClass("hidden");
template.find(".username... |
/**
* Created by Stone on 2016/4/18.
*/
"use strict";
var q = require('q'),
moment = require('moment'),
ArticleDal = require('../dal/article'),
CommentDal = require('../dal/comment');
var ArticleBLL = new Object();
//增
ArticleBLL.addArticle = function (info) {
var defer = q.defer();
info.status =... |
function findMaxSequence(arr) {
var result = [];
var isFound = false;
// Split all sequences
var currLength = 1;
var sequence = [];
for (var i = 0; i < arr.length; i++) {
if(arr[i + 1] > arr[i]) {
currLength++;
sequence.push(arr[i]);
isFound = true;
... |
module.exports = {
entry: './src/client.js',
output: {
path: './public',
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
resolve: {
extensions: ['', '.js', '.json']
}
}; |
const FormatTask = {
CRISPR: {
BAGEL: (task) => {
return new Promise((resolve) => {
const headers = task.status.details.design.map((sampleSet) => {
return sampleSet.name;
});
const range = {
max: 0,
min: 0,
};
const results = task.results... |
import axios from "axios";
import firebase from "firebase/app";
import "firebase/auth";
import "firebase/database";
import firebaseui from "firebaseui";
import _ from "lodash";
import dateFnsIsAfter from "date-fns/is_after";
import dateFnsFormat from "date-fns/format";
// FIREBASE CONFIG
const config = {
apiKey: "AI... |
/* options:
data-editable: enable element to be editable
html support html edit
*/
!function ($) {
var _input = null;
var _target = null;
var _preContent = null;
var preventPopup = false;
// Update element content
function updateElement() {
// Update content
if(_input != null && _target != nul... |
import Responder from './responder'
import DeleteQueue from './deleteQueue'
export default class OptionSelector {
constructor (msg, options) {
this.bot = msg._client
this.channel = msg.channel
this.options = options
this.msg = msg
}
async queryUser (optionsMsg, canSelectAll = false, canCancel = ... |
API_KEY=12345678-abcd-1234-abcd-1234567890ab ./3-match-data.js
*** Match id 2179301104 featured
team 1: ll WaterBoy ll, Too G Double O D, Aschen92, Greenen72, Owlzio the Old
versus
team 2: hatemylyfe, Arinya, ACellularPickle, Ridgebackz, typervader2
|
import test from 'tape';
import { convertArcToEndPoint, getSegmentAnchors, getPolygonAnchors,
} from '../anchors';
import { complexPath, hardEdgePath, pathWithArc, pointsList } from './fixtures';
test('anchors.convertArcToEndPoint', (t) => {
t.deepEqual(
convertArcToEndPoint(['A', 45, 45, 0, 0, 1, 125, 275]),
... |
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var streamify = require('gulp-streamify');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
gulp.task('default', function() {
browserify('./src/transform.js', {
standalone: 'Katakana'
})
.bundle()
.pipe... |
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'bidi', 'hr', {
ltr: 'Smjer teksta s lijeva na desno',
rtl: 'Smjer teksta s desna na lijevo'
} );
|
/**
* Copyright (c) 2014,Egret-Labs.org
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this li... |
import MediumEditor from 'medium-editor';
import AutoList from './autolist';
export class FullEditorCtrl {
constructor($timeout) {
this.$timeout = $timeout;
}
$onInit() {
let editorOptions = {
buttonLabels: 'fontawesome',
targetBlank: true,
placeholder: {... |
'use strict';
import ObjectUtil from '../../../src/util/ObjectUtil';
describe('ObjectUtil', () => {
const object = {
very: {
deep: {
test: 5
}
},
highLevel: 775,
test: [1, 2, 3]
};
describe('find', () => {
it('returns the object if found', () => {
expect(ObjectUt... |
import AppDispatcher from '../dispatcher/AppDispatcher';
const HistoryActions = {
add: function(visit) {
AppDispatcher.dispatch({
actionType: 'add-to-history',
visit: visit
});
}
};
export default HistoryActions;
|
/*global angular */
(function () {
"use strict";
// ANGULAR MODULE/APP (store-products):
var app = angular.module("store-products", [])
.directive("productTitle", function () {
return {
restrict: "A",
templateUrl: "partials/product-title.html"
};
})
.directive("productGallery", function () {... |
function BoundingBox(poly) {
var maxX = -99999;
var maxY = -99999;
var minX = 99999;
var minY = 99999;
for (var i = 0; i < poly.points.length; i++) {
var pos = poly.position;
var point = pos.add(poly.points[i]);
maxX = Math.max(maxX, point.x);
maxY = Math.max(maxY, point.y);
minX = Math... |
app.controller('MainController', ['$scope', 'forecastLviv', function($scope, forecastLviv) {
forecastLviv.success(function(data) {
$scope.responceforecastLviv = data;
});
}]);
|
pmb_im.services.factory('ContactService', ['$http', 'ConfigService', function($http, ConfigService) {
var baseURL = ConfigService.baseURL + "/datauy/contact/";
return {
send_contact: function (name, email, subject, message) {
return $http.get(baseURL + name + "/" + email + "/" + subject + "/" + message,... |
/**
* Copyright 2016-present Tuan Le.
*
* Licensed under the MIT License.
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://opensource.org/licenses/mit-license.html
*
* Unless required by applicable law or agreed to in writing, software
* d... |
'use strict;'
var fs = require('fs'),
path = require('path'),
async = require('async'),
exec = require('child_process').exec,
_ = require('lodash');
var serverIp = require('ip').address();
var config = require('../../config/config'),
rest = require('../others/restware');
var mongoose = require('mongoose'... |
'use strict';
// see https://raw.githubusercontent.com/mysqljs/mysql/master/tool/free-port.js
const Net = require('net');
const PORT_END = 60000;
const PORT_START = 1000;
const TCP_TIMEOUT = 1000;
process.nextTick(run);
function check(port, callback) {
const socket = Net.createConnection(port, 'localhost');
... |
var FolderSubscriptions = Class.create(SubscriptionContainer, {
initialize: function($super, api, stream) {
$super(api)
this.subscriptionOrderingStream = stream
}
}) |
// ==UserScript==
// @name Geocache Circles
// @namespace inge.org.uk/userscripts
// @description Allows you to display a 0.1 mile radius circle around a cache on the Geocaching.com map page
// @match https://www.geocaching.com/map*
// @author JRI
// @oujs:author JRI
// @license MIT; http://www.... |
(function(){
angular.module('app').controller('AboutController', AboutController);
function AboutController($scope, $http){
var usernames = ['robinvanderknaap','remjer','ericsmal'];
$scope.teamMembers = [];
angular.forEach(usernames, function(username){
$http.get('https://api.github.com/users/' + u... |
(function() {
'use strict';
angular.module('app.shared', ['app.core']);
})();
|
//@flow
import * as React from "react";
import type { ViewTicketProps } from 'components/viewTicket';
import { AsideItem } from 'components/pageLayout';
export function TicketStoryPoints(props : ViewTicketProps) {
return (
<AsideItem>
<h2>Story point estimate</h2>
{getStoryPointMess... |
// pageConsole.init();
// console.log('string: test string');
// console.log(1234567890);
//
// var arr = [1, 2, 3];
// console.log(arr);
//
// var obj = {
// foo: 'bar'
// };
// console.log(obj);
|
TS.Text = function()
{
this.initialize.apply(this, arguments);
};
TS.Text.measure = function(text, font, ctx)
{
var w;
ctx.save();
ctx.font = font;
w = ctx.measureText(text).width;
ctx.restore();
return w;
};
TS.Text.prototype =
{
x: 0,
y: 0,
da: 0.2,
text: null,
color: null,
font: null,
a... |
import { combineReducers } from 'redux';
import * as actionTypes from '../constants/actionTypes';
const entities = (state = [], action) => {
switch (action.type) {
case actionTypes.REPOSITORIES_FETCH_SUCCESS:
return action.repositories;
default:
return state;
}
};
const isFetching = (state = ... |
import { actionTypes } from '../action-types';
export const photoTilesReducer = (state = { photoTiles: [] }, action) => {
switch (action.type) {
case actionTypes.REFRESH_PHOTO_TILES_REQUEST:
return state;
case actionTypes.REFRESH_PHOTO_TILES:
return Object.assign({}, state, ... |
export { default } from 'flood-dropdown/components/flood-dropdown-content/component'; |
const { expect } = require('chai');
const nock = require('nock');
const { ArgumentError } = require('rest-facade');
const Auth0RestClient = require('../src/Auth0RestClient');
const API_URL = 'https://tenant.auth0.com';
describe('Auth0RestClient', () => {
before(function () {
this.providerMock = {
getAcce... |
Package.describe({
name: 'vishnucss:alert',
version: '1.1.1',
summary: 'Alert toolkit with modern css.',
git: 'https://github.com/vishnucss/vishnu.git',
documentation: 'README.md'
})
Package.onUse((api) => {
api.versionsFrom('METEOR@1.0')
api.addFiles([
'dist/vishnu.alert.css'
], 'client')
})
|
import Ember from 'ember';
import FreestyleController from 'ember-freestyle/controllers/freestyle';
import moment from 'moment';
import { task } from 'ember-concurrency';
const { inject } = Ember;
export default FreestyleController.extend({
emberFreestyle: inject.service(),
date: moment("2016-10-30T10:30"),
in... |
import { createImageFromBitmapData } from '@koreez/phaser-particle-editor-plugin'
export const setBodyColor = (color) => {
document.body.style.backgroundColor = color
}
export const loadFile = (file, onload) => {
console.log(file)
const fileExtension = file.name.split('.').pop()
// eslint-disable-next-line no... |
{
if (ttl === 0) {
return {
done: true,
value: null
};
} else {
return {
done: false,
value: ttl--
};
}
}
|
(function() {
'use strict';
angular
.module('movieApp')
.run(runBlock);
/** @ngInject */
function runBlock($rootScope, NProgress) {
$rootScope.$on('$stateChangeStart', function(event, toState) {
if (toState.resolve) {
NProgress.start();
}
});
$rootScope.$on('$stateCha... |
/**
* vue vuex 练习
*/
'use strict';
// new Vue({
// // state
// data() {
// return {
// count: 0
// };
// },
// // view
// template: `
// <div>{{ count }}</div>
// `,
// // actions
// methods: {
// increment() {
// this.count++;
// }
// }
// });
// import { SOME_MUTATION } from './vue-mutati... |
import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as roundActions from '../actions/roundActions';
const RoundControl = (props) => {
const {actions} = props;
const next = () => {
const pos = props.round.currentPosition;
... |
// Category
// - Tree
// - Tier
// - Directive
// Query to get the category/tree/tier structure
// There's a lot of directives so leave them out for now and look them up on demand
// Also only look up player progress as needed
'use strict';
// Dependencies
var queryURL = require('../../../Common/src/API/Query.js'... |
var yeoman = require('yeoman-generator');
var fs = require('fs');
module.exports = yeoman.generators.Base.extend({
initializingStep: function() {
this.questions = [];
this.controllerName = 'Users';
this.controllerVersion = 'v1';
this.controllerFolderPath = 'users';
this.controllerRoute = '/users/... |
const container = require('markdown-it-container')
const anchor = require('markdown-it-anchor')
const uslug = require('uslug')
const createContainer = (name, defaultTitle = '') => {
return [
container,
name,
{
render(tokens, idx) {
const token = tokens[idx]
const info = token.info
... |
import config from '../config'
const selectElm = document.querySelector('#projectSelect')
const showMessage = (message, msec = 1500) => {
const messageElm = document.querySelector('#message')
messageElm.textContent = message
window.setTimeout(() => { messageElm.textContent = '' }, msec)
}
chrome.runtime.sendMes... |
function Game(canvas) {
this.context = canvas.getContext('2d');
this.width = canvas.width;
this.height = canvas.height;
this.entities = []; // ball, player, bot, background etc.
this.keyPressed = {};
}
Game.keys = {
32: 'space',
37: 'left',
38: 'up',
39: 'right',
40: 'down'
};
Game.prototype.star... |
const path = require('path');
const express = require('express');
const app = express();
// If an incoming request uses
// a protocol other than HTTPS,
// redirect that request to the
// same url but with HTTPS
const forceSSL = function() {
return function (req, res, next) {
if (req.headers['x-forwarded-proto'] ... |
/**
* Creates a new Scene
*
* @class Scene
* @extends EventTarget
* @param {HTMLElement} wrapper
* @description todoc
* @property {HTMLElement} wrapper
* @property {Screen} screen
* @property {Cursor} cursor
* @property {PublicStorage} settings
* @property {Loader} loader
* @property {Queue} queue
**/
funct... |
var config = require('./config.js').config;
console.log("Config:");
console.log(config);
if (process.argv.length < 4) {
console.log("Expected two params: <bot-name> <room-name,...>")
return;
}
var rooms = process.argv[3].split(',');
var botname = process.argv[2];
console.log("Bot: ", botname);
console.log(... |
// @flow
import React from 'react'
import Node from './Node'
// import type { NodeType } from './Node'
import styles from './Tree.css'
type NodeType = {
name: string,
toggled?: boolean,
active?: boolean,
children?: Array<NodeType>
}
type Props = {
data: NodeType | Array<NodeType>,
onToggle: (node: NodeType... |
'use strict';
module.exports = {
appId: 'wx5cd8798b972e7a98',
appSecret: '095e15df8bb7a673792baad7d6d485c8',
account: 'nainiubang@126.com',
url: 'http://112.124.117.116/nnb/#!/wechat',
host: 'http://112.124.117.116/nnb'
}; |
(function() {
var template = $('.modal-template').html();
Mustache.parse(template);
Chalk.modal = function(url, options, cb) {
cb = cb || function() {};
var modal = $($.parseHTML(Mustache.render(template).trim())[0]);
var inner = $(modal).find('.modal-inner');
var content = $(modal).find('.modal-content... |
exports = module.exports = Factory;
function Factory(opts, defaults) {
this.container = defaults || {};
for(var key in opts) {
if(opts.hasOwnProperty(key)) {
this.settings[key] = opts[key];
}
}
}
Factory.prototype.checkContainer = function() {
if(!this.container) {
... |
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M15 9h-1c-.55 0-1-.45-1-1V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8h-5c-.55 0-1-.45-1-1V9zm2 8H7c-.41 0-.65-.47-.4-.8l2-2.67c.2-.27.6-.27.8 0L11.25 16l2.6-3.47c.2-... |
import * as t from "comal-types";
export { default as Identifier } from "./inferer-reference";
export function VariableDeclarator() {
let id = this.get("id");
if (id.isIdentifier()) {
return this.get("init").getTypeAnnotation();
} else {
return;
}
}
export function TypeCastExpression(node) {
retur... |
define(['handlebars'], function(hbs) {
var translation = {
en : {
translation :{
"login" :{
"headertitle" : "Login",
"login_btn" : "Login",
"username" : "Username",
"password" : "Password"
... |
// @flow
/**
* Checks if `value` is the language type of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* **Note:** See the [ES5 spec](https://es5.github.io/#x8) for more details.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
... |
import React, { Component } from 'react';
import '!style!css!./Loader.css';
class Loader extends Component {
render() {
return (
<div className="loader">Loading...</div>
);
}
}
export default Loader; |
console.log('Problem1');
var sampleString,
reversedString,
i;
sampleString = 'sample string to reverse';
function reverseString(string) {
reversedString = '';
for (i = string.length - 1; i >= 0; i-=1) {
reversedString += string[i];
}
return reversedString;
}
console.log('String is '... |
function miniModalClose(){var i=$(".minimodal-holder"),o=$(".minimodal-close");$(".minimodal-content").click(function(o){o.target==this&&i.removeClass("is-active")}),o.click(function(){i.removeClass("is-active")}),$(document).keyup(function(o){27==o.keyCode&&i.removeClass("is-active")})}function miniModal(){{var i=$("*... |
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest'
},
testRegex: 'test',
moduleFileExtensions: ['ts', 'js'],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.