conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use a unique key for each screenshot\n" }, { "from": "human", "value": "/**\n * React Starter Kit (https://www.reactstarterkit.com/)\n *\n * Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.\n *\n * This source code is licensed under the MIT license found in...
javascript
chosen
[ { "from": "system", "value": "Fix bug breaking redux store shape\n\nThis component was mutating objects passed in as props. Those props were\nobjects from the redux store. Since they are all references to the same\nobject, mutating them will mutate the redux store, which is bad.\n\nThis change creates a clo...
javascript
chosen
[ { "from": "system", "value": "Set topic rather than queue.\n" }, { "from": "human", "value": "function Message(queue, message, headers, deliveryInfo) {\n // Crane uses slash ('/') separators rather than period ('.')\n this.queue = deliveryInfo.routingKey.replace(/\\./g, '/');\n this.headers =...
javascript
chosen
[ { "from": "system", "value": "Fix total lines at end\n" }, { "from": "human", "value": "/**\n * Generate a blob link.\n * @param {string} file - File name\n * @param {string} contents - Contents of the file\n * @param {string} title - The title of the new issue\n * @param {string} sha - Commit w...
javascript
chosen
[ { "from": "system", "value": "Append definition id as param\n" }, { "from": "human", "value": "'use strict';\n\nvar nodes = require('../node');\n\nvar typeNodeMap = Object.keys(nodes).reduce(function(typeNodeMap, modelName) {\n typeNodeMap[nodes[modelName].TYPE] = nodes[modelName];\n retur...
javascript
chosen
[ { "from": "system", "value": "Update to artwork example to get the `data` as well.\n" }, { "from": "human", "value": "var iTunes = require('../')\n , conn = null\n\niTunes.createConnection(onConn);\n\nfunction onConn (err, c) {\n if (err) throw err;\n conn = c;\n conn.selection( onSelectio...
javascript
chosen
[ { "from": "system", "value": "Decrease idle time for connection pool.\n" }, { "from": "human", "value": "var fs = require('fs')\n , path = require('path')\n , Sequelize = require('sequelize')\n , _ = require('lodash')\n , config = require('../../config/secrets')\n , db = {};\n\nvar sequeliz...
javascript
chosen
[ { "from": "system", "value": "Update computed properties to update when input changes" }, { "from": "human", "value": "import Ember from 'ember'\nimport layout from './template'\n\nconst {\n Component,\n computed\n} = Ember\n\nexport default Component.extend({\n classPrefix: 'svg-icon',\n ic...
javascript
chosen
[ { "from": "system", "value": "Access login and signup btns\n" }, { "from": "human", "value": "$(document).ready(function() {\n // This is called after the document has loaded in its entirety\n // This guarantees that any elements we bind to will exist on the page\n // when we try to bind to t...
javascript
chosen
[ { "from": "system", "value": "[update] Use environment variables defined by user.\n\nInstead of using docker automatic variables to access multilevel, let the user\nset these variables, this makes the startup process more user friendly.\n" }, { "from": "human", "value": "'use strict';\nvar net =...
javascript
chosen
[ { "from": "system", "value": "Make the redux -> widgets logic a little bit smarter\n" }, { "from": "human", "value": "import Rx from 'rxjs/Rx';\nimport difference from 'lodash.difference';\n\n/**\n * Updates widget models based on the redux store state.\n */\nexport class ModelUpdater {\n\n /**...
javascript
chosen
[ { "from": "system", "value": "Send user to home page wen logging out\n" }, { "from": "human", "value": "define([\n\n 'Backbone',\n\n //Template\n 'text!templates/topNavTemplate.html'\n], function(\n\n Backbone,\n\n //Template\n topNavTemplate\n\n){\n\n var TopNavView = Backbone.View.exten...
javascript
chosen
[ { "from": "system", "value": "Adjust posted and add fromNow calculation\n\nHandle a special case where stories published on different days had the\nsame fromNow result. By checking if the post is same-day or not, we\ncalculate the duration of a moment from today's start to the publish\ndate. Humanize then h...
javascript
chosen
[ { "from": "system", "value": "Enable cancel button to revert the answer back to its previous value\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('confRegistrationWebApp')\n .controller('EditAnswerDialogCtrl', function ($scope, $modalInstance) {\n $scope.close = function ...
javascript
chosen
[ { "from": "system", "value": "Add new subdomain to cert checker\n" }, { "from": "human", "value": "'use strict';\n\nconst tls = require('tls');\nconst Promise = require('bluebird');\nconst moment = require('moment');\n\nconst SITES = ['porybox.com', 'hq.porygon.co'];\n\nmodule.exports = {\n per...
javascript
chosen
[ { "from": "system", "value": "Add links dependent on `loggedIn`\n" }, { "from": "human", "value": "import React from \"react\";\nimport {IndexLink, Link} from 'react-router';\n\nexport default class Header extends React.Component {\n render() {\n return (\n <div className=\"ui text cont...
javascript
chosen
[ { "from": "system", "value": "Use more robust way to keep the timer reference alive.\n\nStrict mode generates a warning about |timer;| being a useless\nexpression, which suggest that this might be optimized away at some\npoint (see also https://bugzil.la/640629#c9). Instead, explicitly\nstore the timer in t...
javascript
chosen
[ { "from": "system", "value": "Add styles to Inventory Scene\n" }, { "from": "human", "value": "import React from 'react'\nimport InventoryContainer from '../containers/InventoryContainer'\nimport ShadowBox from '../Components/ShadowBox'\nimport FlexDiv from '../Components/FlexDiv'\n\nconst Inven...
javascript
chosen
[ { "from": "system", "value": "Reset browser sync to Google Chrome Canary\n" }, { "from": "human", "value": "var path = require('path');\nvar browserSync = require('browser-sync');\nvar gulp = require('gulp');\nvar webpack = require('webpack');\nvar webpackDevMiddleware = require('webpack-dev-mid...
javascript
chosen
[ { "from": "system", "value": "Add TODO for handling failed signup\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Field, reduxForm } from 'redux-form';\nimport { connect } from 'react-redux';\nimport { withRouter } from 'react-router-dom';\n\nimport { regis...
javascript
chosen
[ { "from": "system", "value": "Fix \"ReferenceError: Bob is not defined\" for correct use of module.exports\n" }, { "from": "human", "value": "require('./bob');\n\ndescribe(\"Bob\", function() {\n var bob = new Bob();\n\n it(\"stating something\", function() {\n var result = bob.hey('Tom-ay-...
javascript
chosen
[ { "from": "system", "value": "Add correct margin to x-axis\n" }, { "from": "human", "value": "(function(d3, fc, sc) {\n 'use strict';\n\n sc.chart.xAxis = function() {\n\n var xAxisHeight = 23;\n var xScale = fc.scale.dateTime();\n var xAxis = d3.svg.axis()\n ...
javascript
chosen
[ { "from": "system", "value": "Use a chain instead of named variables\n" }, { "from": "human", "value": "\n/* Account login state manager\n */\n\nimport _ from 'lodash'\nimport db from './db'\nimport { storeKey } from './config'\n\nexport default setUser\n\nfunction setUser(user) {\n storeKey('u...
javascript
chosen
[ { "from": "system", "value": "Correct the class name.\n[ci skip]\n" }, { "from": "human", "value": "import Ember from 'ember';\n\n/**\n * @module ivy-tree\n */\n\n/**\n * @class IvyTreeComponent\n * @namespace IvyTree\n * @extends Ember.Component\n */\nexport default Ember.Component.extend({\n ...
javascript
chosen
[ { "from": "system", "value": "Add title text to sync button\n" }, { "from": "human", "value": "import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\n\nimport { translate as $t, formatDate } from '../../helpers';\nimport { actions, get } from '.....
javascript
chosen
[ { "from": "system", "value": "Change default storage to file\n" }, { "from": "human", "value": "{\n\n \"host\": \"0.0.0.0\",\n \"port\": 7777,\n\n \"keyLength\": 10,\n\n \"maxLength\": 400000,\n\n \"staticMaxAge\": 86400,\n\n \"recompressStaticAssets\": true,\n\n \"logging\": [\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix print bug for Java primitive native array\n\ngit-svn-id: 5d5bc0d97dbe9d074e4c1656445fd2f468e4e619@219 5a62d92b-e016-0410-9103-b89fe532bb34\n" }, { "from": "human", "value": "/*\n * This file contains methods to print message on console.\n *\n * @author Laurent J...
javascript
chosen
[ { "from": "system", "value": "Add try/catch into unhandled exception handler\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/*global nodeca*/\n\n'use strict';\n\n// Create and run app\nvar app = require('nlib').Application.create({\n name: 'nodeca',\n root: __dirname\n});\n\n//\n// ...
javascript
chosen
[ { "from": "system", "value": "Fix trailing slashes output app-wide\n\ncloses #2963, closes #2964\n- override Ember's `HistoryLocation.formatURL`\n- remove overridden `HistoryLocation.setURL`\n" }, { "from": "human", "value": "/*global Ember */\n\nvar trailingHistory = Ember.HistoryLocation.exten...
javascript
chosen
[ { "from": "system", "value": "Add fix for loggerjs breaking change.\n" }, { "from": "human", "value": "var log4js = require('log4js'),\n logger = log4js.getLogger('VirtualBox');\n\nlogger.setLevel('INFO');\n\nmodule.exports = logger;\n\n\n" }, { "from": "gpt", "value": "var log4js...
javascript
chosen
[ { "from": "system", "value": "Stop triggering onRegister if we haven't set it up yet.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/smd-selector-button';\nimport Setup from '../mixins/setup';\n\nvar get = Ember.get;\n\nexport default E...
javascript
chosen
[ { "from": "system", "value": "Normalize paths based on config.json dirname\n" }, { "from": "human", "value": "var fs = require('fs')\nvar path = require('path')\n\nvar Options = function(configPath) {\n\n var rawData = fs.readFileSync(path.join(process.cwd(), configPath), 'utf8');\n ...
javascript
chosen
[ { "from": "system", "value": "Add a test for the comma-dangle change\n" }, { "from": "human", "value": "// This file should pass linting based on the tweaks made to the standard,\n// standard-jsx and standard-react presets.\nimport React from 'react'\n\n// Allow == for typeof, which always retur...
javascript
chosen
[ { "from": "system", "value": "Use `collections` array for syncing databases.\n" }, { "from": "human", "value": "// Dependencies\nvar MongoSyncFiles = require(\"../index\")\n , Faker = require(\"faker\")\n ;\n\n// Create database instance\nvar MyDatabase = new MongoSyncFiles();\n\nfunction gene...
javascript
chosen
[ { "from": "system", "value": "Update test to use Mocha's promise handling\n" }, { "from": "human", "value": "var promisify = require(\"../\");\nvar assert = require(\"assert\");\n\ndescribe(\"Promisify\", function() {\n it(\"can convert a basic async function\", function(done) {\n function t...
javascript
chosen
[ { "from": "system", "value": "Fix admin groups not saving selected scopes or permissions.\n\nThese must be marked with a default value of an array for saving to work\nproperly.\n" }, { "from": "human", "value": "import DS from 'ember-data';\nimport { validator, buildValidations } from 'ember-cp-...
javascript
chosen
[ { "from": "system", "value": "Add active/inactive filter fields to companies\n\nThese are the same filter fields copied from\ncontacts\n" }, { "from": "human", "value": "const { flatten } = require('lodash')\n\nconst { globalFields } = require('../../macros')\nconst FILTER_CONSTANTS = require('....
javascript
chosen
[ { "from": "system", "value": "Update nonprintable keys to include the cmd key\n" }, { "from": "human", "value": "var isNonPrintableKey = function(keyCode) {\n var nonPrintableKeys, modifierKeys, arrowKeys, fKeys;\n modifierKeys = [8, 9, 13, 16, 17, 18, 19, 20, 27, 33, 34, 35, 26, 46, 93];\n a...
javascript
chosen
[ { "from": "system", "value": "Fix children type for the Hero component.\n" }, { "from": "human", "value": "import React from \"react\"\nimport PropTypes from \"prop-types\"\nimport styles from \"./index.css\"\n\nconst Hero = ({children}) => (\n <div className={styles.hero}>\n {children...
javascript
chosen
[ { "from": "system", "value": "Fix typo (nil instaed of null)\n" }, { "from": "human", "value": "function BetterContentController(){\n this.listeners = {};\n}\n\nBetterContentController.prototype.registerListener = function(client, func) {\n this.listeners[client] = func;\n}\nBetterContentC...
javascript
chosen
[ { "from": "system", "value": "Set size on SVG in scatterplotSquare example.\n" }, { "from": "human", "value": "\nfunction makeScatterplotSquare() {\n var data = makeNormallyDistributedData(100, 50, 20, 60, 10);\n var dataset = {data: data, metadata: {cssClass: \"transparent-square\"}};\n\n...
javascript
chosen
[ { "from": "system", "value": "Move code to its own function.\n" }, { "from": "human", "value": "const _ = require('lodash')\n\nfunction noSuggestions() {\n return 'Sorry, no suggestions available.'\n}\n\nmodule.exports = (results) => {\n if (_.isEmpty(results.suggestionData)) {\n throw new ...
javascript
chosen
[ { "from": "system", "value": "Support for multiple form validation\n" }, { "from": "human", "value": "\n$(document).ready(function() {\n\n\tautosize($('textarea.autosize'));\n\n\t$(\"form.validate\").validate();\n\n});\n" }, { "from": "gpt", "value": "\n$(document).ready(function() {...
javascript
chosen
[ { "from": "system", "value": "Load footer plugin at hook.mounted.Isolate footer to an article element.\n" }, { "from": "human", "value": "(($docsify)=>{\n if(!$docsify){console.err(\"$docsify no exist.\")}\n if ($docsify) {\n $docsify.plugins = [].concat(docsifyFooter(), $docsify.plugins)\n...
javascript
chosen
[ { "from": "system", "value": "Add validation for true CPF number\n" }, { "from": "human", "value": "/*\n * Validate CPF string with the following format 000.000.000-00\n * Dots and dash separators are optional\n * @param string\n * @return boolean\n */\nfunction isCpf(cpfNumber) {\n var cpfRege...
javascript
chosen
[ { "from": "system", "value": "Fix UI misinformation reported by user\n" }, { "from": "human", "value": "$(function() {\n\n\t/* Add click event listeners to the squares of the month for entering the month calendar detail view. */\n $('[data-month]').each(function (i, monthSquare) {\n v...
javascript
chosen
[ { "from": "system", "value": "Change default value to empty string insted of null\n" }, { "from": "human", "value": "module.exports = function(number, name, group, club) {\n\tthis.number = (number = typeof number !== 'undefined' ? number : null);\n\tthis.name = (name = typeof name !== 'undefined...
javascript
chosen
[ { "from": "system", "value": "Set custom map tiles everywhere.\n" }, { "from": "human", "value": "// Map creation + initialisation\nvar map = L.map('map')\n .setView([55.95, -3.2], 14)\n .addLayer(L.mapbox.tileLayer('jeffbr13.h81gnbgn', {\n detectRetina: true\n }));\n\n\nvar soun...
javascript
chosen
[ { "from": "system", "value": "Use `browser` or `chrome` variable.\n\nChrome's extension APIs are namespaced under `chrome`, while Firefox's\nWebExtension implementation namespaces them under `browser`.\n\nThis commit adds an alias in Chrome so we can use `browser` everywhere.\n" }, { "from": "human"...
javascript
chosen
[ { "from": "system", "value": "Fix error in callback on login post\n" }, { "from": "human", "value": "/**\n * Module dependencies.\n */\nvar passport \t= require('passport'),\n login \t\t= require('connect-ensure-login'),\n \trouter \t\t= require('express').Router(),\n \toauth2 \t= require(...
javascript
chosen
[ { "from": "system", "value": "Remove conditional to support latest Chrome\n" }, { "from": "human", "value": "if(document.querySelector('html').getAttribute('manifest') ==\n '/_/chrome/newtab/manifest?espv=2&ie=UTF-8') {\n document.querySelector('#lga img').setAttribute('style', 'visibility: ...
javascript
chosen
[ { "from": "system", "value": "Fix Error 404 related errors when using React Router\n\nWhen using React Router: Refresh and links don't work smoothly: gives error cannot `GET /some-path`" }, { "from": "human", "value": "// development config\nconst { merge } = require(\"webpack-merge\");\nconst w...
javascript
chosen
[ { "from": "system", "value": "Allow .json files as well\n" }, { "from": "human", "value": "$('#import').click(function() {\n $('input[name=import]').click();\n return false;\n});\n\n$('input[name=import]').change(function() {\n if ($(this).val().substr(-8) != '.geojson') {\n aler...
javascript
chosen
[ { "from": "system", "value": "Remove express reference, send only app object\n" }, { "from": "human", "value": "var studentsController = require('../controllers/students');\nvar teachersController = require('../controllers/teachers');\nvar authenticationController = require('../controllers/authe...
javascript
chosen
[ { "from": "system", "value": "Add envirvonment variable for gh-pages\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 ...
javascript
chosen
[ { "from": "system", "value": "Use templates for stat properties.\n" }, { "from": "human", "value": "import Transform from './Transform';\nimport Stats from '../server/Stats';\n\nexport default class StatsTransform extends Transform {\n constructor(opts, config) {\n super(opts);\n this._st...
javascript
chosen
[ { "from": "system", "value": "Create var for temp and pass into HTML document\n" }, { "from": "human", "value": "\n//Geolocation Function is listed below.\n\nfunction geoLocation() {\n var output = document.getElementById(\"out\");\n\n /*$.getJSON('https://ipinfo.io/geo', function(response...
javascript
chosen
[ { "from": "system", "value": "Set bluebird as a Promise lib for mongoose\n" }, { "from": "human", "value": "const mongoose = require('mongoose');\nconst config = require('./src/config/config');\n\nconst app = require('./src/app')(mongoose);\nconst port = config.PORT;\n\napp.listen(port, () => {\...
javascript
chosen
[ { "from": "system", "value": "Print errors to console.error so they show up in Azure Logs. Rearranged app.use statements\n" }, { "from": "human", "value": "var express = require('express')\nvar compression = require('compression')\nvar exphbs = require('express-handlebars')\nvar database = requ...
javascript
chosen
[ { "from": "system", "value": "Move guard clause into if condition\n" }, { "from": "human", "value": "myApp.service('breadCrumbService', function($location) {\n\n this.crumbs = [\n ];\n\n this.current = {\n path: './',\n display:'Inventories'\n };\n\n this.update = fu...
javascript
chosen
[ { "from": "system", "value": "Add id param for the sensor-detail.html page\n" }, { "from": "human", "value": "(function(){\n $.ajax({\n url: 'evanxd/sensors',\n })\n .done(function(sensors) {\n var sensorList = $('#sensor-list ul');\n var html = '';\n sensors.forEach(function(sens...
javascript
chosen
[ { "from": "system", "value": "Add legacy route to keep indexation\n" }, { "from": "human", "value": "var express = require('express');\nrequire('./server/mongoose');\nvar api = require('./server/api');\nvar morgan = require('morgan');\nvar httpProxy = require('http-proxy');\n\nvar app = express(...
javascript
chosen
[ { "from": "system", "value": "Comment out dotenv for heroku deployment\n" }, { "from": "human", "value": "'use strict';\n\nvar express = require('express');\nvar routes = require('./app/routes/index.js');\nvar mongoose = require('mongoose');\nvar passport = require('passport');\nvar session = re...
javascript
chosen
[ { "from": "system", "value": "Test that config passed to constructor is valid\n\nRunner must receive a string representing the relative filepath to a config that\nis exists, is valid JSON, and is formatted correctly with the expected keys.\n" }, { "from": "human", "value": "/* global describe, i...
javascript
chosen
[ { "from": "system", "value": "Make test logging work with newer version of MegaLogger\n" }, { "from": "human", "value": "asmCrypto.random.skipSystemRNGWarning = true;\nlocalStorage.minLogLevel = 50;\n" }, { "from": "gpt", "value": "asmCrypto.random.skipSystemRNGWarning = true;\nlocal...
javascript
chosen
[ { "from": "system", "value": "Add custom app and tray menus\n" }, { "from": "human", "value": "'use strict'\n\nconst path = require('path')\nconst electron = require('electron')\nconst app = electron.app\nconst Tray = electron.Tray\nconst BrowserWindow = electron.BrowserWindow\n\nlet tray = null...
javascript
chosen
[ { "from": "system", "value": "Call the base class constructor\n" }, { "from": "human", "value": "\"use strict\";\n\nclass Foo {\n method (name) {\n console.log(\"Foo: \", name);\n }\n method2 (name) {\n console.log(\"Foo: \", name);\n }\n}\n\nclass Bar extends Foo {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove set type method of Command class\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = class Command {\n constructor() {\n if (this.constructor.name == 'Command')\n throw new TypeError('Command is abstract!');\n this...
javascript
chosen
[ { "from": "system", "value": "Add isRoleOfGuild service, add null check to getRole\n" }, { "from": "human", "value": "const RedisRole = require('../../structs/db/Redis/Role.js')\n\nasync function getRole (roleID) {\n const role = await RedisRole.fetch(roleID)\n return role.toJSON()\n}\n\nasync...
javascript
chosen
[ { "from": "system", "value": "Remove duplicate make_channel from test\n" }, { "from": "human", "value": "/**\n * A simple request test. This measures the time between creation of the request channel\n * and first delivery of the data and time needed to deliver all data expected plus an overall\...
javascript
chosen
[ { "from": "system", "value": "Test that hooks still work in Mocha\n" }, { "from": "human", "value": "var cort = require( \"../mocha\" ); \n\nit = cort( it );\n\ndescribe( \"cort/mocha tests\", () => {\n it( \"Minimal\", function( later, done ) {\n var total = 3;\n\n later( () =>...
javascript
chosen
[ { "from": "system", "value": "Add anonymous function support to dispatcher" }, { "from": "human", "value": "var Dispatcher = App.Dispatcher = {};\n\nDispatcher.extend = function (proto) {\n proto.addListener = addListener;\n proto.triggerListeners = triggerListeners;\n};\n\nfunction addListene...
javascript
chosen
[ { "from": "system", "value": "Increase timeout for Wit.ai speech-to-text plugin\n" }, { "from": "human", "value": "var Donna = require('../../src/');\n\nvar assert = require(\"assert\");\n\ndescribe('Wit.ai Plugin', function() {\n\n describe('#intent extraction()', function() {\n\n bef...
javascript
chosen
[ { "from": "system", "value": "Fix default newtab; optimize process to make page active\n" }, { "from": "human", "value": "\nfunction nt (newtab) {\n\tfunction waitForURL(tabId, changeInfo, tab) {\n\t\tconsole.log(changeInfo);\n\t\tif (changeInfo.title === '@NewTab') {\n\t\t\tbrowser.storage.loca...
javascript
chosen
[ { "from": "system", "value": "Add information message for 'widget list remove'\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n var program = require('./../src/customcommander');\n var registrycontroller = require('./../src/registrycontroller');\n var rmdir = req...
javascript
chosen
[ { "from": "system", "value": "Update to new DBWrkr test structure\n" }, { "from": "human", "value": "/* eslint no-console: 0 */\nconst DBWrkrMongoDb = require('../dbwrkr-mongodb');\nconst dbWrkrTests = require('dbwrkr').tests;\n\n\nconst testOptions = {\n storage: new DBWrkrMongoDb({\n dbNam...
javascript
chosen
[ { "from": "system", "value": "Fix end to end testing by increasing mocha timeout (again)\n\nSigned-off-by: Joe Walker <7a17872fbb32c7d760c9a16ee3076daead11efcf@mozilla.com>\n" }, { "from": "human", "value": "/* eslint prefer-arrow-callback: 0 */\n\nimport expect from 'expect';\nimport { Applicat...
javascript
chosen
[ { "from": "system", "value": "Add doc string to prescriptSummaryRow\n" }, { "from": "human", "value": "/* eslint-disable react/forbid-prop-types */\n/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nimport React from 'react';\nimport { View, StyleSheet } from 'react-native'...
javascript
chosen
[ { "from": "system", "value": "Add image column to database\n" }, { "from": "human", "value": "module.exports = function(sequelize, Sequelize) {\n\n var User = sequelize.define('users', {\n id: {\n type: Sequelize.INTEGER,\n primaryKey: true,\n allowNull: false,\n autoIncr...
javascript
chosen
[ { "from": "system", "value": "Add FilePicker widget to bundle\n" }, { "from": "human", "value": "export VeritoneApp from './shared/VeritoneApp';\nexport AppBar from './widgets/AppBar';\nexport OAuthLoginButton from './widgets/OAuthLoginButton';\n" }, { "from": "gpt", "value": "export...
javascript
chosen
[ { "from": "system", "value": "Update: Refactor Javascript Decorator to match best practices\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('<%= scriptAppName %>')\n .config(function ($provide) {\n $provide.decorator('<%= cameledName %>', function ($delegate) {\n // d...
javascript
chosen
[ { "from": "system", "value": "Make the tests work without olm\n\nOlm is an optional dependency, so the tests should work without it.\n" }, { "from": "human", "value": "\n\"use strict\";\nconst Crypto = require(\"../../lib/crypto\");\nconst sdk = require(\"../..\");\n\ndescribe(\"Crypto\", functi...
javascript
chosen
[ { "from": "system", "value": "Fix model config to alter on every change\n" }, { "from": "human", "value": "/**\n * Default model configuration\n * (sails.config.models)\n *\n * Unless you override them, the following properties will be included\n * in each of your models.\n *\n * For more info o...
javascript
chosen
[ { "from": "system", "value": "Update toogle-button to prevent click bubbling" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n classNames: ['rl-dropdown-toggle'],\n\n tagName: 'button',\n\n attributeBindings: ['type'],\n\n type: function...
javascript
chosen
[ { "from": "system", "value": "Improve feeling when switching tab\n" }, { "from": "human", "value": "import PropTypes from 'prop-types';\nimport React from \"react\";\n\nimport Loading from '../components/Loading';\nimport Error from '../components/Error';\n\nconst DataWrapper = ({error, loading,...
javascript
chosen
[ { "from": "system", "value": "Remove raf polyfill in jest setup\n" }, { "from": "human", "value": "import 'raf/polyfill';\nimport { configure } from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\n\nconfigure({ adapter: new Adapter() });\n" }, { "from": "gpt", "value": "im...
javascript
chosen
[ { "from": "system", "value": "Abort pending requests when there is a new event\n" }, { "from": "human", "value": "var timeouts = [];\nfunction updateResults(e) {\n if (e.which === 0) {\n return;\n }\n var query = $(\"#query\").val();\n for (var x=0; x<timeouts.length; x++) {\n clearT...
javascript
chosen
[ { "from": "system", "value": "Add Total number of Objects Expected\n\nAdd more requirements for digitization\n" }, { "from": "human", "value": "\n/**\n * [schema defines validation schemas for Mongo\n * documents being inserted into db:ibu collection:ibuerrors]\n *\n */\n // Mongoose connection ...
javascript
chosen
[ { "from": "system", "value": "Use opcode function in test\n" }, { "from": "human", "value": "const test = require('tap').test;\nconst TextToSpeech = require('../../src/extensions/scratch3_text2speech/index.js');\n\nconst fakeStage = {\n textToSpeechLanguage: null\n};\n\nconst fakeRuntime = {\...
javascript
chosen
[ { "from": "system", "value": "Check for X-Forwarded-Proto HTTP header before attempting to unnecessarily redirect to HTTPS\n" }, { "from": "human", "value": "var configuration = require(\"configvention\"),\n urlUtil = require(\"url\"),\n\n redirectRequestToHttps = function(req, res) {\n ...
javascript
chosen
[ { "from": "system", "value": "Enable debug mode by default in this test app\n" }, { "from": "human", "value": "/* global DartsUi */\n\n'use strict';\n\nfunction main () {\n var dartsUi = new DartsUi('#darts-ui');\n\n // dartsUi.focus(13, '1-o');\n // dartsUi.blur(13, '1-o');\n // dartsUi.foc...
javascript
chosen
[ { "from": "system", "value": "Put timestamp first in output\n" }, { "from": "human", "value": "//! dnajs-smart-update-websockets ~ MIT License\n\nconst app = {\n wsUrl: 'ws://localhost:7777/',\n ws: null, //instance of WebSocket\n wsSend: (message) => {\n message.timestamp = Date.now...
javascript
chosen
[ { "from": "system", "value": "Switch to results panel when Search is clicked\n" }, { "from": "human", "value": "App.Search.SearchPanel = Ext.extend(App.Search.SearchPanelUi, {\n nSearchPanels: 0,\n\tresultPagerSize: 15,\n\n initComponent: function() {\n if(this.constructor.prototype.nSearch...
javascript
chosen
[ { "from": "system", "value": "Change value to c to make figuring out its HTML less confusing.\n" }, { "from": "human", "value": "\n$(document).ready(function() {\n var data = {};\n\n \n $('#testform').render({\n ifaces: ['viewform'],\n form: {\n widgets: ...
javascript
chosen
[ { "from": "system", "value": "Change to req.protocol for https discrimination\n\n" }, { "from": "human", "value": "var express = require('express');\n\n// Create our app\nvar app = express();\nconst PORT = process.env.PORT || 3100;\n\napp.use(function (req, resp, next) {\n if(req.headers['...
javascript
chosen
[ { "from": "system", "value": "Fix config test expected error message.\n" }, { "from": "human", "value": "'use strict';\n\nvar expect = require('chai').expect,\n config = require('../../../config/config');\n\ndescribe('config', function () {\n\n describe('getConfig', function () {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the one byte ESlint didn't like\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport PipelineIcon from '../icons/Pipeline';\n\nclass Welcome extends React.Component {\n static propTypes = {\n organizati...
javascript
chosen
[ { "from": "system", "value": "Update two upcoming days in every 10 minutes\n" }, { "from": "human", "value": "process.env.NEW_RELIC_ENABLED = true\nrequire('newrelic')\nvar DateTime = require('dateutils').DateTime\nvar dao = require('./src/dao/dao')\nvar daysAhead = 0\nvar maxDaysAhead = 60\n\nd...
javascript
chosen
[ { "from": "system", "value": "Make pagination links work inside modal\n" }, { "from": "human", "value": "$(function () {\n $(document).on('click', '.modal a.image', function (e) {\n e.preventDefault();\n\n var selected_image_id = $(this).data('image');\n var selected_image_url = $(this...
javascript
chosen
[ { "from": "system", "value": "Add nasty jquery scroll to bottom\n" }, { "from": "human", "value": "var ws = new WebSocket(\"ws://\" + location.host + \"/ws\")\n\nws.onmessage = function (event) {\n console.log(event.data)\n $(\"#events\").append(\"<p>\" + event.data + \"</p>\")\n}\n" }, ...
javascript
chosen