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 { BACKWARD, FORWARD } from '@warriorjs/geography';
const defaultDirection = FORWARD;
function attack({ power }) {
return unit => ({
action: true,
description: `Attacks a unit in the given direction (\`'${defaultDirection}'\` by default), dealing ${power} HP of damage.`,
perform(direction = defaul... | olistic/warriorjs | packages/warriorjs-abilities/src/attack.js | JavaScript | mit | 773 |
'use strict';
module.exports = {
db: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://test:test@ds043324.mongolab.com:43324/partnerfinder',
assets: {
lib: {
css: [
'public/lib/bootstrap/dist/css/bootstrap.min.css',
'public/lib/bootstrap/dist/css/bootstrap-theme.min.css',
],
js: [
... | juliofornode/partnerFinder | config/env/production.js | JavaScript | mit | 2,035 |
{
"events": {
"restart":"",
"start":"ng build",
"crash":"",
"exit":"",
"config:update":""
}
}
| Kiri23/MEAN-Stack-Authentication | angular-src/nodemon.js | JavaScript | mit | 118 |
'use strict';
describe('time saving account rest service', function() {
let server, collection, right, savingAccount, userAccount;
let today = new Date();
beforeEach(function(done) {
var helpers = require('../mockServer');
helpers.mockServer('accountRightTimeSavingAccount', function... | gadael/gadael | test/server/rest/account/timeSavingAccountSpec.js | JavaScript | mit | 6,467 |
import {configure} from '../src/index';
import {VelocityAnimator} from '../src/animator';
jasmine.getFixtures().fixturesPath = 'base/test/fixtures/';
describe('animator-velocity-plugin', () => {
let elem;
let animator;
let container;
beforeEach(() => {
//stop all animations running on the test element
... | gooy/aurelia-animator-velocity | test/plugin.spec.js | JavaScript | mit | 1,091 |
/*
* Copyright (c) 2017. MIT-license for Jari Van Melckebeke
* Note that there was a lot of educational work in this project,
* this project was (or is) used for an assignment from Realdolmen in Belgium.
* Please just don't abuse my work
*/
+function ($) {
'use strict';
// BUTTON PUBLIC CLASS DEFINITION
/... | N00bface/Real-Dolmen-Stage-Opdrachten | stageopdracht/src/main/resources/static/vendors/bootstrap/js/button.js | JavaScript | mit | 3,646 |
'use strict';
module.exports = {
username: process.env.SEQ_USER || 'root',
password: process.env.SEQ_PW || null,
database: process.env.SEQ_DB || 'sequelize_test',
host: process.env.SEQ_HOST || '127.0.0.1',
pool: {
max: process.env.SEQ_POOL_MAX || 5,
idle: process.env.SEQ_POOL_IDLE || 300... | sushantdhiman/sequelize-benchmark | lib/config.js | JavaScript | mit | 2,528 |
import Model, { belongsTo, attr } from '@ember-data/model';
export default class CurriculumInventorySequence extends Model {
@attr('string')
description;
@belongsTo('curriculum-inventory-report', { async: true })
report;
}
| ilios/common | addon/models/curriculum-inventory-sequence.js | JavaScript | mit | 233 |
/**
* React example.
*/
class VideojsWavesurferPlayer extends React.Component {
componentDidMount() {
// instantiate Video.js
this.player = videojs(this.audioNode, this.props, () => {
// print version information at startup
var version_info = 'Using video.js ' + videojs.VE... | collab-project/videojs-wavesurfer | examples/react/index.js | JavaScript | mit | 2,103 |
String.prototype.replaceAt=function(index, character) {
return this.substr(0, index) + character + this.substr(index+character.length);
}
function randomChar(mix) {
var num = parseInt(Math.random() * 36);
if (parseInt(Math.random() * 10) < mix){
num = parseInt(Math.random() * 10);
}
if... | medhacks/SplashPage2k16 | beta/programming/binary.js | JavaScript | mit | 3,758 |
/**
* Created by azu on 2014/09/14.
* LICENSE : MIT
*/
"use strict";
var downloader = require("./lib/downloader");
var FS = require("q-io/fs");
module.exports = function (options) {
var biblioPath = options.dataPath ? options.dataPath : "./specref/biblio.json";
var biblio = require(biblioPath);
var SPECU... | azu/webspec-downloader | index.js | JavaScript | mit | 905 |
// below is countdown
// set the date we're counting down to
var target_date = new Date("Nov 28, 2014").getTime();
// set initial date
var initial_date = new Date("Aug 23, 2014").getTime();
var current_date = new Date().getTime();
var time_gone = (current_date - initial_date) / (target_date - initial_date);
// va... | dsmontgomery/houghton | doomsday.js | JavaScript | mit | 2,363 |
"use strict";
/* jshint mocha: true */
const chai = require("chai"),
chaiAsPromised = require("chai-as-promised"),
_ = require("lodash"),
q = require("q"),
dcTest = require("dc-test"),
mockDeckConfig = dcTest.mockDeckConfig,
dcEngine ... | ryb73/dealers-choice-meta | packages/game-states/test/beginning-state.js | JavaScript | mit | 1,387 |
var express = require('express');
var app = express();
app.get('/some/path', function(req, res) {
res.redirect(req.param("target"));
res.header("Location", req.param("target"));
res.header("Content-Type", "text/plain");
foo(res);
});
function foo(arg) {
arg.header("Access-Control-Allow-Credentials", true);
... | github/codeql | javascript/ql/test/library-tests/frameworks/Express/src/express.js | JavaScript | mit | 1,018 |
/*
* extensions/autocomplete_variant_2/autocomplete.js
*
* This file is part of EditableGrid.
* http://editablegrid.net
*
* Copyright (c) 2011 Webismymind SPRL
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://editablegrid.net/license
*/
/**
* Autocomplete cell editor
*
* Text field ed... | PauloLuna/tables | editablegrid/editablegrid-2.0.1/extensions/autocomplete_variant_2/autocomplete.js | JavaScript | mit | 1,774 |
/**
* Root Reducer
*/
import { combineReducers } from 'redux';
// Import Reducers
import app from './modules/App/AppReducer';
import posts from './modules/Main/MainReducer';
import scripts from './modules/Scripts/ScriptsReducer';
import intl from './modules/Intl/IntlReducer';
// Combine all reducers into one root r... | Blaumeiser/dronegames | client/reducers.js | JavaScript | mit | 399 |
(function (App) {
'use strict';
// This is a standalone, self-initializing componenet. This compoenent doesn't needs to be in a data-componenet attr in the DOM.
App.Components['page-scroll'] = function () {
$('body').on('click', 'a', function (e) {
var isHash = $(this).attr('href').inde... | mromanoff/eq-maps | public/js/app/components/page-scroll.js | JavaScript | mit | 813 |
import React, { PropTypes, Component } from 'react';
import VehicleTypes from '../../db/constants/vehicleTypes';
import { initTabs } from '../App/style/js/scripts';
import { map, values, includes } from 'lodash';
class VehiclePage extends Component {
static propTypes = {
vehicles: PropTypes.arrayOf(PropTypes.sha... | andmilj/vip-transfers | src/components/VehiclePage/VehiclePage.react.js | JavaScript | mit | 3,815 |
const store = require('./store')
const oneMonth = 30 * 24 * 3600 * 1000
let ttl = 2 * oneMonth
const storePutOptions = {}
module.exports = {
init: server => {
if (server.options.ttl != null) ttl = server.options.ttl
storePutOptions.ttl = ttl
console.log('using prerender-level-cache', storePutOptions)
}... | maxlath/prerender-level-cache | lib/levelCache.js | JavaScript | mit | 1,364 |
// ax5.ui.grid.scroller
(function () {
const GRID = ax5.ui.grid;
const U = ax5.util;
const convertScrollPosition = {
"vertical": function (css, _var) {
let _content_height = _var._content_height - _var._panel_height,
_scroller_height = _var._vertical_scroller_height - ... | ajou100/ax5ui-kernel | src/ax5ui-grid/src/modules/ax5grid-scroller.js | JavaScript | mit | 23,283 |
const path = require('path');
const resolve = {
alias: {
"scss": path.resolve(__dirname, '../src/stylesheets/'),
"js": path.resolve(__dirname, '../src/modules/'),
"pugs" : path.resolve(__dirname , '../src/pugs/')
},
extensions: ['.js', '.css', '.scss', '.pug', '.png' ],
modules:... | MuhammedYousrii/Bianky-Emmiter | config/webpack.resolver.js | JavaScript | mit | 474 |
/**
* @fileoverview
* @enhanceable
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
goog.provide('proto.boosted_trees.QuantileStreamState');
goog.require('jspb.Message');
goog.require('jspb.BinaryReader');
goog.require('jspb.BinaryWriter');
goog.require('proto.boosted_trees.QuantileSummaryState');
/**
* Generate... | nubbel/swift-tensorflow | NodeGenerated/quantilestreamstate.js | JavaScript | mit | 6,110 |
var joy = function () {
var curtid = 0;
var mergeprop = '$merge$';
function invoke(evts, arg, ignoreNull) {
if (!evts) {
return true;
}
var t = typeof (evts);
if (t == 'function') {
return evts(arg);
}
else if (evts instanceof Array) {... | mind0n/hive | Product/Server/HostNode/Joy/Joy.Service/Js/joy.js | JavaScript | mit | 4,089 |
(function (win, doc, $){
window.setUnifiedSwitch = function () {
var data = {
elements: {
'switch': 'switch',
'control': 'switch-control',
'label': 'label',
'input': 'input:checkbox'
},
states: {
'ready': '__switch--ready',
'focus': '__switch--focus',
'active': '__switch--active'... | toolbarthomas/tipi.component.form.unified-switch | tipi.component.form.unified-switch.js | JavaScript | mit | 5,513 |
Template.cmBackup_BackupList.events({
/**
*
*/
'click .create-backup': function(e, tmpl) {
Meteor.call('exportAllCollections', function(err, res) {
if (err) {
console.error(err);
}
else {
console.log(res);
}
});
},
'change .upload-backup': function(e,... | conceptmate/meteor-backup | api/client/ui/backup-list.js | JavaScript | mit | 542 |
import store from '../store/index'
const setTitle = (title) => {
store.commit('setMetaTitle', title);
document.title = title + ' - ' + window.Admin.Title;
}
const getConfigs = (to, from, next) => {
let vm = store._vm;
let models = store.state.models;
if (Object.keys(models).indexOf(to.params.mode... | ScoLib/admin | resources/assets/mixins/get-config.js | JavaScript | mit | 1,435 |
import React from 'react';
import { shallow } from 'enzyme';
import { stub } from 'sinon';
import RemoveComponent from '../src/components/RemoveComponent';
describe('Test <RemoveComponent/>', () => {
let minProps, onRemoveStub;
beforeAll(() => {
onRemoveStub = stub();
minProps = {
onRemove: onRemove... | prakhar1989/react-tags | __tests__/RemoveComponent.test.js | JavaScript | mit | 639 |
'use strict';
const generateRuleTests = require('../../../helpers/rule-test-harness');
const message = require('../../../../lib/rules/deprecations/deprecated-render-helper').message;
generateRuleTests({
name: 'deprecated-render-helper',
config: true,
good: [
'{{valid-compoennt}}',
'{{input placeholde... | rwjblue/ember-template-lint | test/unit/rules/deprecations/deprecated-render-helper-test.js | JavaScript | mit | 1,160 |
function CreateList() {
this.oWrap = document.createElement("div");
this.oTitle = document.createElement("div");
this.copyright = document.createElement("div");
this.initialize.apply(this, arguments);
this.click.call(this)
}
CreateList.prototype = {
initialize: function(aData) {
var oDl,... | pandoraui/learning-javascript | CreateList.js | JavaScript | mit | 4,522 |
const DrawCard = require('../../drawcard.js');
const AbilityDsl = require('../../abilitydsl');
const { Locations, Durations, Phases, Players } = require('../../Constants');
class TradingOnTheSandRoad extends DrawCard {
setupCardAbilities() {
this.interrupt({
title: 'Take top 4 cards from both p... | jeremylarner/ringteki | server/game/cards/07-WotW/TradingOnTheSandRoad.js | JavaScript | mit | 3,165 |
'use strict';
/* global byId, mongoose, Schema */
let Subject;
let schema = new Schema({
name: String,
}, {
collection: 'subject',
});
let byName = {name: 1};
schema.index(byName);
let S = schema.statics;
let Id = require('mongoose-hook-custom-id');
// {
// items: [{name: String}],
// create: Boolean
// ... | tarquas/tntu-schedcap | app/model/subject.js | JavaScript | mit | 1,249 |
/* ***** ----------------------------------------------- ***** **
/* ***** RSS Date Filter
/* ***** ----------------------------------------------- ***** */
const { DateTime } = require('luxon');
module.exports = dateObj => {
return DateTime.fromJSDate(dateObj).toISO();
}
| bymattlee/bymattlee-web-starter-files | eleventy/filters/rssDate.js | JavaScript | mit | 277 |
export const ic_backpack_outline = {"viewBox":"0 0 24 24","children":[{"name":"g","attribs":{},"children":[{"name":"path","attribs":{"d":"M17,4.14V2h-3v2h-4V2H7v2.14C5.28,4.59,4,6.14,4,8v12c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V8C20,6.14,18.72,4.59,17,4.14z M18,20H6V8c0-1.1,0.9-2,2-2h8c1.1,0,2,0.9,2,2V20z M16.5,12v4h-2v-2... | wmira/react-icons-kit | src/md/ic_backpack_outline.js | JavaScript | mit | 751 |
import * as maptalks from 'maptalks';
import simpleheat from 'simpleheat';
const options = {
'max' : 1,
'gradient' : {
0.4: 'blue',
0.6: 'cyan',
0.7: 'lime',
0.8: 'yellow',
1.0: 'red'
},
'radius' : 25,
'blur' : 15,
'heatValueScale': 1,
'minOpacity' : ... | maptalks/maptalks.heatmap | index.js | JavaScript | mit | 7,384 |
import Controller from '@ember/controller';
import { set } from '@ember/object';
export default Controller.extend({
rows: null,
isLoading: true,
init() {
this._super(...arguments);
set(this, 'rows', []);
},
actions: {
fetchData() {
setTimeout(() => {
if (this.isDestroying) {
... | sir-dunxalot/ember-tooltips | tests/dummy/app/controllers/update-for-reposition.js | JavaScript | mit | 790 |
//
// Free Code Camp
// 8. Algorithms 2 (Intermediate)
//
// Created by Dulio Denis on 9/29/15.
// Copyright (c) 2015 ddApps. All rights reserved.
// ------------------------------------------------
// Bonfire: Search and Replace
// http://freecodecamp.com/challenges/bonfire-search-and-replace
//
// Perform a s... | duliodenis/freecodecamp | 08-Algorithms-2/app5.js | JavaScript | mit | 1,801 |
import { createStore, applyMiddleware } from 'redux';
import promise from 'redux-promise';
import { composeWithDevTools } from 'redux-devtools-extension';
import reducers from './reducers'
const store = createStore(reducers, composeWithDevTools(
applyMiddleware(promise),
// other store enhancers if any
));
export... | tuncatunc/react-blog | src/store.js | JavaScript | mit | 335 |
$(function(){
$("#snap img").on('load', function() {
$("#snap img").attr("data-loading","false");
console.log('snap img load');
})
$("#snap img").on('error', function() {
$("#snap img").attr("data-loading","false");
console.log('snap img error');
})
$("#snap img").attr("data-loading","false");... | sensei-software/sensei-ui | qb8/video.js | JavaScript | mit | 650 |
/**
* Default model configuration
* (sails.config.models)
*
* Unless you override them, the following properties will be included
* in each of your models.
*
* For more info on Sails models, see:
* http://sailsjs.org/#!/documentation/concepts/ORM
*/
module.exports.models = {
/******************************... | VitorDeng/simpleServer | config/models.js | JavaScript | mit | 1,451 |
'use strict';
const _ = require('lodash');
const PrettyStream = require('bunyan-prettystream');
module.exports = function createStream(options) {
const stream = new PrettyStream();
stream.pipe(process.stderr);
return _.defaults({
type: 'raw',
stream: stream
}, options);
};
| peterkuma/bunyan-streams-config | lib/log-console-pretty.js | JavaScript | mit | 292 |
define('progressBar', ['app'], function(app) {
app.directive('progressBar', [function() {
return {
restrict: 'E',
scope: {
min: '@',
max: '@',
now: '@',
vertical: '@',
animate: '@',
type: '@',
color: '@',
size: '@',
striped: '@'
... | Podou/admin | app/framework/directive/progressBar.js | JavaScript | mit | 1,645 |
const { createServer } = require('http')
const { keepAliveTimeout } = require('./config')
const terminus = require('@godaddy/terminus')
const uncaughtException = (err) => {
console.error('Uncaught exception:', err)
}
const unhandledRejection = (reason, p) => {
console.error(
'Unhandled Rejection:', p,
'Re... | lanetix/node-lanetix-microservice | create-server.js | JavaScript | mit | 1,993 |
/**
* @author Hana Lee
* @since 2016-04-22 15:57
*/
'use strict';
var Sqlite3 = require('sqlite3').verbose();
var db = new Sqlite3.Database('translate-chat.db');
var debug = require('debug')('node-translate-chat:sqlite3');
var QUERIES = {};
QUERIES.CREATE_USERS =
'CREATE TABLE IF NOT EXISTS Users(' +
'user_id... | Hana-Lee/node-translate-chat | libs/sqlite3.js | JavaScript | mit | 11,047 |
for (foo = 1; bar >= foo; foo++) {
// 1
}
| dogescript/dogescript | test/language-spec/operators/biggerish/control/much/expect.js | JavaScript | mit | 46 |
/* @flow */
import type Client from '../Client';
import type { Hash160Like } from '../types';
import { type SmartContractABI } from './SmartContractABI';
import SmartContractInstance from './SmartContractInstance';
import converters from '../converters';
type SmartContractOptions = {|
abi: SmartContractABI,
clien... | neotracker/neo-blockchain | packages/neo-blockchain-client/src/sc/SmartContract.js | JavaScript | mit | 782 |
/* Copyright (C) 2014 Newcastle University
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
/**
* Check media access
*/
function checkServerCode(req,res,cb)
{
if (req.param('servertoken'))
{
//has a server token
User.findOne... | digitalinteraction/bootlegger-server | api/policies/checkmedia.js | JavaScript | mit | 2,063 |
function fillBuildingsSelect() {
var select = document.getElementById('building-options');
$(select).empty();
return Promise.resolve(getBuildings()).then(
function(result) {
result.buildings.forEach(function(building) {
var street = window._global.streets.filter(function(... | soberdeer/innomaps_plugin | src/js/select-building.js | JavaScript | mit | 1,747 |
/**
* option
*/
'use strict'
const db = require('./db').db
//create self increament id
exports.createDigitId = function* () {
let obj = yield db.collection('meta').findOneAndUpdate({
_id: '_digitId'
}, {
$inc: {
value: 1
}
}, {
returnOriginal: false
})
return Promise.resolve(obj.value.value)
} | jade-press/jade-press | lib/meta.js | JavaScript | mit | 317 |
const createContext = require('../')
const ctx = createContext()
const baboon = require('baboon-image')
const baboonTex = ctx.texture2D({
data: baboon.data,
width: baboon.shape[0],
height: baboon.shape[1],
flipY: true
})
const quadPositions = [[-1, -1], [1, -1], [1, 1], [-1, 1]]
const quadTexCoords = [[0, 0]... | variablestudio/pex-context | examples/color-mask.js | JavaScript | mit | 2,313 |
angular.module('lcboApp.controllers')
.controller('IntroCtrl', ['$scope', '$rootScope', 'localStorageService',
function($scope, $rootScope, localStorageService) {
/**
* Controller init logic
*/
$scope.init = function() {
console.log('hello world');
}
... | neilff/liqbo-cordova | www/js/controllers/intro.ctrl.js | JavaScript | mit | 351 |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.8/esri/copyright.txt for details.
//>>built
define(["require","exports"],function(g,c){function f(c){var d={},b;for(b in c)if("declaredClass"!==b){var a=c[b];if(null!=a&&"function"!==typeof a)if(Array.isArray... | ycabon/presentations | 2018-user-conference/arcgis-js-api-road-ahead/demos/gamepad/api-snapshot/esri/tasks/operations/urlUtils.js | JavaScript | mit | 520 |
'use strict';
var _ = require('busyman'),
helper = require('../helper');
module.exports = function (netcore, qnode, attrs) {
var permAddr = helper.buildPermAddr(qnode.mac, qnode.clientId);
if (attrs.ip) {
netcore.commitDevNetChanging(permAddr, {
address: {
dynamic: att... | freebirdjs/freebird-netcore-mqtt | lib/handlers/devUpdateHdlr.js | JavaScript | mit | 505 |
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkID=397704
// To debug code on page load in Ripple or on Android devices/emulators: launch your app, set breakpoints,
// and then run "window.location.reload()" in the JavaScript Console.
(function () ... | miguelvasp/cordova-samples | weather-app/WeatherApp/www/scripts/index.js | JavaScript | mit | 1,087 |
'use strict';
define(
"igbtoolbox/igb/ping-ui",
[
'igbtoolbox/flightjs/define',
'igbtoolbox/igb/ping-events',
'igbtoolbox/flightjs/logging-mixin'
],
function(defineComponent, pingEvents, withLogging) {
return defineComponent([withLogging],
{
attributes: {
pingLabelEnabled: 'Auto-Up... | igbtoolbox/eveigb | web/js/igbtoolbox/igb/ping-ui.js | JavaScript | mit | 1,706 |
/* global RTCMultiConnection */
let connection = new RTCMultiConnection();
// Gets all courses from database and adds them to a list.
let courseList = [];
let elements = document.getElementsByClassName('course');
for (let i = 0; i < elements.length; i++) {
let elementString = String(elements[i]);
let course = elem... | Oysteinkn/syme-project | js/timetable.js | JavaScript | mit | 1,107 |
angular.module('talent')
.controller('LandingController', function($scope) {
})
| Seeker1911/talent | client/landingPage/landingCtrl.js | JavaScript | mit | 81 |
// @flow
import React from 'react';
import {Link} from 'react-router';
import type {State_Filter} from '../reducers/idsByFilterMap_Reducer.js'
const FilterLink = ({filter,children}:{filter:State_Filter,children:React$Element<any>})=>(
<Link
to = {filter === 'all' ? '' :filter}
activeStyle = {{
textDecoratio... | jhegedus42/egghead-redux-playaround | src/components/FilterLink.js | JavaScript | mit | 408 |
(function() {
'use strict';
angular
.module('permitmeApp')
.factory('authExpiredInterceptor', authExpiredInterceptor);
authExpiredInterceptor.$inject = ['$rootScope', '$q', '$injector', '$document'];
function authExpiredInterceptor($rootScope, $q, $injector, $document) {
... | UMKC-Law/permit-matrix | src/main/webapp/app/blocks/interceptor/auth-expired.interceptor.js | JavaScript | mit | 2,605 |
/* jshint undef: true */
/* globals
state,
sendChat,
randomInteger,
_,
on
*/
/* Eclectic collection of fumbles */
var fumble =
[
{low: 1, high: 10, result: "Distracted", effect: "Roll DEX or fall down."},
{low: 11, high: 14, result: "Negligent", effect: "Fall down."},
{low: 15, high: 20, result: "Careles... | mcstalker/roll20-api-scripts | Fumbler/Fumbler.js | JavaScript | mit | 6,374 |
"use strict";
// This helper builds the request body for the v3 mail/send endpoint
// Please see examples/helpers/mail/example.js for an usage example
function ClickTracking(enable, enable_text) {
this.enable = enable
this.enable_text = enable_text
this.setEnable = function(enable){
this.enable = enable
}... | CassF/cassandrafrimpongcv | node_modules/sendgrid/lib/helpers/mail/mail.js | JavaScript | mit | 18,138 |
/*
A simple class for displaying file information and progress
Note: This is a demonstration only and not part of SWFUpload.
Note: Some have had problems adapting this class in IE7. It may not be suitable for your application.
*/
// Constructor
// file is a SWFUpload file object
// targetID is the HTML elem... | edbiler/BazaarCorner | module/emailsystem/static/jscript/fileprogress.js | JavaScript | mit | 7,178 |
const path = require('path');
const fs = require('fs');
const AdmZip = require('adm-zip');
const { mkdir, ls } = require('shelljs');
const tar = require('tar');
const project_root = path.join(__dirname, "..");
const dist_root = path.join(project_root, 'dist');
const build_root = path.join(project_root, 'build');
modu... | znetstar/aria2ui | grunt/zipper.js | JavaScript | mit | 1,631 |
var React = require('react')
var ace = require('brace')
var _ = require('lodash')
require('brace/mode/html')
require('brace/theme/tomorrow')
module.exports = React.createClass({
getInitialState: function() {
return {
width: 200
}
},
componentDidMount: function() {
... | doubleshow/craftml-docs | lib/components/craft-editor.js | JavaScript | mit | 2,656 |
const https = require('https');
const get = url => new Promise(resolve =>
https.get(url, resolve));
const readStream = stream => {
const buffer = [];
return new Promise((resolve, reject) => {
stream
.on('error', reject)
.on('data', chunk => {
buffer.push(chunk);
})
.on('end',... | song940/node-dns | client/google.js | JavaScript | mit | 630 |
'use strict';
describe('ngRepeat', function() {
var element, $compile, scope, $exceptionHandler, $compileProvider;
beforeEach(module(function(_$compileProvider_) {
$compileProvider = _$compileProvider_;
}));
beforeEach(module(function($exceptionHandlerProvider) {
$exceptionHandlerProvider.mode('log'... | spencerapplegate/angular.js | test/ng/directive/ngRepeatSpec.js | JavaScript | mit | 28,841 |
var bcrypt = require('bcrypt');
module.exports = {
attributes: {
username: {
type: 'string',
required: true,
unique: true
},
email: {
type: 'email',
required: true,
unique: true
},
first_name: {
type: 'string',
required: true
},
last_name: {
type: 'string'
},
hr: {
col... | mastersoftwaresolutions/hrm-sails | api/models/User.js | JavaScript | mit | 858 |
#!/usr/bin/env node
var program = require('commander');
var xlsx = require('xlsx');
var fs = require('fs');
program
.version('0.3.0')
.usage('<file ...>')
.parse(process.argv);
if (program.args.length < 1) {
console.error('You need to specify a filename.');
process.exit(1);
}
var filename = program.args... | noxan/xlsx2json | bin/xlsx2json.js | JavaScript | mit | 970 |
/**
* com_zimbra_dompurify Zimlet
*/
function com_zimbra_dompurify_handler () {
/**
* Return the first element named elem starting with root.
* This is a recursive function.
* Returns: undefined if cannot locate.
*/
var findElement = function (root, elem) {
var val = undefined;
... | gordyt/com_zimbra_dompurify | com_zimbra_dompurify.js | JavaScript | mit | 2,428 |
'use strict';
import fs from 'fs';
fs.readdirSync('./gulp/tasks/').forEach((task) => require('./tasks/' + task)); | fellswoop/react-project-template | gulp/index.js | JavaScript | mit | 115 |
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(ex... | stil4m/elm-analyse | dist/app/editor/editor.js | JavaScript | mit | 2,209 |
import React from 'react'
import {Tabs, Tab} from 'material-ui/Tabs';
const styles = {
nav: {
marginBottom: '20px'
},
tabs: {
background: 'transparent',
borderBottom: '1px solid #666'
},
tab: {
color: 'white',
fontWeight: '500',
textTransform: 'none'
}
}
class MmrNav extends React.... | byronsha/open_dota | src/components/mmr/MmrNav.js | JavaScript | mit | 935 |
/**
* @author Eugene Maslovich <ehpc@em42.ru>
*/
module.exports = function (grunt) {
// Настраиваем grunt
grunt.initConfig({
// Настройки отладочного сервера
express: {
options: {
delay: 1000
},
dev: {
options: {
script: 'bin/server-debug',
opts: ['--debug']
}
}
},
// Нас... | ehpc/fispatch | Gruntfile.js | JavaScript | mit | 3,204 |
// SearchBar.js
(function() {
'use strict';
var React = require('react');
var SearchBar = React.createClass({
handleChange: function() {
this.props.onUserInput(
this.refs.nameInput.value,
this.refs.inStockOnlyInput.checked
);
},
handleSelectJa: function() {
this.props.onUserSelect('ja... | ohtomi/reactjs-karma-gulp | src/main/js/component/SearchBar.js | JavaScript | mit | 1,042 |
/**
* Module dependencies.
*/
var express = require('express');
var popularNames = require('./routes/popularNames');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set(... | davidbkemp/namecloud | src/app/app.js | JavaScript | mit | 893 |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styles from '../../build/styles';
export default class Label extends Component {
static propTypes = {
children: PropTypes.any,
className: PropTypes.string,
};
static defaultProps = {
className: '',
};
createCla... | bokuweb/re-bulma | src/elements/label.js | JavaScript | mit | 570 |
// ===================================
// MONMIN
// this is NOT a middleware
// ===================================
'use strict';
// Node defaults
const fs = require('fs'),
path = require('path'),
cp = require('child_process');
// Installed
const uglify = require('uglify-js'),
sass = require('node... | andrao/monmin | lib/convert.js | JavaScript | mit | 21,627 |
/**
* Module dependencies.
*/
var fs = require('fs');
var config = require('config');
var express = require('express');
/**
* Expose
*/
module.exports = function (app) {
// Bootstrap controllers-routes/api
// page.js transforms => to /page
// page-form.js transforms => to /page/form
fs.readdirSync(conf... | jekamoroz/node-api-express-sequelize | config/routes.js | JavaScript | mit | 1,028 |
'use strict';
var _ = require('lodash');
var async = require('async');
var helpers = require('../helpers');
exports.index = function(req, res, next) {
res.render('people/index', { title: 'person home' });
};
| karlcarlo/MEEN | app/controllers/people_controller.js | JavaScript | mit | 214 |
/*获取dom结点*/
var maskWrapper=document.getElementById("mask-wrapper"),
closeButton=document.getElementById("close-button"),
// determineButton=document.getElementById("determine-button"),
// cancelButton=document.getElementById("cancel-button"),
mask=document.getElementById("mask"),
login=document.get... | Hjingjing/task-exercises-of-ife | task_3_37/index.js | JavaScript | mit | 790 |
const
pkg = require('./package.json'),
program = require('commander'),
express = require('express'),
log = require('winston'),
path = require('path'),
address = require('network-address');
// Initialise logging.
require('./Logging').init();
// Fetch program parameters:
program
.version(pk... | Cygnut/hookshot-server | app.js | JavaScript | mit | 1,970 |
// All code points in the Myanmar Extended-A block as per Unicode v10.0.0:
[
0xAA60,
0xAA61,
0xAA62,
0xAA63,
0xAA64,
0xAA65,
0xAA66,
0xAA67,
0xAA68,
0xAA69,
0xAA6A,
0xAA6B,
0xAA6C,
0xAA6D,
0xAA6E,
0xAA6F,
0xAA70,
0xAA71,
0xAA72,
0xAA73,
0xAA74,
0xAA75,
0xAA76,
0xAA77,
0xAA78,
0xAA79,
0xAA7A,
... | mathiasbynens/unicode-data | 10.0.0/blocks/Myanmar-Extended-A-code-points.js | JavaScript | mit | 366 |
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("React"), require("_"));
else if(typeof define === 'function' && define.amd)
define(["React", "_"], factory);
else if(typeof exports === 'object')
exports["... | Sipree/Griddle | build/griddle.js | JavaScript | mit | 94,233 |
//
// httpproxy module example
//
require.paths.unshift('lib');
var httpproxy = require('httpproxy').proxy;
var proxies = [];
for (var port=4000; port<4010; port++) {
proxies.push(
new httpproxy({
host : '127.0.0.1',
port : port
})
);
}
proxies.map(function(p) {
p.start();
});
| michiel/httpproxy-js | proxies-example.js | JavaScript | mit | 319 |
/*=============================================
Tianhai Information Technology 2013-2018
-----------------------------------------------
Tianhai Information Technology
http://tianhai.info/
Soha Jin
https://sohaj.in/
=============================================*/
const magnetUri=require('magnet-uri');
let javbus=req... | sohaking/telegram-happypartybot | module/command/busdetail.js | JavaScript | mit | 2,356 |
/**
* Created by Cam on 14-2-6.
*/
var syBookshelf = require('./base'),
ClientVersion, ClientVersions;
ClientVersion = module.exports = syBookshelf.Model.extend({
tableName: 'client_versions',
fields: [
'id', 'versioncode', 'versionname', 'description', 'comment', 'posttime'
],
defaults: function () {
retur... | node-fun/siyuan | models/clientVersion.js | JavaScript | mit | 455 |
'use strict';
const expect = require('chai').expect;
const optionsHash = require('../../lib/options-hash');
const VALID_HASH = /^[a-z0-9]{32}$/;
const PLUGIN_A_PATH = __dirname + '/../fixtures/plugin-a/';
const PLUGIN_B_PATH = __dirname + '/../fixtures/plugin-ab';
describe('optionsHash', function() {
const warnWas... | babel/broccoli-babel-transpiler | tests/utils/options-hash.js | JavaScript | mit | 11,054 |
/**
* AuthController
*
*/
var passport = require('passport');
module.exports = {
login: function(req, res) {
if (req.allParams().rdr) {
req.session.rdr = req.allParams().rdr;
}
res.view();
},
modalLogin: function(req, res) {
if (req.allParams().rdr) {
req.session.rdr = req.allPara... | datacamp/rdocumentation-app | api/controllers/AuthController.js | JavaScript | mit | 1,854 |
import React from 'react';
import ReactDOM from 'react-dom';
//import './index.css';
import Client from './Client';
//import * as serviceWorker from './serviceWorker';
ReactDOM.render(<Client />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() ... | bpa/cyborg-rally | src/index.js | JavaScript | mit | 467 |
import React from 'react';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs-isomorphic';
import { SpecTbl } from './Spec';
import { SortableTbl } from '../../Shared/SortableTbl';
import {CustomDownloadTd} from '../../Shared/Shared';
let idCounter = 0;
const generateIds = () => `custom-id-${idCounter++}`;
co... | Grace951/ReactAU | src/shared/components/Products/Details/DetailsTab.js | JavaScript | mit | 1,826 |
//~ name a533
alert(a533);
//~ component a534.js
| homobel/makebird-node | test/projects/large/a533.js | JavaScript | mit | 52 |
import Ember from 'ember';
import EditFormController from 'ember-flexberry/controllers/edit-form';
import { translationMacro as t } from 'ember-i18n';
export default EditFormController.extend({
/**
Text for 'flexberry-lookup' component 'placeholder' property.
@property placeholder
@type String
@defa... | Flexberry/ember-flexberry | tests/dummy/app/controllers/components-acceptance-tests/flexberry-lookup/settings-example.js | JavaScript | mit | 2,338 |
$(document).ready(function(){
module("AfterFinally advices");
test("Testing afterFinally advice with failing method", function() {
expect(3);
function Thing() {}
Thing.prototype.failingMethod = function() {
throw 'Some error';
}
var aspects = jQuery.aop.afterFinally( {target: Thing... | gonzalocasas/jquery-aop | test/test.cases.afterFinally.js | JavaScript | mit | 1,516 |
"enable aexpr";
import AbstractAstNode from './abstract-ast-node.js'
export default class AstNodeLogicalExpression extends AbstractAstNode {
async initialize() {
await super.initialize();
this.windowTitle = "AstNodeLogicalExpression";
}
get operator() { return this.get('#operator'); }
async setN... | LivelyKernel/lively4-core | src/client/pen-editor/components/ast-node-logical-expression.js | JavaScript | mit | 577 |
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('groups-column', 'Integration | Component | groups column', {
integration: true
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle... | atanana/blik-shuffler | tests/integration/components/groups-column-test.js | JavaScript | mit | 660 |
import temp from "temp";
//temp.track();
export default function test() {
this.write = () => {};
this.debug("test");
this.destination(temp.mkdirSync("stimpak-test"));
return this;
}
| FreeAllMedia/stimpak | source/lib/stimpak/stimpak.test.js | JavaScript | mit | 189 |
function Pessoa() {
this.nome = 'Renzo';
}
Pessoa.prototype = {
cumprimentar: function () {
return 'Olá, meu nome é ' + this.nome;
}
};
function Homem() {
this.sexo = 'Masculino';
Pessoa.call(this);
}
var HomemPrototype = new Pessoa();
HomemPrototype.atividade = function () {
return this.nome + ' é d... | renzon/scripts-t4 | aula6/heranca.js | JavaScript | mit | 1,121 |
/**
* Camera handler class fro creating and modifyng cameras in the scene. This includes the
* aeroplane, which is created from a model and added to the environment. Contains all the
* initialisers for each camera, edit methdods, and get methods.
* @name CameraController
* @class CameraController
* @constructor
... | craighep/Dissertation | js/cameraController.js | JavaScript | mit | 9,264 |
var version = require('./build/version'),
setup = require('./build/setup'),
path = require('path'),
connect_livereload = require('connect-livereload');
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTas... | BSick7/sax-xaml | Gruntfile.js | JavaScript | mit | 6,970 |
'use strict';
var winston = require('winston');
var config = require('config');
winston.emitErrs = true;
var logger = new winston.Logger({
transports: [
new winston.transports.Console({
level: config.get('log.level'),
handleExceptions: true,
json: false,
colo... | thanhson1085/angular-admin-seed | server/utils/logger.js | JavaScript | mit | 1,747 |
import { greet } from './index'
describe('app', () => {
it('should work', () => {
greet('1').should.equal('Hello, 1')
})
it('should work 2', () => {
greet('2').should.equal('Hello, 2')
})
})
| borys-ihnatyev/react-redux-express-template | src/front/index.spec.js | JavaScript | mit | 227 |