conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Return null if the binary doesn't exist.\n" }, { "from": "human", "value": "'use strict'\n\nconst path = require('path')\nconst cp = require('child_process')\nconst distInfo = require('./dist-info')\n\nconst distPath = distInfo.getDistPath()\nconst productName = dis...
javascript
chosen
[ { "from": "system", "value": "Make the slider input toggable\n" }, { "from": "human", "value": "const InputNumber = require('domain_abstract/ui/InputNumber');\n\nmodule.exports = require('./PropertyIntegerView').extend({\n\n events: {\n 'change': 'inputValueChanged',\n 'input': 'inputValu...
javascript
chosen
[ { "from": "system", "value": "Fix overview page col headers\n" }, { "from": "human", "value": "import React from 'react'\n\nimport GamesContainer from './containers/GamesContainer'\n\nexport default (props) => {\n return (\n <div className='container overview'>\n <div className='page-he...
javascript
chosen
[ { "from": "system", "value": "Edit search pattern for FPD vulnerability scan\n" }, { "from": "human", "value": "\n/**\n * wpscan module fpd-vulnerability.js\n * Scan a PHP file for Full Path Disclosure\n */\n\n\n/**\n * Required modules\n */\n\nconst request = require( 'request' ).defaults( { fo...
javascript
chosen
[ { "from": "system", "value": "Update array to literal notation\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n model: function() {\n return this.store.createRecord('parseUser');\n },\n\n actions: {\n createUser: function(user) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add selectors to select the threshold values for config temperatures\n" }, { "from": "human", "value": "export const selectNewSensor = ({ newSensor }) => {\n const { macAddress = '' } = newSensor || {};\n return macAddress;\n};\n" }, { "from": "gpt", "...
javascript
chosen
[ { "from": "system", "value": "Move to hash history to allow refresh when on java server\n" }, { "from": "human", "value": "// @flow\nimport 'bootstrap/dist/css/bootstrap.css';\nimport createBrowserHistory from 'history/createBrowserHistory'\nimport React from 'react';\nimport ReactDOM from 'reac...
javascript
chosen
[ { "from": "system", "value": "Add russian i18n for angular.\n" }, { "from": "human", "value": "/**\n * This is a manifest file that will be compiled into application.js, which will\n * include all the files listed below.\n *\n * Any JavaScript file within this directory can be referenced here us...
javascript
chosen
[ { "from": "system", "value": "Change the url for trip template\n" }, { "from": "human", "value": "BeTogether.Router.map(function(){\n this.resource('home', {path: '/'});\n this.resource('profile', function(){\n this.resource('trip', {path: ':trip_id'});\n });\n});\n" }, { "from": "...
javascript
chosen
[ { "from": "system", "value": "Set format options from JSON file, resources/format.json.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('classBrowserUHApp.offeredclass', ['ngRoute'])\n\n.config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/offeredcla...
javascript
chosen
[ { "from": "system", "value": "Fix environment variable name in comment" }, { "from": "human", "value": "// Copyright (c) 2016-present, salesforce.com, inc. All rights reserved\n// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license\n\n'use strict'\n\nconst express = require('exp...
javascript
chosen
[ { "from": "system", "value": "Use correct directory for static files\n" }, { "from": "human", "value": "module.exports = createApp\n\nvar express = require('express')\nvar PORT = process.env.port || 80\n\nfunction createApp() {\n var app = express()\n app.set('views', __dirname + '/views');\n ...
javascript
chosen
[ { "from": "system", "value": "Reduce category name and note title to 20 characters\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n CATEGORY_NAME_MAXLENGTH: 30,\n NOTE_TITLE_MAXLENGTH: 30,\n NOTE_NOTE_MAXLENGTH: 500\n};\n" }, { "from": "gpt", "value": "'use...
javascript
chosen
[ { "from": "system", "value": "Fix code style issues in sample\n" }, { "from": "human", "value": "var measureCRP = function() {\n\tvar span = document.getElementsByTagName('span')[0];\n\tspan.innerText = 'interactive'; // change DOM text content\n\tspan.style.display = 'inline'; // change CSSOM ...
javascript
chosen
[ { "from": "system", "value": "Make the \"your config.key, or your data, hasn't got the right `key` field\" error message a little clearer.\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nmodule.exports = function(config, reducerName, records) {\n // All given records must have ...
javascript
chosen
[ { "from": "system", "value": "Add new rules that are not offended just yet\n" }, { "from": "human", "value": "// @flow\nmodule.exports = {\n env: {\n jest: true,\n },\n plugins: ['testing-library'],\n extends: ['plugin:jest/recommended', 'plugin:testing-library/react'],\n rules: {\n '...
javascript
chosen
[ { "from": "system", "value": "Remove capturing of gestures from vaccine wizard\n" }, { "from": "human", "value": "/* eslint-disable react/forbid-prop-types */\n/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2021\n */\nimport React from 'react';\nimport { Wizard } from '../widgets';\n...
javascript
chosen
[ { "from": "system", "value": "Add a test: 'Listen for changes in the collection'\n" }, { "from": "human", "value": "Tinytest.add('init', function (test) {\n var TestCollection = new Mongo.Collection()\n, kriegslustigFilterTestInstance = Object.create(KriegslustigFilter)\n kriegslustigFilterTes...
javascript
chosen
[ { "from": "system", "value": "Change names of variables in settings file\n\n" }, { "from": "human", "value": "import express from \"express\"\nimport graphqlHTTP from \"express-graphql\"\nimport { graphqlExpress, graphiqlExpress } from \"graphql-server-express\"\nimport bodyParser from \"body-pa...
javascript
chosen
[ { "from": "system", "value": "FIX: Add missing route for deferring\n" }, { "from": "human", "value": "'use strict';\n\nvar express = require('express');\nvar controller = require('./bounceEndpoint');\n\nvar router = express.Router();\n\nrouter.get('/', controller.show);\nrouter.get('/:token', co...
javascript
chosen
[ { "from": "system", "value": "Allow reference_many field to be used as filter\n\nCloses #727\n" }, { "from": "human", "value": "export default {\n getReadWidget: () => '<ma-choices-column values=\"::entry.listValues[field.name()]\"></ma-choices-column>',\n getLinkWidget: () => '<ma-ref...
javascript
chosen
[ { "from": "system", "value": "Add nav element to IE fix\n" }, { "from": "human", "value": "var h5s = ['abbr', 'aside', 'article', 'code', 'figcaption', 'figure',\n\t\t'section', 'time'];\nfor (var i = 0; i < h5s.length; i++)\n\tdocument.createElement(h5s[i]);\nwindow.onload = function () { $('h1...
javascript
chosen
[ { "from": "system", "value": "Use native Promise in tests if available\n" }, { "from": "human", "value": "import {polyfill} from 'es6-promise';\npolyfill();\n\nexport const data = {\n email: 'foo@bar.baz',\n emptyArray: [],\n error: 'foo',\n errorMsg: 'Set sail for fail!',\n found: 'bar',\n...
javascript
chosen
[ { "from": "system", "value": "Change to code style that reflects rest of project" }, { "from": "human", "value": "\nmodule.exports = function(grunt) {\n return grunt.registerMultiTask('mkdir', 'Make directories.', function() {\n var options;\n options = this.options({\n mode: null,\n...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix Pages rendering on template change\n\nRequires not caching page builds, which is unfortunately very slow\n" }, { "from": "human", "value": "'use strict';\n\nconst config = require('config');\n\nconst cache = require('gulp-cached');\nconst failure = require...
javascript
chosen
[ { "from": "system", "value": "Add matchMedia to the global scope\n" }, { "from": "human", "value": "require(\"@babel/register\")({\n extensions: [\".ts\", \".js\", \".tsx\", \".jsx\"],\n})\n\nrequire(\"coffeescript/register\")\nrequire(\"@babel/polyfill\")\nrequire(\"raf/polyfill\")\nrequire(\"...
javascript
chosen
[ { "from": "system", "value": "Support Q, use when not static resolve\n" }, { "from": "human", "value": "PromiseAllSync = {\n extend: function(PromiseClass) {\n PromiseClass.allSync = function(collection, fn, unfn) {\n var stack = [];\n return collection.reduce(function(promise, ite...
javascript
chosen
[ { "from": "system", "value": "[native] Use hook instead of connect functions and HOC in Timestamp\n\nTest Plan: Flow\n\nReviewers: ashoat, palys-swm\n\nReviewed By: ashoat\n\nSubscribers: zrebcu411, Adrian\n\nDifferential Revision: https://phabricator.ashoat.com/D481\n" }, { "from": "human", "va...
javascript
chosen
[ { "from": "system", "value": "Use correct comparison operator for TEXTAREA in isEditorBlur\n" }, { "from": "human", "value": "export default class FocusHandler {\n inputFocused = false;\n editorMouseDown = false;\n\n onEditorMouseDown = ():void => {\n this.editorFocused = true;\n }\n\n o...
javascript
chosen
[ { "from": "system", "value": "Fix wrong test naming for docs\n" }, { "from": "human", "value": "import { expect } from 'chai'\n\nimport AtomicString from '../../src/atomic/string'\n\n/** @test {AtomicString} */\ndescribe('AtomicString', () => {\n const bitArrayHello = [104, 97, 108, 108, 111, 0...
javascript
chosen
[ { "from": "system", "value": "Make use of the lastField variable\n" }, { "from": "human", "value": "var lastField = null;\nvar currentFillColor = ''; // ???\nvar changeCounter = 0; // ???\n\nfunction setField(element) {\n // element contains the current html element\n if (element.s...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary flooring for image gravity point\n" }, { "from": "human", "value": "module.exports = function (ctx, p) {\n if (!p.image.complete) {\n return\n }\n\n var w = p.z * p.image.width\n var h = p.z * p.image.height\n\n ctx.globalAlpha = p.a\n ct...
javascript
chosen
[ { "from": "system", "value": "Adjust typing of creatReducer function\n\n" }, { "from": "human", "value": "//@flow\n\nexport const updateObject = (\n oldObj: { [string]: any },\n newVals: { [string]: any }\n): { [string]: any } => Object.assign({}, oldObj, newVals);\n\nexport const updateObject...
javascript
chosen
[ { "from": "system", "value": "Monitor the card status independantly\n\nand only stop the form from posting when we are certain the card is not valid. This value is stored in a global variable called ucStripeAllow." }, { "from": "human", "value": "jQuery(document).ready(function(){\n\n jQuery(...
javascript
chosen
[ { "from": "system", "value": "Add hide for casting to the default mod list\n" }, { "from": "human", "value": "\nvar rModsList = [];\n\n/* start ui_mod_list */\nvar global_mod_list = [\n\n];\nvar scene_mod_list = {'connect_to_game': [\n\n],'game_over': [\n\n],\n'icon_atlas': [\n\n],\n'live_game':...
javascript
chosen
[ { "from": "system", "value": "Add more tests for string/int types as constraint arguments or in the guard\n" }, { "from": "human", "value": "var test = require('tape')\n\nvar CHR = require('../../src/index')\n\ntest(\"String arguments (Issue #20)\", function (t) {\n var chr = new CHR()\n chr(\...
javascript
chosen
[ { "from": "system", "value": "Test for field definitions / values." }, { "from": "human", "value": "'use strict';\n\nvar ogr = require('../lib/gdal.js').ogr;\nvar path = require('path');\nvar assert = require('chai').assert;\n\ndescribe('Open', function() {\n\tdescribe('GeoJSON', function() {\n\...
javascript
chosen
[ { "from": "system", "value": "Remove should from test descriptions\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar supertest = require('supertest');\nvar api = supertest(\"http://localhost:3000\");\n\ndescribe('Checkout index page', function(){\n it(\"should respond...
javascript
chosen
[ { "from": "system", "value": "Save `downloadIcon` test output to `out`\n" }, { "from": "human", "value": "const downloadIcon = require('./../lib/modules/download/downloadIcon');\nconst fs = require('fs');\n\nconst ICON_URL = 'https://web.whatsapp.com/favicon.ico';\n\ndescribe('Download Icons', f...
javascript
chosen
[ { "from": "system", "value": "Fix missing whitespace in title\n" }, { "from": "human", "value": "// Home Route\nRouter.route('/', function () {\n this.render('home');\n SEO.set({ title: 'Home -' + Meteor.App.NAME });\n});\n" }, { "from": "gpt", "value": "// Home Route\nRouter.route...
javascript
chosen
[ { "from": "system", "value": "Use template for namespaced version\n" }, { "from": "human", "value": "(function() {\n if(typeof(this.PHP_JS) === \"undefined\"){ \n // This references at top of namespace allows PHP_JS class to\n // be included directly inside an object (unusual us...
javascript
chosen
[ { "from": "system", "value": "Fix a typo in the view generator\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path'),\n util = require('util'),\n GeneratorBase = require('../generator-base'),\n generatorUtils = require('../util');\n\nvar ViewGenerator = Generato...
javascript
chosen
[ { "from": "system", "value": "Clean up implementation a bit." }, { "from": "human", "value": "var pathjoin = require('pathjoin');\nvar fs = require('data/fs');\n\n// Wrapper around tedit's private APIs to provide access to the vfs.\nexports = module.exports = relative;\nexports.readFile = readFi...
javascript
chosen
[ { "from": "system", "value": "Update error handling and add pretty print option for jade\n" }, { "from": "human", "value": "\nconst http = require('http');\nconst path = require('path');\nconst jade = require('jade');\n\nconst rotu = require('./rotu');\nconst data = require('./data.json');\n\nco...
javascript
chosen
[ { "from": "system", "value": "Add a comment on the cursor position trick.\n" }, { "from": "human", "value": "var undertale = Elm.fullscreen(\n Elm.UndertaleDialog,\n {\n staticRoot: $STATIC_ROOT,\n scriptRoot: $SCRIPT_ROOT\n }\n);\n\n// passing in above doesn't seem to wor...
javascript
chosen
[ { "from": "system", "value": "Add test for parametricSVG errors\n" }, { "from": "human", "value": "import toDOM from \"domify\";\n\nimport _test from \"../_/test\";\nlet test = _test(\"parametric-svg API\");\n\nimport parametricSVG from \"../../source/parametric-svg\";\nimport VirtualTree from \...
javascript
chosen
[ { "from": "system", "value": "feat: Add shorthand section for objects\n" }, { "from": "human", "value": "describe(\"About Objects\", function () {\n\n describe(\"Initialiser Shorthand\", function () {\n\n it('should understand usage', function() {\n\n function passThrough(one, two) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary version constraints from ecmascript implications.\n" }, { "from": "human", "value": "Package.describe({\n name: 'ecmascript',\n version: '0.1.3-plugins.3',\n summary: 'Compiler plugin that supports ES2015+ in all .js files',\n documentation: '...
javascript
chosen
[ { "from": "system", "value": "frontend: Reset play head on music selection change.\n" }, { "from": "human", "value": "import g from './globals';\n\nlet lastPlayed = '';\n\nfunction toggle(soundtrack) {\n if (g.sound.isPlaying) {\n pause();\n // eslint-disable-next-line no-negated-co...
javascript
chosen
[ { "from": "system", "value": "Send promise from API request\n" }, { "from": "human", "value": "var server = 'http://localhost:3000';\n\nmodule.exports = {\n login: (username, password) => {\n return \n fetch(server + '/login', {\n method: 'POST',\n headers: {\n 'A...
javascript
chosen
[ { "from": "system", "value": "Fix DRCJ session manager entry\n" }, { "from": "human", "value": "import Route from '@ember/routing/route';\nimport AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';\n\nexport default Route.extend(AuthenticatedRouteMixin, {\n model(...
javascript
chosen
[ { "from": "system", "value": "Change return value of getResults\n" }, { "from": "human", "value": "define([\"underscore\", \"jquery\"], function(_, $) {\n return function (averageCartype) {\n\n var public = {};\n var private = {};\n\n private.createObject = function (averageCartype) {\...
javascript
chosen
[ { "from": "system", "value": "Add mocks to search controller tests\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('controllers', function() {\n var httpBackend, scope, createController;\n beforeEach(module('polyflix'));\n\n beforeEach(inject(function($rootScope, $httpBackend, $c...
javascript
chosen
[ { "from": "system", "value": "Change to call improved weather icon lookup functionality.\n" }, { "from": "human", "value": "'use strict';\n\nvar angular = require('angular'),\n lookupWeatherIcon = require('../lookup-weather-icon'),\n unixTimestamp = require('unix-timestamp'),\n moment =...
javascript
chosen
[ { "from": "system", "value": "Remove the title from the cookie message link\n\nIt’s unnecessary and doesn’t give an accessibility benefit. Thanks to @trevorsaint for catching this." }, { "from": "human", "value": "// Use this file to change prototype configuration.\n\n// Note: this config can be...
javascript
chosen
[ { "from": "system", "value": "Copy only main.css if css framework is selected\n" }, { "from": "human", "value": "import { join } from 'path';\nimport { cpy } from '../utils';\n\nasync function generatePlainCssPreprocessor(params) {\n const cssDir = join(__base, 'build', params.uuid, 'public', '...
javascript
chosen
[ { "from": "system", "value": "Add Firebase dependency in modules\n" }, { "from": "human", "value": "'use strict';\n\n\n// Declare app level module which depends on filters, and services\nangular.module('myApp', [\n 'ngRoute',\n 'myApp.filters',\n 'myApp.services',\n 'myApp.directives',\n 'm...
javascript
chosen
[ { "from": "system", "value": "Add ngCookie module dependency in order to use service\n" }, { "from": "human", "value": "'use strict';\n\nvar eventsApp = angular.module('eventsApp', ['ngResource'])\n\t.factory('myCache', function($cacheFactory) {\n\t\treturn $cacheFactory('myCache', {capacity: 3...
javascript
chosen
[ { "from": "system", "value": "Disable security rules because they are note related with user input\n" }, { "from": "human", "value": "import fs from 'fs';\nimport express from 'express';\nimport favicon from 'serve-favicon';\nimport path from 'path';\nimport { config } from '../../config/applica...
javascript
chosen
[ { "from": "system", "value": "Fix download link in file settings dialog\n\nEvent listener on parent element prevented default.\n" }, { "from": "human", "value": "/**\n * Display view for a link to a URL, to be used like an input view.\n *\n * @param {string} [options.propertyName]\n * Target U...
javascript
chosen
[ { "from": "system", "value": "Add median/avg response time stats functions.\n" }, { "from": "human", "value": "var _ = require('underscore'),\n moment = require('moment');\n\nfunction Stats() {\n this.outstandingPings = {};\n this.responseTimes = [];\n}\n\nStats.prototype.makeKey = func...
javascript
chosen
[ { "from": "system", "value": "Update return annotation and add missing semicolon\n" }, { "from": "human", "value": "'use strict';\n\n/**\n* Return a random permutation of elements from an array-like object.\n*\n* @module @stdlib/math/generics/random/shuffle\n*\n* @example\n* var shuffle = requir...
javascript
chosen
[ { "from": "system", "value": "Revert \"New select test scenario. Not passing yet.\"\n\nThis reverts commit 528eefaa2ba52a887712419d29b9e464bb747fc5.\n" }, { "from": "human", "value": "\"use strict\";\nmodule.loaded = false;\nmodule.exports.examples = [\n {incoming: 'select A as [Yuba dubba]', e...
javascript
chosen
[ { "from": "system", "value": "Allow conroller to set editable state\n" }, { "from": "human", "value": "var _ = require('underscore'),\n ControlBones = require('./ControlBones'),\n AmountEntry = require('../model/AmountEntry'),\n AmountEntryCollection = require('../model/AmountEntryColle...
javascript
chosen
[ { "from": "system", "value": "Add option to include specified tech(bemhtml, bh)\n" }, { "from": "human", "value": "module.exports = function() {\n\n return this\n .title('Benchmarks')\n .helpful()\n .arg()\n .name('treeish-list')\n ...
javascript
chosen
[ { "from": "system", "value": "Remove commented import in htmlbars component lookup test.\n" }, { "from": "human", "value": "import EmberView from \"ember-views/views/view\";\nimport Registry from \"container/registry\";\nimport compile from \"ember-template-compiler/system/compile\";\nimport Com...
javascript
chosen
[ { "from": "system", "value": "Fix formatting inside of image tags\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Text, View, Image} from 'react-native';\nimport { StackNavigator } from 'react-navigation';\nimport styles from './styles/LaunchScreenStyle';\n...
javascript
chosen
[ { "from": "system", "value": "Bring into line with new styles\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n\nvar React = require('react'),\n\tTappable = require('../../touchstone/tappable');\n\nmodule.exports = React.createClass({\n\tdisplayName: 'RadioList',\n\n\tpropTypes: {\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Make a comment as \"not yet implemented fully\"\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * 영역 박스\n * @class BoundingSphere\n */\nvar BoundingSphere = function() \n{\n\tif (!(this instanceof BoundingSphere)) \n\t{\n\t\tthrow new Error(Messages.CONSTR...
javascript
chosen
[ { "from": "system", "value": "Support exponential syntax in number and percentage regular expression.\n" }, { "from": "human", "value": "let percentReg = /^(-?\\d+(?:\\.\\d+)?)(%?)$/;\nexport default function (percent) {\n let matched = percent.match(percentReg);\n if (!matched) {\n ...
javascript
chosen
[ { "from": "system", "value": "Enable CORS on the API server.\n" }, { "from": "human", "value": "var express = require('express');\nvar MetaInspector = require('node-metainspector');\nvar app = express();\n\napp.get('/api/v1/urlmeta/:url', function(req, res) {\n var client = new MetaInspector(...
javascript
chosen
[ { "from": "system", "value": "Change route transition so it redirects back to 'start' when websocket isn't OPEN\n" }, { "from": "human", "value": "export function runBlock($log, $state, $trace, $transitions) {\n\t'ngInject';\n\n\t// Enable logging of state transition\n\t$trace.enable('TRANSITION...
javascript
chosen
[ { "from": "system", "value": "[TASK] Change the order of the docs compile task\n\nSince the styleguide is now based on top of the generated .css file\n" }, { "from": "human", "value": "/**\n * Compile:documentation task.\n * Create the extension documentation/styleguide.\n */\n\nmodule.exports =...
javascript
chosen
[ { "from": "system", "value": "Update with reference to global nav partial\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tachyon...
javascript
chosen
[ { "from": "system", "value": "Use URL git to clone base repositories\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar wizard = require('../lib/wizard'),\n\tprogram = require('commander');\n\nprogram\n .description('Create a BASEL application in the current working directory')\n .opt...
javascript
chosen
[ { "from": "system", "value": "Make sure functional getters are added to the getters registry\n" }, { "from": "human", "value": "import pickBy from 'lodash/pickBy';\nimport isEmpty from 'lodash/isEmpty';\nimport isArray from 'lodash/isArray';\nimport isFunction from 'lodash/isFunction';\n\nexport...
javascript
chosen
[ { "from": "system", "value": "Add the extension version to the log data collected.\n" }, { "from": "human", "value": "function handleLogRequest(request) {\n $.post(\"http://dominion-point-counter.appspot.com/log_game\", request);\n}\n\nfunction handleFetchRequest(request, sendResponse) {\n $.g...
javascript
chosen
[ { "from": "system", "value": "refactor: Set trains page as home page\n\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport config from './config/environment';\n\nconst Router = Ember.Router.extend({\n location: config.locationType,\n rootURL: config.rootURL,\n route: functio...
javascript
chosen
[ { "from": "system", "value": "Switch title of final example\n" }, { "from": "human", "value": "// This is the view in detail area which is instantiate within mailInbox.controller.js.\nsap.ui.jsview(\"view.demoFive.Demo\", {\n\n\tgetControllerName: function() {\n\t\treturn \"view.demoFive.Demo\";...
javascript
chosen
[ { "from": "human", "value": "Add Array.indexOf polyfill for IE8\n" }, { "from": "gpt", "value": "if (!Array.prototype.indexOf) {\n Array.prototype.indexOf = function (searchElement, fromIndex) {\n if ( this === undefined || this === null ) {\n throw new TypeError( '\"this\" ...
javascript
chosen
[ { "from": "system", "value": "Update: Add process title & improve callback invocation\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\nvar Liftoff = require('liftoff');\n\nvar Hacker = new Liftoff({\n localDeps: ['hacker'],\n configName: 'hackerfile',\n cwdOpt: 'cwd',\...
javascript
chosen
[ { "from": "system", "value": "Use existing `asMatcher` instead of `toMatcher`\n" }, { "from": "human", "value": "'use strict';\n\nconst _ = require('lodash');\nconst AssertionError = require('assertion-error');\nconst Description = require('./Description');\nconst {isMatcher} = require('./matche...
javascript
chosen
[ { "from": "system", "value": "Add comments explaining future use of compareStrings()\n" }, { "from": "human", "value": "\n// group together entries from different stores\nvar simplifyString = function simplifyString(string) {\n return string.toLowerCase().split(/\\W/).filter(function(e) { ret...
javascript
chosen
[ { "from": "system", "value": "Remove console.log and add explanation\n" }, { "from": "human", "value": "$(document).ready(function() {\n var $separators = $('div.text-wrapper-static-home > hr');\n \n var separator_predecessors = [];\n \n $separators.each(function(index, element) {...
javascript
chosen
[ { "from": "system", "value": "Fix for error that appears on npm run lint:fix" }, { "from": "human", "value": "function setup() {\n createCanvas(windowWidth, windowHeight, WEBGL);\n\n // controls should work whether or not camera center is set to (0,0,0)\n // camera(0, 0, 500, 300, 0, 0, 0, 1,...
javascript
chosen
[ { "from": "system", "value": "Fix export method of package entry point\n\nThe ES2015 \"export default\" syntax returns the exported properties in a\n\"default\" property when imported with require().\n\nThe module.exports method will behave identically for import and\nrequire().\n" }, { "from": "hum...
javascript
chosen
[ { "from": "system", "value": "Change data loading. Added ajax load.\n" }, { "from": "human", "value": "import SexyDropdown from \"./components/SexyDropdown.jsx\";\nimport APISearchItems from \"./api-search-items\";\n\nexport {\n APISearchItems,\n SexyDropdown\n}\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Add syntax examples to test suite\n" }, { "from": "human", "value": "describe(\"Gilded Rose\", function() {\n\n it(\"should do something\", function() {\n\n });\n\n});\n" }, { "from": "gpt", "value": "describe(\"Gilded Rose\", function() {\n\n it(\"sh...
javascript
chosen
[ { "from": "system", "value": "Add info containers to EVENTINFO view\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport {\n Text,\n View,\n TouchableHighlight,\n LayoutAnimation,\n StyleSheet,\n Image\n} from 'react-native'\n\nimport { connect } from 'react-...
javascript
chosen
[ { "from": "system", "value": "Create a dummy console for browsers without one\n\nFixes issue with IE8 under Win7\n" }, { "from": "human", "value": "// this code is from developer.mozilla.org\n\n// adds the forEach array method if it doesn't exist\nif ( !Array.prototype.forEach )\n{\n\tArray.prot...
javascript
chosen
[ { "from": "system", "value": "Remove require of old browser lib\n" }, { "from": "human", "value": "/**\n * hobbes.js -- a Java subset interpreter in JavaScript\n * (c) 2010 Johannes Emerich (jemerich@uos.de)\n * v0.1\n */\n\n// TODO\n// - HTML- und CLI-Umgebungen\n// - Vernuenftige Grammatik\n...
javascript
chosen
[ { "from": "system", "value": "Clean up some console chatter\n" }, { "from": "human", "value": "var hooks = require('hooks');\nvar async = require('async');\n\nfunction Renderable(View) {\n this.data = {};\n this.mode = 'main';\n this.view = {};\n\n if (typeof View === 'function') {\n this...
javascript
chosen
[ { "from": "system", "value": "Add input fields changing location state.\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport NavBar from './NavBar';\n\nexport default class App extends Component {\n render() {\n return (\n <div>\n <h1>Test</h1>\n ...
javascript
chosen
[ { "from": "system", "value": "Fix checking if an element is attached to the document\n" }, { "from": "human", "value": "var _ = require('_'),\n _cache = require('./cache'),\n _nodeNameCache = _cache();\n\nmodule.exports = {\n isAttached: function(elem) {\n return (elem.ownerDocum...
javascript
chosen
[ { "from": "system", "value": "Remove requirement for setup script to be on an entity." }, { "from": "human", "value": "(function () {\n var _fb = false;\n var _pc = false;\n var _inst = null;\n\n window.fbAsyncInit = function() {\n FB.init({\n appId : '12388160...
javascript
chosen
[ { "from": "system", "value": "Remove broken (albeit angular-suggested) exception annotation\n" }, { "from": "human", "value": "'use strict';\n\nif (DEBUG) app.factory('$exceptionHandler', [\n '$log',\n function ($log) {\n return function (exception, cause) {\n if (cause)\n excep...
javascript
chosen
[ { "from": "system", "value": "Handle url encodings in address\n" }, { "from": "human", "value": "import React from 'react';\nimport addressbar from 'addressbar';\n\nexport default class LocationBar extends React.Component {\n componentDidMount() {\n addressbar.on('change', this.onUrlChange.b...
javascript
chosen
[ { "from": "system", "value": "Use promises to express CompilerCollection::transform\n" }, { "from": "human", "value": "var async = require('async')\nvar RSVP = require('rsvp')\n\nvar transformers = require('../transformers')\nvar Component = require('../component').Component\n\n\nexports.Compile...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Setting siderbar styles fix for Edge\"\"\n\nThis reverts commit 64a8ef7cd90172c97a70170f941ee5c703473ddb.\n" }, { "from": "human", "value": "(function($) {\n\n function init() {\n /* Sidebar height set */\n $sidebarStyles = $('.sidebar').attr...
javascript
chosen
[ { "from": "system", "value": "Exit with non-zero when error occurs\n" }, { "from": "human", "value": "'use strict';\nconst path = require('path');\nconst binBuild = require('bin-build');\nconst log = require('logalot');\nconst bin = require('.');\n\nconst args = [\n\t'-copy',\n\t'none',\n\t'-opt...
javascript
chosen