conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix code quality task for gulp 4\n" }, { "from": "human", "value": "const path = require('path');\nconst eslint = require('gulp-eslint');\nconst config = require('../utils/config');\n\nmodule.exports = gulp => () => {\n const stream = gulp.src(path.join(config.pkgd...
javascript
chosen
[ { "from": "system", "value": "Correct status output text for Make Map\n" }, { "from": "human", "value": "const webModel = require('../webModel');\nconst webModelFunctions = require('../webModelFunctions');\nconst robotModel = require('../robotModel');\n\nasync function makeMap() {\n if (webMo...
javascript
chosen
[ { "from": "system", "value": "Fix some issues that were breaking javascript in firefox.\n\nThis fixes a regression introduced when marked.js was removed. Apparently\ntesting global names to see if they're defined doesn't work so well in firefox.\nThis broke pretty much all javascript everywhere. Fortunately...
javascript
chosen
[ { "from": "system", "value": "Define missing local variable \"connection\"\n" }, { "from": "human", "value": "var socketIo = require('socket.io');\n\nfunction deepClone(base) {\n if (!base || typeof base != 'object')\n return base;\n\n var cloned = Object.create(null);\n Object.keys(base)....
javascript
chosen
[ { "from": "system", "value": "Enable Keystone's session auth for Rest API\n" }, { "from": "human", "value": "\nconst keystone = require('keystone');\nconst jwt = require('jsonwebtoken');\n\n/*\n JWT middleware\n*/\n\nexports.requireJwtAuth = function(req, res, next) {\n const errorMessage = {\...
javascript
chosen
[ { "from": "system", "value": "Write the function to generate every path according to the data\n" }, { "from": "human", "value": "var mathChart = {\n\tvar insertchart = function(canvas,data)\n\t{\n\t\tvar xmlns=\"https://www.w3.org/2000/svg\"\n\t\tvar svg = document.createElementNS(xmlns,\"svg\")...
javascript
chosen
[ { "from": "system", "value": "Fix wrong path for package.json\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst UI = require('console-ui');\nconst cli = require('cli');\n\nconst Project = require('../models/project');\nconst CommandFactory = require('../commands/command-factory');\...
javascript
chosen
[ { "from": "system", "value": "Change jsplayer behavior for more natural ranking\n" }, { "from": "human", "value": "//initialize things globally if necessary\nvar move = \"rock\";\n\nfunction respond(command) {\n if(command === \"move\")\n return Math.random() < 0.5 ? \"rock\" : \"paper\";\n ...
javascript
chosen
[ { "from": "system", "value": "Add API that allows users to retreive all recipes in the application\n" }, { "from": "human", "value": "import userController from '../controllers/users';\nimport recipeController from '../controllers/recipes';\nimport Login from '../middleware/ensureLogin';\nimport...
javascript
chosen
[ { "from": "system", "value": "Change component to class for state (see full msg)\n\nInstead of dealing with a CSS MediaQuery cluster bomb to unintuitively force styles, I decided that using local state on this component with windwo resizes to conditionally render drop-downs like drop-downs would be best. Wh...
javascript
chosen
[ { "from": "system", "value": "Use regular require, when given context is same as current context\n" }, { "from": "human", "value": "'use strict';\n\nvar Module = require('module')\n , wrap = Module.wrap\n , readFile = require('fs').readFileSync\n , dirname = require...
javascript
chosen
[ { "from": "system", "value": "Add proptype validation to Empty component\n" }, { "from": "human", "value": "import React from 'react';\nimport './empty.scss';\n\nconst Empty = (props) => (\n <div className=\"container empty\">\n <div className=\"empty__image\" />\n <div className=\"empty_...
javascript
chosen
[ { "from": "system", "value": "Update style guide highlight.js from 9.1.0 to 9.2.0\n" }, { "from": "human", "value": "/* global hljs */\n\nWee.fn.make('guide', {\n\t/**\n\t * Highlight code and bind click events\n\t *\n\t * @constructor\n\t */\n\t_construct: function() {\n\t\tvar priv = this.$pri...
javascript
chosen
[ { "from": "system", "value": "Remove print calls from custom validator\n\nBrowsers and server-side CDV seem to have a somewhat\ndifferent idea of what 'print' means. Ooops." }, { "from": "human", "value": "wd.cdv.validators.registerValidator(\"custom\", function(validation, rs){\n var validatio...
javascript
chosen
[ { "from": "system", "value": "Fix computation of ticks for yAxis on responsive\n" }, { "from": "human", "value": "export default chart => {\n if (chart.responsive) {\n\n const {\n width,\n height\n } = chart\n\n // preserve original values\n chart._originWidth = width\n ...
javascript
chosen
[ { "from": "system", "value": "Fix orthographic camera usage of the glViewport method\n" }, { "from": "human", "value": "'use strict';\n\nlet gl = require('./gl');\nlet glm = require('gl-matrix');\nlet mat4 = glm.mat4;\nlet Camera = require('./Camera');\n\nconst _name = 'orthographic.camera';\nco...
javascript
chosen
[ { "from": "system", "value": "Fix Webpack build for server side rendering\n\nREDMINE-17566\n" }, { "from": "human", "value": "module.exports = {\n externals: {\n 'backbone': 'Backbone',\n 'backbone.babysitter': 'Backbone.ChildViewContainer',\n 'cocktail': 'Cocktail',\n 'jquery': 'jQ...
javascript
chosen
[ { "from": "system", "value": "Fix firefox launching from Karma\n" }, { "from": "human", "value": "module.exports = config => {\n config.set({\n frameworks: ['jasmine'],\n\n files: ['*.js'],\n\n preprocessors: {\n '*.js': ['webpack'],\n },\n\n browsers: ['Chrome_fakeDevices']...
javascript
chosen
[ { "from": "system", "value": "Set alert error instead of stopping\n" }, { "from": "human", "value": "Template.postSubmit.events({\n 'submit form': function(e) {\n e.preventDefault();\n\n var post = {\n url: $(e.target).find('[name=url]').val(),\n title: $(e.target).find('[name=t...
javascript
chosen
[ { "from": "system", "value": ":white_check_mark: Add specs for exists and versionFromRange\n" }, { "from": "human", "value": "'use babel'\n\nconst { it } = require(process.env.SPEC_HELPER_SCRIPT)\n\ndescribe('versionFromRange', function() {\n \n})\n" }, { "from": "gpt", "value": "'u...
javascript
chosen
[ { "from": "system", "value": "Add section information and section 17\n" }, { "from": "human", "value": "export default {\n \"fileSignature\": {\n \"byteOffset\": 0,\n \"length\": 4,\n \"previousProperty\": null,\n \"type\": \"fixedLengthString\"\n },\n \"saveGameVersion\": {\n ...
javascript
chosen
[ { "from": "system", "value": "Change initial color to diferentiate from non-active countries to active countries\n" }, { "from": "human", "value": "var regionStyle = {\n initial: {\n fill: '#000000',\n \"fill-opacity\": 1,\n stroke: 'none',\n \"stroke-width\": 0,\n \"stroke-opaci...
javascript
chosen
[ { "from": "system", "value": "Fix translation sanitizing to work for plurals.\n" }, { "from": "human", "value": "var through = require( 'through2' );\nvar gutil = require( 'gulp-util' );\nvar PluginError = gutil.PluginError;\nvar sanitize = require( 'sanitize-html' );\n\nconst PLUGIN_NAME = 'gul...
javascript
chosen
[ { "from": "system", "value": "Add reselect support for job limit values\n\n" }, { "from": "human", "value": "import { createSelector } from \"reselect\";\nimport { endsWith, flatMap, keys, map, max, pick } from \"lodash-es\";\n\nimport { taskDisplayNames } from \"../utils\";\n\nconst getMaximumT...
javascript
chosen
[ { "from": "system", "value": "Add fix for collapsing services bug\n" }, { "from": "human", "value": "\"use strict\";\n\nlet ListToMapLinkingController = function() {\n let self = {};\n\n function mapMarkerSelected(data) {\n let parentDiv = $(\"#serviceList\");\n let dPanel = d3.selectAll...
javascript
chosen
[ { "from": "system", "value": "Add margin between open job posting rows.\n" }, { "from": "human", "value": "import { Component, PropTypes } from 'react'\nimport {Link} from 'react-router'\n\nclass JobListing extends Component {\n static propTypes: {\n title: PropTypes.string.isRequired...
javascript
chosen
[ { "from": "system", "value": "Improve design of image input preview delete button\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport FlatButton from 'material-ui/FlatButton';\nimport { red600 } from 'material-ui/styles/colors';\nimport RemoveCircle from 'materia...
javascript
chosen
[ { "from": "system", "value": "Use string values for attributes in acceptance tests\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport { addTodo } from './common.js';\n\n\ndescribe('App', function() {\n beforeEach(function() {\n // TODO: refactor this using something li...
javascript
chosen
[ { "from": "system", "value": "Add function to fetch data and fetch data when component is mounted\n" }, { "from": "human", "value": "import React from 'react';\nimport './styles/App.css';\nimport TravelObject from './components/TravelObject'\n\nclass App extends React.Component {\n render () {\...
javascript
chosen
[ { "from": "system", "value": "Use new Snake object naming\n" }, { "from": "human", "value": "var animate;\nvar Game = Game || {};\nvar WIDTH = window.innerWidth;\nvar HEIGHT = window.innerHeight;\nvar FPS = 1000 / 30;\nvar engine = new Game.Engine('game', WIDTH, HEIGHT);\n\nengine.init();\nengin...
javascript
chosen
[ { "from": "system", "value": "Add edit subject unit test in portal\n" }, { "from": "human", "value": "import DomMock from '../../helpers/dom-mock';\nimport jsdom from 'mocha-jsdom';\nimport expect from 'expect';\nimport React from 'react';\nimport TestUtils from 'react-addons-test-utils';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Use system tick to retrieve controllers instead of unreliable inputsourceschange event.\n" }, { "from": "human", "value": "var registerSystem = require('../core/system').registerSystem;\n\n/**\n * Tracked controls system.\n * Maintain list with available tracked con...
javascript
chosen
[ { "from": "system", "value": "Rename http-random-user key to category\n" }, { "from": "human", "value": "import Cycle from '@cycle/core';\nimport {div, button, h1, h4, a, makeDOMDriver} from '@cycle/dom';\nimport {makeHTTPDriver} from '@cycle/http';\n\nfunction main(sources) {\n const getRandom...
javascript
chosen
[ { "from": "system", "value": "Fix resource download event tracking js\n" }, { "from": "human", "value": "// Add Google Analytics Event Tracking to resource download links.\nthis.ckan.module('google-analytics', function(jQuery, _) {\n return {\n options: {\n googleanalytics_resource_pref...
javascript
chosen
[ { "from": "system", "value": "Fix CSS not updating on development mode\n" }, { "from": "human", "value": "// Compile SCSS files into CSS (dev mode is not compressed)\nmodule.exports = {\n dev: {\n options: {\n style: 'expanded'\n },\n files: {\n 'pre...
javascript
chosen
[ { "from": "system", "value": "Handle case where Pages collection isn't loaded yet (although that should never happen…)\n" }, { "from": "human", "value": "Telescope.config.adminMenu.push({\n route: 'pages',\n label: 'Pages',\n description: 'manage_static_pages'\n});\n\nTelescope.config.preload...
javascript
chosen
[ { "from": "system", "value": "Put all URLs to public\n" }, { "from": "human", "value": "import packageJson from './package.json';\n\nmodule.exports = {\n backendRoot: 'https://obscure-woodland-71302.herokuapp.com/',\n flaskRoot: 'http://localhost:5000',\n /* flaskRoot: 'http://catapp-staging....
javascript
chosen
[ { "from": "system", "value": "Add endpoint for retrieving a single session\n" }, { "from": "human", "value": "var Session = require( './sessions' );\n\nmodule.exports = {\n\n getAllSessions: function(request, response) {\n Session.findAll()\n .then( function(sessions) {\n response.se...
javascript
chosen
[ { "from": "system", "value": "Add optional initialization hash to `inherits`\n" }, { "from": "human", "value": "require('./extensions/es5');\nrequire('./extensions/json');\n\n// Based on Crockford's http://javascript.crockford.com/inheritance.html\nif (!Function.prototype.inherits) {\n Function...
javascript
chosen
[ { "from": "system", "value": "Add new contact on form submitted\n" }, { "from": "human", "value": "window.ContactManager = {\n Models: {},\n Collections: {},\n Views: {},\n\n start: function(data) {\n var contacts = new ContactManager.Collections.Contacts(data.contacts),\n router =...
javascript
chosen
[ { "from": "system", "value": "Add fallback if invalid or no Soundcloud API key is set\n" }, { "from": "human", "value": "var settings = require(process.cwd() + '/settings.js').settings;\nvar request = require('request');\n\nmodule.exports.currentLink = \"\";\nmodule.exports.currentName = \"\";\n...
javascript
chosen
[ { "from": "system", "value": "Add pseudocode to quick sort function\n" }, { "from": "human", "value": "// Program to sort an array using recursion\nfunction quickSort(arr) {\n\tif(arr.length == 0) {\n\t\treturn [];\n\t}\n\tvar left = [], right = [], pivot = arr[0];\n\tfor(var i = 1; i < arr.leng...
javascript
chosen
[ { "from": "system", "value": "Remove host from hapijs so it is not binding to a specific host\n" }, { "from": "human", "value": "/** hapijs default hello world **/\n\n'use strict';\n\nconst Hapi = require('hapi');\n\n// Create a server with a host and port\nconst server = new Hapi.Server();\nser...
javascript
chosen
[ { "from": "system", "value": "Use port env to keep heroku happy\n" }, { "from": "human", "value": "<<<<<<< HEAD\nvar port = process.env.PORT || 8080;\nvar StaticServer = require('static-server');\nvar server = new StaticServer({\n rootPath: '.', // required, the root of the server fi...
javascript
chosen
[ { "from": "system", "value": "Update ensure secure express middleware\n" }, { "from": "human", "value": "const path = require('path')\nconst express = require('express')\n\nconst app = express()\n\nconst port = process.env.PORT ? process.env.PORT : 8081\nconst dist = path.join(__dirname, 'public...
javascript
chosen
[ { "from": "system", "value": "Make sure the info button works with turbolinks\n" }, { "from": "human", "value": "var conversations = {\n onRespondLaterClick: function() {\n var $listItem = $(this).parents('.conversation-row').parent();\n var path = $(this).attr('data-account-conversation-...
javascript
chosen
[ { "from": "system", "value": "Support button in the footer\n" }, { "from": "human", "value": "import React from 'react';\n\nconst styles = {\n footer: {\n padding: '10px',\n position: 'fixed',\n left: '0px',\n bottom: '0px',\n height: '45px',\n width: '100%',\n background: ...
javascript
chosen
[ { "from": "human", "value": "Deploy functionality related with testing.\n" }, { "from": "gpt", "value": "describe(\"Checking correctly data in object projects\", function() {\n\n it(\"Length of object should to equal 4\", function() {\n expect(projects.length).toEqual(4)\n });\n\n var i = ...
javascript
chosen
[ { "from": "system", "value": "Add function to add images by draggin from desktop\n" }, { "from": "human", "value": "function setStyle(style) {\n var range, sel;\n\n if (window.getSelection) {\n sel = window.getSelection();\n if (sel.getRangeAt) {\n range = sel.getRangeAt(0);\n }\...
javascript
chosen
[ { "from": "system", "value": "Add play to the navigation\n" }, { "from": "human", "value": "'use strict';\n\nvar angular = require('angular');\n\nmodule.exports = angular.module('myApp.services.navigationService', [\n])\n.service('NavigationService', function (\n) {\n\treturn {\n\t\tgetMainNavIt...
javascript
chosen
[ { "from": "system", "value": "Fix React warning regarding 'key' prop in render.\n" }, { "from": "human", "value": "/* @flow */\nimport React from 'react'\nimport type { MessageResult } from 'types'\nimport styles from './style.css'\n\ntype RollsProps = {\n rolls: Array<number>\n}\nconst Rolls =...
javascript
chosen
[ { "from": "system", "value": "Refactor usage cssProperties in $.fn.anim\n" }, { "from": "human", "value": "// Zepto.js\n// (c) 2010, 2011 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\n\n(function($, undefined){\n var supportedTransforms = [\n 'scale ...
javascript
chosen
[ { "from": "system", "value": "Change port for client development\n" }, { "from": "human", "value": "'use strict'\n\n// see http://vuejs-templates.github.io/webpack for documentation.\nconst path = require('path')\n\nmodule.exports = {\n build: {\n env: require('./prod.env'),\n index: path...
javascript
chosen
[ { "from": "system", "value": "Fix chat to use security.ChainSeperator instead of hard-coded value.\n\nChange-Id: Ie83886089e802cad27d69df8b53b421f6a2aef72\n" }, { "from": "human", "value": "// Copyright 2015 The Vanadium Authors. All rights reserved.\n// Use of this source code is governed by a ...
javascript
chosen
[ { "from": "system", "value": "Fix importing styles where there's none\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport s from './<%= componentName %>.scss';\nimport withStyles from '../withStyles';\n\nclass <%= componentName %> extends Component {\n\n render(...
javascript
chosen
[ { "from": "system", "value": "Update location of local test file\n" }, { "from": "human", "value": "\nvar loadFileUrl = function (url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false); // synchronous\n // retrieve data unprocessed as a binary string\n xhr.overrideMi...
javascript
chosen
[ { "from": "system", "value": "Define a maximum number of calls to get more events;\nRequest user action before requesting more;\nRemove unnecessary use of component state.\n" }, { "from": "human", "value": "import React from 'react'\nimport Link from 'gatsby-link'\n\nexport default class Infinit...
javascript
chosen
[ { "from": "system", "value": "Add body to draft card\n" }, { "from": "human", "value": "import React, { Fragment } from 'react'\nimport Link from 'gatsby-link'\nimport styled from 'styled-components'\nimport { Container, Flex, Heading } from '@hackclub/design-system'\n\nimport storage from '../....
javascript
chosen
[ { "from": "system", "value": "Fix timestamp function to give seconds\n" }, { "from": "human", "value": "function statusIdToText(id) {\n \tif(id==0) {\n \t\treturn 'Offline';\n \t}\n \telse if(id==1) {\n \t\treturn 'Available';\n \t}\n \telse if(id==2) {\n \t\treturn 'Away';\n \...
javascript
chosen
[ { "from": "system", "value": "Remove token querystring from API call\n" }, { "from": "human", "value": "angular.module('MyApp')\n .factory('Account', ['$http', '$window', function($http, $window) {\n return {\n getUserInfo: function() {\n return $http.get('/api/me?token=' + $wind...
javascript
chosen
[ { "from": "system", "value": "Fix bug with reloading on Login page\n" }, { "from": "human", "value": "(() => {\n\n 'use strict';\n\n angular\n .module('app')\n .controller('LoginController', LoginController);\n\n LoginController.$inject = ['growl', '$window', '$http', '$ro...
javascript
chosen
[ { "from": "system", "value": "Correct order of files to cache\n" }, { "from": "human", "value": "// JavaScript Document\n\n// Scripts written by YOURNAME @ YOURCOMPANY\n\n// no service worker for previews\nself.addEventListener(\"fetch\", (event) => {\n if (event.request.url.match(/preview=tr...
javascript
chosen
[ { "from": "system", "value": "Fix bug to display the default snapshot item\n" }, { "from": "human", "value": "// @flow\nimport type {Snapshot, SnapshotItem} from 'redux-ship';\n\nexport type State = {\n logs: {action: mixed, snapshot: Snapshot<mixed, mixed>}[],\n selectedLog: ?number,\n selec...
javascript
chosen
[ { "from": "system", "value": "Fix back links in intro\n" }, { "from": "human", "value": "module.exports = {\n '/': {\n backLink: '/../priority_service_170301/filter/uncancelled',\n next: '/what-you-need'\n },\n '/before-you-continue-overseas': {\n backLink: '/../pri...
javascript
chosen
[ { "from": "system", "value": "Add reloadWithReason to Fast Refresh\n\nSummary: This diff adds reload reasons to Fast Refresh. This will help us understand why, for internal Facebook users, Fast Refresh is bailing out to a full reload so that we can improve it for everyone.\n\nReviewed By: cpojer\n\nDifferen...
javascript
chosen
[ { "from": "system", "value": "Fix trl: Don't access filesystem, file doesn't get written when using dev-server\n" }, { "from": "human", "value": "'use strict';\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\nvar fs = require('fs');\n\nclass TrlHtmlWebpackPlugin extends HtmlWebpackPlugi...
javascript
chosen
[ { "from": "system", "value": "Fix service edit javascript bug\n\nThe value that was set was overwritten directly.\n" }, { "from": "human", "value": "'use strict';\n\n$(document).ready(function() {\n function enableOrDisableAttributeField() {\n var rows = $(this)\n .parents('...
javascript
chosen
[ { "from": "system", "value": "Add get_flags method to access all flags\n" }, { "from": "human", "value": "(function(){\n var FLAGS = {\n {% for flag, value in flags %}'{{ flag }}': {% if value %}true{% else %}false{% endif %}{% if not forloop.last %},{% endif %}{% endfor %}\n },\n SWIT...
javascript
chosen
[ { "from": "system", "value": "Use AuthService rather than custom controller code\n" }, { "from": "human", "value": "ords.controller('mainController', function($rootScope,$location, User, Project) {\n\t\n\t\t//\n\t\t// If we're not logged in, redirect to login\n\t\t//\t\t\n\t\t$rootScope.user = U...
javascript
chosen
[ { "from": "system", "value": "Add comment about 3rd party integrations\n" }, { "from": "human", "value": "/**\n * In order to support reload-and-profile functionality, the renderer needs to be injected before any other scripts.\n * Since it is a complex file (with imports) we can't just toString...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Add the updateSession method to the UserService\n" }, { "from": "human", "value": "angular.module('publicApp').service('UserService', ['$http','$location', function($http, $location) {\n var user = {\n isLogged: false,\n username: '',\n\n login: ...
javascript
chosen
[ { "from": "system", "value": "Add bootstrap-sprockets to js manifest\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/java...
javascript
chosen
[ { "from": "system", "value": "Increase note body max length\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n CATEGORY_NAME_MAXLENGTH: 20,\n NOTE_TITLE_MAXLENGTH: 20,\n NOTE_BODY_MAXLENGTH: 500,\n UNSPECIFIED_CATEGORY_NAME: 'Unspecified'\n};\n" }, { "from": "gp...
javascript
chosen
[ { "from": "system", "value": "Fix typo in unit test\n" }, { "from": "human", "value": "/* eslint-env jasmine */\nvar editTypes = require('../helpers/edit-types')\nvar makeEditableElement = ('../helpers/make-editable-element')\nvar Edited = require('../../..')\n\ndescribe('`detach` method', funct...
javascript
chosen
[ { "from": "system", "value": "Change My Library auth url\n\n" }, { "from": "human", "value": "\n(function () {\n Polymer({\n is: 'uql-apps-button',\n properties: {\n /** Whether to display title of the button */\n showTitle: {\n type: Boolean,\n value: true\n ...
javascript
chosen
[ { "from": "system", "value": "Use url encoded form data in http request\n" }, { "from": "human", "value": "/**\n * Registers a new user. After signing up, the user gets an activation code per mail. With this \n * code, the user can activate his account.\n */\napp.controller('RegisterController',...
javascript
chosen
[ { "from": "system", "value": "Drop support for IE9 and IE10 in dummy app\n" }, { "from": "human", "value": "/* eslint-env node */\n\nmodule.exports = {\n browsers: [\n 'ie 9',\n 'last 1 Chrome versions',\n 'last 1 Firefox versions',\n 'last 1 Safari versions'\n ]\n};\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Cover two uncovered lines in error reducer test [skip ci]\n" }, { "from": "human", "value": "import errors from '../../src/reducers/errors';\nimport { GET_DATA_FAILED } from '../../src/actions/data';\n\ndescribe('errors reducer', () => {\n describe(`action type ${G...
javascript
chosen
[ { "from": "system", "value": "Make sure the input value is kept up-to-date ...\n" }, { "from": "human", "value": "(function($) {\n jQuery.fn.lineeditor = function (options, callback) {\n return this.each(function () {\n var el = this;\n var $el = $(this);\n \n if ( el.nod...
javascript
chosen
[ { "from": "system", "value": "Use number generator with seed\n" }, { "from": "human", "value": "var instances = require('./../taillard');\nvar NEH = require('./../neh');\n\n// Iterate over filtered Taillard instances\nvar filteredInstances = instances.filter(50, 20);\nfor(var i = 0; i < filtered...
javascript
chosen
[ { "from": "system", "value": "Update ngconstant version after releasing\n" }, { "from": "human", "value": "\"use strict\";\n// DO NOT EDIT THIS FILE, EDIT THE GRUNT TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\nangular.module('publisherApp')\n\n.constant('ENV', 'dev')\n\n.constant(...
javascript
chosen
[ { "from": "system", "value": "Add missing semicolon, because JS is weird.\n" }, { "from": "human", "value": "\nvar AV = {}\n\nAV.source = Backbone.Model.extend({\n\turl: 'redirect.php',\n\tdefaults: {\n\t\tname: '',\n\t\ttype: 'raw',\n\t\tcontentType: 'txt',\n\t\tdata: ''\n\t}\n});\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Create a new scope for this directive\n" }, { "from": "human", "value": ";(function() {\n'use strict'; \n\nangular.module('gebo-client-performatives.conversationControl',\n ['gebo-client-performatives.request',\n 'templates/server-rep...
javascript
chosen
[ { "from": "system", "value": "Change where the files are stored in the server\n" }, { "from": "human", "value": "const express = require('express');\nconst morgan = require('morgan');\nconst path = require('path');\n\nconst app = express();\n\n// Setup logger\napp.use(morgan(':remote-addr - :rem...
javascript
chosen
[ { "from": "system", "value": "Fix validator for existance of subsets\n" }, { "from": "human", "value": "//# sourceURL=heatmapValidator.js\n\n'use strict';\n\n/**\n * Heatmap Validator\n */\nwindow.HeatmapValidator = (function() {\n\n var validator = {\n NO_SUBSET_ERR : 'No subsets are ...
javascript
chosen
[ { "from": "system", "value": "Handle dumb paths being given to the custom CSS tooling\n" }, { "from": "human", "value": "import fs from 'fs';\n\nEmitter.on('FetchMainAppCustomStyles', () => {\n const mainAppPath = Settings.get('mainAppStyleFile');\n const css = mainAppPath && fs.existsSync(mai...
javascript
chosen
[ { "from": "system", "value": "Return the state object using getter\n" }, { "from": "human", "value": "import events from 'events';\n\nclass Feeder extends events.EventEmitter {\n queue = [];\n pending = false;\n changed = false;\n\n constructor() {\n super();\n\n this.o...
javascript
chosen
[ { "from": "system", "value": "Allow specifying a title to Box component\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\n\nconst Box = ({ children }) => (\n <div>\n {children}\n\n <style jsx>{`\n @import 'colors';\n\n div {\n ...
javascript
chosen
[ { "from": "system", "value": "Tidy up and apply bootstrap styles to the add to do task page.\n" }, { "from": "human", "value": "/**\r\n * Created by allen on 02/06/2015.\r\n */\r\nimport React from \"react\";\r\n\r\nimport _Store from \"../../../stores/_Store.js\";\r\n\r\nconst defaultProps = {\...
javascript
chosen
[ { "from": "system", "value": "Add license mapping to config\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar rootPath = path.normalize(__dirname + '/../../..');\n\nconst REVIEW_STATE_FIELD = ''; // TODO: Adjust this to a new field GUID.\n\nmodule.exports = {\n...
javascript
chosen
[ { "from": "system", "value": "Return also teams.image_path from getTeams\n" }, { "from": "human", "value": "const {knex} = require('../util/database').connect();\nimport _ from 'lodash';\nimport {deepChangeKeyCase} from '../util';\n\nfunction getTeams() {\n return knex.raw(`SELECT teams.id, tea...
javascript
chosen
[ { "from": "system", "value": "Add loadOptions and wrap submit logic.\n" }, { "from": "human", "value": "(function() {\n loadOptions();\n submitHandler();\n})();\n\nfunction submitHandler() {\n var $submitButton = $('#submitButton');\n\n $submitButton.on('click', function() {\n console.log...
javascript
chosen
[ { "from": "system", "value": "Change input box to <form> to enable search with Enter key.\n\n" }, { "from": "human", "value": "/**\n * Poster v0.1.0\n * A React webapp to list upcoming movies and maintain a watchlist, powered by TMDb\n *\n * Author: Kushal Pandya <kushalspandya@gmail.com> (https...
javascript
chosen
[ { "from": "system", "value": "feat: Add koan about object duplicate properties\n" }, { "from": "human", "value": "describe(\"About Objects\", function () {\n\n describe(\"Shorthand Syntax\", function () {\n\n it('should understand initailiser shorthand', function() {\n\n function passTh...
javascript
chosen
[ { "from": "system", "value": "Update function signature in req handler\n" }, { "from": "human", "value": "var async = require( 'async' );\nvar Validation = require( './validation' );\nvar Data = require( './data' );\nvar Output = require( './output' );\nvar utils = require( '../utils' );\n\n\nex...
javascript
chosen
[ { "from": "system", "value": "Fix bug that prevented showing the loading screen\n" }, { "from": "human", "value": "import { Map } from 'immutable';\nimport LastLoginScreen from './last_login_screen';\nimport LoadingScreen from '../loading_screen';\nimport { ui, isConnectionEnabled } from '../ind...
javascript
chosen
[ { "from": "system", "value": "Add playerName and playerScore to stats page\n" }, { "from": "human", "value": "class Stats extends Phaser.State {\n\n\tcreate() {\n\t\tthis.totalScore = this.game.state.states['Main'].totalScore\n this.game.stage.backgroundColor = '#DFF4FF';\n\n\t\tlet statsHead...
javascript
chosen
[ { "from": "system", "value": "Improve checkbox filter performance by checking key instead of iterating\n" }, { "from": "human", "value": "export function filterByText(data, textFilter) {\n if (textFilter === '') {\n return data;\n }\n\n // case-insensitive\n textFilter = textFilter.toLowe...
javascript
chosen
[ { "from": "system", "value": "Test for skipping already known links added.\n" }, { "from": "human", "value": "/* global PageEvaluator */\ndescribe(\"PageEvaluator\", function () {\n describe(\"getSelfReferences\", function () {\n it(\"should be able to return all self references\", fun...
javascript
chosen
[ { "from": "system", "value": "Update Backbone.js plugin to handle event map syntax.\n" }, { "from": "human", "value": "/**\n * Backbone.js plugin\n *\n * Patches Backbone.Events callbacks.\n */\n;(function(window, Raven, Backbone) {\n'use strict';\n\n// quit if Backbone isn't on the page\nif (!B...
javascript
chosen