conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Throw error if no frame is found.\n" }, { "from": "human", "value": "define(['exports', 'module',\n 'events',\n 'class'],\nfunction(exports, module, Emitter, clazz) {\n \n function send(data, origin, win) {\n if (!win) {\n var frame;\n f...
javascript
chosen
[ { "from": "system", "value": "Reformat expected values file for readability\n" }, { "from": "human", "value": "[{\"name\":\"a\",\"param\":[\"x\",\"y\"],\"line\":2,\"character\":12,\"last\":4,\"lastcharacter\":5},{\"name\":\"b\",\"line\":7,\"character\":12,\"last\":12,\"lastcharacter\":2},{\"name...
javascript
chosen
[ { "from": "system", "value": "Switch firefox back to dynamic script\n" }, { "from": "human", "value": "var pageMod = require(\"sdk/page-mod\");\nvar data = require(\"self\").data;\npageMod.PageMod({\n include: \"http://www.nationstates.net/region=*\",\n contentScriptWhen : \"end\",\n contentS...
javascript
chosen
[ { "from": "system", "value": "Remove uneeded comment and sort modules.\n" }, { "from": "human", "value": "/*global define*/\ndefine([\n 'dojo/_base/declare',\n 'dojo/dom-class', // domClass.toggle\n 'dijit/_WidgetBase',\n 'dijit/_CssStateMixin',\n 'dijit/_Templ...
javascript
chosen
[ { "from": "system", "value": "Add some comments to the test 01\n" }, { "from": "human", "value": "'use strict';\r\n\r\nclass Game {\r\n\tconstructor() {\r\n\t\tthis.clock = new Yaje.Clock();\r\n\t\tthis.graphics = new Yaje.Graphics();\r\n\t\tif (this.graphics.initialize(document.getElementById('...
javascript
chosen
[ { "from": "system", "value": "Update default url to encoded one\n" }, { "from": "human", "value": "(function() {\n\t'use strict';\n\n\tfunction setEditorValue(val) {\n\t\tvar editor = document.getElementById('editor');\n\t\teditor.value = val;\n\t}\n\n\tfunction getEditorValue() {\n\t\tvar edito...
javascript
chosen
[ { "from": "system", "value": "Fix typo in migration file, from commit c338cd606.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n up: function (queryInterface, Sequelize) {\n /*\n Add altering commands here.\n Return a promise to correctly handle asynchronic...
javascript
chosen
[ { "from": "system", "value": "Change `in` class to `show` for collapse in BS4.\n" }, { "from": "human", "value": "export { default } from 'ember-bootstrap/components/base/bs-collapse';\n\n" }, { "from": "gpt", "value": "import Collapse from 'ember-bootstrap/components/base/bs-collaps...
javascript
chosen
[ { "from": "system", "value": "Allow timeout for test to be specified.\n" }, { "from": "human", "value": "var CLIEngine = require('eslint').CLIEngine;\nvar chalk = require('chalk');\nvar glob = require('glob');\nvar cli = new CLIEngine({});\n\n\nfunction test(p, opts) {\n it('should have no erro...
javascript
chosen
[ { "from": "system", "value": "Handle 3rd party components that use styleUrls for CSS\n" }, { "from": "human", "value": "'use strict';\nconst path = require('path');\nconst webpackConfig = require('./webpack.config.js');\nconst loaders = require('./webpack/loaders');\nconst AotPlugin = require('...
javascript
chosen
[ { "from": "system", "value": "Allow continuous development using source, just need to link npm package and then we don't have to cake watch anymore.\n" }, { "from": "human", "value": "module.exports = require('lib/cheerio.js');" }, { "from": "gpt", "value": "// Use source if we have ...
javascript
chosen
[ { "from": "system", "value": "Make Model.all work as expected." }, { "from": "human", "value": "var resourceful = require('resourceful');\n\nvar Riak = resourceful.engines.Riak = function(config) {\n if(config && config.bucket) {\n this.bucket = config.bucket;\n } else {\n throw new Erro...
javascript
chosen
[ { "from": "system", "value": "Set default variables at start of function\n" }, { "from": "human", "value": "var hslToHex = require('tie-dye/hslToHex');\n\nfunction hashbow(input, saturation, lightness) {\n var toColor, sum;\n\n var toColor, sum;\n\n switch (typeof input) {\n case 'object':...
javascript
chosen
[ { "from": "system", "value": "Fix callback call in markdown mode\n" }, { "from": "human", "value": "'use strict';\n\nvar githubReadme = require('github-readme'),\n readmeToManPage = require('readme-to-man-page'),\n ghgot = require('gh-got');\n\n\nmodule.exports = function (user, repo, opts...
javascript
chosen
[ { "from": "system", "value": "Switch to proper api for reading from streams\n" }, { "from": "human", "value": "import querystring from 'querystring'\n\nexport default class FormData {\n constructor(req) {\n this.req = req\n this.parsed = false\n this.data = {}\n }\n\n async get(key) ...
javascript
chosen
[ { "from": "system", "value": "Add default options to module\n\nUsers shouldn't need to specify the rest api base\nunless they need something non standard\n" }, { "from": "human", "value": "\"use strict\";\n\nvar headers = require('./headers');\nvar patch = require('./patch');\nvar serialize = re...
javascript
chosen
[ { "from": "system", "value": "Change to enable one store per driver\n" }, { "from": "human", "value": "var express = require(\"express\");\nvar bodyParser = require(\"body-parser\");\nvar databox_directory = require(\"./utils/databox_directory.js\");\n\nvar timeseriesRouter = require('./timeseri...
javascript
chosen
[ { "from": "system", "value": ":sparkles: Add in a modules option that defaults to false\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst pkg = require(path.resolve('./package.json'));\nconst semver = require('semver');\nconst versions = require('./versions...
javascript
chosen
[ { "from": "system", "value": "Add BitBar metadata, working app\n" }, { "from": "human", "value": "#!/usr/bin/env /usr/local/bin/node\nconst bitbar = require('bitbar');\nconst request = require('superagent');\nconst moment = require('moment');\n\nvar busStop = 18610;\nvar busAPIKey = 'TEST';\nvar...
javascript
chosen
[ { "from": "system", "value": "Fix the issue of invalid default property when bundling\n" }, { "from": "human", "value": "module.exports = {\n presets: [\n require(\"babel-preset-react\")\n ],\n plugins: [\n require(\"babel-plugin-transform-decorators-legacy\"),\n require(\"babel-plug...
javascript
chosen
[ { "from": "system", "value": "Switch to Zepto for examples\n" }, { "from": "human", "value": "require.config({\n baseUrl: '../',\n paths: {\n 'text': 'bower_components/requirejs-text/text',\n '$': 'bower_components/jquery/dist/jquery',\n 'bouncefix': 'bower_components/...
javascript
chosen
[ { "from": "system", "value": "Remove jquery from dummy app\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/javascripts, v...
javascript
chosen
[ { "from": "system", "value": "Enable cache for all endpoints\n" }, { "from": "human", "value": "/* global angular */\n\nangular\n .module('speciesApp')\n .factory('SpeciesService', [\n 'API_BASE_URL',\n '$resource',\n SpeciesService\n ])\n\nfunction SpeciesService (API_BASE_URL, $res...
javascript
chosen
[ { "from": "system", "value": "Hotels: Remove border radius from room image overlay\n" }, { "from": "human", "value": "// @flow\n\nimport * as React from 'react';\nimport { View } from 'react-native';\nimport { Touchable, NetworkImage, StyleSheet } from '@kiwicom/mobile-shared';\n\nimport Gallery...
javascript
chosen
[ { "from": "system", "value": "[server] Send updateTypes.UPDATE_THREAD to user's other devices when ThreadSubscription changed\n" }, { "from": "human", "value": "// @flow\n\nimport type {\n ThreadSubscription,\n SubscriptionUpdateRequest,\n} from 'lib/types/subscription-types';\nimport type { V...
javascript
chosen
[ { "from": "system", "value": "feat(redux): Add cache functions to localstorage\n" }, { "from": "human", "value": "export const loadState = () => {\n\ttry {\n\t\tconst serializedState = localStorage.getItem('state')\n\t\tif (serializedState === null) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn J...
javascript
chosen
[ { "from": "system", "value": "Add file not found test\n" }, { "from": "human", "value": "var should = require('should'),\n CLI = require('../lib/CLI.js');\n\ndescribe('CLI Tool', function () {\n var optimist = {}, argv = {};\n\n beforeEach(function () {\n optimist = {};\n argv = {}...
javascript
chosen
[ { "from": "system", "value": "Change alert message on login\n" }, { "from": "human", "value": "function AuthController($scope, $state, Auth, Flash) {\n $scope.login = function () {\n Auth.login($scope.user).then(function () {\n $state.go('home');\n $scope.successAlert();\n }, fu...
javascript
chosen
[ { "from": "system", "value": "Include Bubble dropdown in navigation\n\n" }, { "from": "human", "value": "//@flow\nimport React from \"react\";\n\nimport { Ul, Li, Nav } from \"./styled-components\";\nimport { LinkedInIcon } from \"../../../../elements/linkedin-icon\";\nimport { OctocatIcon } fro...
javascript
chosen
[ { "from": "system", "value": "Change how weather forcast is inserted into the page\n" }, { "from": "human", "value": "import { chainableClassList } from './libs/helpers';\nimport purify from './libs/purify-dom';\nimport { initializeSearch } from './modules/search';\nimport initializeHistory from...
javascript
chosen
[ { "from": "system", "value": "Implement findMinMax functionality for non-number arrays.\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = {\n\t// This function finds the minimum and maximum values in an array of numbers.\n\tfindMinMax: function(numlist) {\n\t\tif (numlist.lengt...
javascript
chosen
[ { "from": "system", "value": "Use setImmediate instead of process.nextTick (since 0.10)\n" }, { "from": "human", "value": "/**\n * Convenient Redis Storage mock for testing purposes\n */\n\nvar util = require ('util');\n\nfunction StorageMocked(data){\n data = data || {};\n this.currentOutage ...
javascript
chosen
[ { "from": "system", "value": "Add unsafe to component mount\n" }, { "from": "human", "value": "import { Component } from 'react'\nimport PropTypes from 'prop-types'\n\nexport default class Redirect extends Component {\n\n static propTypes = {\n redirectPath: PropTypes.string.isRequired,\n ...
javascript
chosen
[ { "from": "system", "value": "Disable first run after configuration process\n" }, { "from": "human", "value": "const Configstore = require('configstore');\nconst Promise = require('promise');\nconst inquirer = require('inquirer');\nconst pkg = require('../../../../package.json');\nconst prompts ...
javascript
chosen
[ { "from": "system", "value": "Remove IE8 support from CSS module\n" }, { "from": "human", "value": "/**\n * @fileoverview CSS helper functions\n */\n\ngoog.provide('treesaver.css');\n\n/**\n * Return the computedStyle object, which varies based on\n * browsers\n * @param {?Element} el\n * @retur...
javascript
chosen
[ { "from": "system", "value": "Fix bug cannot read movilinks of undefined\n" }, { "from": "human", "value": "import fetch from 'focus-core/network/fetch';\nimport personUrl from '../config/server/persons';\nimport omit from 'lodash/object/omit';\n\nexport default {\n loadPerson(id) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add default full annotation description SHOULD check\n" }, { "from": "human", "value": "var assert = require('chai').assert;\nvar request = require('supertest');\n\nvar container_url = 'http://localhost:8080/annotations/';\n\nconst MEDIA_TYPE = 'application/ld+json;...
javascript
chosen
[ { "from": "system", "value": "Add missing class to select\n" }, { "from": "human", "value": "$( window ).load(function() {\n var togglePanel = function(panelId, link){\n var panel = $(panelId);\n panel.toggle();\n if(panel.is(\":visible\")){\n $(link).html('<span class=\"glyphicon...
javascript
chosen
[ { "from": "system", "value": "Allow examples to use ES7 class properties\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar webpack = require('webpack');\n\nfunction isDirectory(dir) {\n return fs.lstatSync(dir).isDirectory();\n}\n\nmodule.exports = {\n...
javascript
chosen
[ { "from": "system", "value": "Use $sections instead of sections\n\nAs the variable is a JQuery object, give it a $name instead of a name\n" }, { "from": "human", "value": "(function() {\n \"use strict\";\n window.GOVUK = window.GOVUK || {};\n\n function CollapsibleCollection(options){\n th...
javascript
chosen
[ { "from": "system", "value": "Fix benign JS error from clicking reference links in ArticleViewer\n\nSome footnote anchors have valid IDs but not valid CSS selectors, so they would cause errors with document.querySelector().\n\nhttps://stackoverflow.com/a/37271406/4957673\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Add 1 hour to datetimes for start_time and end_time in the events API result\"\n\nThis reverts commit a81f28284fb3ef1a91f2029be2e2a03ef4488592.\n" }, { "from": "human", "value": "var restify = require('express-restify-mongoose');\nvar Artist = require('../a...
javascript
chosen
[ { "from": "system", "value": "Fix bug which cause ENOENT window.json\n" }, { "from": "human", "value": "const low = require('lowdb')\nconst FileSync = require('lowdb/adapters/FileSync')\n\nexport default function (userAppPath) {\n const windowAdapter = new FileSync(userAppPath)\n const windowS...
javascript
chosen
[ { "from": "system", "value": "Increment the version to pre0.28.\n" }, { "from": "human", "value": "var PROPERTY_SS_ID = 'SPREADSHEET_ID';\nvar RULE_KEY = 'MAILMAN_PROP_RULES';\nvar MAILMAN_VERSION = 'pre0.27';\nvar APP_NAME = 'Mailman';\nvar LAST_AUTH_KEY = 'MAILMAN_AUTH_EMAIL';\n\nvar SPREADSHE...
javascript
chosen
[ { "from": "system", "value": "Revert \"One can use an anonymous function\"\n\nThis reverts commit 55f750d0dfb1d92798221118c9b0eb0ba01abcb5.\n\nThis commit reverts my experiment of defining my controller inline as an\nanonymous function.\n" }, { "from": "human", "value": "// Code goes here\n\n/*\...
javascript
chosen
[ { "from": "system", "value": "Fix error due to yarn outdated returns 1\n" }, { "from": "human", "value": "import spawn from \"./promise/spawn\";\n\nlet COMMAND = \"yarnpkg\";\nexport default class {\n constructor(workingdir, LOG) {\n this.cwd = workingdir;\n this.LOG = LOG;\n ...
javascript
chosen
[ { "from": "system", "value": "Remove spurious console.log from yepnope path filter" }, { "from": "human", "value": "/**\r\n * YepNope Path Filter\r\n * \r\n * Usage:\r\n * yepnope.paths = {\r\n *\t 'google': '//ajax.googleapis.com/ajax',\r\n *\t 'my-cdn': '//cdn.myawesomesite.com'\r\n * ...
javascript
chosen
[ { "from": "system", "value": "Add busy indication on data load\n" }, { "from": "human", "value": "Controller.$inject = ['$http', 'qgrid'];\nexport default function Controller($http, qgrid) {\n\tconst ctrl = this;\n\tctrl.rows = [];\n\tctrl.model = qgrid.model();\n\n\tctrl.model.pagination({\n\t\...
javascript
chosen
[ { "from": "system", "value": "Fix Jest call in the release script\n\nJust running jest binary will no longer work" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nconst chalk = require('chalk');\nconst {exec} = require('child-process-promise');\nconst {logPromise} = requi...
javascript
chosen
[ { "from": "system", "value": "Fix source array is \"0\"\n\nUsed 'settings.options.sourceMap.filename' as 'source' value, so if wants to make source map file, 'sourceMap.filename' have to be gave with right value.\r\n\r\nI'm not good at javascript enough and not sure this is good design." }, { "from"...
javascript
chosen
[ { "from": "system", "value": "Add mocha / chai globals to tests/.jshintrc\n\n[Closes #3]\n" }, { "from": "human", "value": "module.exports = {\n name: 'ember-cli-mocha',\n\n normalizeEntityName: function() {\n // this prevents an error when the entityName is\n // not specified (since tha...
javascript
chosen
[ { "from": "system", "value": "Add html test coverage reporting\n\nThe html reporter for test coverage provides a visual representation of\nexactly which lines/code have test coverage, so its very useful in\ntracking down missing tests. This will only affect development.\n" }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Fix indentation in the text-fill directive.\n" }, { "from": "human", "value": "/*global angular*/\n(function () {\n 'use strict';\n\n // min-font-size attribute = minimum font size in pixels\n // max-font-size attribute = maximum font size in pixels\n //...
javascript
chosen
[ { "from": "system", "value": "Fix error on displaying when no content\n" }, { "from": "human", "value": "import moment from 'moment'\n\nfunction display (content, format) {\n if (format === 'Date') return moment(content).format('YYYY-MM-DD HH:mm:ss')\n else if (format === 'GeoPoint') return `$...
javascript
chosen
[ { "from": "system", "value": "Use AngularJS best practice naming conventions\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('chartsExample.directives',[])\n\n.directive('chart', function () {\n return {\n restrict: 'E',\n template: '<div></div>',\n scope: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the use of runtimeCatalogueLocal\n" }, { "from": "human", "value": "import SandboxBrowser from '../sandboxes/SandboxBrowser';\nimport AppSandboxBrowser from '../sandboxes/AppSandboxBrowser';\nimport Request from '../browser/Request';\nimport {RuntimeCatalogue, R...
javascript
chosen
[ { "from": "system", "value": "Add worflow validation to prevent user replacement assumptions\n" }, { "from": "human", "value": "(function( $ ) {\n $.fn.searchify = function() {\n return this.each(function() {\n $(this).autocomplete({\n source: $(this).data(\"s...
javascript
chosen
[ { "from": "system", "value": "Optimize backend button click function\n" }, { "from": "human", "value": "define('app/views/backend_button', ['ember'],\n /**\n * Backend Button View\n *\n * @returns Class\n */\n function() {\n return Ember.View.extend({\n\n ...
javascript
chosen
[ { "from": "system", "value": "Comment out some Angular Material demo code to refer to later\n" }, { "from": "human", "value": "app.controller('NavController', ['$http', '$firebaseAuth', function($http, $firebaseAuth) {\n console.log('NavController running');\n var auth = $firebaseAuth();\n va...
javascript
chosen
[ { "from": "system", "value": "Connect to LDAP server to verify config\n\n" }, { "from": "human", "value": "class LdapConfigService {\n\tasync create(config, params) {\n\t\tconst { verifyOnly } = params.query;\n\n\t\tconst verificationResult = await this.verifyConfig(config);\n\n\t\tif (verificat...
javascript
chosen
[ { "from": "system", "value": "Increase timeout on score entry\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport { task, timeout } from 'ember-concurrency';\n\nexport default Ember.Component.extend({\n autosave: task(function* (points){\n let intPoints = parseInt(points);...
javascript
chosen
[ { "from": "system", "value": "Use new way of loading messages, the old one is deprecated\n" }, { "from": "human", "value": "define('app/controllers/notification', ['ember'],\n\t/**\n\t * Notification controller\n\t *\n\t * @returns Class\n\t */\n\tfunction() {\n\t\treturn Ember.Object.extend({\n...
javascript
chosen
[ { "from": "system", "value": "Use query instead of params (from router), and set up events instead of pointless delegate.\n" }, { "from": "human", "value": "var app = require('ridge');\n\nvar FormView = require('ridge/views/form');\n\nmodule.exports = FormView.extend({\n\tsubmit: function(e) {\n...
javascript
chosen
[ { "from": "system", "value": "Fix th class of BaseFormatSet\n" }, { "from": "human", "value": "\"use strict\"\n\nconst BaseFormatSet = require('./baseFormatSet');\n\nclass BaseFormatSetTable extends BaseFormatSet {\n commit(subquery, formattedRows) {\n let output = '<thead><tr>';\n for (l...
javascript
chosen
[ { "from": "system", "value": "Modify variables passing in in dummy app.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport CommentableMixin from 'ember-osf/mixins/commentable';\nimport TaggableMixin from 'ember-osf/mixins/taggable-mixin';\nimport NodeActionsMixin from 'ember-o...
javascript
chosen
[ { "from": "system", "value": "Remove prop-types import in production\n" }, { "from": "human", "value": "'use strict'\n\nconst getBrowserslistConfig = require('./lib/getBrowserslistConfig')\nconst mergeByEnv = require('./lib/mergeByEnv')\n\nmodule.exports = mergeByEnv({\n presets: [\n [\n ...
javascript
chosen
[ { "from": "system", "value": "Fix errors in node 6 on Windows x64\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n env: {\n browser: true,\n node: true\n },\n extends: 'standard',\n plugins: [\n 'html'\n ],\n 'rules': {\n 'arrow-parens': 0,\n 'no-debugg...
javascript
chosen
[ { "from": "system", "value": "Enable new flowtype eslint rules\n\nThere have been some new rules added since we started using this plugin.\nIt looks like we are already following them, so no additional cleanup is\nneeded.\n" }, { "from": "human", "value": "module.exports = {\n parser: 'babel-es...
javascript
chosen
[ { "from": "system", "value": "Use the rootURL in prerender to get assets\n" }, { "from": "human", "value": "/* eslint-env node */\n\nmodule.exports = {\n name: 'ilios-prerender',\n contentFor: function(type, config) { // eslint-disable-line no-unused-vars \n if (type === 'body-footer') {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix javascript day calculation to highlight current day\n\n * Remove jsonp call to appspot.com becuase of \"Over Quota\" error.\n\n * This new solution does not depend on an external service and just\n uses local browser time.\n" }, { "from": "human", "value": ...
javascript
chosen
[ { "from": "system", "value": "Make JS observation on 'change notice period' form live.\n\nNow our JavaScript can still catch events even when the form\nelements are added to the DOM after page load.\n" }, { "from": "human", "value": "// Place all the behaviors and hooks related to the matching c...
javascript
chosen
[ { "from": "system", "value": "Add onPress handlers for each repo list item generated\nSetup each list item to navigate to a new screen, passing the name of\nthe repository being viewed and the repository's url which would be used\nby the API to get the README\n" }, { "from": "human", "value": "i...
javascript
chosen
[ { "from": "system", "value": "Resolve method error as a standard GraphQL error\n" }, { "from": "human", "value": "class DDPNetworkInterface {\n constructor({\n connection,\n noRetry = true,\n method = '/graphql' } = {}\n ) {\n this.connection = connection;\n ...
javascript
chosen
[ { "from": "system", "value": "Reorder imports for a happy linter" }, { "from": "human", "value": "const {Menu} = require('electron')\nconst menubar = require('menubar')\nconst platform = require('os').platform()\n\n// Toggle with cmd + alt + i\nrequire('electron-debug')({showDevTools: true})\n\n...
javascript
chosen
[ { "from": "system", "value": "Add PATH env manipulation when platform is darwin\n" }, { "from": "human", "value": "var app = require('app'); // Module to control application life.\nvar BrowserWindow = require('browser-window'); // Module to create native browser window.\n\n// Report crashes to...
javascript
chosen
[ { "from": "system", "value": "Use classes for a better defined architecture. Still not split in various files though, but that's minor\n" }, { "from": "human", "value": "\"use strict\"\n\nconst qs = require('qs')\nconst moment = require('moment')\nconst templateStore = require('./templates/templ...
javascript
chosen
[ { "from": "system", "value": "Improve readability on error handling.\n" }, { "from": "human", "value": "var logger = require('../support/logger');\n\nvar ItemSchema = require('../domain/item-schema');\nvar instanceSchemaCorrelator = require('../http/instance-schema-correlator');\n\n\nvar instanc...
javascript
chosen
[ { "from": "system", "value": "Change to Fix breaking window object" }, { "from": "human", "value": "'use strict'\n// https://github.com/purposeindustries/window-or-global\nmodule.exports = (typeof self === 'object' && self.self === self && self) ||\n (typeof global === 'object' && global.global...
javascript
chosen
[ { "from": "system", "value": "Fix foundation-sites not being loaded\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst autoprefixer = require('gulp-autoprefixer');\nconst concat = require('gulp-concat');\nconst sass = require('gulp-sass');\n\nconst sassPaths = [\n\t'bower_co...
javascript
chosen
[ { "from": "system", "value": "Add null check to get unit tests passing\n" }, { "from": "human", "value": "const organisationUnitConstants = require('../constants/organisation-unit')\n\nmodule.exports = function (pageTitle, subNav, organisationLevel) {\n let selectedSubNavTitle = ''\n subNav.fo...
javascript
chosen
[ { "from": "system", "value": "Add gulp default task to run unit tests and build documentation\n\nSigned-off-by: Harri Kovalainen <2ecf1d4f49b9d136d53b819dc389c152487e9e18@gmail.com>\n" }, { "from": "human", "value": "\"use strict\";\n\nrequire('./gulp/unit-tests');\nrequire('./gulp/documentation...
javascript
chosen
[ { "from": "system", "value": "feat: Add user settings method to return day that month begins\n\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Service.extend({\n currency () {\n return '$';\n }\n});\n" }, { "from": "gpt", "value": "import Em...
javascript
chosen
[ { "from": "system", "value": "Add fetchSrc method to entry model.\n" }, { "from": "human", "value": "define(['backbone'], function(B) {\n var M = {};\n\n M.Entry = B.Model.extend({});\n M.Entries = B.Collection.extend({\n model: M.Entry,\n url: 'entries/data.json'\n });\n\n return M;\...
javascript
chosen
[ { "from": "system", "value": "Add unit tests for the class methods of Stream\n" }, { "from": "human", "value": "var kamo = require('../src/kamo');\nvar assert = require('assert');\n\ndescribe('kamo.Stream', function () {\n beforeEach(function () {\n this.stream = new kamo.Stream();\n });\n\...
javascript
chosen
[ { "from": "system", "value": "Add client side user detail permission\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n var app = angular.module('radar.users');\n\n app.factory('UserInfoController', ['ModelDetailController', '$injector', function(ModelDetailController, $inje...
javascript
chosen
[ { "from": "system", "value": "Add repo and uefi to required options list\n" }, { "from": "human", "value": "// Copyright 2016, EMC, Inc.\n\n'use strict';\n\nmodule.exports = {\n friendlyName: 'base-uefi',\n injectableName: 'Task.Base.uefi',\n runJob: 'Job.Uefi',\n requiredOptions: [...
javascript
chosen
[ { "from": "system", "value": "Change font-size even when the window is resized\n" }, { "from": "human", "value": "function formatTime(num){\n var minute = '0' + String(Math.floor(num / 60));\n var second = '0' + String(num % 60);\n\n return minute.substr(-2) + ':' + second.substr(-2);\n...
javascript
chosen
[ { "from": "system", "value": "Fix running individual tests with 'test' task\n\nUndo overwriting of existing 'test' task from commit 3d70678, while preserving\nintention of linting before tests.\n" }, { "from": "human", "value": "/*\n * grunt-contrib-watch\n * http://gruntjs.com/\n *\n * Copyrigh...
javascript
chosen
[ { "from": "system", "value": "Use http instead of https for grunt deployment.\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n buildcontrol: {\n options: {\n dir: 'demo',\n commit: true,\n push: true,\n message: 'Bu...
javascript
chosen
[ { "from": "system", "value": "Fix 'Cannot read property 'apply' of undefined' introduced in daaae82\n" }, { "from": "human", "value": "var utils = require('./utils')\n\nfunction api (opbeat, queuedCommands) {\n this.q = []\n\n this.opbeat = opbeat\n this.execute = utils.functionBind(this.exec...
javascript
chosen
[ { "from": "system", "value": "Add a little more behavior to search box view\n" }, { "from": "human", "value": "import $ from 'jquery';\nimport BaseView from '../../utils/_base-view';\n\nclass SearchBoxView extends BaseView {\n\n get el() { return '#search-box'; }\n\n get query() {\n return ...
javascript
chosen
[ { "from": "system", "value": "Support title props in addition to children\n" }, { "from": "human", "value": "import {\n ADD,\n SHOW,\n DISMISS\n} from './actions.js'\n\nconst INITIAL_STATE = {\n items: [],\n current: null\n}\n\nfunction show (state, payload) {\n return {\n ...state,\n ...
javascript
chosen
[ { "from": "system", "value": "Change blink-diff threshold 1 to 5\n\nTest in local machine is passed. But in CI environment, the test is\nfailed. So, I just increase pixel threshold 1 to 5.\n" }, { "from": "human", "value": "export default {\n customDiffConfig: {\n thresholdType: 'pixel',\n ...
javascript
chosen
[ { "from": "system", "value": "Use an accumulator instead and only do one iteration - much more efficient\n" }, { "from": "human", "value": "var _cache = [];\n\nfunction EventHandler(token, eventName, handler, enabled) {\n this.elementToken = token;\n this.eventName = 'click.namespacename';\n ...
javascript
chosen
[ { "from": "system", "value": "Revert \"fix: add missing feature\"\n\nThis reverts commit f674d64689777e41f07b2a875b83127049d36ab9.\n" }, { "from": "human", "value": "/**\n * Returns a very important number\n * @returns {number}\n */\nexport default function theDefaultExport() {\n return 42;\n}\...
javascript
chosen
[ { "from": "system", "value": "Use hashhistory, no scroll thing, remove devtools.\n" }, { "from": "human", "value": "//TODO INSTLALL ESLINT THINGS\n\nimport React from 'react'\nimport { render } from 'react-dom'\nimport { Router, Route, Redirect, IndexRoute } from 'react-router'\nimport { Provide...
javascript
chosen
[ { "from": "system", "value": "Set the export as default\n" }, { "from": "human", "value": "import copySitecoreLibraries from './tasks/copy-sitecore-libraries';\nimport deploy from './tasks/deploy';\nimport nugetRestore from './tasks/nuget-restore';\nimport packageWebsite from './tasks/package-we...
javascript
chosen
[ { "from": "system", "value": "Allow partitionAssigners to be configured\n" }, { "from": "human", "value": "const { createLogger, LEVELS: { INFO } } = require('./loggers')\nconst LoggerConsole = require('./loggers/console')\nconst Cluster = require('./cluster')\nconst createProducer = require('./...
javascript
chosen
[ { "from": "system", "value": "Remove need to spread config object\n" }, { "from": "human", "value": "import 'pixi';\nimport 'p2';\nimport 'phaser';\n\nimport { STATES } from 'constants';\n\nimport Boot from 'states/boot';\nimport Play from 'states/play';\nimport End from 'states/end';\nimport Ti...
javascript
chosen
[ { "from": "system", "value": "Add route to 404 page\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport Router from 'vue-router'\nimport Index from '@/views/Index'\nimport Group from '@/views/Group'\n\nVue.use(Router)\n\nexport default new Router({\n routes: [\n {\n path: '...
javascript
chosen