conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Resolve tasks appearing twice in the same group.\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash'),\n _s = require('underscore.string');\n\nfunction getOutput(output, groups, taskOptions) {\n var hasGroup = false;\n\n _.each(Obj...
javascript
chosen
[ { "from": "system", "value": "Make text-input visible for testing purposes\n\nSummary: What the title ^ says\n\nTest Plan: 1) Make sure that accessing text-input directly (snowman text-input) works\n\nReviewers: eater\n\nReviewed By: eater\n\nSubscribers: alpert\n\nDifferential Revision: http://phabricator....
javascript
chosen
[ { "from": "system", "value": "Rewrite test to check for heatmap on project page.\n" }, { "from": "human", "value": "var EC = protractor.ExpectedConditions;\n\ndescribe('con10t pages', function() {\n\n\n function click() {\n \n browser.waitForAngular();\n return element.al...
javascript
chosen
[ { "from": "system", "value": "Secure checks before removing channels\n" }, { "from": "human", "value": "Meteor.methods({\n 'channels.remove': function(channelId) {\n check(channelId, String);\n \n Messages.remove({channelId: channelId});\n Channels.remove({_id: channelId});\n }\n})...
javascript
chosen
[ { "from": "system", "value": "Fix linting error for unused session variable\n" }, { "from": "human", "value": "import Promise from 'bluebird'\nimport BaseWorker from '../../base'\n\nimport rota from '../../rota.json'\n\nimport redis from 'redis'\nPromise.promisifyAll(redis.RedisClient.prototype)...
javascript
chosen
[ { "from": "system", "value": "Add an alert for the values.\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n\nvar React = require('react'),\n ReactPolyselect = require('../src/javascripts/main'),\n Polyselect = ReactPolyselect.Polyselect,\n Polyoption = ReactPolyselect.Polyopti...
javascript
chosen
[ { "from": "system", "value": "Make it possible to have a active object\n\nThis enables the WebGameMaker to modify a currently\nactive element.\n" }, { "from": "human", "value": "function Game() {\n\n var plugins = [];\n var temporary_instance = undefined;\n\n this.addPluginInstance = fu...
javascript
chosen
[ { "from": "system", "value": "Change end value in example\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport CountUp from '../../lib/CountUp';\n\nReactDOM.render(\n <CountUp start={0} end={210987} />,\n document.getElementById('root')\n);\n...
javascript
chosen
[ { "from": "system", "value": "Add usage info to ember-utils entry point.\n" }, { "from": "human", "value": "export { default as symbol } from './symbol';\nexport { getOwner, setOwner, OWNER } from './owner';\nexport { default as assign } from './assign';\nexport { default as EmptyObject } from '...
javascript
chosen
[ { "from": "system", "value": ":new: Add pretty printing support to writeJSON\n" }, { "from": "human", "value": "/* @flow */\n\nimport FS from 'fs'\nimport promisify from 'sb-promisify'\nimport mkdirp from 'mkdirp'\nimport rimraf from 'rimraf'\nimport ncp from 'ncp'\n\nexport const copy = promisi...
javascript
chosen
[ { "from": "system", "value": "Fix a bug where the review request summary shown in the Review dialog was being HTML-escaped but really needed to be JavaScript-escaped.\n\nFixes bug #860.\n\n\n\n" }, { "from": "human", "value": "{% load djblets_utils %}\n /*\n * Initial state from the server. T...
javascript
chosen
[ { "from": "system", "value": " Fix extension to work with latest state changes\n" }, { "from": "human", "value": "import app from 'flarum/app';\n\nimport AkismetSettingsModal from './components/AkismetSettingsModal';\n\napp.initializers.add('flarum-akismet', () => {\n app.extensionSettings['fla...
javascript
chosen
[ { "from": "system", "value": "Change false to true to match expectation\n" }, { "from": "human", "value": "describe(\"About Expects\", function() {\n\n //We shall contemplate truth by testing reality, via spec expectations. \n it(\"should expect true\", function() {\n expect(false).toBeTru...
javascript
chosen
[ { "from": "system", "value": "Use console.error to print functional test errors\n\nThis allows them to show up in tap-dot output\n" }, { "from": "human", "value": "var fs = require( 'fs' );\nvar path = require( 'path');\n\nvar tape = require( 'tape' );\nvar event_stream = require( 'event-stream'...
javascript
chosen
[ { "from": "system", "value": "Add project settings form component test\n" }, { "from": "human", "value": "import { moduleForComponent, test } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('project-settings-form', 'Integration | Component | project setti...
javascript
chosen
[ { "from": "system", "value": "Test basic connection and message sending for both transports\n" }, { "from": "human", "value": "import Socket from 'src/socket'\nimport {LongPoll} from 'src/transports'\nimport {pause, resume} from 'tests/utils'\n\nQUnit.test('can connect', function(assert){\n ass...
javascript
chosen
[ { "from": "system", "value": "Update the url for api retrieval.\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport $ from 'jquery';\nimport CurrentWeatherCard from './CurrentWeatherCard';\n\nexport default class App extends Component {\n constructor(){\n super...
javascript
chosen
[ { "from": "system", "value": "Throw error if an EtchComponent subclass doesn't implement render()\n" }, { "from": "human", "value": "/** @babel */\n/** @jsx etch.dom */\n\nimport {Emitter} from 'atom'\nimport etch from 'etch'\n\nexport default class EtchComponent {\n constructor (props) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add unit test for gravatar util\n" }, { "from": "human", "value": "import gravatar from '../../../utils/gravatar';\nimport { module, test } from 'qunit';\n\nmodule('gravatar');\n\n// Replace this with your real tests.\ntest('it works', function(assert) {\n var resu...
javascript
chosen
[ { "from": "system", "value": "Fix native modules && use string instead of require to require plugin\n" }, { "from": "human", "value": "'use strict'\n\nconst modifyBabelPreset = require('modify-babel-preset')\n\nconst mergeByEnv = require('./lib/mergeByEnv')\n\nconst modifiedReactPreset = modifyB...
javascript
chosen
[ { "from": "system", "value": "Fix comment JS with new HTML structure\n" }, { "from": "human", "value": "$().ready(function () {\n\n $(\"form.comment\").on(\"submit\", function (event) {\n event.preventDefault();\n var $form = $(this);\n var $comments = $(\".comment-group\");\n var $...
javascript
chosen
[ { "from": "system", "value": "Set only one view for all request which always return index.html\n" }, { "from": "human", "value": "/**\n * Module dependencies\n */\n\nvar express = require('express'),\n http = require('http'),\n path = require('path');\n\nvar app = module.exports = express();\n...
javascript
chosen
[ { "from": "system", "value": "Add forgotten fields to Location schema\n" }, { "from": "human", "value": "module.exports = function(config) {\n ['MONGO_URL', 'MONGO_USERNAME', 'MONGO_PASSWORD'].forEach(function(envvar) {\n if (config[envvar] === undefined) {\n throw new Error('Mongo is m...
javascript
chosen
[ { "from": "system", "value": "Fix typo in direction generator (api)\n" }, { "from": "human", "value": "const _ = require('lodash');\n\nconst db = require('../../db.js');\n\nmodule.exports = () => {\n\treturn new Promise(async (resolve) => {\n\t\t\n\t\tconst stops = await db.query(`\n\t\t\tSELECT...
javascript
chosen
[ { "from": "system", "value": "Return the item_id as well\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport objectAssign from 'object-assign';\nimport * as fields from './fields';\n\nexport function items(item) {\n return _.forEach(item.fields, (field) => {\n return field;\n ...
javascript
chosen
[ { "from": "system", "value": "Add infinite scroll feature to Qiita's feed\n" }, { "from": "human", "value": "alert(\"It works!\");\n" }, { "from": "gpt", "value": "\"use strict\";\nwindow.addEventListener(\"load\", () => {\n let htmlHeight = document.documentElement.scrollHeight;\...
javascript
chosen
[ { "from": "system", "value": "Fix values sent to CloudWatch for requests and allocations. Check that CloudWatch is available and change timer to 50 seconds.\n" }, { "from": "human", "value": "var async = require('async');\n\nvar context;\nvar publishTimer;\n\nfunction publishToDashboard() {\n ...
javascript
chosen
[ { "from": "system", "value": "Check for \"to \" with verbs\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Base from 'ember-validations/validators/base';\n\nexport default Base.extend({\n call: function() {\n var prop = this.model.get(this.property);\n var backtick =...
javascript
chosen
[ { "from": "system", "value": "Refactor DOM manipulation to proper hook\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport ReactDOM from 'react-dom';\nimport echarts from 'echarts';\nimport { arrayEqual } from '../_utils/ArrayUtils';\n\nexport default class EChar...
javascript
chosen
[ { "from": "system", "value": "Add missing return, add eslint hint for jsx\n" }, { "from": "human", "value": "'use babel';\n/**\n Eval Console\n @description Provides a console where user can enter input in order to\n evaluate Go expressions within the current scope of the debugger in\n a...
javascript
chosen
[ { "from": "system", "value": "Use CommonJS syntax for CommonJS modules\n\n@stoeffel I guess ES2015 import syntax makes sense for importing ES2015 modules. Otherwise it just creates overhead, and isn’t as flexible (dynamic imports and such).\n" }, { "from": "human", "value": "import {\n ifElse,\...
javascript
chosen
[ { "from": "system", "value": "Stop button is not rendered.\n" }, { "from": "human", "value": "(function($) {\n\n\t$.extend(mejs.MepDefaults, {\n\t\tstopText: 'Stop'\n\t});\n\n\t// STOP BUTTON\n\t$.extend(MediaElementPlayer.prototype, {\n\t\tbuildstop: function(player, controls, layers, media) {\...
javascript
chosen
[ { "from": "system", "value": "Send navigation object as prop to RepoList\nReact Navigator adds a navigation object as a prop to each screen. This\nisn't shared by the screen's components so it has to be passed down\nmanually for the child components to be able to navigate.\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Fix data reference for selecting hospitals\n\nI think this is a d3 change that happened when I updated libraries?\nThat’s when it broke\n" }, { "from": "human", "value": "HospitalCheckup.Behaviors = {\n HospitalSelect: Marionette.Behavior.extend({\n events: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add toJSON method to display id instead of _id\n" }, { "from": "human", "value": "var mongoose = require('mongoose'),\n shortid = require('shortid');\n\nvar UserSchema = new mongoose.Schema({\n _id: {type: String, required: true, unique: true, 'default': short...
javascript
chosen
[ { "from": "system", "value": "Check that the element exists before rendering component\n" }, { "from": "human", "value": "/**\n * WordPress dependencies\n */\nimport { render } from '@wordpress/element';\nimport domReady from '@wordpress/dom-ready';\n\n/**\n * Internal dependencies\n */\nimport ...
javascript
chosen
[ { "from": "system", "value": "Use `Room.getCities` instead of checking each visible room controller\n" }, { "from": "human", "value": "'use strict'\n\n/**\n * Top level program- it is responsible for launching everything else.\n */\n\nclass Player extends kernel.process {\n constructor (...args...
javascript
chosen
[ { "from": "system", "value": "Add reactive variable and instance variables\n" }, { "from": "human", "value": "Template.activities.created = function () {\n var showLatestActivities = new ReactiveVar();\n};\n\nTemplate.activities.rendered = function () {\n var elem = document.querySelector(\"[n...
javascript
chosen
[ { "from": "system", "value": "Remove newline at beginning of file\n" }, { "from": "human", "value": "\n/**\n * Copyright 2013-2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this...
javascript
chosen
[ { "from": "system", "value": ":heavy_plus_sign::one: Add test for no online booking link\n" }, { "from": "human", "value": "const chai = require('chai');\nconst chaiHttp = require('chai-http');\nconst cheerio = require('cheerio');\nconst app = require('../../server');\nconst constants = require(...
javascript
chosen
[ { "from": "system", "value": "Resolve conflict by keeping voteCount response argument.\n" }, { "from": "human", "value": "$(document).ready( function () {\n $(\".upvote\").click( function() {\n var commentId = $(\".upvote\").data(\"id\");\n event.preventDefault();\n $.ajax({\n url...
javascript
chosen
[ { "from": "system", "value": "Fix Typo in VRTSceneNavigator as result of merge\n\n\nFormer-commit-id: 1e0c2f25d2085eb7b0e92e07f6e6cb144052e353" }, { "from": "human", "value": "/**\n * Copyright (c) 2015-present, Viro, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the B...
javascript
chosen
[ { "from": "system", "value": "Add stubs for user data\n" }, { "from": "human", "value": "/**\n * Created by aknauss on 6/21/17.\n */\n\n\nvar jwt = require('jsonwebtoken');\n\nmodule.exports = {\n login: ctx => {\n let request = ctx.request.body;\n console.log(request);\n ...
javascript
chosen
[ { "from": "system", "value": "Transform timestamps on messages to Date objects.\n" }, { "from": "human", "value": "'use strict';\n\nconst ActionTypes = require('../constants').ActionTypes;\nconst Dispatcher = require('../dispatcher');\nconst { List, Map } = require('immutable');\nconst Store = r...
javascript
chosen
[ { "from": "system", "value": "Add locales link for project show\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport { List, ListItem } from 'material-ui/List';\n\nexport default class Project extends React.Component {\n static propTypes = {\n project: Pr...
javascript
chosen
[ { "from": "system", "value": "Remove Account.features and replace it with Account.role\n" }, { "from": "human", "value": "var wompt = require(\"../includes\"),\nmongoose = wompt.mongoose,\nObjectId = mongoose.Schema.ObjectId;\n\nvar Account = new mongoose.Schema({\n\t'display_name' : String\n...
javascript
chosen
[ { "from": "system", "value": "Update blueprint to use 0.4.10 of ember-qunit.\n" }, { "from": "human", "value": "module.exports = {\n normalizeEntityName: function() {\n // this prevents an error when the entityName is\n // not specified (since that doesn't actually matter\n // to us\n ...
javascript
chosen
[ { "from": "system", "value": "Fix indexOf to return value\n" }, { "from": "human", "value": "/* ***********************************************************************************************\n\n Unify Project\n\n Homepage: unify-project.org\n License: MIT + Apache (V2)\n Copyright: ...
javascript
chosen
[ { "from": "system", "value": "Fix typo in error message\n\n[#115369351]\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport pureRender from 'pure-render-decorator'\n\nimport '../../css/data-fetch-error.less'\n\n@pureRender\nexport default class DataFetchError exte...
javascript
chosen
[ { "from": "system", "value": "Use a shorter timeout when using a range slider\n" }, { "from": "human", "value": "var dimTimer;\n\nangular.module('onmote')\n .controller('DeviceListCtrl', function ($scope, $timeout, socket) {\n\n\tsocket.on('telldus:*',function(event, data) {\n\t console.log(...
javascript
chosen
[ { "from": "system", "value": "Add models and serializers unit tests\n" }, { "from": "human", "value": "import ODataSerializer from 'ember-flexberry/serializers/odata';\n\nexport default ODataSerializer.extend({\n});\n" }, { "from": "gpt", "value": "import ODataSerializer from 'ember-...
javascript
chosen
[ { "from": "system", "value": "Remove debug output & fix semicolons\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar fs = require('fs');\n\n/* GET home page. */\nrouter.get('/', function(req, res, next) {\n res.render('index', { title: 'Ex...
javascript
chosen
[ { "from": "system", "value": "Make the hide_input extension work with jupyter\n\n- Add the needed load_ipython_extension property\n- Use the require mechanism\n" }, { "from": "human", "value": "// Adds a button to hide the input part of the currently selected cells\n\n// Prevent this script from...
javascript
chosen
[ { "from": "system", "value": ":art: Use Dist files under every circumstances\n" }, { "from": "human", "value": "var IsIoJS = parseInt(process.version.substr(1)) > 0;\nif(IsIoJS){\n var v8 = require('v8');\n v8.setFlagsFromString('--harmony_classes');\n v8.setFlagsFromString('--harmony_object_...
javascript
chosen
[ { "from": "human", "value": "v1.0.0: Write initial tests for the ogmneo operation.\n" }, { "from": "gpt", "value": "'use strict';\n\nconst test = require('tape');\nconst OGMNeoOperation = require('../lib/ogmneo-operation');\nconst _ = require('lodash');\n\ntest('Test create operation', (assert) ...
javascript
chosen
[ { "from": "system", "value": "Fix formatting for hours greater than 9" }, { "from": "human", "value": "function pad(num, size) {\n var s = '0000' + num\n return s.substring(s.length - size)\n}\n\n\nfunction capitalize(s) {\n return s[0].toUpperCase() + s.slice(1)\n}\n\n\nexport function forma...
javascript
chosen
[ { "from": "system", "value": "Remove debug code from example" }, { "from": "human", "value": "var registry = require('registry');\nvar exec = require('process').exec;\n\nregistry.addDevice(registry.createDevice('Testing', registry.DimmableLamp, function (state, cb) {\n console.log('State change...
javascript
chosen
[ { "from": "system", "value": "Make remote tests work with jquery\n" }, { "from": "human", "value": "const http = require('http');\nconst nodeStatic = require('node-static');\nconst port = 3000;\n\nconst demo = new nodeStatic.Server('../demo');\nconst server = http.createServer((request, response...
javascript
chosen
[ { "from": "system", "value": "Update Storybook for legacy setup accordingly after migrating Header component.\n" }, { "from": "human", "value": "/**\n * External dependencies\n */\nimport { storiesOf } from '@storybook/react';\n\n/**\n * Internal dependencies\n */\nimport Setup from '../assets/j...
javascript
chosen
[ { "from": "system", "value": "Improve live region behaviour with JAWS / IE\n" }, { "from": "human", "value": "define(['jquery'],\n function ($) {\n return {\n createLiveRegion: function() {\n var $liveRegionContainer = $('.live-region-container');\n if ($liveRegionContaine...
javascript
chosen
[ { "from": "system", "value": "Add sleep to flaky headless test\n" }, { "from": "human", "value": "var assert = require('chai').assert;\nvar Context = require('../headless-context');\nvar context;\n\ndescribe('Core window events', function() {\n beforeEach(function() {\n context = new Context...
javascript
chosen
[ { "from": "system", "value": "Add dropdown menu functionality plugin.\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n $(\".button-collapse\").sideNav();\n $('.parallax').parallax();\n\n});\n" }, { "from": "gpt", "value": "$(document).ready(function(){\n\n ...
javascript
chosen
[ { "from": "system", "value": "feat(Provider): Allow passing props to 'Notification' through 'Provider'\n" }, { "from": "human", "value": "import React, { Children } from 'react';\nimport PropTypes from 'prop-types';\n\nimport Context from './context';\nimport Notification from './notification';\...
javascript
chosen
[ { "from": "system", "value": "Use query option of got\n" }, { "from": "human", "value": "const got = require('got');\n\nconst API_VERSION = 1;\nconst GOT_OPTIONS = { json: true };\n\nconst searchUrl = query => (\n `https://rubygems.org/api/v${API_VERSION}/search.json?query=${query}`\n);\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Add support for IE11 (msCrypto)\n" }, { "from": "human", "value": "var almost = (function() {\n function lookupWord(id)\n {\n // TODO: Return the specified entry from our words list.\n return 'word' + id;\n }\n\n return {\n getWords ...
javascript
chosen
[ { "from": "system", "value": "Remove old and unnecessary code.\n" }, { "from": "human", "value": "import React from 'react'\n\nimport ComponentRenderer from './src/components/component-renderer-with-pagination'\n\nexport const replaceComponentRenderer = ({ props, loader }) => {\n if (props.layo...
javascript
chosen
[ { "from": "system", "value": "Use MtkStyle.GetColor helper method instead of the object directly\n" }, { "from": "human", "value": "function MtkLabel (settings) {\n MtkXaml.call (this, \"<TextBlock/>\", settings);\n \n this.MapProperties ([ \n [ \"Text\", \"QueueResize\" ], \n ...
javascript
chosen
[ { "from": "system", "value": "Fix a bug during creating a new user with username/email.\n" }, { "from": "human", "value": "Accounts.validateNewUser(function (user) {\n if (Meteor.users.findOne({username: user.username}))\n throw new Meteor.Error(403, \"User already exists.\");\n return true...
javascript
chosen
[ { "from": "system", "value": "Enhance Functionality of Mutation Function\n" }, { "from": "human", "value": "module.exports =\n{\n mutationFunction: function(phenotype)\n {\n // make a random change to phenotype\n var count = phenotype.nmos + phenotype.pmos\n var randNumb = Math.floor(...
javascript
chosen
[ { "from": "system", "value": "Set this.data as an empty object instead of null\n" }, { "from": "human", "value": "import {Data} from 'Framework/Data';\n\nconst dataData = new Data();\n\nexport class Locale\n{\n constructor()\n {\n this.isInitialized = false;\n this.data = null;\n }\n\n ...
javascript
chosen
[ { "from": "system", "value": "Clarify the example assignment text." }, { "from": "human", "value": "// ==========================================================================\n// Project: MySystem.Activity Fixtures\n// Copyright: ©2011 Concord Consortium\n// ================================...
javascript
chosen
[ { "from": "system", "value": ":fire: Remove unused function and import in tests\n" }, { "from": "human", "value": "import expect from 'expect.js'\nimport {fix, check} from '../../../src/typography-fixer'\nimport rules from '../../../src/rules/en-UK/html'\n\nconst fixString = fix(rules)\nconst ch...
javascript
chosen
[ { "from": "system", "value": "Add removeTestResults to the signout button\n" }, { "from": "human", "value": "import React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport fetchContainer from \"../../containers/fetch-container\";\nimport \"./Controls.css\";\n\nconst handleSignO...
javascript
chosen
[ { "from": "system", "value": "Fix wrong dependencies to create Master\n" }, { "from": "human", "value": "'use strict'\n\nconst assert = require('assert')\nconst defaultOptions = require(__source + 'config/default')\nconst RunnerInterface = require(__source + 'runner-interface')\nconst LoggerFact...
javascript
chosen
[ { "from": "system", "value": "Convert count() result to number if it's a string\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nexports.formatNumber = function(dialect) {\n return {\n mysql: _.identity,\n sqlite3: _.identity,\n postgresql: function(count) { return coun...
javascript
chosen
[ { "from": "system", "value": "Add ui.bootstrap to paperworkNotes module\n" }, { "from": "human", "value": "angular.module('paperworkNotes', ['ngRoute', 'ngSanitize', 'ngAnimate', 'angularFileUpload', 'ab-base64'])\n.constant('paperworkApi', '/api/v1');\n" }, { "from": "gpt", "value":...
javascript
chosen
[ { "from": "system", "value": "Change linechart test to find components by class instead of tag to prevent confusion with voronoi tag\n" }, { "from": "human", "value": "'use strict';\n\nvar expect = require('chai').expect;\n\ndescribe('LineChart', function() {\n it('renders linechart', function(...
javascript
chosen
[ { "from": "system", "value": "Switch date-fn-utils.text from Ukrainian to Russian\n" }, { "from": "human", "value": "import uaLocale from 'date-fns/locale/ua';\nimport DateFnsUtils from '../../src/utils/date-fns-utils';\n\ndescribe('DateFnsUtils', () => {\n const enUtils = new DateFnsUtils();\n...
javascript
chosen
[ { "from": "system", "value": "Fix CSP errors in dummy app\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n EmberENV: ...
javascript
chosen
[ { "from": "system", "value": "Update to match docs with positionalParams\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/with-service';\nimport getOwner from 'ember-getowner-polyfill';\n\nexport default Ember.Component.extend({\n layout...
javascript
chosen
[ { "from": "system", "value": "Put back changes in observer after unsuccessful commit.\n" }, { "from": "human", "value": "const expect = require('chai').expect;\n\nimport { TopicObserver } from \"../topic-observer\";\n\ndescribe('topic observer', () => {\n\n const observer = new TopicObserver(...
javascript
chosen
[ { "from": "system", "value": "Remove useless lines from acceptance tests\n" }, { "from": "human", "value": "'use strict';\n\nrequire('../helper');\n\nconst Backbone = require('backbone');\nconst _ = require('underscore');\n\nconst Factotum = require('../../src/backbone.factotum');\n\n// =====\n/...
javascript
chosen
[ { "from": "system", "value": "Make jshint pass on test-helper.js\n\nFixes #94 .\n" }, { "from": "human", "value": "/* jshint node: true */\n\nvar EOL = require('os').EOL;\n\nmodule.exports = {\n description: 'Generates ember-cli-flash test helper',\n\n afterInstall: function() {\n var TEST_...
javascript
chosen
[ { "from": "system", "value": "Use correct value for storing user id\n" }, { "from": "human", "value": "var Promise = require('bluebird'),\n \tmongoose = Promise.promisifyAll(require('mongoose')),\n \tUser = mongoose.model('User');\n authUtils = require('utils/auth');\n\nmodule.exports = {\n...
javascript
chosen
[ { "from": "system", "value": "Sort linter results by page URL\n" }, { "from": "human", "value": "module.exports = function*() {\n\tthis.time('Linter')\n\tthis.separator()\n\n\tlet methods = {}\n\n\tfor(let tuple of this.pages) {\n\t\tlet page = tuple[1]\n\n\t\tfor(let method of page.httpVerbs) {...
javascript
chosen
[ { "from": "system", "value": "Add matches to annotated object\n" }, { "from": "human", "value": "function annotateEngine(src, rules, ruleTypes, ruleMap) {\n var tokens = [];\n\n while(src) {\n // Pick rule\n var rule = ruleTypes.filter(function(ruleName, idx) {\n v...
javascript
chosen
[ { "from": "system", "value": "Fix even more stupid code.\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash');\n\nfunction arrayToQueryString(args) {\n var queryString = '?q=' + args.join('+');\n return queryString.substring(0, queryString.length - 1);\n}\n\nmodule.exp...
javascript
chosen
[ { "from": "system", "value": "Remove unused params from comments.\n" }, { "from": "human", "value": "import { toArray, Class } from './lib/objects';\nimport { normalizeOperations } from './lib/operations';\nimport { uuid } from './lib/uuid';\n\n/**\n Transforms represent a set of operations that...
javascript
chosen
[ { "from": "system", "value": "Change hardcoded localhost:9200 to window.location.host\n\nLocalhost had been hardcoded for testing, but was not removed when pushed.\nThis fix removes localhost and defaults to window.location.host, which\nis basically whatever has been entered in the URL.\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Fix for active nav links when URL has hash" }, { "from": "human", "value": "$(function() {\n\n $('#side-menu').metisMenu();\n\n});\n\n//Loads the correct sidebar on window load,\n//collapses the sidebar on window resize.\n// Sets the min-height of #page-wrapper t...
javascript
chosen
[ { "from": "system", "value": "Fix the regular expression at the end of raw jsonp.\n" }, { "from": "human", "value": "function extractJSON(rawJson) {\n return rawJson\n .replace(/\\s*while\\((1|true)\\)\\s*;?/, '')\n .replace(/\\s*for\\(;;\\)\\s*;?/, '')\n .replace(/^[^{\\[].+\\({/, '{'...
javascript
chosen
[ { "from": "system", "value": "Use Math.ceil to get rounded to px values to remove SVG rendering issues.\n" }, { "from": "human", "value": "import React from 'react';\n\nexport default class SparklinesBars extends React.Component {\n\n static propTypes = {\n points: React.PropTypes.arra...
javascript
chosen
[ { "from": "system", "value": "Improve the signature of the function open\n" }, { "from": "human", "value": "var process = function (url, filename, successCallback, errorCallback) {\n if(!filename) {\n filename = '';\n }\n \n return cordova.exec(successCallback, errorCallback, 'Hazelnut', ...
javascript
chosen
[ { "from": "system", "value": "Fix race condition in test\n@bug W-3269340@\n@rev tbliss@\n" }, { "from": "human", "value": "({\n setStatus: function(cmp, status) {\n cmp.set(\"v.status\", status);\n this.log(cmp, \"\\nStatus update: \" + status);\n },\n\n log: function(cmp,...
javascript
chosen
[ { "from": "system", "value": "Move this out of here...\n" }, { "from": "human", "value": "var async = require( \"async\" );\nvar _ = require( \"lodash\" );\nvar cta = require( \"cta-bus-tracker\" );\n\n\nvar busTracker = cta( process.env.CHICAGO_CTA_BUS_API_KEY );\n\n\nvar getRoutes = function (...
javascript
chosen
[ { "from": "system", "value": "Add wait for contact element to be visible before editing\n" }, { "from": "human", "value": "module.exports = {\n url: process.env.QA_HOST,\n elements: {\n editContactDetailsButton: 'a[href*=\"/edit\"]',\n auditHistoryTab: 'a[href*=\"/audit\"]',\n telepho...
javascript
chosen
[ { "from": "system", "value": "Handle UTC formatting of covid newsfeed\n" }, { "from": "human", "value": "// @flow\n\nimport * as React from 'react'\nimport moment from 'moment-timezone'\nimport {Alert} from 'react-native'\nimport {Column, Row} from '../components/layout'\nimport {ListRow, Detail...
javascript
chosen
[ { "from": "system", "value": "Deploy mock contracts only for test\n" }, { "from": "human", "value": "module.exports = function(deployer) {\n deployer.deploy(PullPaymentBid);\n deployer.deploy(BadArrayUse);\n deployer.deploy(ProofOfExistence);\n deployer.deploy(SimpleTokenBounty);\n deployer...
javascript
chosen
[ { "from": "system", "value": "Fix one import being made on mastodon's codebase instead of glitch-soc's\n" }, { "from": "human", "value": "import { connect } from 'react-redux';\nimport { fetchTrends } from 'mastodon/actions/trends';\nimport Trends from '../components/trends';\n\nconst mapStateTo...
javascript
chosen
[ { "from": "system", "value": "Add --version flag to print atom-shell's version.\n" }, { "from": "human", "value": "var app = require('app');\nvar argv = require('optimist').argv;\nvar dialog = require('dialog');\nvar path = require('path');\n\n// Quit when all windows are closed and no other one...
javascript
chosen