code stringlengths 2 1.05M | repo_name stringlengths 5 114 | path stringlengths 4 991 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import React, {Component} from 'react';
import LanguageSwitcher from './LanguageSwitcher';
import Navigation from './Navigation';
import $ from 'jquery';
const Translate = require('react-i18nify').Translate;
export default class Menu extends Component{
constructor(){
super();
let self = this;
this.sta... | lhew/manguezal-test | src/components/Menu.js | JavaScript | mit | 2,593 |
define(
['polygonjs/math/Color'],
function (Color) {
"use strict";
var Surface = function (opts) {
opts = opts || {};
this.width = opts.width || 640;
this.height = opts.height || 480;
this.cx = this.width / 2;
this.cy = this.height / ... | WebSeed/PolygonJS | polygonjs/surfaces/CanvasSurface.js | JavaScript | mit | 3,361 |
'use strict';
var handler = {
fragments: null,
tab: null,
tabId: 0,
windowId: 0,
captureCmd: '',
initContextMenu: function () {},
queryActiveTab: function (callback) {
chrome.tabs.query({
active: true,
lastFocusedWindow: true
}, function (tabs) {
var tab = tabs && tabs[0] ... | bubkoo/crx-element-capture | src/js/background.js | JavaScript | mit | 4,787 |
const isAsync = (caller) => caller && caller.ASYNC;
module.exports = api => {
const ASYNC = api.caller(isAsync);
return {
babelrc: false,
plugins: [
['./babel-plugin-$-identifiers-and-imports', { ASYNC }],
['macros', { async: { ASYNC } }],
// use dead code elimination to clean up if(fals... | sithmel/iter-tools | generate/babel-generate.config.js | JavaScript | mit | 456 |
import React from 'react';
import PropTypes from 'prop-types';
import Post from './Post';
const Posts = ({ posts }) => (
<div>
{posts
.filter(post => post.frontmatter.title.length > 0)
.map((post, index) => <Post key={index} post={post} />)}
</div>
);
Posts.propTypes = {
posts: PropTypes.arrayO... | kbariotis/kostasbariotis.com | src/components/blog/Posts.js | JavaScript | mit | 367 |
'use strict';
const Promise = require('bluebird');
const { Transform } = require('readable-stream');
const vfs = require('vinyl-fs');
module.exports = function assets(src, dest, options = {}) {
const { parser, env } = options;
Reflect.deleteProperty(options, 'parser');
Reflect.deleteProperty(options, 'env');
... | oddbird/sassdoc-theme-herman | lib/utils/assets.js | JavaScript | mit | 801 |
'use strict';
function injectJS(src, cb) {
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.onreadystatechange = script.onload = function () {
var readyState = script.readyState;
if (!readyState || readyState == 'loaded' || readyState == 'complete' || readySt... | elpadi/js-library | dist/utils.js | JavaScript | mit | 496 |
/**
* Created by desen on 2017/7/24.
*/
function isArray(value) {
if (typeof Array.isArray === "function") {
return Array.isArray(value);
} else {
return Object.prototype.toString.call(value) === "[object Array]";
}
}
// 进行虚拟DOm的类型的判断
function isVtext(vNode) {
return true;
}
| enmeen/2017studyPlan | someDemo/虚拟DOM实现/util.js | JavaScript | mit | 307 |
import babel from 'rollup-plugin-babel';
export default {
plugins: [babel()]
};
| alexeyraspopov/message-script | rollup.config.js | JavaScript | mit | 83 |
var lang = navigator.language;
exports.set_lang=function(_lang,msgs){
lang = _lang || navigator.language;
if(lang.indexOf('en')===0){
lang = 'en';
}else if(lang.indexOf('es')===0){
lang = 'es';
}else{
lang = 'en';
}
var nodes = document.querySelectorAll('[msg]');
for(var i = 0; i < nodes.leng... | Technogi/website | src/scripts/msg.js | JavaScript | mit | 1,145 |
'use strict';
const postcodeApi = require('../index.js');
const sinon = require('sinon');
const chai = require('chai');
const expect = chai.expect;
const sinonChai = require('sinon-chai');
const requestApi = require('../lib/requestApi.js');
before(() => {
chai.use(sinonChai);
});
var sandbox;
beforeEach(() => {
s... | joostdebruijn/node-postcode-nl | test/helpers.followNext.js | JavaScript | mit | 6,658 |
import test from 'ava';
import { actionTest } from 'redux-ava';
import {
ADD_POST_REQUEST,
DELETE_POST_REQUEST,
} from '../constants';
import {
addPostRequest,
deletePostRequest,
} from '../PostActions';
const post = { name: 'Prashant', title: 'Hello Mern', cuid: 'f34gb2bh24b24b2', content: "All cats meow 'm... | Skrpk/mern-sagas | client/modules/Post/__tests__/PostActions.spec.js | JavaScript | mit | 657 |
version https://git-lfs.github.com/spec/v1
oid sha256:ba1edb37cd9663c92048dc14cd2f7e9e81d2ce7364194e973ba9e1238f9198a2
size 878
| yogeshsaroya/new-cdnjs | ajax/libs/extjs/4.2.1/src/lang/Number.min.js | JavaScript | mit | 128 |
/**
* Module dependencies
*/
var uuid = require('uuid');
var utils = require('../utils');
var safeRequire = utils.safeRequire;
var helpers = utils.helpers;
var couchbase = safeRequire('couchbase');
var CouchBase;
exports.initialize = function (schema, callback) {
var db, opts;
opts = schema.settings || {};
... | biggora/caminte | lib/adapters/couchbase.js | JavaScript | mit | 9,831 |
var ObjectExplorer = require('../')
var explorer = document.getElementById('explorer')
var add = document.getElementById('add')
var obj = {
a: 10,
b: true,
reg: /foo/g,
dat: new Date('2013-08-29'),
str: "fooo, bar"
}
obj.self = obj
obj.arr = [obj, obj, obj]
obj.longArr = []
for (i = 0; i < 500; i++) obj.long... | ForbesLindesay/object-explorer | demo/client.js | JavaScript | mit | 503 |
var global = window;
var Stack = require('lib/swing/stack'),
Card = require('lib/swing/card');
global.gajus = global.gajus || {};
global.gajus.Swing = {
Stack: Stack,
Card: Card
};
module.exports = {
Stack: Stack,
Card: Card
};
| unbug/generator-webappstarter | app/templates/app/src/lib/swing/swing.js | JavaScript | mit | 242 |
const FliprYaml = require('../lib/flipr-yaml');
const source = new FliprYaml({
filePath: 'sample/config/basic.yaml',
});
source.preload()
.then(() => {
console.log('Config file has been read and cached. Any changes to the .yaml file will not be read by flipr-yaml.');
})
.then(() => source.flush())
.the... | godaddy/node-flipr-yaml | sample/flush-cache.js | JavaScript | mit | 461 |
/*
Copyright 2019 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
const expect = require('chai').expect;
const activateAndControlSW = require('../../../infra/testing/activate-and-control');
const cleanS... | GoogleChrome/workbox | test/workbox-precaching/integration/test-cleanup-outdated-caches.js | JavaScript | mit | 2,212 |
import { AudioStreamFormat } from 'microsoft-cognitiveservices-speech-sdk';
export { AudioStreamFormat };
| billba/botchat | packages/testharness/pre/external/microsoft-cognitiveservices-speech-sdk/index.js | JavaScript | mit | 107 |
app.controller('MapsCTRL2', function($scope) {
app.value('NEW_TODO_ID', -1);
app.service('mapService', function () {
var map;
this.setMap = function (myMap) {
map = myMap;
};
this.getMap = function () {
if (map) return map;
throw new Error("Map not defined");
... | hopeeen/instaApp | www/scripts/controllers/maps2.js | JavaScript | mit | 13,504 |
import mongoose from 'mongoose';
import request from 'supertest-as-promised';
import httpStatus from 'http-status';
import chai, { expect } from 'chai';
import app from '../../index';
chai.config.includeStack = true;
/**
* root level hooks
*/
after((done) => {
// required because https://github.com/Automattic/mon... | CaptainSid/WarSid-Swissport | server/tests/Compte.test.js | JavaScript | mit | 3,205 |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import AppActions from '../../actions/AppActions';
/*
|--------------------------------------------------------------------------
| Child - Audio settings
|--------------------------------------------------------------------------
*/
expo... | Eeltech/SpaceMusik | src/ui/components/Settings/SettingsAudio.react.js | JavaScript | mit | 1,248 |
var path = require('path');
var config = {
contentBase: path.join(__dirname, "docs"),
watchContentBase: true,
host: 'localhost',
port: 8080,
// Recommended for hot module replacement
hot: true,
inline: true,
// Open the browser does not work when webpack dev server called from node.
// open: ... | manu-garcia/react-pwa-from-scratch | webpack.devserver.config.js | JavaScript | mit | 712 |
/**
Copyright (c) 2015, 2017, Oracle and/or its affiliates.
The Universal Permissive License (UPL), Version 1.0
*/
/**
* # oraclejet-build.js
* This script allows users to configure and customize the grunt build tasks.
* Configurable tasks include:
* copySrcToStaging
* copyCustomLibsToStaging
* inject... | amalbose/media-manager | scripts/grunt/config/oraclejet-build.js | JavaScript | mit | 4,603 |
// @flow
import type { ChooView } from "../app";
const html = require("choo/html");
const messages = require("../messages");
const textInput = ({ label, name }) => html`
<label>
${label}
<input name=${name}/>
</label>`;
const signupForm = ({ onSubmit }) => html`
<form onsubmit=${onSubmit}>
${textInput({ l... | fczuardi/videochat-client | src/views/signup.js | JavaScript | mit | 981 |
var notice_this_is_a_global_var = "WAT?";
window.getGlobalTemplate = function() {
var compiled = _.template('<h1>Hello from a <strong>Global</strong> module running a <%= templateName %>!</h1>');
return compiled({
'templateName': 'Lodash template'
});
};
| staxmanade/jspm-presentation | demo-commonjs-amd-global/globalModule.js | JavaScript | mit | 270 |
const DrawCard = require('../../drawcard.js');
const { Locations, Players, CardTypes } = require('../../Constants');
class MyAncestorsStrength extends DrawCard {
setupCardAbilities(ability) { // eslint-disable-line no-unused-vars
this.action({
title: 'Modify base military and political skills',... | jeremylarner/ringteki | server/game/cards/04.4-TEaF/MyAncestorsStrength.js | JavaScript | mit | 2,289 |
import { createStore } from 'redux';
import reducers from './reducers';
const store = createStore(reducers);
if (module.hot) {
module.hot.accept(() => {
const nextRootReducer = require('./reducers').default;
store.replaceReducer(nextRootReducer);
});
}
export default store;
| entria/entria-components | storybook/store.js | JavaScript | mit | 291 |
(function () {
var fullpage = (function () {
'use strict';
var Cell = function (initial) {
var value = initial;
var get = function () {
return value;
};
var set = function (v) {
value = v;
};
var clone = function () {
return Cell(get());
};
return {
get: get,... | AnttiKurittu/kirjuri | vendor/tinymce/tinymce/plugins/fullpage/plugin.js | JavaScript | mit | 16,270 |
$(document).ready(function(){
SC.initialize({
client_id: "472760520d39b9fa470e56cdffc71923",
});
$('.leaderboard tr').each(function(){
var datacell = $(this).find('.datacell').data('url');
var data = datacell.data('url');
SC.oEmbed(data, {auto_play: false}, datacell);
})
/*
SC.oEmbed($('#cru... | srhoades28/CI_Crunchoff | assets/js/leaderboard.js | JavaScript | mit | 498 |
"use strict";
describe("PROXY", function () {
beforeEach(function () {
this.p = new PubnubProxy();
});
describe('setFlashObjectId ', function () {
it('should accept flash object name (string) as only argument', function () {
var _test = this,
failFn = ... | pubnub/flash | pubnub-as2js-proxy/test/unit/pubnubProxy_test.js | JavaScript | mit | 4,174 |
#!/usr/bin/env node
/**
* Extremely simple static website serving script
* This is provided in case you need to deploy a quick demo
*
* Install + run:
*
* # from parent directory
*
* cd demo
* npm install
* node server
*
*/
var bodyParser = require('body-parser');
var express = require('express');
var humanize = ... | MomsFriendlyDevCo/angular-ui-history | demo/server.js | JavaScript | mit | 3,855 |
'use strict';
/**
* Password based signin and OAuth signin functions.
*/
var qs = require('querystring'),
route = require('koa-route'),
parse = require('co-body'),
jwt = require('koa-jwt'),
request = require('co-request'),
config = require('../config/config'),
mongo = require('..... | nileshlg2003/koan | server/controllers/signin.js | JavaScript | mit | 5,541 |
/**
* Plural rules for the fi (Finnish, suomi, suomen kieli) language
*
* This plural file is generated from CLDR-DATA
* (http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html)
* using js-simple-plurals and universal-i18n
*
* @param {number} p
* @return {number} 0 - one, 1 - other
*... | megahertz/js-simple-plurals | web/fi.js | JavaScript | mit | 750 |
/*global Ghetto*/
(function ($) {
$('div').on('click', '.save-button', function (e) {
var id = $(this).attr('data-id');
//trim genre off the end of id (it was there for uniqueness on the page)
id = id.substring(0, id.indexOf('_'));
$('[id^=save-button-div-' + id + ']').collapse('h... | jajmo/Ghetto-IMDB | static/js/movies.js | JavaScript | mit | 6,246 |
'use strict';
var fs = require( 'fs' );
var path = require( 'path' );
var readlineSync = require( 'readline-sync' );
require( 'plus_arrays' );
require( 'colors' );
var freqTable = require( './freqTable' );
function annotateRandomSample( inputFile, options ) {
// if path is not absolute, make it absolute with resp... | Planeshifter/node-wordnetify-sample | lib/annotateRandomSample.js | JavaScript | mit | 1,860 |
/*!
* datastructures-js
* priorityQueue
* Copyright(c) 2015 Eyas Ranjous <eyas@eyasranjous.info>
* MIT Licensed
*/
var queue = require('./queue');
function priorityQueue() {
'use strict';
var prototype = queue(), // queue object as the prototype
self = Object.create(prototype);
// determin... | Bryukh/datastructures-js | lib/priorityQueue.js | JavaScript | mit | 1,632 |
Minder.run(function($rootScope) {
angular.element("body").fadeIn(300);
// Add runtime tasks here
}); | jeremythuff/minderui | app/config/runTime.js | JavaScript | mit | 107 |
var Scene = function(gl) {
this.noiseTexture = new Texture2D(gl, "media/lab4_noise.png");
this.brainTexture = new Texture2D(gl, "media/brain-at_1024.jpg");
this.brainTextureHD = new Texture2D(gl, "media/brain-at_4096.jpg");
this.matcapGreen = new Texture2D(gl, "media/Matcap/matcap4.jpg");
this.skyCubeTexture = new... | RyperHUN/RenderingExamples | RayMarchingVolumetric_Brain/js/Scene.js | JavaScript | mit | 3,266 |
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('va... | ordinarygithubuser/chat-es7 | server/model/message.js | JavaScript | mit | 4,285 |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var RandomFloat = /** @class */ (function () {
function RandomFloat() {
}
RandomFloat.nextFloat = function (min, max) {
if (max === void 0) { max = null; }
if (max == null) {
max = min;
min =... | pip-services/pip-services-commons-node | obj/src/random/RandomFloat.js | JavaScript | mit | 892 |
! function() {
"use strict";
function t(t, i, n, e) {
function r(t, i) {
for (var n = 0; n < t.length; n++) {
var e = t[n];
i(e, n)
}
}
function a(t) {
s(t), o(t), u(t)
}
function s(t) {
t.addEventListener("mouseover", function(i) {
r(f, function(i, n) {
document.getElementBy... | teacher144123/npo_map | server/js/dict/rating.min.js | JavaScript | mit | 1,615 |
"use strict";
// INCLUDES
if (typeof exports !== "undefined")
{
global.URL = require("url");
global.fs = require("fs");
global.http = require("http");
global.https = require("https");
global.WSServer = require("websocket").server;
global.WebSocketConnection = require("./websocketconnection");
global.logger ... | ptesavol/webjsonrpc | websocketserver.js | JavaScript | mit | 4,196 |
/**
* Layout component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from "react"
import PropTypes from "prop-types"
import { useStaticQuery, graphql } from "gatsby"
import "./layout.css"
import "./fonts.css"
import "./jame... | parisminton/james.da.ydrea.ms | src/components/layout.js | JavaScript | mit | 928 |
/**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within... | nz-andy/electron-test | systemjs.config.js | JavaScript | mit | 1,529 |
import React,{ Component } from 'react'
import { {{ name }}List } from './list'
export { {{ name }}List }
| team4yf/yf-fpm-admin | src_template/index.js | JavaScript | mit | 107 |
angular.module('Techtalk')
.factory('socket', function ($rootScope, config) {
if (typeof (io) != "undefined") {
var socket = io.connect(config.Urls.URLService, { reconnection: false });
return {
on: function (eventName, callback) {
socket.on(eventName, function () {
var a... | RafaSousa/techtalk-node | client/app/directives/main-directive.js | JavaScript | mit | 1,844 |
// Regular expression that matches all symbols with the `IDS_Binary_Operator` property as per Unicode v7.0.0:
/[\u2FF0\u2FF1\u2FF4-\u2FFB]/; | mathiasbynens/unicode-data | 7.0.0/properties/IDS_Binary_Operator-regex.js | JavaScript | mit | 140 |
(function(){
console.log("Message");
})(); | curvecode/chrome-ext-js | app/helloworld/js/app.js | JavaScript | mit | 46 |
var express = require('express');
var morphine = require('./api');
var app = express();
// Mounts the rpc layer middleware. This will enable remote function calls
app.use(morphine.router);
// Serve static files in this folder
app.use('/', express.static(__dirname + '/'));
// Listen on port 3000
app.listen(3000, fu... | d-oliveros/isomorphine | examples/barebone/src/server.js | JavaScript | mit | 703 |
#!/usr/bin/env node
require('yargs')
.commandDir('cmd')
.demand(1)
.strict()
.help()
.argv;
| dobbydog/webpack-porter | cli.js | JavaScript | mit | 93 |
// flow-typed signature: a4cf0a15120e85fc382b90182181b521
// flow-typed version: <<STUB>>/grunt_v^1.0.1/flow_v0.49.1
/**
* This is an autogenerated libdef stub for:
*
* 'grunt'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* communi... | kaitamkun/frisktol | flow-typed/npm/grunt_vx.x.x.js | JavaScript | mit | 2,626 |
/**
* @desc express config
* @author awwwesssooooome <chengpengcp9@gmail.com>
* @date 2015-09-21
*/
'use strict';
/**
* Module dependencies
*/
import express from 'express';
import cookieParser from 'cookie-parser';
import bodyParser from 'body-parser';
import favicon from 'serve-favicon';
import compression fr... | playwolsey/Robin | config/express.js | JavaScript | mit | 1,492 |
var Type = function(Bookshelf) {
return Bookshelf.Model.extend({
tableName: 'types',
model: function() {
return this.belongsTo('model');
}
});
};
module.exports = Type;
| ericclemmons/bookshelf-manager | test/models/type.js | JavaScript | mit | 193 |
var Mocha = require('mocha');
var path = require('path');
var Module = require('module');
var generateSauceReporter = require('./mocha-sauce-reporter');
var fs = require('fs');
var path = require('path');
module.exports = function (opts, fileGroup, browser, grunt, onTestFinish) {
//browserTitle means we're on a SL t... | pdehaan/grunt-mocha-webdriver | tasks/lib/mocha-runner.js | JavaScript | mit | 1,479 |
exports.BattleMovedex = {
//-----------------------------------------------------------------------------------------------
//Misc changes
//-----------------------------------------------------------------------------------------------
"shellsmash": {
inherit: true,
boosts: {
... | DreMZ/PS | mods/duskmod/moves.js | JavaScript | mit | 18,661 |
// Admin main
//
// This is the main execution loop of the admin panel. It provides basic
// configuration, routing, and default imports.
require.config({
paths: {
'jquery': 'lib/jquery-1.10.2.min',
'underscore': 'lib/underscore',
'backbone': 'lib/backbone',
'require-css': 'lib/require-css.min',
... | astex/peanuts.admin | static/main.js | JavaScript | mit | 2,817 |
import angular from 'angular-fix';
import utils from '../other/utils';
export default formlyConfig;
// @ngInject
function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix, formlyApiCheck) {
const typeMap = {};
const templateWrappersMap = {};
const defaultWrapperName = 'default';
const _t... | kentcdodds/angular-formly | src/providers/formlyConfig.js | JavaScript | mit | 8,628 |
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { HomeComponent as Home } from '../components';
import { ProtectedContainer } from '.';
class HomeContainer extends Component {
render () {
return (
<ProtectedContainer>
<Home user={this.props.user} />
</... | advantys/workflowgen-templates | integration/azure/authentication/azure-v1/auth-code-pkce/WorkflowGenExample/containers/HomeContainer.js | JavaScript | mit | 515 |
// generated by Neptune Namespaces v4.x.x
// file: Art/Engine/Elements/ShapeChildren/index.js
(module.exports = require('./namespace'))
.addModules({
FillElement: require('./FillElement'),
OutlineElement: require('./OutlineElement')
}); | art-suite/art-engine | source/Art/Engine/Elements/ShapeChildren/index.js | JavaScript | mit | 245 |
module.exports = {
transform: {
'^.+\\.(t|j)sx?$': 'ts-jest'
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: [
'ts',
'tsx',
'js',
'jsx',
'json',
'node'
],
globals: {
'ts-jest': {
tsConfig: {
jsx: 'react'
}
}
}... | KeitIG/react-keybinding-component | jest.config.js | JavaScript | mit | 323 |
'use strict';
// Setting up route
angular.module('users').config(['$stateProvider',
function ($stateProvider) {
// Users state routing
$stateProvider
.state('settings', {
abstract: true,
url: '/settings',
templateUrl: 'modules/users/client/views/settings/settings.client.view.htm... | dpxxdp/segue4 | modules/users/client/config/users.client.routes.js | JavaScript | mit | 2,704 |
import test from 'tape'
import lerp from './'
test('snap-lerp', t => {
t.equal(lerp(1, 3, 0.5, 0.01), 2)
t.equal(lerp(1, 3, 0.5, 2, false), 3)
t.equal(lerp(1, 3, 0.5, 2, true), 3)
t.equal(lerp(3, 1, 0.5, 0.01), 2)
t.equal(lerp(3, 1, 0.5, 2, false), 1)
t.equal(lerp(3, 1, 0.5, 2, true), 1)
t.equal(lerp(1,... | hughsk/snap-lerp | test.js | JavaScript | mit | 1,018 |
var raf = require('raf');
var createCaption = require('vendors/caption');
var glslify = require('glslify');
var windowSize = new THREE.Vector2(window.innerWidth, window.innerHeight);
var SwapRenderer = require('vendors/swapRenderer'), swapRenderer;
var velocityRenderer, pressureRenderer;
var Solver = require('./flu... | kenjiSpecial/webgl-sketch-dojo | sketches/theme/fluid/app00temp01/app.js | JavaScript | mit | 3,670 |
module.exports = function() {
return {
connectionString : "mongodb://127.0.0.1:27017/mongolayer"
}
} | simpleviewinc/mongolayer | testing/config.js | JavaScript | mit | 108 |
'use strict';
const clone = require('../helpers/clone');
class SaveOptions {
constructor(obj) {
if (obj == null) {
return;
}
Object.assign(this, clone(obj));
}
}
module.exports = SaveOptions; | aguerny/LacquerTracker | node_modules/mongoose/lib/options/saveOptions.js | JavaScript | mit | 216 |
import React from 'react';
import ShiftKey from './ShiftKey';
import 'scss/vigenere.scss';
export default class VigenereKeys extends React.Component {
constructor(props) {
super(props);
this.state = {
keyword: ''
};
this.keywordHandler = this.keywordHandler.bind(this);
}
keywordHandler(ev... | pshrmn/cryptonite | src/components/tools/VigenereKeys.js | JavaScript | mit | 1,314 |
/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
module.exports = {
// All imported modules in your tests should be mocked automatically
// automock: false,
// Stop running tests after `n` failures
// bail: 0,
// The direct... | C2FO/gofigure | jest.config.js | JavaScript | mit | 6,865 |
'use strict';
import UserNotificationConstants from '../constants/UserNotificationConstants';
import UserNotificationService from '../services/UserNotificationService';
const _initiateRequest = (type, data) => {
return {
'type': type,
'data': data
};
};
const _returnResponse = (type, data) => {
return {
'typ... | zdizzle6717/battle-comm | src/actions/UserNotificationActions.js | JavaScript | mit | 2,189 |
/*jshint node: true, eqnull: true*/
exports.purge = require('./lib/purge').AkamaiPurge; | patrickkettner/grunt-akamai-clear | node_modules/akamai/akamai.js | JavaScript | mit | 88 |
() => {
const [startDate, setStartDate] = useState(new Date());
let handleColor = (time) => {
return time.getHours() > 12 ? "text-success" : "text-error";
};
return (
<DatePicker
showTimeSelect
selected={startDate}
onChange={(date) => setStartDate(date)}
timeClassName={handleCo... | Hacker0x01/react-datepicker | docs-site/src/examples/customTimeClassName.js | JavaScript | mit | 340 |
'use strict';
var arg = require('../util').arg;
var oneDHeightmapFactory = require('../1d-heightmap');
var rng = require('../rng');
var random = rng.float;
var randomRange = rng.range;
var randomRangeInt = rng.rangeInt;
var randomSpacedIndexes = rng.space... | unstoppablecarl/1d-heightmap | src/key-indexes/index.js | JavaScript | mit | 11,619 |
'use strict';
/**
* practice Node.js project
*
* @author Huiming Hou <240050497@qq.com>
*/
import mongoose from 'mongoose';
module.exports = function(done){
const debug = $.createDebug('init:mongodb');
debug('connecting to MongoDB...');
const conn = mongoose.createConnection($.config.get('db.mongodb'));
... | hhmpro/node-practice-project | src/init/mongodb.js | JavaScript | mit | 450 |
var request = require('request'),
Q = require('q'),
xml2js = require('xml2js'),
_ = require('lodash');
module.exports = {
/**
* Helper function that handles the http request
*
* @param {string} url
*/
httprequest: function(url) {
var deferred = Q.defer();
request(url, ... | LoganArnett/node-zillow | lib/helpers.js | JavaScript | mit | 1,998 |
var closet = closet || {};
(function($) {
closet.folders = (function() {
var iconPlus = '<img class="icon" style="width:10px" src="/static/image/16x16/Plus.png"/>';
var iconMinus = '<img class="icon" style="width:10px" src="/static/image/16x16/Minus.png"/>';
var iconEmpty = '<img class="icon" style="width:... | mudynamics/pcapr-local | lib/pcapr_local/www/static/script/closet/closet.folders.js | JavaScript | mit | 3,861 |
define(function(require) {
var $ = require('jquery');
var Point = require('joss/geometry/Point');
var _scrollIsRelative = !($.browser.opera || $.browser.safari && $.browser.version < "532");
/**
* Returns a DOM element lying at a point
*
* @param {joss/geometry/Point} p
* @return {Element}
*/
var fr... | zship/joss | src/joss/util/elements/fromPoint.js | JavaScript | mit | 681 |
import gulp from 'gulp';
import runSequence from 'run-sequence';
gulp.task('dev', ['clean'], function(cb) {
global.isProd = false;
runSequence(['styles', 'images', 'fonts', 'views','vendor'], 'browserify', 'watch', cb);
});
| tungptvn/tungpts-ng-blog | gulp/tasks/development.js | JavaScript | mit | 239 |
/**
*
* @type {*}
* @private
*/
jDoc.Engines.RTF.prototype._specialControlWords = [
"chpgn",
"chftn",
"chdate",
"chtime",
"chatn",
"chftnsep",
"/",
":",
"*",
"~",
"-",
"_",
"'hh",
"page",
"line",
"раr",
"sect",
"tab",
"сеll",
"row",
... | pavel-voronin/jDoc | js/engines/RTF/reader/private/_specialControlWords.js | JavaScript | mit | 383 |
export default function album() {
return {
getAlbum: id => this.request(`${this.apiURL}/albums/${id}`),
getAlbums: ids => this.request(`${this.apiURL}/albums/?ids=${ids}`),
getTracks: id => this.request(`${this.apiURL}/albums/${id}/tracks`),
};
}
| dtfialho/js-tdd-course | module-06/src/album.js | JavaScript | mit | 263 |
function airPollution(sofiaMap, forces) {
for (let i = 0; i < sofiaMap.length; i++) {
sofiaMap[i] = sofiaMap[i].split(' ').map(Number)
}
for (let i = 0; i < forces.length; i++) {
forces[i] = forces[i].split(' ')
}
for (let i = 0; i < forces.length; i++) {
for (let k = 0; k < ... | b0jko3/SoftUni | JavaScript/Core/Fundamentals/Exams/11_Feb_2018/02._Air_Pollution.js | JavaScript | mit | 1,937 |
"use strict";
exports.default = {
type: "html",
url: "http://www.xnview.com/en/xnviewmp/",
getVersion: function($) {
return $("#downloads p")
.contains("Download")
.find("strong")
.version("XnView MP @version");
}
};
| foxable/app-manager | storage/apps/xnview-mp/versionProvider.js | JavaScript | mit | 277 |
///////////////////////////////////////////////////////////////////////////
// Copyright © Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the 'License');
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.ap... | tmcgee/cmv-wab-widgets | wab/2.13/widgets/ParcelDrafter/nls/tr/strings.js | JavaScript | mit | 5,323 |
/*globals $:false, _:false, Firebase:false */
'use strict';
var url = 'https://jengaship.firebaseio.com/',
fb = new Firebase(url),
gamesFb = new Firebase(url + 'games'),
games,
avaGames = [],
emptyGames = [],
myGames = [],
myBoardPositions = [],
current... | kylemcco/jengaship | app/scripts/index.js | JavaScript | mit | 19,418 |
import { Durations } from '../../Constants.js';
const DrawCard = require('../../drawcard.js');
const AbilityDsl = require('../../abilitydsl.js');
class MatsuKoso extends DrawCard {
setupCardAbilities() {
this.action({
title: 'Lower military skill',
condition: context => context.sour... | gryffon/ringteki | server/game/cards/12-SoW/MastuKoso.js | JavaScript | mit | 964 |
'use strict';
require('../../../TestHelper');
/* global bootstrapDiagram, inject */
var modelingModule = require('../../../../lib/features/modeling'),
bendpointsModule = require('../../../../lib/features/bendpoints'),
rulesModule = require('./rules'),
interactionModule = require('../../../../lib/feature... | camunda-internal/bpmn-quiz | node_modules/diagram-js/test/spec/features/bendpoints/BendpointsSpec.js | JavaScript | mit | 4,569 |
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import Landing from './../Landing'
import * as UserActions from './../actions/User'
function mapStateToProps(state) {
return {
user: state.userStore.user
}
}
const mapDispatchToProps = (dispatch) => {
return bindActio... | Briseus/Kape | src/containers/Landing.js | JavaScript | mit | 425 |
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
Ember.MODEL_FACTORY_INJECTIONS = true;
var App = Ember.Application.extend({
modulePrefix: 'tvdb', // TODO: loaded via config
Resolver: Resolver
});
loadInitializers(App, 'tvdb');
export default App;
| bolotyuh/ember-symfony-starterkit | web/ember/foo/app/app.js | JavaScript | mit | 302 |
YUI.add('dataschema-array', function (Y, NAME) {
/**
* Provides a DataSchema implementation which can be used to work with data
* stored in arrays.
*
* @module dataschema
* @submodule dataschema-array
*/
/**
Provides a DataSchema implementation which can be used to work with data
stored in arrays.
See the `app... | braz/mojito-helloworld | node_modules/mojito/node_modules/yui/dataschema-array/dataschema-array.js | JavaScript | mit | 6,625 |
module.exports = (function () {
var moduleName = 'cut-media-queries';
var lolArrayDiff = function(array1, array2) {
var diff1 = array1.filter(function(elem){
return array2.indexOf(elem) === -1;
});
var diff2 = array2.filter(function(elem){
return array1.indexOf(elem) === -1;
});
return diff1.conca... | iVariable/csscomb-cut-media-queries | options/cut-media-queries.js | JavaScript | mit | 2,636 |
// Dependencies
const {types} = require('focus').component;
// Components
const ContextualActions = require('../action-contextual').component;
const CheckBox = require('../../common/input/checkbox').component;
// Mixins
const translationMixin = require('../../common/i18n').mixin;
const referenceMixin = require('..... | JRLK/focus-components | src/list/selection/line.js | JavaScript | mit | 4,528 |
'use strict';
var assert = require('assert');
var extraStep = require('../../../lib/tasks/extra-step');
var MockUI = require('../../helpers/mock-ui');
describe('Extra Step', function() {
var ui;
var dummySteps = [
{ command: 'echo "command number 1"' },
{ command: 'echo "command number 2"' },
{... | AReallyGoodName/ember-cli-s3-sync-index-last-no-cache | tests/unit/tasks/extra-step-test.js | JavaScript | mit | 2,577 |
/* eslint-disable comma-style, operator-linebreak, space-unary-ops, no-multi-spaces, key-spacing, indent */
'use strict'
const analyzeHoldem = require('./lib/holdem')
/**
* Analyzes a given PokerHand which has been parsed by the HandHistory Parser hhp.
* Relative player positions are calculated, i.e. cutoff, button... | thlorenz/hha | hha.js | JavaScript | mit | 1,658 |
import { h, render, rerender, Component } from '../../src/preact';
let { expect } = chai;
/*eslint-env browser, mocha */
/*global sinon, chai*/
/** @jsx h */
describe('render()', () => {
let scratch;
before( () => {
scratch = document.createElement('div');
(document.body || document.documentElement).appendChi... | okmttdhr/preact-fork | test/browser/render.js | JavaScript | mit | 10,825 |
version https://git-lfs.github.com/spec/v1
oid sha256:f7df841464cae1b61b2fb488b6174926c0e0251ceddf1dd360b031ab9fb83c3c
size 4289
| yogeshsaroya/new-cdnjs | ajax/libs/angular.js/1.2.6/angular-sanitize.min.js | JavaScript | mit | 129 |
const React = require('react')
const Layout = require('./src/components/layout').default
// Logs when the client route changes
exports.onRouteUpdate = ({ location, prevLocation }) => {
const body = document.querySelector('body')
body.setAttribute('data-current-page', location.pathname)
body.setAttribute('data-pr... | yowainwright/yowainwright.github.io | gatsby-browser.js | JavaScript | mit | 504 |
import { handleActions } from 'redux-actions';
import { Map, OrderedMap } from 'immutable';
import initialState from '../store/initialState';
const App = handleActions({
WINDOW_LOADED: (state) => ({
...state,
windowLoaded: true
}),
CLOSE_LEGAL_HINT: (state) => ({
...state,
showLegal... | NTU-ArtFest22/Monitor-web | src/Reducers/index.js | JavaScript | mit | 4,611 |
'use strict';
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProp... | 9o/react-color | lib/components/slider/SliderPointer.js | JavaScript | mit | 3,128 |
'use strict';
// Declare app level module which depends on views, and components
angular.module('collegeScorecard', [
'ngRoute',
'ui.bootstrap',
'nemLogging',
'uiGmapgoogle-maps',
'collegeScorecard.common',
'collegeScorecard.footer',
'collegeScorecard.home',
'collegeScorecard.schools',
'collegeScorec... | brianyamasaki/collegeScorecard | app/app.js | JavaScript | mit | 658 |
// © Copyright 2013 Paul Thomas <paul@stackfull.com>. All Rights Reserved.
// sf-virtual-repeat directive
// ===========================
// Like `ng-repeat` with reduced rendering and binding
//
(function(){
'use strict';
// (part of the sf.virtualScroll module).
var mod = angular.module('sf.virtualScroll');
... | looker/angular-virtual-scroll | src/virtual-repeat.js | JavaScript | mit | 14,764 |
require('../helpers');
const assert = require('assert');
const ironium = require('../../src');
const Promise = require('bluebird');
describe('processing', ()=> {
const errorCallbackQueue = ironium.queue('error-callback');
const errorPromiseQueue = ironium.queue('error-promise');
const errorGeneratorQueue... | djanowski/ironium | test/queues/error_test.js | JavaScript | mit | 2,127 |