conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use existing id instead of selector in JS\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n $('#id_degree_programme_options').change(function() {\n console.log('hello');\n if (this.value === 'extra') {\n $('#unknown_de...
javascript
chosen
[ { "from": "system", "value": "Fix issue in ajax call on page refresh\n\nThis closes #25" }, { "from": "human", "value": "/*\n---\n\nname: Request\n\ndescription: Provides a request that allow loading files locally.\n\nlicense: MIT-style license.\n\nauthors:\n\t- Jean-Philippe Dery (jeanphilippe....
javascript
chosen
[ { "from": "system", "value": "Load svgPanZoom at the right time\n" }, { "from": "human", "value": "window.addEventListener('DOMContentLoaded', function() {\n\n var linkedDataGraph = svgPanZoom('#linked-data-graph', {\n zoomEnabled: true,\n controlIconsEnabled: true\n });\n\n});\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Fix process.stdin error when running outside TTY\n" }, { "from": "human", "value": "'use strict'\n\nconst path = require('path')\nconst { log } = require(path.join(__dirname, '..', '..', 'main.config.js'))\n\nconst defaultOpts = {\n viewer: null,\n onKeyPress: nul...
javascript
chosen
[ { "from": "system", "value": "Fix permissions on Aphlict log\n\nSummary: Currently, the Aphlict server created the log file (if it doesn't exist) but then immediately fails with \"Unable to open logfile\". It seems that we don't set the permissions correctly.\n\nTest Plan: Deleted log file and was able to s...
javascript
chosen
[ { "from": "system", "value": "Add fallback to English locale if translation not found\n" }, { "from": "human", "value": "/**\n * returns a localised string\n * @param {String} str\n * @param {String} locale (optional)\n */\nfunction _t() {\n\tvar args = _t.arguments;\n\tvar str = args[0] ? args[...
javascript
chosen
[ { "from": "system", "value": "[ReactNative] Remove padding restriction on images\n\nSummary:\n@public\nPadding actually works fine on images.\n\nTest Plan: Nested text inside an image is properly positioned with padding on the image.\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015-...
javascript
chosen
[ { "from": "system", "value": "Connect to local instance and look for signin button\n" }, { "from": "human", "value": "/* eslint max-len: [\"error\", 100 ] */\n/* global describe, beforeEach, afterEach, it, expect */\n'use strict';\n\ndescribe('Selenium Tutorial', function() {\n\n var selenium...
javascript
chosen
[ { "from": "system", "value": "Change instantiate AudioContext timing, and add a argument frequency in init function\n" }, { "from": "human", "value": "(function (window) {\n\t'use strict';\n\n\tvar HearingTest = Object.create(null);\n\n\tHearingTest.init = function init() {\n\t\tthis.context = n...
javascript
chosen
[ { "from": "system", "value": "Initialize post list when showing post list page\n" }, { "from": "human", "value": "$(function() {\n var api_uri = 'http://amateras.wsd.kutc.kansai-u.ac.jp/~otsuka/michishiki_api_server/select.py?order_by=created_at&order=descend';\n $.getJSON(api_uri, functio...
javascript
chosen
[ { "from": "system", "value": "Include mandatory constraints generation test\n" }, { "from": "human", "value": "// internal config tests\nrequire('./camera-resolution');\nrequire('./camera-fps');\nrequire('./camera-combo');\nrequire('./camera-noaudio');\nrequire('./camera-targets');\n\n// constra...
javascript
chosen
[ { "from": "system", "value": "Update done() call to run().\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n var cli = require('casper').create().cli;\n var parapsych = require(cli.raw.get('rootdir') + '/dist/parapsych').create(require);\n\n parapsych.set('cli', cli)\n ...
javascript
chosen
[ { "from": "system", "value": "Enable or disable an inline in accordance with the type of article\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n var $id_type = $('[id$=type]');\n\n $id_type.each(function() {\n if($(this).val() == 'p'){\n $('[id$=per...
javascript
chosen
[ { "from": "system", "value": "Move static asset middleware up a few notches" }, { "from": "human", "value": "/*eslint-disable */\nvar path = require('path')\nvar express = require('express')\nvar webpack = require('webpack')\nvar config = require('../webpack.dev.config')\nvar app = express()\nva...
javascript
chosen
[ { "from": "system", "value": "Fix a bug that cause redirection to login page failed at the second time\n" }, { "from": "human", "value": "import accountsModule from '../resources/accounts';\n/**\n * 每次切换页面时判断是否需要登录,如果需要就跳转到登录页\n * @param {Object} $rootScope\n */\nfunction LoginInterceptor($rootS...
javascript
chosen
[ { "from": "system", "value": "Use mock registry route if using mocks, even in dev\n" }, { "from": "human", "value": "var\n config = require('./config'),\n mocks = require('./routes/mocks'),\n help = require('./lib/routeHelpMessage'),\n components = require('./routes/components...
javascript
chosen
[ { "from": "system", "value": "Fix route for the api's hook\n" }, { "from": "human", "value": "var httpProxy = require('http-proxy');\nvar http = require('http');\n\nvar proxy = httpProxy.createProxy();\n\nvar routes = {\n // Router\n 'hook.labeli.org' : 'http://localhost:9000',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix delete confirmation in queue and history\n" }, { "from": "human", "value": "/* global angular */\n'use strict';\n\nangular.module('storm.controllers')\n\n.controller('LocalRowListCtrl', ['$scope', '$state', '$stateParams', '$injector', 'Navigation', function($sc...
javascript
chosen
[ { "from": "system", "value": "Fix popup updates when url changes\n\nProblem: when the article changes url once (medium.com), popup is not\nable to report article status immediately.\n\nCause: the issue was caused by entities reducer to update only one\narticle (in non-deterministic fashion).\n\nSolution: th...
javascript
chosen
[ { "from": "system", "value": "Use watch to watch the directory for changes to the less files\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(grunt)\n{\n grunt.loadNpmTasks('grunt-contrib-less');\n\n // load all grunt tasks\n grunt.initConfig({\n less: {\n ...
javascript
chosen
[ { "from": "system", "value": "Use this to set PORT both locally and on Heroku: app.listen(process.env.PORT || PORT)\n" }, { "from": "human", "value": "/**********\n\nhttp://expressjs.com/en/api.html\n\n************/\n\nvar express = require('express')\nvar app = express()\nvar PORT = 3000\nvar r...
javascript
chosen
[ { "from": "system", "value": "Use BIND instead of PORT.\n\n(It’s deployed with Unix domain sockets.)\n" }, { "from": "human", "value": "'use strict';\n\nvar app = require('./application');\n\nvar server = app.listen(\n\tprocess.env.PORT || 3000,\n\tprocess.env.HOST || '::1'\n);\n\nprocess.once('...
javascript
chosen
[ { "from": "system", "value": "Fix bad function argument name\n" }, { "from": "human", "value": "var util = require(__dirname+'/../util.js');\nvar schema = require(__dirname+'/../schema.js');\n\nfunction TypeAny() {\n this._default = undefined;\n this._validator = undefined;\n this._optio...
javascript
chosen
[ { "from": "system", "value": "Fix typo in server form.\n" }, { "from": "human", "value": "import bridge from '../common/bridge';\nimport React from 'react';\n\nexport default class ServerForm extends React.Component {\n render() {\n return (\n <form onSubmit={this.connect.bind(this)}>\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Fix broken funnel\"\"\n" }, { "from": "human", "value": "/**\n * Dummy implementation of analytics.\n */\n\"use strict\";\n\nplugin.consumes = [];\nplugin.provides = [\"analytics\"];\n\nmodule.exports = plugin;\n\nfunction plugin(options, imports, ...
javascript
chosen
[ { "from": "system", "value": "Make TPC check work on chrome again\n" }, { "from": "human", "value": "// buffer-tpc-check.js\n// (c) 2013 Sunil Sadasivan\n// Check if third party cookies are disabled\n//\n\n;(function () {\n\n\n ;(function check() {\n //if the 3rd party cookies check...
javascript
chosen
[ { "from": "system", "value": "Add isVisible to shortcuts overlay and extracted `props=this.props`." }, { "from": "human", "value": "/** @jsx React.DOM */\nvar NavigationBar = require('../navigation-bar/component');\nvar EditorAndRunner = require('../editor-and-runner/component');\nvar KeyboardSh...
javascript
chosen
[ { "from": "system", "value": "Fix version check when your version is later than the one fetched by the last version check job\n" }, { "from": "human", "value": "/**\n Our data model for determining whether there's a new version of Discourse\n\n @class VersionCheck\n @extends Discourse.Model\n...
javascript
chosen
[ { "from": "system", "value": "Add responsive behaviour to table, add search box\n" }, { "from": "human", "value": "$(function() {\n var dt = {sPaginationType: 'full_numbers',\n bAutoWidth:false ,\n aaSorting: [[ 0, 'desc' ]],\n fnDrawCallback: _iconify,\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Convert functional component to class extending PureComponent\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Box } from '../box';\nimport { IconButton } from '../button';\nimport {\n IconArrowLeftMediumO...
javascript
chosen
[ { "from": "system", "value": "Make svgJar a callable method" }, { "from": "human", "value": "import { htmlSafe } from 'ember-string';\nimport makeHelper from 'ember-svg-jar/utils/make-helper';\nimport makeSVG from 'ember-svg-jar/utils/make-svg';\nimport inlineAssets from '../inline-assets';\n\ne...
javascript
chosen
[ { "from": "system", "value": "Use single quotes instead of a double quotes\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar nightwatch = require('../');\n\ngulp.task('default', function() {\n gulp.src('')\n .pipe(nightwatch({\n configFile: 'nightwatch.json'\n }));\...
javascript
chosen
[ { "from": "system", "value": "Declare current user to Sentry only if enabled\n" }, { "from": "human", "value": "import log from 'logger';\nimport User from 'models/user';\nimport Raven from 'raven';\n\nclass Me extends User {\n fetch() {\n this.$api('me.get_me', {}, this.on_user_fetche...
javascript
chosen
[ { "from": "system", "value": "Add parameters for publishing project (as embeddable)\n" }, { "from": "human", "value": "\nvar gulp = require('gulp');\nvar execsyncs = require('gulp-execsyncs');\n\n\ngulp.task('prepare-data', function(cb) {\n execsyncs({\n cmds : [\n './prepare.sh',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix broken locale copying mechanism\n" }, { "from": "human", "value": "const fs = require('fs-extra');\nconst path = require('path');\nconst { createFilePath } = require('gatsby-source-filesystem');\n\nexports.onCreateNode = ({ node, getNode, boundActionCreators }) ...
javascript
chosen
[ { "from": "system", "value": "Check for process without potential to cause a ReferenceError." }, { "from": "human", "value": "'use strict';\nexports.test = function () {\n // Don't get fooled by e.g. browserify environments.\n return process && !process.browser;\n};\n\nexports.install = functi...
javascript
chosen
[ { "from": "system", "value": "Add prop \"spin\" for icon\n" }, { "from": "human", "value": "var React = require('react');\n\nvar Icon = React.createClass({\n propTypes: {\n id: React.PropTypes.string,\n type: React.PropTypes.string,\n className: React.PropTypes.string\n...
javascript
chosen
[ { "from": "system", "value": "Add prop to disable submit\n" }, { "from": "human", "value": "import React, {PropTypes, Component} from 'react';\nimport {View} from 'react-native';\n\nexport default class Form extends Component {\n _listeners = [];\n\n static PropTypes = {\n onSuccess: PropTy...
javascript
chosen
[ { "from": "system", "value": "Change entry for CLI layout\n" }, { "from": "human", "value": "import fs from 'fs';\nimport path from 'path';\nimport { Reader } from 'fstream';\nimport { Pack } from 'tar';\n\n/** pose.save\n * @desc Save a template.\n * @param {Object} opts - Options.\n */\nfuncti...
javascript
chosen
[ { "from": "system", "value": "Use evt.coordinate instead of evt.getCoordinate()\n" }, { "from": "human", "value": "goog.require('ol.Map');\ngoog.require('ol.RendererHint');\ngoog.require('ol.View2D');\ngoog.require('ol.layer.Tile');\ngoog.require('ol.source.TileWMS');\n\n\nvar wmsSource = new ol...
javascript
chosen
[ { "from": "system", "value": "Create response for request and create env var for twilio account.\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar app = express();\n\nrouter.get('/sendSMS', function(req, res, next){\n var number = req.qu...
javascript
chosen
[ { "from": "system", "value": "Remove tree.js from browserify as it is actually imported via npm\n" }, { "from": "human", "value": "var browserify = require('browserify');\nvar rebundler = require(\"rebundler\");\nvar path = require(\"path\");\nvar SpawnStream = require(\"spawn-stream\");\n\nvar ...
javascript
chosen
[ { "from": "system", "value": "Add comments lost by converting to JS\n" }, { "from": "human", "value": "'use babel';\n\n/* eslint-disable no-multi-str, prefer-const, func-names */\nlet linkPaths;\nconst regex = new RegExp('\\\n((?:\\\\w:)?/?\\\n(?:[-\\\\w.]+/)*[-\\\\w.]+)\\\n:(\\\\d+)\\\n(?::(\\\...
javascript
chosen
[ { "from": "system", "value": "Add documentation & basic cache lookup function\n" }, { "from": "human", "value": "/**\n Resource Middleware\n @description main definition of middleware\n @exports @default {function} remoteResourceMiddleware\n**/\n\nconst remoteResourceMiddleware = () => {};\n\...
javascript
chosen
[ { "from": "system", "value": "Connect to Docker before walking.\n" }, { "from": "human", "value": "var walk = require('walk');\nvar request = require('request');\n\nvar logger = require('./logger');\nvar prepare = require('./prepare');\n\n// walk the filesystem from . to find directories that co...
javascript
chosen
[ { "from": "system", "value": "Add static method in order to serve pages on /public\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\ndb = require('../queries');\n\nrouter.get('/api/todos', db.getAllTodos);\nrouter.get('/api/todos/:id', db.get...
javascript
chosen
[ { "from": "system", "value": "Add two function for account panel\n\nadd the ability to get/set user data in database\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar User = require('./../app/models/user');\n\n/* GET users listing. */\nrou...
javascript
chosen
[ { "from": "system", "value": "Set up client app files to be served by the server\n" }, { "from": "human", "value": "var app = require('express')();\nvar bodyParser = require('body-parser');\nvar cors = require('cors');\nvar http = require('http').Server(app);\nvar io = require('socket.io')(http)...
javascript
chosen
[ { "from": "system", "value": "Fix that displays the data sent back by the server\n" }, { "from": "human", "value": "console.log(\"Loaded editor.js\");\nfunction submitData(path){\n\tvar data = editor.getSession().getValue();\n\tconsole.log(\"Got data: \" + data);\n\t$.ajax({\n\t\ttype: \"POST\",...
javascript
chosen
[ { "from": "system", "value": "Set heights after images have loaded" }, { "from": "human", "value": "if (typeof jQuery === 'undefined') {\n throw new Error('The jQuery equal height extension requires jQuery!');\n}\n\njQuery.fn.equalHeight = function() {\n\n\tvar $ = jQuery;\n\tvar that = this;\n...
javascript
chosen
[ { "from": "system", "value": "Make the overlay fix more readable\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2008-2013 The Open Source Geospatial Foundation\n *\n * Published under the BSD license.\n * See https://github.com/geoext/geoext2/blob/master/license.txt for the full\n * tex...
javascript
chosen
[ { "from": "system", "value": "Add default props to PageMarquee.\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport Box from 'grommet/components/Box';\nimport Heading from 'grommet/components/Heading';\nimport defaultHero from '../../../images/bhamc-hero.jpg';\n\...
javascript
chosen
[ { "from": "system", "value": "Update lcov reporter to put data in the same place Travis was expecting it before.\n" }, { "from": "human", "value": "module.exports = function (config) {\n require('./karma.conf.js')(config);\n config.set({\n coverageReporter: {\n reporters: [{\n t...
javascript
chosen
[ { "from": "system", "value": "Add integrate method to the particle\n" }, { "from": "human", "value": "'use strict';\n\nfunction Particle(config) {\n this.position = config.position;\n this.velocity = config.velocity;\n this.acceleration = config.acceleration;\n this.damping = config.damping ...
javascript
chosen
[ { "from": "system", "value": "Make \"children\" an optional prop\n\nFixes #5\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport Truncate from 'react-truncate';\n\nclass ShowMore extends Component {\n static defaultProps = {\n lines: 3,\n ...
javascript
chosen
[ { "from": "system", "value": "Add comment to eslint options\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = {\n extends: [\n 'eslint:recommended',\n 'eslint-config-airbnb-base',\n 'plugin:prettier/recommended',\n ],\n\n env: {\n jest: true,\n },\n\n globals: ...
javascript
chosen
[ { "from": "system", "value": "Fix ESLint config to ignore Ember Data imports RFC rule\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n ecmaVersion: 2018,\n sourceType: 'module',\n ecmaFeatures: { \n legacyDecorato...
javascript
chosen
[ { "from": "system", "value": "Remove bootstrap css from bundling\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst del = require('del');\nconst paths = require('vinyl-paths');\nconst rev = require('gulp-rev');\nconst through = require('through2');\nconst concat = require('g...
javascript
chosen
[ { "from": "system", "value": "Handle exceptions when attempting to open zip file\n" }, { "from": "human", "value": "var q = require(\"q\");\nvar mammoth = require(\"./\");\n\n\nexports.Converter = mammoth.Converter;\nexports.fileInput = fileInput;\n\nfunction fileInput(inputElement, callback) {\...
javascript
chosen
[ { "from": "system", "value": "Remove unused path import in package.json" }, { "from": "human", "value": "import webpack from 'webpack';\nimport path from 'path';\n\nconst APP = __dirname;\n\nexport default {\n context: APP,\n entry: {\n app: './public/app.js'\n },\n output: {\n path: '...
javascript
chosen
[ { "from": "system", "value": "Load SCSS and SVG files\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nvar config = {\n devtool: 'cheap-module-eval-source-map',\n entry: [\n './src/main.js',\n 'webpack-hot-middleware/client'...
javascript
chosen
[ { "from": "system", "value": "Work around slack message limits" }, { "from": "human", "value": "'use strict';\n\nvar\n bole = require('bole'),\n restify = require('restify')\n ;\n\nvar slackClient;\nvar logger = bole('slack');\n\nexports.createClient = function createClient(opts)\n{\...
javascript
chosen
[ { "from": "system", "value": "Clone array for aliases and loaders\n" }, { "from": "human", "value": "import extend from 'extend'\nimport rump from 'rump'\nimport webpack from './webpack'\nimport {aliases, loaders, glob} from './file'\n\nconst dropConsoleKey = 'drop_console',\n dropDebuggerK...
javascript
chosen
[ { "from": "system", "value": "Deploy the `next` branch of frontpage too\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/* eslint-disable no-console */\n\nconst fetch = require('node-fetch');\nconst { execSync } = require('child_process');\n\nconst { FRONTPAGE_WEBHOOK } = process.env;\n\...
javascript
chosen
[ { "from": "system", "value": "Raise error for unexpected CSS entrypoints\n" }, { "from": "human", "value": "module.exports = {\n plugins: [\n [\n \"@fullhuman/postcss-purgecss\",\n {\n contentFunction: (src) => {\n if (src.endsWith(\"src/popup/index.scss\")) {\n ...
javascript
chosen
[ { "from": "system", "value": "Create function for displaying success messages\n" }, { "from": "human", "value": "/**\r\n * Created by nkmathew on 23/06/2016.\r\n */\r\n\r\n// Spinjs options for a big spinner\r\nvar BIG_SPINNER = {\r\n lines: 13,\r\n length: 33,\r\n width: 14,\r\n rad...
javascript
chosen
[ { "from": "system", "value": "Update to new BBVA html\n" }, { "from": "human", "value": "/* configure jshint globals */\n/* globals numeral */\n(function ($) {\n 'use strict';\n\n // Set langauge for Numeral library.\n numeral.language('es');\n\n var $center = $('center');\n\n var...
javascript
chosen
[ { "from": "system", "value": "Use firefox for local testing, as it works best for me with webdriver.\n" }, { "from": "human", "value": "var SeSauce = require('./selenium-sauce');\nvar git = require('git-rev');\n\nvar remote = require('./remote');\nvar config = require('./config');\nvar eachBrows...
javascript
chosen
[ { "from": "system", "value": "Add asynchronous handler for common test tasks\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash');\nvar path = require('path');\n\n// Build a path relative to `test/`\nexports.buildPath = function() {\n var args = _.slice(arguments, 0...
javascript
chosen
[ { "from": "system", "value": "Create line break for icons.\n" }, { "from": "human", "value": "import React from 'react';\nimport icons from '../weather_icons/WeatherIcons';\n\nconst SevenHour = ({ hourlyForecast }) => {\n if (!hourlyForecast) {\n return null;\n }\n\n const sevenHourForecas...
javascript
chosen
[ { "from": "system", "value": "Support attaching data to an error object\n" }, { "from": "human", "value": "/* @flow */\n\nexport default class EnhancedError extends Error {\n\tcode: string;\n\n\tconstructor(message: string, code: string) {\n\t\tsuper(message);\n\n\t\tthis.name = this.constructor...
javascript
chosen
[ { "from": "system", "value": "feat(router): Add a precommit extension point to the pipeline" }, { "from": "human", "value": "import {Container} from 'aurelia-dependency-injection';\nimport {Pipeline} from './pipeline';\nimport {BuildNavigationPlanStep} from './navigation-plan';\nimport {ApplyMod...
javascript
chosen
[ { "from": "system", "value": "Throw error if using getToken() outside cordova\n" }, { "from": "human", "value": "import axios from '@/services/axios'\nimport authUser from '@/services/api/authUser'\n\nlet KEY, updateToken, clearToken\n\nif (CORDOVA) {\n const { localStorage } = window\n\n KEY ...
javascript
chosen
[ { "from": "system", "value": "Add cache logic to get script utility.\n" }, { "from": "human", "value": "import fs from 'fs';\nimport path from 'path';\nimport yaml from 'js-yaml';\n\nconst travisCommands = [\n // Reference: http://docs.travis-ci.com/user/customizing-the-build/#The-Build-Lifecyc...
javascript
chosen
[ { "from": "system", "value": "Fix header alignment and silliness\n" }, { "from": "human", "value": "import React from 'react';\n\nimport Paper from 'material-ui/lib/paper';\n\nimport { sideMargin, pageWidth } from 'data/layout';\n\nexport default () => (\n <div>\n <Paper rounded={false} zDep...
javascript
chosen
[ { "from": "system", "value": "Copy reference handling methods to collection as well\n" }, { "from": "human", "value": "VIE.prototype.Collection = Backbone.Collection.extend({\n model: VIE.prototype.Entity,\n\n get: function(id) {\n if (!this.models.length) {\n return null...
javascript
chosen
[ { "from": "system", "value": "Replace as-sys's RegExp escaping with externally provided one.\n" }, { "from": "human", "value": "/** SolrJsX library - a neXt Solr queries JavaScript library.\n * Added ability to give pattern to text/facet/range values.\n *\n * Author: Ivan Georgiev\n * Copyri...
javascript
chosen
[ { "from": "system", "value": "Reset genfors admin password in afterEach\n" }, { "from": "human", "value": "jest.mock('../../models/meeting');\njest.mock('../../utils');\nconst { emit, broadcast } = require('../../utils');\nconst { createGenfors } = require('../../models/meeting');\nconst { gener...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fixes failed to find module in react-native 0.36.0\"\n" }, { "from": "human", "value": "var React = require('react');\nimport { ReactNativePropRegistry } from 'react-native';\nvar _ = require('lodash');\n\nmodule.exports = function(incomingProps, defaultPro...
javascript
chosen
[ { "from": "system", "value": "Refactor and complement yeoman.test.createGenerator tests\n" }, { "from": "human", "value": "/*global it, describe, before, beforeEach */\n\nvar util = require('util');\nvar assert = require('assert');\nvar generators = require('..');\nvar helpers = require('../').t...
javascript
chosen
[ { "from": "system", "value": "Add test for invalid series in `episodesByAirDate`\n" }, { "from": "human", "value": "'use strict';\n\nconst TVDB = require('..');\nconst API_KEY = process.env.TVDB_KEY;\n\nconst chai = require('chai');\nconst chaiAsPromised = require('chai-as-promised');\nconst exp...
javascript
chosen
[ { "from": "system", "value": "Add a test case for robots.txt\n" }, { "from": "human", "value": "'use strict';\n\n\n// mocha defines to avoid JSHint breakage\n/* global describe, it, before, beforeEach, after, afterEach */\n\n\nvar preq = require('preq');\nvar assert = require('../../utils/asse...
javascript
chosen
[ { "from": "system", "value": "Remove the apikey=\"\" stuff from the unit tests.\n" }, { "from": "human", "value": "// Helper functions used to test endpoints that are protected by authentication.\n\nexports.APIKEY_ADMIN = process.env.ADMIN_APIKEY || '12345';\n\nexports.AUTH_ADMIN = 'deconst apik...
javascript
chosen
[ { "from": "system", "value": "Simplify tests to check request and request with payload\n" }, { "from": "human", "value": "/* global sinon, expect, describe, it, before */\nimport '../../setup'\nimport { app } from '../../../src/lib/app'\n\nconst request = require('supertest')\n\nconst url = 'htt...
javascript
chosen
[ { "from": "system", "value": "Add unit test for store service initializer\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport { initialize } from '../../../initializers/store';\nimport { module, test } from 'qunit';\n\nvar container, application;\n\nmodule('Unit | Initializer |...
javascript
chosen
[ { "from": "system", "value": "Set a default width and height\n\nSet the default width and height for the resize mixin to be 0 so that we don't\nget error resulting from undefined values in the SVG viewBox attribute.\n" }, { "from": "human", "value": "/* global window */\n\n'use strict';\n\nvar d...
javascript
chosen
[ { "from": "system", "value": "Disable ghostMode (mirroring interactions in different browsers) and\nnotifications (top right corner)\n" }, { "from": "human", "value": "module.exports = {\n port: 3001,\n files: [ 'build/*', \"src/views/index.html\" ]\n};\n" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Disable service worker on localhost\n" }, { "from": "human", "value": "if('serviceWorker' in navigator) {\n navigator.serviceWorker.register('./sw.js').then(function(registration) {\n // Registration was successful 😊\n console.log('ServiceWorker registration...
javascript
chosen
[ { "from": "system", "value": "Fix employee test to check for returned result keys\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport util from './util';\n\ndescribe('Employees API', () => {\n describe('fetch', () => {\n\n it('should get employee list', (done) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Create End point for items list\n" }, { "from": "human", "value": "'use strict';\n\nconst express = require('express');\n\nconst app = express();\n\napp.get('/', (req, res) => {\n res.render('./../app/index.ejs');\n});\napp.use(express.static(__dirname + '/../tmp...
javascript
chosen
[ { "from": "system", "value": "ci: Remove comments from Babili Webpack Plugin" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\nconst BabiliPlugin = require('babili-webpack-plugin');\nconst pkg = require('./package.json');\n\nlet banner =\n `OBS...
javascript
chosen
[ { "from": "system", "value": "Use umd as browser output format\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n entry: 'src/autobahn.js',\n resolve: {\n root: path.resolve('./dist/'),\n extensions: ['', '.json', '.js']\n },\n output...
javascript
chosen
[ { "from": "system", "value": "Add loading message while retrieving data, support enter key on zip field\n" }, { "from": "human", "value": "/**\n * POST to the query endpoint to get information on whether or not it is going to snow.\n */\nfunction queryData() {\n var zipCode = $(\"#zip-input\"...
javascript
chosen
[ { "from": "system", "value": "Add moment global usage warning\n" }, { "from": "human", "value": "/*\n * This is the main PebbleJS file. You do not need to modify this file unless\n * you want to change the way PebbleJS starts, the script it runs or the libraries\n * it loads.\n *\n * By default,...
javascript
chosen
[ { "from": "system", "value": "Add support for beta versions to update notifier\n" }, { "from": "human", "value": "import Npm from 'silent-npm-registry-client';\nimport boxen from 'boxen';\nimport chalk from 'chalk';\nimport pkg from '../package.json';\n\nexport default function() {\n return new...
javascript
chosen
[ { "from": "system", "value": "Integrate instagram auth and remove duplicated config\n" }, { "from": "human", "value": "/** index.js\n* @file: /config/index.js\n* @description: Handles passport authentication\n* @parameters: Object(app), Object(passport)\n* @exports: Passport authentication\n*/\n...
javascript
chosen
[ { "from": "system", "value": "Add initial default plugin options\n" }, { "from": "human", "value": "/*\n * grunt-xcode\n * https://github.com/matiassingers/grunt-xcode\n *\n * Copyright (c) 2014 Matias Singers\n * Licensed under the MIT license.\n */\n'use strict';\n\nvar Promise = require('blue...
javascript
chosen
[ { "from": "system", "value": "Add failing test for negative integers.\n" }, { "from": "human", "value": "var test = require('tape');\nvar parseInts = require('../');\n\ntest.skip('#1 - require radix is an integer or undefined', function (t) {\n var nonInts = ['1', [1], {}];\n t.plan(nonIn...
javascript
chosen
[ { "from": "system", "value": "Trim added to verifications done by Mark\n" }, { "from": "human", "value": "var validateEditForm = function (formObject) {\n var error = false;\n\n // check room number\n if (formObject['room-number'].length < 1) {\n toastr.error(\"You did not enter ...
javascript
chosen
[ { "from": "system", "value": "Set the target to lowercase inside command object\n\nThis makes it simpler to manage state for things like th CDN build that\nneeds to check what build target is currently is.\n" }, { "from": "human", "value": "'use strict';\n\nvar commander = require('commander');\...
javascript
chosen