conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Improve JSON Tree directive code\n" }, { "from": "human", "value": "(function(kopf, JSONTree) {\n \"use strict\";\n kopf.directive('kopfJsonTree',function() {\n var directive = {\n restrict: 'E',\n template:'<div class=\"json-tree\"></div>',\n li...
javascript
chosen
[ { "from": "system", "value": "Check if SMTP is enabled.\n" }, { "from": "human", "value": "Registrants.after.insert(function (userId, document) {\n var to = document.createdByEmail,\n from = process.env.MAIL_FROM,\n name = document.first_name,\n html = 'We have received y...
javascript
chosen
[ { "from": "system", "value": "Update hash link tests to use enzyme.\n" }, { "from": "human", "value": "/* Copyright (C) 2017 Canonical Ltd. */\n'use strict';\n\nconst React = require('react');\n\nconst HashLink = require('./hash-link');\nconst SvgIcon = require('../svg-icon/svg-icon');\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Fix standalone timeline (show community timeline again)\n" }, { "from": "human", "value": "import React from 'react';\nimport { Provider } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport configureStore from '../store/configureStore';\nimport { hydra...
javascript
chosen
[ { "from": "system", "value": "Allow custom highlight color in Highlight component\n\n" }, { "from": "human", "value": "//@flow\n\nimport styled, { css } from \"styled-components\";\n\nexport const Underline = styled.span`\n\n ${({ isActive, theme }) => `\n position: relative;\n &:before {...
javascript
chosen
[ { "from": "system", "value": "Fix gulp config require in production\n" }, { "from": "human", "value": "/*\n gulpfile.js\n ===========\n Rather than manage one giant configuration file responsible\n for creating multiple tasks, each task has been broken out into\n its own file in gulp/tasks....
javascript
chosen
[ { "from": "system", "value": "Make js player a little more interesting\n" }, { "from": "human", "value": "//initialize things here if necessary\nvar move = \"rock\";\n\nfunction respond(command) {\n if(command === \"move\")\n return move;\n else\n return \"err\";\n}" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Fix injected file path pointing to root.\n" }, { "from": "human", "value": "'use strict';\n\nrequire('dotenv').load();\n\nvar pkg = require('./package.json'),\n path = require('path');\n\nvar gulp = require('gulp'),\n gutil = require('gulp-util'),\n inject ...
javascript
chosen
[ { "from": "system", "value": "Fix the way to build and test\n" }, { "from": "human", "value": "'use strict';\nvar gulp = require('gulp'),\n jasmine = require('gulp-jasmine'),\n babel = require('gulp-babel'),\n concat = require('gulp-concat');\n\ngulp.task('build', () => {\n return gulp...
javascript
chosen
[ { "from": "system", "value": "Support mapping of http method and setup for express. Setup this.route for each subclass and define GET, POST, … for handling request.\n" }, { "from": "human", "value": "\nvar Base = function(app) {\n\tthis.setup(app);\n};\nBase.METATAGS_VARNAME = 'metaTags';\nBase....
javascript
chosen
[ { "from": "system", "value": "Set default route to checks module\n" }, { "from": "human", "value": "'use strict';\n\n// Setting up route\nangular.module('core').config(['$stateProvider', '$urlRouterProvider',\n\tfunction($stateProvider, $urlRouterProvider) {\n\t\t// Redirect to home view when ro...
javascript
chosen
[ { "from": "system", "value": "Fix project group creation error\n" }, { "from": "human", "value": "\napp.controller('createprojgrpCtrl',['$scope','$location','$routeSegment','$http', '$timeout','$sessionStorage', function($scope,$location,$routeSegment,$http, $timeout,$sessionStorage) {\n\t$scope...
javascript
chosen
[ { "from": "system", "value": "Prepare app for Heroku deploy\n" }, { "from": "human", "value": "const port = '8080';\nconst host = '0.0.0.0';\nconst express = require('express');\nconst app = express();\n\nconst rules = require('./app');\napp.use(rules);\n\napp.listen(port, host);\n\nconsole.log(...
javascript
chosen
[ { "from": "system", "value": "Add login command to cypress on rails support\n" }, { "from": "human", "value": "// ***********************************************\n// This example commands.js shows you how to\n// create various custom commands and overwrite\n// existing commands.\n//\n// For more...
javascript
chosen
[ { "from": "system", "value": "Add decimals, decPoint and thousandsSep params support in humanizeFilesize filter\n" }, { "from": "human", "value": "(function( angular ) {\n 'use strict';\n\n angular.module('angular-humanize', []).\n filter('humanizeFilesize', function () {\n return fun...
javascript
chosen
[ { "from": "system", "value": "Use a more numerically stable algorithm\n" }, { "from": "human", "value": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in complian...
javascript
chosen
[ { "from": "system", "value": "Update demo to use ReactDOM.createRoot\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport App from './App'\n\nReactDOM.render(<App />, document.getElementById('app'))\n" }, { "from": "gpt", "value": "im...
javascript
chosen
[ { "from": "system", "value": "Use a real model in test\n\nFake object wasn't working anymore since this component is now loading\nmore data.\n" }, { "from": "human", "value": "import EmberObject from '@ember/object';\nimport { module, test } from 'qunit';\nimport { setupRenderingTest } from 'emb...
javascript
chosen
[ { "from": "system", "value": "Remove un-needed incoming filter for extension\n" }, { "from": "human", "value": "function FayeAuthentication(endpoint) {\n this._endpoint = endpoint || '/faye/auth';\n}\n\nFayeAuthentication.prototype.endpoint = function() {\n return (this._endpoint);\n};\n\nFaye...
javascript
chosen
[ { "from": "system", "value": "Add clean task for package publishing\n" }, { "from": "human", "value": "/// <binding AfterBuild='nuget-pack' />\n\"use strict\";\n\nvar gulp = require('gulp'),\n path = require('path'),\n exec = require('child_process').exec,\n fs = require('fs');\n\nvar ...
javascript
chosen
[ { "from": "system", "value": "Rewrite to use jquery svg\n" }, { "from": "human", "value": "define([\n 'jquery',\n 'underscore',\n 'backbone',\n 'views/KeyView',\n 'router'\n], function ($, _, Backbone, KeyView, Router) {\n\n var KeyboardView = Backbone.View.extend({\n el: $('#keyboard')...
javascript
chosen
[ { "from": "system", "value": "Revert modules update to file in app directory" }, { "from": "human", "value": "import { computed } from '@ember/object';\nimport Service from '@ember/service';\nimport ENV from '../config/environment';\n\nfunction computedFromConfig(prop) {\n return computed(funct...
javascript
chosen
[ { "from": "system", "value": "Move magic numbers intos consts\n" }, { "from": "human", "value": "module.exports = length => {\n let last = null\n let repeat = 0\n\n length = !length ? 25 : length\n\n return () => {\n let now = Math.pow(10, 2) * +new Date()\n\n if (now == last) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use link to identifiy contributor count on contribution-calendar\n" }, { "from": "human", "value": "import Ember from 'ember'\n\nconst {\n Component,\n computed,\n A: emberA\n} = Ember\n\nexport default Component.extend({\n items: computed(function() { return em...
javascript
chosen
[ { "from": "system", "value": "Add project name in metadata to support local also local deploys\n" }, { "from": "human", "value": "\nvar gulp = require('gulp');\n\nvar template = require('lucify-commons/src/js/lucify-page-def-template.js');\n\nvar opts = {\n\n pageDef: template.apply({\n titl...
javascript
chosen
[ { "from": "system", "value": "Update the USDGBP exchange rate\n" }, { "from": "human", "value": "// https://www.bloomberg.com/quote/USDGBP:CUR\nconst EXCHANGE_RATE_USD_TO_GBP = 0.7189\nconst EXCHANGE_RATE_GBP_TO_USD = parseFloat(\n Number(1 / EXCHANGE_RATE_USD_TO_GBP).toFixed(4)\n)\n\nconst DAT...
javascript
chosen
[ { "from": "system", "value": "Modify to make this file work as is\n\nModified to make this file work as is, without the same file structure" }, { "from": "human", "value": "'use strict';\n\nvar Drone = require('../');\nvar noble = require('noble');\nvar knownDevices = [];\n\nif (this.ble.state =...
javascript
chosen
[ { "from": "system", "value": "Add expres cors headers middleware\n" }, { "from": "human", "value": "const http = require('http');\n\nconst bodyParser = require('body-parser');\nconst cors = require('cors');\nconst express = require('express');\n\nconst isProduction = process.env.NODE_ENV === 'pr...
javascript
chosen
[ { "from": "system", "value": "Modify whitespaces according to ESLint, remove unused key and onClick\n" }, { "from": "human", "value": "import React from 'react';\nimport ClipboardJS from 'clipboard';\nimport 'balloon-css/balloon.css';\n\nexport default class CopyButton extends React.PureComponen...
javascript
chosen
[ { "from": "system", "value": "Fix Form error style below\n" }, { "from": "human", "value": "var ErrorStyleAbove = require('kwf/frontend-form/error-style/above');\nvar kwfExtend = require('kwf/extend');\nvar errorStyleRegistry = require('kwf/frontend-form/error-style-registry');\n\nvar ErrorStyle...
javascript
chosen
[ { "from": "system", "value": "Use local variable to store monkey-patch state\n" }, { "from": "human", "value": "if (console._isPatched) return;\n\nfunction addColor(string, name) {\n var colors = {\n green: ['\\x1B[32m', '\\x1B[39m'],\n red: ['\\x1B[1m\\x1B[31m', '\\x1B[39m\\x1B[22m'],\n ...
javascript
chosen
[ { "from": "system", "value": "Add requireLoginWrapper function to make requireLogin in routes\n" }, { "from": "human", "value": "import createRoutes from './createRoutes'\nimport createContainer from './createContainer'\nimport * as actions from './actions'\nimport reducers from './reducers'\n\n...
javascript
chosen
[ { "from": "system", "value": "Use finally to clean up (hello @sunesimonsen).\n" }, { "from": "human", "value": "var mockfs = require('mock-fs');\nvar fs = require('fs');\nvar MountFs = require('mountfs');\nvar rewriteMockFsOptions = require('./lib/rewriteMockFsOptions');\n\nmodule.exports = {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix error screen usage assignment\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\nimport Icon from './Icon';\nimport InlineCode from './code/InlineCode';\n\nconst Container ...
javascript
chosen
[ { "from": "system", "value": "Use href rather than construct url for last cookie\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n function getExpires() {\n var d = new Date();\n\n // expires in 1 hour from now\n d.setTime(+d + 1000 * 60 * 60);\n return d.toUTCS...
javascript
chosen
[ { "from": "system", "value": "Change express routing for uuids\n" }, { "from": "human", "value": "var express = require('express');\nvar path = require('path');\nvar compression = require('compression');\n\nvar app = express();\n\nvar static_path = path.join(__dirname, '/../build');\n\napp.set('...
javascript
chosen
[ { "from": "system", "value": "Add sanitisation strategy for translation\n" }, { "from": "human", "value": "'use strict';\n\n// Start by defining the main module and adding the module dependencies\nvar app = angular.module(ApplicationConfiguration.applicationModuleName, ApplicationConfiguration.a...
javascript
chosen
[ { "from": "system", "value": "Refactor to aid optimization of non-try/catch code." }, { "from": "human", "value": "'use strict';\n\nvar strValue = String.prototype.valueOf;\n\nmodule.exports = function isString(value) {\n\tif (typeof value === 'string') { return true; }\n\tif (typeof value !== '...
javascript
chosen
[ { "from": "system", "value": "Revert \"does order matter for the view engine?\"\n\nThis reverts commit 523b70a5153c7624fc8d56304133d4a7a7e73d5c.\n" }, { "from": "human", "value": "'use strict';\nvar express = require('express');\nvar path = require('path');\n\nvar port = process.env.PORT || 3000...
javascript
chosen
[ { "from": "system", "value": "Support for Keystone List schemas\n" }, { "from": "human", "value": "function modelToJSON(schema, fn) {\n\tschema.set('toJSON', { transform: function(doc, rtn, options) {\n\t\trtn.id = rtn._id;\n\t\tdelete rtn._id;\n\t\tdelete rtn.__v;\n\t\tif (fn) {\n\t\t\tvar resu...
javascript
chosen
[ { "from": "system", "value": "Make the server able to start...\n" }, { "from": "human", "value": "'use strict';\n\n// var io = require('./server');\nvar config = require('./config');\n\nvar request = require('request');\n\nrequest.get(config.api + '/auth', function(err, res, body) {\n\tconso...
javascript
chosen
[ { "from": "system", "value": "Resolve PhpStorm \"Unresolved Javascript Function\"\n\nHey, \r\n\r\nI know that writing the name of the elixir task twice may be redundant but this allows for PhpSorm to find the function and therefore avoid it from telling that the function was unresolved.\r\n\r\nThanks :)" ...
javascript
chosen
[ { "from": "system", "value": "Use the chai expect syntax\n" }, { "from": "human", "value": "const chai = require('chai')\nconst chaiHttp = require('chai-http')\nconst server = require('../server')\n\nchai.use(chaiHttp)\nchai.should()\n\ndescribe('Black box tests', () => {\n it('GET /index shoul...
javascript
chosen
[ { "from": "system", "value": "Hide wtfnode from browserify etc.\n\nThis reduces the browserified size by ~1MB (i.e. 99%)\n" }, { "from": "human", "value": "'use strict'\n\nvar IS_BROWSER = require('is-browser');\nif (!IS_BROWSER) {\n var wtfnode = require('wtfnode');\n}\nvar Suite = require('./...
javascript
chosen
[ { "from": "system", "value": "Check for users table on app start.\n" }, { "from": "human", "value": "var app = require(\"./app\");\nvar port = process.env.PORT || 5000;\n\napp.listen(port, function() {\n console.log(\"Listening on \" + port);\n});" }, { "from": "gpt", "value": "va...
javascript
chosen
[ { "from": "system", "value": "Add default assertion message for qunit `strictEqual`\n" }, { "from": "human", "value": "document.write('<div id=\"ember-testing-container\"><div id=\"ember-testing\"></div></div>');\n\nEmber.testing = true;\n\nwindow.startApp = require('appkit/tests/helper...
javascript
chosen
[ { "from": "system", "value": "Update log for local server\n" }, { "from": "human", "value": "const cacheManager = require('cache-manager');\nconst createWebhook = require('github-webhook-handler');\nconst createIntegration = require('github-integration');\nconst Raven = require('raven');\nconst ...
javascript
chosen
[ { "from": "system", "value": "Allow custom Cancel button text with buttonText property.\n" }, { "from": "human", "value": "'use strict';\n\nvar React = require('react-native');\nvar Button = require('./button');\nvar FadeInView = require('./fade_in_view');\nvar { Modal, StyleSheet, TouchableOpac...
javascript
chosen
[ { "from": "system", "value": "Add options to disable importing CSS\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ui-slider',\n description: 'A flexible UI slider for ambitious Ember apps',\n included: function(app) {\n let parentAp...
javascript
chosen
[ { "from": "system", "value": "Remove scroll listener if it's still there" }, { "from": "human", "value": "import once from 'one-event';\nimport {getScrollTop, getScrollLeft} from 'get-scroll';\n\nlet state = 'auto';\n\nfunction waitForScroll() {\n\tonce(window, 'scroll', scrollTo.bind(window, ge...
javascript
chosen
[ { "from": "system", "value": "Add condition for production environment.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar http = require('http');\nvar https = require('https');\nvar keyfile = process.env.KEY_FILE;\nvar crtfile = process.env.CRT_FILE;\n\nvar privateKey = fs.readFile...
javascript
chosen
[ { "from": "system", "value": "Fix path for custom plugin\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nconst Funnel = require('broccoli-funnel');\nconst path = require('path');\nconst mergeTrees = require('broccoli-merge-trees');\n\nmodule.exports = {\n name: 'emb...
javascript
chosen
[ { "from": "system", "value": "FIX: Remove g and m flags from autolink regex\n" }, { "from": "human", "value": "/**\n This addition handles auto linking of text. When included, it will parse out links and create\n a hrefs for them.\n**/\nvar urlReplacerArgs = {\n matcher: /^((?:https?:(?:\\/{1...
javascript
chosen
[ { "from": "system", "value": "Adjust Cypress test launcher to v4 format\n" }, { "from": "human", "value": "// ***********************************************************\n// This example plugins/index.js can be used to load plugins\n//\n// You can change the location of this file or turn off loa...
javascript
chosen
[ { "from": "system", "value": "Fix react router hot reload of routes in dev mode\n" }, { "from": "human", "value": "const path = require(\"path\");\nconst webpack = require(\"webpack\");\n\nconst FlowtypePlugin = require('flowtype-loader/plugin');\n\nconst config = {\n devtool: \"#source-maps\",...
javascript
chosen
[ { "from": "system", "value": "Remove broken logic from controller.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('fivefifteenApp')\n .controller('MainCtrl', function ($scope, $routeParams, Data, Steps) {\n\n // Simple Data service to persist form values.\n $scope.data...
javascript
chosen
[ { "from": "system", "value": "Add webrtc-troubleshooter to blueprint to export\n" }, { "from": "human", "value": "module.exports = {\n description: 'WebRTC Troubleshoot',\n normalizeEntityName: function () {},\n\n afterInstall: function () {\n return this.addBowerPackageToProject('webrtc-a...
javascript
chosen
[ { "from": "system", "value": "Fix a minor answer submitting bug\n" }, { "from": "human", "value": "var AnswerModel = Backbone.Model.extend({\n\t\n\tquestionID: false,\n\t\n\turlRoot: function(){\n\t\treturn Quest.url() + \"/questions/\" + this.get('questionID') + \"/answer\"\n\t}\n\n});" }, ...
javascript
chosen
[ { "from": "system", "value": "Change Pandora song data selectors to select current track\n" }, { "from": "human", "value": ";(function() {\n \"use strict\";\n\n var BaseController = require(\"BaseController\");\n\n new BaseController({\n siteName: \"Pandora\",\n play: \".playButton\",\n...
javascript
chosen
[ { "from": "system", "value": "Adjust browser size to accurately check responsive constraints\n" }, { "from": "human", "value": "module.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chrome'\n ],\n launch_in_dev: [\n 'Chrome'\n ]...
javascript
chosen
[ { "from": "system", "value": "Add watch on 'data' for redraw on data changes\n\nFixes #2." }, { "from": "human", "value": "\nangular.module('ng-xCharts', [])\n .directive('xchart', function () {\n var graphIdCount = 0;\n return {\n restrict: 'EACM',\n templ...
javascript
chosen
[ { "from": "system", "value": "Implement Read SubCampaign Setting Model Logic\n" }, { "from": "human", "value": "var configuration = require('../../../config/configuration.json')\n\nmodule.exports = {\n getsubcampaignSettingModel: function (redisClient, CampaignHashID, subCampaignHashID, callbac...
javascript
chosen
[ { "from": "system", "value": "Fix Node 10 localstorage in tests\n" }, { "from": "human", "value": "// Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the License at\n//\n// http:...
javascript
chosen
[ { "from": "system", "value": "Add users to Project angular ressource\n" }, { "from": "human", "value": "// -*- coding: utf-8 -*-\n//\n// (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>\n//\n// See LICENSE comming with the source of 'trex' for details.\n//\n'use strict';\n\nvar trexServices = angu...
javascript
chosen
[ { "from": "system", "value": "Fix conversion being executed without time zone\n" }, { "from": "human", "value": "const axios = require('axios');\nconst chalk = require('chalk');\n\nconst time = require('./time');\n\nfunction getLaunchDetails(launchId, callback) {\n axios.get('https://launchlibr...
javascript
chosen
[ { "from": "system", "value": ":new: Support multiple colors on the same line\n" }, { "from": "human", "value": "'use babel'\n\nconst COLOR_EXTRACTION_REGEXP = /rgb\\(\\d+, ?\\d+, ?\\d+\\)|rgba\\(\\d+, ?\\d+, ?\\d+, ?\\d?\\.?\\d+\\)|#[0-9a-f]{3,6}/\n\nexport function isColor(textEditor, bufferPos...
javascript
chosen
[ { "from": "system", "value": "Allow config files to live in a dir not relative to the current working dir\nif the first char is a / then use the config file path directly, otherwise\nappend to the current working directory\n" }, { "from": "human", "value": "/*jshint node:true, indent:2, curly:fa...
javascript
chosen
[ { "from": "system", "value": "Fix deprecation warning on v0.7.x\n" }, { "from": "human", "value": "/**\n * package - Easy package.json exports.\n * \n * Author: Veselin Todorov <hi@vesln.com>\n * Licensed under the MIT License.\n */\n\n/**\n * Dependencies.\n */\nvar fs = require('fs');\nvar pat...
javascript
chosen
[ { "from": "system", "value": "Add 2 function, pad and totitlecase\n" }, { "from": "human", "value": "const moment = require('moment')\n\nfunction hbsHelpers(hbs) {\n return hbs.create({\n defaultLayout:'layout',\n helpers: {\n section: function(name, options){\n if(!this._sect...
javascript
chosen
[ { "from": "system", "value": "Fix tutorial after playing state changes\n" }, { "from": "human", "value": "function TutorialState (game) {\n this.game = game;\n this.playingState = new PlayingState(game);\n var renderRegion = new RenderRegion(null, game.canvas.height * 0.005, null, game.canvas...
javascript
chosen
[ { "from": "system", "value": "Add declarative flambeau-style Specs actions\n" }, { "from": "human", "value": "\nexport function setSpecsURLsForDocumentWithID(documentID, specsURLs) {\n \n}\n" }, { "from": "gpt", "value": "// TODO: change to ../config ?\nimport { getActionURL } from ...
javascript
chosen
[ { "from": "system", "value": "Edit default list to avoid violations of content security policy\n" }, { "from": "human", "value": "var defaultFilterList = [\n {\n name: \"Default - China\",\n isEnabled: true,\n isEditable: false,\n activePage: null,\n rules: [\n {\n sr...
javascript
chosen
[ { "from": "system", "value": "Implement non reactive coupling tests, only invoke reactive tests within chrome\n" }, { "from": "human", "value": "var test = require('tape');\n\ntest('can import rtc module', function(t) {\n t.plan(1);\n t.ok(require('../'), 'imported successfully');\n});\n\nrequ...
javascript
chosen
[ { "from": "system", "value": "Include the media test for firefox now given fake media for firefox is possible\n" }, { "from": "human", "value": "var detect = require('rtc/detect');\nvar isTestling = typeof __testlingConsole != 'undefined';\n\n// if we are running in testling then run the media t...
javascript
chosen
[ { "from": "system", "value": "Remove partial code to add user\n" }, { "from": "human", "value": "(function () {\n\n var echadZeman = angular.module('echad-zeman');\n echadZeman.factory('userService', ['validator', 'scrypt', 'userDao', function(validator, scrypt, userDao) {\n var use...
javascript
chosen
[ { "from": "system", "value": "fix(PyFr): Allow PyFr mesh to either be .msh or .pyfrm\n" }, { "from": "human", "value": "import React from 'react';\nimport { FileUploadEntry } from '../../../../../panels/ItemEditor';\n\nexport default React.createClass({\n\n displayName: 'Simulat...
javascript
chosen
[ { "from": "system", "value": "Implement basic elements of competition card\n" }, { "from": "human", "value": "import React, { useEffect } from \"react\";\nimport classes from \"./CompetitionCard.module.css\";\n\nconst CompetitionCard = (props) => {\n return (\n <li className={classes.Competi...
javascript
chosen
[ { "from": "system", "value": "Add require with new favicons\n" }, { "from": "human", "value": "'use strict';\n\nimport './main.less';\n\nimport angular from 'angular';\nimport ngRouter from 'angular-route';\nimport ngSanitize from 'angular-sanitize';\nimport angulartics from 'angulartics';\nimpo...
javascript
chosen
[ { "from": "system", "value": "Remove native logging for unhandledrejection\n" }, { "from": "human", "value": "import BaseListener from './base-listener';\nimport ErrorDescriptor from '../error-descriptor';\n\nexport default BaseListener.extend({\n\n listen(manager) {\n\n // window list...
javascript
chosen
[ { "from": "system", "value": "Revert \"Connect protractor directly with browsers\"\n\nIt does not work in all cases\n\nThis reverts commit 7aeb9f7062f803dbd248b94d74a15a1ec6342e95.\n" }, { "from": "human", "value": "'use strict';\n\nvar gulpConfig = require(__dirname + '/../gulpfile').config;\n\...
javascript
chosen
[ { "from": "system", "value": "fix(flow): Allow Flow to access more memory for larger projects\n" }, { "from": "human", "value": "/* @flow */\nimport type { Template } from 'create-npm/lib/template'\n\nexport default function({ repoName }: { repoName: string }): Template {\n const [, packageName...
javascript
chosen
[ { "from": "system", "value": "Load store into the tested components too\n" }, { "from": "human", "value": "import jq from 'jquery';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport ReactTestUtils from 'react-addons-test-utils';\nimport jsdom from 'jsdom';\nimport chai, { ex...
javascript
chosen
[ { "from": "system", "value": "Change reporting url in console message\n" }, { "from": "human", "value": "function run($rootScope, SyncService, $transitions, $location, $trace, $uiRouter) {\n 'ngInject';\n\n SyncService.init();\n\n if ($featureFlags.debugRouter) {\n $trace.enable('TRANSITIO...
javascript
chosen
[ { "from": "system", "value": "Add code to clear up on process interrupt\n" }, { "from": "human", "value": "// start grunt\n\nrequire(__dirname + '/node_modules/grunt/lib/grunt.js').cli();" }, { "from": "gpt", "value": "var fs = require('fs'),\n pidFile = __dirname + '/.start.pid',...
javascript
chosen
[ { "from": "system", "value": "Fix an issue that caused unnecessary code to end up in the transpiled file.\n" }, { "from": "human", "value": "var paths = require('./build/paths');\nvar webpackConfig = require('./webpack.config.js');\n\n\n// Add istanbul-instrumenter to webpack configuration\nwebp...
javascript
chosen
[ { "from": "system", "value": "Remove broken merge commit header\n" }, { "from": "human", "value": "const Statement = require('../entities/Statement.js');\nconst error = require('../error.js');\n\nclass ReturnStatement extends Statement {\n constructor(returnValue) {\n super();\n this.retu...
javascript
chosen
[ { "from": "system", "value": "Fix plugin to pass right node in\n" }, { "from": "human", "value": "(function() {\n\tif( typeof window.addEventListener === 'function' ) {\n\t\tReveal.addEventListener(\"slidechanged\", function (event) {\n\t\t\tif (event.previousSlide.querySelector('.gallery') || d...
javascript
chosen
[ { "from": "system", "value": "Add env check for test\n" }, { "from": "human", "value": "var path = require(\"path\")\nvar home = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME']\nvar npmbrew = path.join(home, \".npmbrew\")\n\nmodule.exports = {\n url : \"http://registry.npmjs...
javascript
chosen
[ { "from": "system", "value": "Throw an error when no api token defined\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require(\"request\");\nvar defaultUserAgent = require(\"./user_agent\");\n\nmodule.exports = {\n\n // @param {string} apiToken the Dialog API token\n // @par...
javascript
chosen
[ { "from": "system", "value": "Fix css minification for prod\n" }, { "from": "human", "value": "const {inspect} = require('util');\n\nconst getLoader = function(rules, matcher) {\n let loader;\n\n rules.some(rule => {\n return loader = matcher(rule)\n ? rule\n : getLoader(rule.use ...
javascript
chosen
[ { "from": "system", "value": "Clean up frontend profile editing\n" }, { "from": "human", "value": "$(document).ready(function() {\n fetch('/profile-update')\n .then((response) => response.json())\n .then((userData) => {\n const userName = userData['name'];\n const userIn...
javascript
chosen
[ { "from": "system", "value": "Remove default options from router start\n" }, { "from": "human", "value": "class GelatoRouter extends Backbone.Router {\n\n execute(callback, params) {\n if (this.page) {\n this.page.remove();\n }\n callback.apply(this, params);\n }\n\n start(optio...
javascript
chosen
[ { "from": "system", "value": "Return sha of most recent commit." }, { "from": "human", "value": "var github = require('octonode');\nvar _ = require('lodash');\n\n\nfunction GitHub(options) {\n this.client = github.client({\n username: options.user,\n password: options.password\n });\n}\n...
javascript
chosen
[ { "from": "system", "value": "Hide data when \"reset zoom\" button is pressed.\n" }, { "from": "human", "value": "/// </// <reference path=\"data_functions.js\" />\n\n// function getSvg(){\n// return document.getElementsByClassName(\"highcharts-container\")[0].firstChild;\n// }\nfunction getAn...
javascript
chosen
[ { "from": "system", "value": "Make sure scatter chart's circle are animating when hovered\n" }, { "from": "human", "value": "'use strict';\n\nvar expect = require('chai').expect;\n\ndescribe('ScatterChart', function() {\n it('renders scatterchart', function() {\n var React = require('react/a...
javascript
chosen
[ { "from": "system", "value": "Handle error when chart does not load\n" }, { "from": "human", "value": "{% load i18n %}\n\n<script src=\"//www.gstatic.com/charts/loader.js\"></script>\n<script src=\"//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script>\n<script type=\"text/javasc...
javascript
chosen
[ { "from": "system", "value": "Fix crash with headers not a function\n" }, { "from": "human", "value": "function responseIsXml (response) {\n if (response && response.config && response.config.responseType) {\n return response.config.responseType === 'xml'\n }\n var contentType = response.h...
javascript
chosen
[ { "from": "system", "value": "Fix submit_flag not outputting anything\n" }, { "from": "human", "value": "$(\"[name='submit']\").click(function(e) {\n e.preventDefault();\n var form = $(this).parents('form:first');\n var flag = $(\"input[name='flag']\", form).val();\n var pid = $(\"in...
javascript
chosen
[ { "from": "system", "value": "Fix replacement of spaces in auto permalink\n" }, { "from": "human", "value": "$(function() {\n $('input[type=text][data-auto-permalink]').keyup(function() {\n var target = $(this).data('auto-permalink');\n $('#' + target).val(\n $(this).val().toLowerCas...
javascript
chosen
[ { "from": "system", "value": "Allow jsx in .js files\n" }, { "from": "human", "value": "module.exports = {\n extends: 'airbnb',\n};\n" }, { "from": "gpt", "value": "module.exports = {\n extends: 'airbnb',\n rules: {\n 'react/jsx-filename-extension': ['error', { extensions: ['.j...
javascript
chosen