code stringlengths 2 1.05M |
|---|
/*global js_beautify: true */
/*jshint node:true */
var SanityTest = require('./sanitytest'),
Urlencoded = require('../unpackers/urlencode_unpacker'),
js_beautify = require('../beautify').js_beautify,
run_beautifier_tests = require('./beautify-tests').run_beautifier_tests;
function node_beautifier_tests()... |
var jsonfile = require('jsonfile');
var logger = require('../logger.js');
var middleware = require('swagger-express-middleware');
var recursive = require('recursive-readdir');
var DataStoreLoader = {};
module.exports = DataStoreLoader;
DataStoreLoader.load = function(myDB, baseDir) {
// Filter function
... |
const React = require('react')
const ReactDOM = require('react-dom')
const App = require('./App')
ReactDOM.hydrate(React.createElement(App), document.getElementById('root'))
|
const onUpdatedProfileInfoSubscriptionsStub = [
{
type: 'email',
topic: 'News',
isSubscribed: true
},
{
type: 'email',
topic: 'Offers',
isSubscribed: false
},
{
type: 'sms',
isSubscribed: true
}
]
const onUpdatedProfileInfoStub = {
operation: 'UpdateProfile',
data: {
... |
'use strict';
var crayon = require('@ccheever/crayon');
function log() {
var prefix = crayon.gray('[') + crayon.gray('exp') + crayon.gray(']');
var args = [prefix].concat(Array.prototype.slice.call(arguments, 0));
console.error.apply(console, args);
}
log.error = function error() {
var prefix = crayon.red('[... |
var Bob = function() {
var isShouting = function(input) {
return input.toUpperCase() === input && input.toLowerCase() !== input;
};
var isQuestion = function(input) {
return input.charAt(input.length - 1) === '?';
};
var isSilent = function(input) {
return /^\s*$/.test(input);
};
this.hey =... |
'use strict';
define(function () {
return function () {
return {
firebase : {
url : 'https://xxx.firebaseio.com/'
},
/*
* isLast() : gets if an index of an array is on the last index or not
*/
isLast : function (isLast) {
return (isLast);
},
/*
... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express = require("express");
const app = express();
app.use(express.static('../frontend'));
app.listen(3000, function () {
console.log('listening on port 3000');
});
//# sourceMappingURL=index.js.map |
(function() {
'use strict';
/**
* Complex prototype for computation with complex numbers
*/
var Complex = function(real, imag) {
if (!(this instanceof Complex)) {
return new Complex(real, imag);
}
this.real = Number(real) || 0;
this.imag = Number(imag)... |
import React from "react";
import DocSection from "../../docs/DocSection";
import { wrapSection } from "../../../hocs/WrapSection";
const enhancer = wrapSection(
require.context("./examples", false, /.js$/),
require.context("!!raw-loader!./examples", false, /.js$/),
// eslint-disable-next-line import/no-webpack-... |
function makeRequest(page,divid)
{
var http_request = getHttpRequest();
http_request.onreadystatechange = function() { handle_request(http_request,divid); };
http_request.open('GET', page, true);
http_request.send(null);
return false;
}
function handle_request(handle,divid)
{
if (handle.readySta... |
//inicializamos eventos y procesos desde el DOM
$(document).ready(function(){
IniciarEventos();}
);
function IniciarEventos(){
$('#datetimepicker1').datetimepicker({locale:'es',format: "DD/MM/YYYY"});
$('#datetimepicker2').datetimepicker({locale:'es',format: "DD/MM/YYYY"});
fechaactual('fecdesde')
fechaactual('f... |
function OrbitCamera(basecam) {
this._cam = basecam;
this._viewpos = new THREE.Vector3(0.0,0.0,0.0);
this._theta = 0;
this._phi = 0;
this._rate = 0.05;
this._minradius = 0.1;
this._maxradius = 20.0;
this._radius = 5.0;
this._tarphi = 0.0;
this._tartheta = 0.0;
this._reftheta = 0.0;
this._tracked = false;
t... |
import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as userInterfaceActions from '../actions/user_interface_actions';
import Dashboard from './dashboard';
const PortfolioApp = React.createClass({
render() {
return (
<Dashboard
{...t... |
import { TICK, TOGGLE, CLEAR, RANDOM } from '../constants/ActionTypes';
import { makeGrid, makeBlankGrid } from '../lib/grid';
import { nextState, toggle } from '../lib/game';
const GRID_SIZE = 30;
const randomizer = (y, x) => Math.random(x + y) > 0.8;
const DEFAULT_STATE = makeGrid(randomizer, GRID_SIZE);
const clon... |
'use strict';
module.exports.validateEmail = (email) => {
let re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
let valid = re.test(email);
let error = valid ? "" : "invalid e-mail";
return {
valid: valid,
value: email,
error : error
}
/*
NOTE:
The regular expression used here DOES NOT comply to the required sta... |
const path = require('path');
const docsConfig = require('./docs.config');
module.exports = Object.assign(
{},
docsConfig,
{
plugins: [],
devtool: 'module-source-map',
devServer: {
contentBase: path.resolve(__dirname, '../examples'),
stats: { colors: true },
},
},
);
|
/*
copy.js
===========
copies images and javascript folders to public
*/
var gulp = require('gulp')
var config = require('./config.json')
gulp.task('copy-assets', function () {
return gulp.src(['!' + config.paths.assets + 'sass{,/**/*}',
config.paths.assets + '/**'])
.pipe(gulp.dest(config.paths.public)... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const chalk_1 = require("chalk");
const command_1 = require("@ionic/cli-utils/lib/command");
const serve_1 = require("@ionic/cli-utils/lib/serve");
let DocsCommand = class DocsCommand extends command_1.Command... |
'use strict';
angular.module('simpleCharts', []); |
/*
* grunt-fea-build
* https://github.com/bpletzer/FET-build-dep
*
* Copyright (c) 2013 Benedikt Pletzer
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js'... |
// Generated by CoffeeScript 1.3.3
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() {... |
modules.define('component', ['inherit'], function (provide, inherit) {
/**
* Base component
* @implements IComponent
*/
provide(inherit({
_isStarted: false,
start: function () {
this._isStarted = true;
},
stop: function () {
this._isStart... |
// For development only!!
// Add sample data to window object that used for initializing appendGrid.
window.myAppendGridInitData = [{
"uid": "d4c74a61-a24e-429f-9db0-3cf3aaa22425",
"name": "Monique Zebedee",
"company": "Welch LLC",
"country": "Japan",
"memberSince": "2012-02-18",
"orderPlaced": ... |
const api = "http://127.0.0.1:3001/"
let token = localStorage.token
if (!token)
token = localStorage.token = Math.random().toString(36).substr(-8)
const headers = {
'Authorization': token,
'Content-Type': 'application/json',
'Accept': 'application/json'
};
export const getCategories = () => {
co... |
const fs = require("fs")
const dialog = require('./luis.js')
fs.readdirSync('bot/luis/matches').forEach(file => require('./matches/' + file))
module.exports = dialog |
(function (tree) {
//
// A function call node.
//
tree.Call = function (name, args, index) {
this.name = name;
this.args = args;
this.index = index;
};
tree.Call.prototype = {
//
// When evaluating a function call,
// we either find the function in `tree.functions` [1],
// in which case we ... |
export default function (q1, q2, precision = 1e-6) {
return (
Math.abs(q1[0] - q2[0]) <= precision &&
Math.abs(q1[1] - q2[1]) <= precision &&
Math.abs(q1[2] - q2[2]) <= precision &&
Math.abs(q1[3] - q2[3]) <= precision
);
}
|
version https://git-lfs.github.com/spec/v1
oid sha256:c4eff6147e4aa3cd83b559adb30b75a42f984ca68528744b89729bb6f4fb4370
size 50687
|
'use strict';
const redirects = function (request, h) {
return h.redirect('/').takeover();
};
module.exports = redirects;
|
jQuery(function(a){a.datepicker.regional["en-AU"]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct",... |
const views = {
engines: {
pug: require('pug')
},
relativeTo: __dirname,
path: '../views'
};
module.exports = views;
|
(function(){
'use strict';
angular.module('playlistApp.track', [])
.directive('pbTrack', function(){
return {
restrict: 'E',
templateUrl: 'components/track/track.html',
scope: {
track: '=',
list: '=',
... |
import React from 'react';
import highlight from './highlight';
export default options => {
const {
loader,
isLanguageRegistered,
registerLanguage,
languageLoaders,
noAsyncLoadingLanguages
} = options;
class ReactAsyncHighlighter extends React.PureComponent {
static astGenerator = null;
... |
function validSlug(value) {
return /^([a-zA-Z0-9-]*)?$/i.test(value);
}
function addSlugValidation(inputSlugId){
var inputSlug = $vic('#' + inputSlugId);
displaySlugIcons(inputSlugId, inputSlug.val());
inputSlug.on('keyup', function(){
displaySlugIcons(inputSlugId, $vic(this).val());
});
}
fu... |
var request = require('request');
var Q = require('q');
module.exports = (function () {
function FlickrAPI() {}
FlickrAPI.ENDPOINT = 'https://api.flickr.com/services/rest/';
FlickrAPI.APIKey = '7c8048f68c6cffcf51b58b17380a90f5';
FlickrAPI.Secret = 'fb5c317f514c35b4';
FlickrAPI.prototype.tags = {... |
/**
* 把组件 MD 文档转为 hexo 最终渲染 MD,主要功能:
* 1、增加头部信息,用于渲染左侧多级菜单
* 2、把组件内的 jsdoc 注释转为 MD 追加到尾部,用于生成 API 文档
* 3、把 DEMO 代码实例化为组件
*
* author: Cody Chan <int64ago@gmail.com> 2017-02-08
*/
/* eslint no-param-reassign: 0 */
const fs = require('fs-extra');
const path = require('path');
const glob = require('glob');
const jsd... |
var structca_1_1axoninteractive_1_1_geometry_1_1_hex_1_1_float_axial =
[
[ "FloatAxial", "structca_1_1axoninteractive_1_1_geometry_1_1_hex_1_1_float_axial.html#addb3b8ac33094e21bd68f06c05af9ecf", null ],
[ "FloatAxial", "structca_1_1axoninteractive_1_1_geometry_1_1_hex_1_1_float_axial.html#a04a78a140b41b1220373... |
import { withRouter } from 'next/router'
function useWithRouter (props) {
return <div>I use withRouter</div>
}
useWithRouter.getInitialProps = () => ({})
export default withRouter(useWithRouter)
|
import callApi from '../../util/apiCaller';
// Export Constants
export const ACTIONS = {
SET_ADMIN_SEARCH: 'SET_ADMIN_SEARCH',
SET_ADMIN_CURRENT_PAGE: 'SET_ADMIN_CURRENT_PAGE',
SET_ADMIN_MAX_PAGE: 'SET_ADMIN_MAX_PAGE',
SET_ADMIN: 'SET_ADMIN',
};
export function setSearch(search) {
return {
type: ACTIONS.S... |
export default {
signupInitialState: {
success: false,
welcome: false,
errors: null,
fails: null
},
signinInitialState: {
success: false,
errors: null,
fails: null
},
passwordInitialState: {
message: null,
success: false,
errors: null,
fails: null,
resetMessage:... |
define([
'utils/Debug',
'core/Config',
'core/PubSub',
'core/Hub',
'utils/Dom',
'backbone',
'views/PageView',
'views/ToDoCollectionView',
'collections/ToDoCollection',
'caches/TodoCollectionCache'
], function(
Debug,
Config,
PubSub,
Hub,
Dom,
Backbone,
... |
module.exports = function(redis_client){
this.redis = redis_client;
this.init = {
kakao_rest_key: "653ef2a8cf89b38765bd83528f3c9012",
kakao_redirect: "http://localhost:3000/oauth"
};
this.MD5_SALT = {
kakao: "VERyStronGPassword:)forKakaO"
};
this.redis_key = {
user: "DWT:user:",
sessi... |
YUI.add('yui2-connection', function(Y) {
var YAHOO = Y.YUI2;
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.4.1
*/
/**
* The Connection Manager provides a simplified interface to the XMLHttpRequest
* object.... |
{
'type': 'game', // game or console
'name': 'Breakout',
'authors': [ 'Nolan Bushnell', 'Steve Bristow'],
'company': ['Atari, Inc'],
'year': '1976',
'date': '13-05-1976', // Day, Month, Year
'headline': 'Break blocs!',
'resume': [
'Breakout é... |
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { check } from 'meteor/check';
import { EasySearch } from 'meteor/easy:search'
import { _ } from 'meteor/underscore';
// 스키마 임포트.
import { EventSchema } from '/imports/schemas/event.js';
// 컬렉션 익스포트.
export const Events = new Mongo.C... |
'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var PostcardSchema = new mongoose.Schema({
user: [{ type: Schema.ObjectId, ref: 'User' }],
candidate: [{ type: Schema.ObjectId, ref: 'Candidate' }],
message: String,
state: [{ type: Schema.ObjectId, ref: 'State' }],
pr... |
"use strict"
var MINUTE = 60000
var EventEmitter = require('events')
var format = require('python-format')
var WebSocketClient = require('websocket').client
var request = require('request')
function objectHas(object, key) {
return Object.prototype.hasOwnProperty.call(object, key)
}
function copySafely(target,... |
var HOME = "app_dev.php/";
var first_time = 1;
var app_container = $("#backbone_container");
function showPrettyBackground()
{
$('<canvas class="blur" src='+canvasbg+' width="500" height="357">').appendTo( $('#container') );
$(".blur").each(function()
{
var element = this;
var img = new Image;
im... |
import * as Fathom from 'fathom-client';
function getSupport() {
window.open('https://github.com/gotdibbs/Dynamics-365-Toolkit/issues/', '_new');
Fathom.trackGoal('GFT1EFPR', 0);
}
export default {
action: getSupport,
key: 'get-support',
title: 'Get Support',
description: 'Takes you to a form... |
'use strict';
import Mraa from 'mraa';
import config from 'config';
import logger from './logger';
const Gate = function () {
const { port, time } = config.get('gate');
Mraa.init();
const pin = new Mraa.Gpio(port);
pin.dir(Mraa.DIR_OUT);
let timeout;
this.open = () => {
logger.info('requesting gat... |
/**
* deck_info.js
*
*/
// Object literal which encapsulates: rating selectors
DeckInfoUI = {
deck:null,
table:null,
resultsTable:null,
RATING_MAP:new Array("unrated","easy","medium","hard"),
CARD_ID_INDEX:1,
'init':function() {
// Pass global deck JSON data
this.deck = new... |
import Theme from '../../../src/utils/theme';
function getHighlightResult(
fillMode,
color,
isDark,
bgClass = '',
contentClass = '',
) {
let styles = {};
let classes = {};
if (bgClass) {
classes.class = bgClass;
}
if (contentClass) {
classes.contentClass = contentClass;
}
switch (fillMo... |
var express = require('express'),
fs = require('fs'),
app = express();
var cors = require('cors');
var app = express();
app.use(cors());
var ip = process.env.IP || process.env.OPENSHIFT_NODEJS_IP || '0.0.0.0';
app.get('http://quarkus-customer-service:8080/customers', function(req, res) {
res.send(res... |
/**
* Select the text of an element.
*
* @param {htmlelement} $el - The element.
* @return {undefined} - Nothing.
*
* @resource [https://www.sanwebe.com/2014/04/select-all-text-in-element-on-click]
*/
var selection = function($el) {
// Clear any current selection.
selection.clear();
// Create the selection.... |
import {throttle} from 'lodash'
// use like this within a react component:
// constructor(props){
// super(props)
// rerenderOnWindowResize(this)
// }
export default function rerenderOnWindowResize(that) {
that.updateDimensions = throttle(() => {
if (that.props.disabled) return
that.forceUpdate()
},... |
/*
Get value at location described by dot notion path
*/
import pathway from './pathway'
export const get = (obj, path) => {
path = pathway.split(path)
path.some((key, i) => {
if (typeof obj !== 'object') throw Error(`Get path '${path.join('.')}' cannot navigate past key '${path[i - 1]}', '${path[i - 1]}' i... |
var io = require('cheerio');
var reader = {
readPart: function(body, index) {
var $ = io.load(body);
var part = { };
var title = '';
var items = [];
$('#divMiddleList > div:nth-child(' + index + ')').each(function (index, object) {
title = $(object).find('s... |
import React from 'react';
import RaisedButton from 'material-ui/RaisedButton';
import QueueAnim from 'rc-queue-anim';
const mWidthStyle = {
minWidth: '135px'
};
const Section1 = () => (
<div className="container-fluid with-maxwidth">
<article className="article">
<h2 className="article-title">Basic</h2... |
/* ===================================================
* bootstrap-transition.js v2.2.1
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you ... |
'use strict';
const serverErrorCode = 500;
module.exports = function serverError (data) {
var req = this.req;
var res = this.res;
var sails = req._sails;
res.status(serverErrorCode);
if (data === undefined) {
sails.log.error('Sending empty 500 ("Server Error") response');
} else {
sails.log.erro... |
'use strict';
angular.module('gamePlatformServerApp')
.directive('navbar', () => ({
templateUrl: 'components/navbar/navbar.html',
restrict: 'E',
controller: 'NavbarController',
controllerAs: 'nav'
}));
|
import styles from './ModelHeader.css';
import React, { Component } from 'react';
export default class ModelHeader extends Component {
render() {
return <div className={styles.root}>
Complaints<br />by <b>Model</b>
</div>
}
} |
/**
* THIS FILE IS AUTO-GENERATED
* DON'T MAKE CHANGES HERE
*/
import { IndexDependencies } from './dependenciesIndexClass.generated';
import { compareNaturalDependencies } from './dependenciesCompareNatural.generated';
import { sizeDependencies } from './dependenciesSize.generated';
import { subsetDependencies } fr... |
var structRT__TASK__INFO =
[
[ "name", "structRT__TASK__INFO.html#a3e5d47277ecea23aa3a5730e0b6b2d13", null ],
[ "pid", "structRT__TASK__INFO.html#a70c731ca5877ff4a6235fa81caa77798", null ],
[ "prio", "structRT__TASK__INFO.html#a632e09c1d8dabc29c020c828abf62ac6", null ],
[ "stat", "structRT__TASK__INFO.h... |
const React = require('react');
class DonationOptions extends React.Component {
constructor(props) {
super(props);
this.state = {selectedDonationOption: 'option1', btnActiveID: "donation-option-1"};
}
btnIsActive = (value) => {
return 'btn btn-primary ' + ((value===this.state.btnActiveID) ? 'active':'');
}
... |
var path = require('path');
var fs = require('fs');
var _ = require('underscore');
var chalk = require('chalk');
_.str = require('underscore.string');
_.mixin(_.str.exports());
var ngParseModule = require('ng-parse-module');
exports.JS_MARKER = "<!-- Add New Component JS Above -->";
exports.LESS_MARKER = "/* Add Comp... |
import { ToggleTimerBar } from '../../Config/SpecificToggles';
import ToggleBotBar from '../../Config/Toggles/ToggleBotBar';
import UpdateBackground from './UpdateBackground';
/**
* This function disables and shows the bars created by CookieMonster when the game is "ascending"
* It is called by CM.Disp.Draw()
*/
e... |
var questions = [
{
question: 'How many times will the code inside the loop execute?',
inputGroup: 'question-1',
inputs: {
looptotal: 10
}
},
{
question: 'How many times will the code inside the loop execute?',
inputGroup: 'question-2',
inputs: {
looptotal: 9
}
},
{... |
/**
* @ngdoc directive
* @name barchart
* @module angular-graphael
* @description
* Creates a bar chart.
* @link http://g.raphaeljs.com/reference.html#Paper.barchart
*/
angular.module('angular-graphael').directive('barchart', function ($window, mapData) {
'use strict';
return {
restrict: 'E',
... |
var mongoose = require('mongoose'),
models = require('../models');
module.exports = function (config) {
mongoose.connect(config.db);
var db = mongoose.connection;
db.once('open', function (error) {
if (error) {
console.log('Database could not be opened: ' + error);
retu... |
import test from 'ava'
import sinon from 'sinon'
import pokeapiEndpoints from './'
test('pokeapi-endpoints', (t) => {
const results = [{
'name': 'berry',
'url': 'https://pokeapi.co/api/v2/berry/'
}, {
'name': 'berry-firmness',
'url': 'https://pokeapi.co/api/v2/berry-firmness/'
}, {
'name': 'b... |
'use strict';
(function() {
describe('HomeController', function() {
//Initialize global variables
var scope,
HomeController;
// Load the main application module
beforeEach(module(ApplicationConfiguration.applicationModuleName));
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScop... |
/*
* StoryQuest 2
*
* Copyright (c) 2014 Questor GmbH
*
* 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, mo... |
import React from 'react'
import PropTypes from 'prop-types'
import Colors from '../constants/Colors'
import Styles from '../styles/PersonCreate'
import HeaderTitle from '../components/HeaderTitle'
import PersonCreateView from '../components/PersonCreateView'
import { bindActionCreators } from 'redux'
import { connect... |
var mongoose = require('mongoose'),
Sync = require('sync'),
uniqueValidator = require('mongoose-unique-validator');
var studentAbsencesSchema = mongoose.Schema({
number: {
type: Number,
required: true,
unique: true,
match: /^\d{1,2}$/,
min: 1,
max: 30,
... |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by CodeZu.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//-----------------------------------... |
'use strict';
const BinaryTree = require('../index').BinaryTree,
assert = require('chai').assert;
describe('BinaryTree', () => {
let myBinaryTree = new BinaryTree('A');
myBinaryTree.addChild('B')
myBinaryTree.addChild('C')
myBinaryTree.addChild('D')
myBinaryTree.addChild('E')
myBinaryTree.addChild(... |
'use strict'
const client = require('../octopus-client')
const getAll = async (take, skip) => {
const url = `/channels?${take ? `take=${take}` : ''}&${skip ? `skip=${skip}` : ''}`
return client.get(url)
}
module.exports = { getAll }
|
var app = angular.module('ui.grid.edit');
app.provider('uiGridEditDatepickerCustomTemplate', function() {
var template = false;
return {
set: function(_template_) {
template = _template_;
},
$get: function() {
return template;
}
}
});
app.directive('... |
'use strict';
module.exports = {
'rules': {
'accessor-pairs': 'off',
'array-bracket-spacing': [
'error',
'never'
],
'brace-style': [
'error',
'1tbs',
{
'allowSingleLine': false
}
],
'camelcase': [
'error',
{
'properties': 'always... |
"use strict";
var helpers = require("../../helpers/helpers");
exports["Africa/Douala"] = {
"guess:by:offset" : helpers.makeTestGuess("Africa/Douala", { offset: true, expect: "Africa/Lagos" }),
"guess:by:abbr" : helpers.makeTestGuess("Africa/Douala", { abbr: true, expect: "Africa/Lagos" }),
"1905" : helpers.make... |
// ## Globals
var argv = require('minimist')(process.argv.slice(2));
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var flatten = require('gulp-flatten');
var gulp ... |
const path = require('path')
const BannerPlugin = require('webpack/lib/BannerPlugin')
const DedupePlugin = require('webpack/lib/optimize/DedupePlugin')
const DefinePlugin = require('webpack/lib/DefinePlugin')
const OccurrenceOrderPlugin = require(
'webpack/lib/optimize/OccurrenceOrderPlugin')
const UglifyJsPlugin = ... |
class MemorableClass {
static final ArrayList list = new ArrayList(100);
}
Calling String.intern() on lengthy String
String str=readString(); // read lengthy string any source db,textbox/jsp etc..
// This will place the string in memory pool from which you cant remove
str.intern();
(Unclosed) open streams ( file , ... |
import React, { PropTypes as T } from 'react';
import ReactModal2 from 'react-modal2';
export default class Modal extends React.Component {
static propTypes = {
children: T.node,
onClose: T.func.isRequired,
closeOnEsc: T.bool,
closeOnBackdropClick: T.bool,
};
static defaultProps = {
closeOnEsc: true,
... |
Thorax.templatePathPrefix = 'templates/';
var Application = window.Application = module.exports = new Thorax.Application(module.exports);
$(document).ready(function() {
$('body').append(Application.el);
Application.start({
pushState: false,
root: '/'
});
});
|
// methods
import curry from './curry';
// utils
import coalesceToArray from './_utils/coalesceToArray';
import isObject from './_utils/isObject';
/**
* @function takeObject
*
* @description
* get the first n number of items in an object
*
* @param {number} size the number of items to get from the end of the ob... |
_gaq.push(['_trackPageview']);
// If awaiting activation
var waiting = false;
// If trusted exit, for exit confirmation
var trustedExit = false;
// Show game screens
function ActivateGame(){
waiting = false;
$(".box-wrap").css("background", "#fff");
$(".box-wait").hide();
$(".box-game .game-swf").at... |
import { all } from 'redux-saga/effects';
import { actionCreator, asyncActionCreators, createAxiosSaga } from './utils';
import { appName } from '../config';
/**
* Constants
* */
export const moduleName = 'main';
const prefix = `${appName}/${moduleName}`;
export const CONST_EXAMPLE = `${prefix}/CONST_EXAMPLE`;
/*... |
/**
* @jest-environment jsdom
*/
/* eslint import/extensions: [0, {}] */
/* eslint import/no-unresolved: [0, {}] */
import DOMRouter from 'core/DOMRouter';
describe('DOMRouter', () => {
test('can trigger the right controller using data attributes on the <body> tag', async () => {
const testController01 = {
... |
const cliConfig = require('./cli-config');
const path = require('path');
const chalk = require('chalk');
const program = require('commander');
const commands = require('./commands');
const {common} = require('./utils');
const dependencyManager = common.getDependencyManager(process.cwd());
const packageVersion = common.... |
/* global chrome: true */
(function() {
if (window.onbeforeunload !== null) {
chrome.extension.sendRequest({ url: document.documentURI, type: "onbeforeunload", sessionID: "", message: "Site has redefined window.onbeforeunload with " + window.onbeforeunload.toString() }, function(response) {} );
}
}()); |
'use strict';
//使用应用名和依赖定义主模块
angular.module(ApplicationConfiguration.applicationModuleName, ApplicationConfiguration.applicationModuleVendorDependencies);
// 启动HTML location模式
angular.module(ApplicationConfiguration.applicationModuleName).config(['$locationProvider', '$httpProvider',
function ($locationProvider, $... |
'use strict';
//Hostels service used to communicate Hostels REST endpoints
angular.module('hostels').factory('Hostels', ['$resource',
function($resource) {
return $resource('hostels/:hostelId', { hostelId: '@_id'
}, {
update: {
method: 'PUT'
}
});
}
]); |
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"... |
var StartLayer_root = null;
var StartLayer = cc.Layer.extend({
rootnode:null,
PushBg:null,
TextFieldName:null,
ButtonCertain:null,
PanelNickName:null,
ctor:function () {
this._super();
StartLayer_root = this;
var size = cc.winSize;
this.rootnode = ccs.load(res.StartLayer_json)... |
import { Random } from 'meteor/random';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { BlazeLayout } from 'meteor/kadira:blaze-layout';
FlowRouter.route('/', {
name: 'home',
action() {
BlazeLayout.render('layout', { main: 'home' });
},
});
FlowRouter.route('/bailout', {
name: 'home-bailo... |
/**
* Simple link handler. Registers after template expansions, as an
* asynchronous transform.
*
* TODO: keep round-trip information in meta tag or the like
*/
'use strict';
var coreutil = require('util');
var defines = require('../parser.defines.js');
var PegTokenizer = require('../tokenizer.js').PegTokenizer;
... |
var loadDate = new Date();
console.log(loadDate);
window.setInterval(function(){
getTimeFromLoading();
}, 1000);
function getTimeFromLoading(){
var now = new Date();
var resultado = (now - loadDate);
var seconds = Math.round(resultado/1000);
document.getElementById('time').innerHTML="<strong>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.