code stringlengths 2 1.05M |
|---|
const chai = require('chai');
const MemoryCache = require('..');
const observable = require('../lib/observable');
const constants = require('../lib/constants');
const { expect, assert } = chai;
const testObj = () => ({
a: { b: 'c' },
deep: { nested: { obj: { is: { set: 'yes' }}}},
arr: [1,2,3,4,5]
});
c... |
var URL = require('url');
var Pagination = function(request, model){
this.request = request;
this.model = model;
this.paginate = function(query, limit, sort, selected, onDataReception){
var url = URL.parse(this.request.url).pathname;
var page = this.request.param('page');
page = page === undefined ? 0 : pag... |
define(
[
'solarfield/lightship-js/src/Solarfield/Lightship/Environment',
'solarfield/ok-kit-js/src/Solarfield/Ok/ObjectUtils'
],
function (LightshipEnvironment, ObjectUtils) {
"use strict";
var Environment = ObjectUtils.extend(LightshipEnvironment, {
});
return Environment;
}
);
|
'use strict';
exports.BattleScripts = {
inherit: 'gen5',
gen: 4,
init: function () {
for (let i in this.data.Pokedex) {
delete this.data.Pokedex[i].abilities['H'];
}
},
modifyDamage: function (baseDamage, pokemon, target, move, suppressMessages) {
// DPP divides modifiers into several mathematically imp... |
$(function(){
var InvitationForm = Backbone.View.extend({
el: $('fieldset[data-control=invitation]'),
events: {
},
initialize: function(){
if(!this.$el.length) return null;
this.listenTo(Backbone, 'showInvitationForm', this.showInvitationForm);
this.listenTo(Backbone, 'hideInvit... |
import React, { PropTypes } from 'react';
class AutoFocus extends React.Component {
constructor( props ) {
super( props );
this.receiveRef = this.receiveRef.bind( this );
}
componentDidMount() {
if ( this.ref ) {
this.ref.focus();
}
}
receiveRef( node ) {
this.ref = node;
}
... |
var DObject_8h =
[
[ "DObject", "classHelix_1_1Logic_1_1dev_1_1DObject.html", "classHelix_1_1Logic_1_1dev_1_1DObject" ],
[ "DObject_svect", "DObject_8h.html#a56460b28b8ab9b64a1aecf912b2f14ac", null ]
]; |
/*
* Sidebar toggle function
*/
(function(document) {
var toggle = document.querySelector('.sidebar-toggle');
var sidebar = document.querySelector('#sidebar');
var checkbox = document.querySelector('#sidebar-checkbox');
document.addEventListener('click', function(e) {
var target = e.target;
if(!ch... |
import React from 'react';
import PropTypes from 'prop-types';
import { reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import compose from 'recompose/compose';
import getDefaultValues from './getDefaultValues';
import FormField from './FormField';
import Toolbar from './Toolbar';
const noop = ()... |
export function allDaysDisabledBefore (day, unit, { minDate, includeDates } = {}) {
const dateBefore = day.clone().subtract(1, unit)
return (minDate && dateBefore.isBefore(minDate, unit)) ||
(includeDates && includeDates.every(includeDate => dateBefore.isBefore(includeDate, unit))) ||
false
}
|
var util = require('util');
var fs = require('fs');
var path = require('path');
var ltrim = require('underscore.string/ltrim');
exports.isCommand = function (input) {
if (input.toLowerCase().substr(0, prefix.length) === prefix)
return true;
else
return false;
};
exports.isNumber = function (n) {
return ... |
//window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-... |
function main() {
var N = 10000;
var lines = generateLines(N);
//timeCanvas2D(lines, N);
timeBatchDraw(lines, N);
}
function generateLines(N) {
var lines = new Array(N);
let canvas = document.getElementById("canvas");
let w = canvas.width;
let h = canvas.height;
// Create funky ... |
marriageMapApp.factory('MapService', ['UtilArrayService', function(UtilArrayService) {
var mapLoading = true;
var observerPOIShowCallback = null;
var map = {
center: { latitude: null, longitude: null },
zoom: null
};
var poisDay = [
{
id : 10,
coords : {
latitude : 48.8143725,
longitude... |
xdescribe('uiMask', function () {
var inputHtml = "<input ui-mask=\"'(9)9'\" ng-model='x'>";
var $compile, $rootScope, element;
beforeEach(module('ui.directives'));
beforeEach(inject(function (_$rootScope_, _$compile_) {
$rootScope = _$rootScope_;
$compile = _$compile_;
}));
describe('ui changes o... |
$(document).ready(function() {
///*определение ширины скролбара
// создадим элемент с прокруткой
var div = document.createElement('div');
div.style.overflowY = 'scroll';
div.style.width = '50px';
div.style.height = '50px';
div.style.position = 'absolute';
div.style.zIndex = '-1';
// при... |
<script type="text/javascript">
//set the interval temporary variable
var setIntrVal = null;
var intrVal = 3000;
//lets get the slider elements
var slides = document.getElementById('slides'); //get the <ul id="slides">
var slide = document.getElementsByClassName('slide'); //get the <li class="s... |
/**
* Created by Cai Kang Jie on 2017/7/31.
*/
import lazyLoading from './../../store/modules/routeConfig/lazyLoading'
export default {
name: 'UI Features',
expanded: false,
sidebarMeta: {
title: 'UI Features',
icon: 'ion-android-laptop',
order: 1
},
subMenu: [{
name: 'Panels',
path: '/u... |
'use strict';
function Memoized() {}
const memoize = (
// Create memoized function
fn // function, sync or async
// Returns: function, memoized
) => {
const cache = new Map();
const memoized = function(...args) {
const callback = args.pop();
const key = args[0];
const record = cache.get(key);
... |
$(document).ready(function() {
$(".container").hide();
$(".container").fadeIn('5000');
$(".showcase-wrapper").hide();
$(".showcase-wrapper").fadeIn("slow");
});
/*
var toggle = false;
$('.nav-toggle').on('click', function () {
if (toggle == false) {
$('#sidebar-wrapper').stop().animate({
... |
var jwt = require('jsonwebtoken');
/**
* Middleware
*/
module.exports = function(scullog){
return {
realIp: function* (next) {
this.req.ip = this.headers['x-forwarded-for'] || this.ip;
yield* next;
},
handelError: function* (next) {
try {
yield* next;
} catch (err) {... |
var Thermostat = function() {
this.temp = 20;
this.mode = 'power saving';
this.min = 10;
this.max = 25;
};
Thermostat.prototype.setPowerSaving = function(value) {
this.mode = (value ? 'power saving' : 'normal');
this.max = (value ? 25 : 32);
};
Thermostat.prototype.increase = function() {
if(this.temp <... |
/* @flow */
import React from "react";
import PropTypes from "prop-types";
import {
Text,
TouchableOpacity,
Platform,
StyleSheet,
ScrollView,
PixelRatio,
View
} from "react-native";
import Modal from "react-native-modalbox";
type Props = {
styleContainer?: Object,
coverScreen?: boolean,
backButto... |
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the ri... |
var ParseIndex = require("../../index");
module.exports = function addRole(params) {
Parse.Cloud.define("addRole", (req, res) => {
if (req.params.masterKey === ParseIndex.config.masterKey) {
var roleName = req.params.roleName;
if (roleName.length > 2) {
var roleACL = new Parse.ACL();
... |
/* global describe, it, require */
'use strict';
// MODULES //
var // Expectation library:
chai = require( 'chai' ),
// Check whether an element is a finite number
isFiniteNumber = require( 'validate.io-finite' ),
// Module to be tested:
quantile = require( './../lib/array.js' );
// VARIABLES //
var expect ... |
// JS specifically for the toolkit documentation
(function( $, window, document ) {
// Masthead
// -----------------------------------
var $window = $(window),
winTop = $window.scrollTop(),
$masthead = $('.masthead'),
$mastheadTitle = $masthead.find('.page-title'),
$pageTitle = $('.jumbotron h1'),
thresho... |
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'pagebreak', 'km', {
alt: 'បំបែកទំព័រ',
toolbar: 'បន្ថែមការបំបែកទំព័រមុនបោះពុម្ព'
} );
|
// Copyright 2016 Hewlett-Packard Development Company, L.P.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy,... |
/*:
* @plugindesc Basic plugin for manipulating important parameters.
* @author RM CoreScript team
*
* @help
* Basic plugin for manipulating important parameters.
* There is no plugin command.
*
* Caching images improves performance but increases memory allocation.
* On mobile devices, a lot of memory allocati... |
pinion.on("create.message.systemMessagesList", function(data) {
data.element.settings.data = pinion.messages.reverse();
});
pinion.backend.renderer.SystemMessageRenderer = (function($) {
var constr,
modules = pinion.php.modules;
// public API -- constructor
constr = function(settings... |
function solve(args){
var i,
array = [];
for(i = 0; i < args.length; i++){
array[i] = +args[i];
}
var sum = 0,
count = 0,
min = array[0],
max = array[0],
avg = 0;
for(i = 0; i < array.length; i++){
sum += array[i];
count++;
... |
define(["globals",
"ember",
"core_ext",
"ember-i18n",
"ember-bootstrap",
"select2",
"moment",
"mediaelement",
"jquery.highlight-search-results",
"jquery.autogrow-textarea",
"jquery.anchorlinks",
"jquery.hashtags",
"jquery.ex... |
import React from 'react';
import PropTypes from 'prop-types';
import './Todo.css';
const ARCHIVE_SHORTCUT_KEY_CODE = 65; // 'a'
const onArchiveShortcutPress = (handler, event) => {
if(event.keyCode === ARCHIVE_SHORTCUT_KEY_CODE) handler(event);
};
const Todo = ({text, completed, onClick, onDeleteClick}) => (
<... |
// Generated on 2015-05-19 using generator-angular-fullstack 2.0.13
'use strict';
module.exports = function (grunt) {
var localConfig;
try {
localConfig = require('./server/config/local.env');
} catch(e) {
localConfig = {};
}
// Load grunt tasks automatically, when needed
require('jit-grunt')(grun... |
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
ctags: {
files: ['ctags'],
tasks: ['shell:ctags'],
options: {
nospawn: false,
},
}
... |
var TreeNode = require('../dist/treenode').TreeNode;
describe("TreeNode Class", function() {
var tree;
var data = [
{
name: 'I am ROOT',
status: 'initial'
},
{
name: 'Node 1',
status: 'initial'
},
{
name: 'Node ... |
/*
* Copyright (c) 2015-2017 Steven Soloff
*
* This is free software: you can redistribute it and/or modify it under the
* terms of the MIT License (https://opensource.org/licenses/MIT).
* This software comes with ABSOLUTELY NO WARRANTY.
*/
'use strict'
const _ = require('underscore')
const diceExpressionResult... |
// inheritientence!!
function Pet() {
this.animal = "";
this.name="";
this.setAnimal = function(newAnimal){
this.animal = newAnimal;
}
this.setName = function(newName){
this.name = newName;
}
}
var myCat = new Pet();
myCat.setAnimal = "cat";
myCat.setName = "Sylvester";
function Dog(){
this.bre... |
export const u1F443 = {"viewBox":"0 0 2600 2760.837","children":[{"name":"path","attribs":{"d":"M2043 2036q-41 85-119.5 119.5T1784 2190q-25 0-46-3.5t-39-8.5l-35-8q-16-4-30-4-47 0-130.5 53t-204.5 53q-70 0-119-16t-86-37l-64-37q-29-16-63-16-17 0-33 4l-35 8q-17 5-38 8.5t-46 3.5q-58 0-134.5-31.5t-121-118.5-44.5-195q0-66 28-... |
//= require fluent/admin/admin.js |
'use strict'
import ObjectUtils from 'es-common-core/object-utils';
import Asset from 'rpgmv-asset-manager-core/datas/asset';
import AssetFileDeserializer from 'rpgmv-asset-manager-core/datas/asset-file-deserializer';
/**
* Asset Manager MV
* アセットデシリアライザ
*
* @since 2016/01/03
* @author RaTTiE
*/
export default c... |
// Use require('arpjs') if youre running this example elsewhere.
var arp = require('../')
// arp.setInterface('en0');
arp.send({
'op': 'request',
'src_ip': '10.105.50.100',
'dst_ip': '10.105.50.1',
'src_mac': '8f:3f:20:33:54:44',
'dst_mac': 'ff:ff:ff:ff:ff:11'
})
|
class AddAktModalController{
constructor(API, $uibModal, $state,$timeout){
'ngInject';
let vm=this;
vm.API=API;
vm.program=vm.resolve.program;
vm.programs=vm.resolve.programs;
vm.data={
program:vm.program.id,
title:null,
date:new Da... |
// A DOM operation helper. Append an Element to a parent
export default function append(parent, ...children) {
// Always select the first item of a list, similarly to jQuery
if (Array.isArray(parent)) {
parent = parent[0]
}
children.forEach(parent.appendChild, parent)
return parent
}
|
///
// Dependencies
///
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import classNames from 'classnames';
import isString from 'lodash/isString';
import * as types from './types';
import Panel from 'react-bootstrap/lib/Panel';
import Button from 'react-bootstrap/lib/But... |
/* global moment, angular */
function TimePickerCtrl($scope, $mdDialog, time, autoSwitch, ampm, confirmText, cancelText, $mdMedia) {
var self = this;
this.VIEW_HOURS = 1;
this.VIEW_MINUTES = 2;
this.currentView = this.VIEW_HOURS;
this.time = moment(time);
this.autoSwitch = !!autoSwitch;
this.a... |
"use strict";
// Mail Body Parser
var logger = require('./logger');
var Header = require('./mailheader').Header;
var utils = require('./utils');
var events = require('events');
var util = require('util');
var Iconv = require('./mailheader').Iconv;
var attstr = require('./attachment_stream');
var buf_siz = 65536;
... |
import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h("path", {
d: "M19.5 3.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5zM19 19.09H5V4.91h14v1... |
'use strict';
/* App Module */
var granuleApp = angular.module('granuleApp', [ 'ngRoute', 'angularBasicAuth', 'granuleControllers', 'granuleServices']);
granuleApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/login', {
templateUrl: 'partials/login.html',
con... |
import * as lamb from "../..";
import { nonFunctions, wannabeEmptyArrays } from "../../__tests__/commons";
describe("count / countBy", function () {
var getCity = lamb.getKey("city");
var persons = [
{ name: "Jane", surname: "Doe", age: 12, city: "New York" },
{ name: "John", surname: "Doe", a... |
import React from 'react';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
// import RaisedButton from 'material-ui/RaisedButton';
import TextField from 'material-ui/TextField';
export default class NewTaskDialog extends React.Component {
state = {
open: false,
... |
/* eslint key-spacing : 0 */
const EventEmitter = require('events');
class CAS extends EventEmitter {
constructor() {
super();
this.timeout = {
encode_ignition : null,
};
} // constructor()
// [0x130] Ignition status
decode_ignition(data) {
data.command = 'bro';
let new_level_name;
// Save pr... |
/*globals describe, afterEach, beforeEach, it*/
var should = require('should'),
sinon = require('sinon'),
Promise = require('bluebird'),
// Stuff we're testing
db = require('../../server/data/db'),
errors = require('../../server/errors'),
exporter = require('../../server/dat... |
'use strict';
const Sites = require('./reducers/sites-list');
const Site = require('./reducers/site-form');
const User = require('./reducers/user');
const Delete = require('./reducers/delete');
const Count = require('./reducers/count');
const Redux = require('redux');
module.exports = Redux.createStore(
Redux.co... |
/**
* Linked lists utilities
* Algorithm author: Harold Gonzalez
* Twitter: @haroldcng
* Questions: harold.gonzalez.tech@gmail.com
*/
'use strict';
/**
* Definition of Linked List Node Data Structure
*/
module.exports.ListNode = function(v){
this.val = v;
this.next = null;
};
/**
* Prints a linked ... |
/**
* System commands
* Pokemon Showdown - http://pokemonshowdown.com/
*
* These are system commands - commands required for Pokemon Showdown
* to run. A lot of these are sent by the client.
*
* System commands should not be modified, added, or removed. If you'd
* like to modify or add commands, add or edit fil... |
'use strict';
const Support = require('../support');
const DataTypes = require('../../../lib/data-types');
const chai = require('chai');
const sinon = require('sinon');
const expect = chai.expect;
const current = Support.sequelize;
const _ = require('lodash');
describe(Support.getTestDialectTeaser('Model'), () => {
... |
// @flow
import React, { Component } from 'react'
import { View, StatusBar } from 'react-native'
import NavigationRouter from '../Navigation/NavigationRouter'
import { connect } from 'react-redux'
import StartupActions from '../Redux/StartupRedux'
import ReduxPersist from '../Config/ReduxPersist'
// Styles
import sty... |
document.onmousemove = moveDefence;
var width = 1200;
var height = 600;
var ballPerSeconds = 1;
var canvas = document.getElementById('myCanvas');
var ctx = canvas.getContext('2d');
var allBalls = new Array();
var defence = {
start: 0,
end: (Math.PI) / 3,
jiao: 0
};
var HP = 100;
var draw = drawInGame;
var s... |
/********************** tine translations of Setup**********************/
Locale.Gettext.prototype._msgs['./LC_MESSAGES/Setup'] = new Locale.Gettext.PO(({
""
: "Project-Id-Version: Tine 2.0\nPOT-Creation-Date: 2008-05-17 22:12+0100\nPO-Revision-Date: 2012-09-19 08:58+0000\nLast-Translator: corneliusweiss <mail@corneli... |
var socketio = require('socket.io');
exports.listen = function( server, Manager ) {
var io = socketio.listen(server);
Manager.findAllUsers(function ( err, data ) {
if(!err){
if(data.length === 0){
Manager.addUser({'login': 'madzia26', 'password': 'qwertyuiop', 'id': new Date().getTime() }, funct... |
var Document = require('pelias-model').Document;
var docs = {};
docs.named = new Document('item1',1);
docs.named.setName('default','poi1');
docs.unnamed = new Document('item2',2); // no name
docs.unnamedWithAddress = new Document('item3',3);
docs.unnamedWithAddress.setCentroid({lat:3,lon:3});
docs.unnamedWithAddres... |
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
//basePath: '../src/',
// frameworks to use
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'../src/**/*.js... |
/* BBY261 */
/* Sayısal Loto Uygulaması */
//Çekiliş yapılacak sayıların dizisi
var rakamlar = new Array(49);
//Oynanacak kolonun dizisi
var loto = new Array(6);
document.write('<center><img src="sayisalloto.jpg" width=70% ></center>');
//Rakam havuzunun oluşturulması
for(var i=0; i<49; i++){
r... |
angular.module('tabss.controllers', [])
.controller('TabssCtrl', function($scope,$state) {
$scope.gotoTabs =function(){
$state.go('tabs')
}
$scope.gotoNearby =function(){
$state.go('app.nearby')
}
$scope.gotoEditProfile =function(){
$state.go('editprofile')
}
$sc... |
'use strict';
var http = require('http');
var Pusher = require('pusher');
var Network = require('./model/network');
var Node = require('./model/node');
var Sensor = require('./model/sensor');
var Feature = require('./model/feature');
require('./model/relations');
// https://pusher.com/docs/server_api_guide/interact... |
define(['handlebars'], function (Handlebars) {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['ma-ecca-treenode'] = template(function (Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.h... |
import {combineEpics} from 'redux-observable';
import {combineReducers} from 'redux';
import {
disposePastebinEpic,
pastebinLayoutEpic,
pastebinEpic,
pastebinTokenEpic,
pastebinTokenRejectedEpic,
pastebinReducer,
pastebinContentEpic,
pastebinContentRejectedEpic,
} from './pastebin';
imp... |
import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h(h.f, null, h("path", {
d: "M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4... |
export default function isSingleTextTree(treeList) {
return treeList.length === 1 && treeList[0].type === 'text';
} |
const Comparator = require('../../util/comparator');
/**
* Swaps two elements in the array
*/
const swap = (array, x, y) => {
const tmp = array[y];
array[y] = array[x];
array[x] = tmp;
};
/**
* Chooses a pivot and makes every element that is
* lower than the pivot move to its left, and every
* greater elem... |
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
let express = require('express');
let path = require('path');
let favicon = require('serve-favicon');
let logger = require('morgan');
let cookieParser = require('cookie-parser');
let bodyParser = require('body-parser');
let compression = require('compression... |
const landingText = (
``
)
const aboutText = (
`We are a team of expert web developers coming from diverse backgrounds who
are passionate about building a better web experience and delivering quality
code to our clients`
)
|
import React, { PropTypes } from 'react';
export default function ImageDesciption({desc, price}) {
return (
<div className="text">
<h3>{desc}</h3>
<p className="price">{price}</p>
</div>
);
}
|
var gulp = require("gulp");
var $ = require("gulp-load-plugins");
gulp.task("html", function () {
gulp.src("./src/index.html")
.pipe(gulp.dest("./.tmp"));
});
|
const _ = require('lodash');
module.exports = _.extend(
require('./users/users.authentication.server.controller'),
require('./users/users.authorization.server.controller'),
require('./users/users.password.server.controller'),
require('./users/users.profile.server.controller')
);
|
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Review Schema
*/
var ReviewSchema = new Schema({
content: {
type: String,
default: '',
trim: true
},
contentHTML: {
type: String,
default: ''
... |
$(document).ready(function(){
var $nomeInput = $('#nomeInput');
var $descricaoInput = $('#descricaoInput');
var $precoInput = $('#precoInput');
var $categoriaSelect = $('#categoriaSelect');
var $novidadeSelect = $('#novidadeSelect');
var $carregandoImg = $('#carregandoImg');
$carregandoImg.hide();
var... |
// Karma configuration
// Generated on Wed Jul 15 2015 09:44:02 GMT+0200 (Romance Daylight Time)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.or... |
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this n... |
'use strict';
const os = require('os');
const cluster = require('cluster');
const DEFAULT_DEADLINE_MS = 30000;
function makeWorker(workerFunc) {
var server = workerFunc(cluster.worker.id);
server.on('close', function() {
process.exit();
});
process.on('SIGTERM', function() {
server.close();
});
... |
var chai = require('chai')
, expect = chai.expect
, Support = require(__dirname + '/../support')
, dialect = Support.getTestDialect()
, DataTypes = require(__dirname + "/../../lib/data-types")
, _ = require('lodash')
, sequelize = require(__dirname + '/../../lib/sequelize');
chai.config... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from 'react-bootstrap/lib/Button';
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
import { post } from '../../api';
class PostActionButton extends Component {
static propTypes = {
bsStyle: PropTypes.string.isRequ... |
import $ from 'jquery'
const DURATION_MS = 400
export default function scrollToTop () {
const scrollTop = $('.auction-artworks-HeaderDesktop').offset().top - $('.mlh-navbar').height()
$('html,body').animate({ scrollTop }, DURATION_MS)
}
|
version https://git-lfs.github.com/spec/v1
oid sha256:96c89faf399ad903c813617aca830b28b3330c35d8af37d08743722e06d9323d
size 84
|
module.exports = function(grunt) {
grunt.initConfig({
web_server: {
options: {
cors: true,
port: 8000,
nevercache: true,
logRequests: true
},
foo: 'bar'
},
uglify: {
my_target: {
files: {
'dist/ng-video-preview.min.js': ['video-pre... |
var model = require('./model');
var backbone = require('backbone');
var fs = require('fs');
var util = require('util');
var fpath = require('path');
var hive = require('./hive');
var EMPTY_FILE = '';
var exports = module.exports = model.extend({
initialize: function(attributes) {
var _self = this;
var path = thi... |
/**
min任务
-------------
min脚本,样式,图片或html
### 用法
<min src='my.js' dest='my.min.js'/>
<min file='reset.css' destfile='reset.min.css'/>
@class min
**/
module.exports = function(bee) {
bee.register('min', function(options, callback) {
var path = require('path');
var minifier = requ... |
// Generated by CoffeeScript 1.10.0
(function() {
(function($) {
return $(".some_button").on("click", function(event) {
console.log("some_button clicked!");
return event.preventDefault();
});
})(jQuery);
}).call(this);
|
const mongoose = require('mongoose')
const TABLE_NAME = 'Post'
const Schema = mongoose.Schema
const ObjectId = Schema.Types.ObjectId
const escape = (require('../utils')).escape
const PostSchema = new Schema({
//类型
type: {
type: String,
default: 'post' // post | page
},
//标题
title: {
type: String,... |
var test = require("tape")
var mongo = require("continuable-mongo")
var uuid = require("node-uuid")
var setTimeout = require("timers").setTimeout
var eventLog = require("../index")
var client = mongo("mongodb://localhost:27017/colingo-group-tests")
var collectionName = uuid()
var col = client.collection(collectionName... |
version https://git-lfs.github.com/spec/v1
oid sha256:356614d2260c69b92680d59e99601dcd5e068f761756f22fb959b5562b9a7d62
size 17413
|
import * as React from 'react';
import {Row,Col,Table,Code,Items,Item} from 'yrui';
import thead from './thead';
let items=[{
key:'style',
expr:'设置items样式',
type:'object',
values:'-',
default:'-',
}];
let item=[{
key:'border',
expr:'设置border样式',
type:'string',
values:'-',
default:'-',
}];
const c... |
define(function() {
'use strict';
/* @ngInject */
var gameCtrl = function($scope, commoditySrvc, citySrvc, accountSrvc, gameSrvc, tutorialSrvc, $modal) {
//todo: find a better way to expose services to template
this.gameSrvc = gameSrvc;
this.commoditySrvc = commoditySrvc;
this.citySrvc = citySrvc... |
/**
* Module dependencies.
*/
var express = require('express');
var http = require('http');
var path = require('path');
var handlebars = require('express3-handlebars')
var index = require('./routes/index');
// Example route
// var user = require('./routes/user');
// below added by tommy
var login = require('./rou... |
import _jsx from "@babel/runtime/helpers/builtin/jsx";
import React from 'react';
import EditMediaDialog from '../../containers/EditMediaDialog';
import LoginDialog from '../../containers/LoginDialog';
import PreviewMediaDialog from '../../containers/PreviewMediaDialog';
var _ref =
/*#__PURE__*/
_jsx("div", {
classN... |
import {
addClass,
removeClass,
EVENTS,
on,
off,
getViewportSize,
getClosest,
getParents
} from '../../utils/domUtils'
import {nodeListToArray} from '../../utils/arrayUtils'
function ScrollSpy (element, target = 'body', options = {}) {
this.el = element
this.opts = Object.assign({}, ScrollSpy.DEFAU... |
import { red } from "./colors.js";
export default `body { background: url("${
new URL("./file.png" + __resourceQuery, import.meta.url).href
}"); color: ${red}; }`;
|
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
if (message && confirm(message)) {
sc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.