conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix deprecated warning for ts-jest\n" }, { "from": "human", "value": "var semver = require('semver');\n\nfunction getSupportedTypescriptTarget() {\n var nodeVersion = process.versions.node;\n\n if (semver.gt(nodeVersion, '7.6.0')) {\n return 'es2017'\n } else ...
javascript
chosen
[ { "from": "system", "value": "Remove unused template helper; add comments\n" }, { "from": "human", "value": "Template.editHome.helpers({\n 'home': function () {\n // Get Home ID from template data context\n // convert the 'String' object to a string for the DB query\n var homeId = this...
javascript
chosen
[ { "from": "system", "value": "Update eBay highlight script to work with new classes\n" }, { "from": "human", "value": "// ==UserScript==\n// @name eBay - Hilight Items With Bids\n// @namespace http://mathemaniac.org\n// @include http://*.ebay.*/*\n// @grant none\n// @v...
javascript
chosen
[ { "from": "system", "value": "Set long time caching for js/css builds.\n" }, { "from": "human", "value": "/* eslint strict: 0 */\n'use strict';\n\n// Load environment variables\nrequire('dotenv-safe').load();\n\n// Load assets\nconst assets = require('./assets');\nconst express = require('expres...
javascript
chosen
[ { "from": "system", "value": "Add pagination logic, cleanup re-org code\n" }, { "from": "human", "value": "catalogApp.controller('CatalogCtrl', ['$scope', 'assetService', function($scope, assetService) {\n\n $scope.assets = [];\n $scope.totalHits = 0;\n\n $scope.getAssets = function(data) {\n...
javascript
chosen
[ { "from": "system", "value": "Use cache dir based on file location" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function Browscap (cacheDir) {\n if (typeof cacheDir === 'undefined') {\n cacheDir = './sources/';\n }\n\n this.cacheDir = cacheDir;\n\n /**\n * parses...
javascript
chosen
[ { "from": "system", "value": "Switch from arrays to Sets\n" }, { "from": "human", "value": "import normalizeEvents from './tools/normalizeEvents';\nimport normalizeListener from './tools/normalizeListener';\n\nexport default function stereo () {\n let listeners = {};\n\n let emitter = {\n o...
javascript
chosen
[ { "from": "system", "value": "Save the players array correctly when saving game stats\n" }, { "from": "human", "value": "const mongoskin = require('mongoskin');\nconst logger = require('../log.js');\n\nclass GameRepository {\n save(game, callback) {\n var db = mongoskin.db('mongodb://1...
javascript
chosen
[ { "from": "system", "value": "Add test for untested empty string branch.\n" }, { "from": "human", "value": "'use strict';\n\nvar chai = require('chai'),\n expect = chai.expect,\n sinon = require('sinon'),\n sinonChai = require('sinon-chai'),\n logger = require('../../../logger');\n\n...
javascript
chosen
[ { "from": "system", "value": "Add ReactTransitionGroup to the build\n" }, { "from": "human", "value": "'use strict';\n\nvar rootIDs = [\n \"React\"\n];\n\nvar debug = {\n rootIDs: rootIDs,\n configFile: \"grunt/config/jsx/debug.json\",\n sourceDir: \"src\",\n outputDir: \"build/modules\"\n}...
javascript
chosen
[ { "from": "system", "value": "Hide (instead of fade out) badge on iPhone\n" }, { "from": "human", "value": "$(document).ready(function() {\n function updateAssessmentFormState() {\n var numberOfQuestions = $('#assessment .legend').length;\n var numberOfCheckedAnswers = $('#assessment inpu...
javascript
chosen
[ { "from": "system", "value": "Make function to eat bookmarks\n" }, { "from": "human", "value": "$(document).ready(function() {\n onCreatedChrome()\n});\n\nfunction onCreatedChrome() {\n chrome.tabs.onCreated.addListener(function(tab) {\n alert(\"hello\");\n });\n}\n" }, { "from": "...
javascript
chosen
[ { "from": "system", "value": "Update Siddhi quick start guide link\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n * WSO2 Inc. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may ...
javascript
chosen
[ { "from": "system", "value": "Add helper for container “created”-status checking" }, { "from": "human", "value": "var exec = require('child_process').exec,\n _ = require('lodash')\n\n\nmodule.exports.asyncIterate = function(array, callback, done) {\n function iterate(idx) {\n var...
javascript
chosen
[ { "from": "system", "value": "Fix the potential XSS in URI-like strings with <, > and \"\n" }, { "from": "human", "value": "// ==UserScript==\n// @id Modify URL @2ch\n// @name Modify URL @2ch\n// @version 0.0.5\n// @namespace curipha\n// @author curipha\...
javascript
chosen
[ { "from": "system", "value": "Set topic rather than queue.\n" }, { "from": "human", "value": "/**\n * Creates an instance of `Message`.\n *\n * This class is used as a mock when testing Crane handlers, substituted in\n * place of a `Message` from the underlying message queue adapter.\n *\n * @co...
javascript
chosen
[ { "from": "system", "value": "Replace .jsx requires in .js to be able to require e.g. timeago\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar visitors = require('react-tools/vendor/fbtransform/visitors');\nvar jstransform = require('jstransform');\n\nvar visitorL...
javascript
chosen
[ { "from": "system", "value": "Fix foreign import declaration for byteLength\n" }, { "from": "human", "value": "/* global exports */\n/* global Buffer */\n\"use strict\";\n\n// module Node.Encoding\n\nexports.byteLength = function (str) { \n return function (enc) { \n return Buffer.byteLength...
javascript
chosen
[ { "from": "system", "value": "Replace all tabs with spaces.\n" }, { "from": "human", "value": "(function($) {\n\t$(document).ready(function(){\n\n\t\tshowHideButton();\n\t\t$('.cms-tabset-nav-primary li').on('click', showHideButton);\n\t\t\n\t\tfunction showHideButton() {\n\t\t\tif ($('#Root_Mai...
javascript
chosen
[ { "from": "system", "value": "Add 3 movies in example, looks better\n" }, { "from": "human", "value": "angular.module('listExample.controllers', [])\n\n\n// Controller that fetches a list of data\n.controller('MovieIndexCtrl', function($scope, MovieService) {\n \n // \"MovieService\" is a serv...
javascript
chosen
[ { "from": "system", "value": "Update the enemy bounds in the enemy class\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @description Enemy class => objects the player should avoid\n * @constructor\n * @param {number} x position of the enemy on the 'x' axis\n * @para...
javascript
chosen
[ { "from": "system", "value": "Add click listener to play buttotn.\n" }, { "from": "human", "value": "import React from 'react';\n\nmodule.exports = React.createClass({\n getInitialState: function getInitialState() {\n return {\n isPlayingStream: typeof window.orientation === 'undefined'...
javascript
chosen
[ { "from": "system", "value": "Print out uncaught exceptions. Node stops doing this when you add an uncaught exception handler.\n" }, { "from": "human", "value": "var Hoptoad = require('hoptoad-notifier').Hoptoad\n ,\tenv = require('../environment')\n , shouldReport = env.hoptoad && env.hoptoa...
javascript
chosen
[ { "from": "system", "value": "Reimplement early exit for JSON parse errors.\n" }, { "from": "human", "value": "const utils = require('../../utils')\n\nconst load = (files, jsonFiles, jsonContentsDict, annexed, dir) => {\n let issues = []\n\n // Read JSON file contents and parse for issues\n c...
javascript
chosen
[ { "from": "system", "value": "Change en_US code from \"en\" to \"en-us\" for consistency\n" }, { "from": "human", "value": "function randomFrom(array) {\n return array[Math.floor(Math.random()*array.length)]\n}\n\nfunction filter_available(item) {\n return !item.unreleased\n}\n\nvar language_m...
javascript
chosen
[ { "from": "system", "value": "Disable idleTimer on iOS for appified apps" }, { "from": "human", "value": "/*\n * This is a template used when TiShadow \"appifying\" a titanium project.\n * See the README.\n */\n\nvar TiShadow = require(\"/api/TiShadow\");\nvar Compression = require('ti.compressi...
javascript
chosen
[ { "from": "system", "value": "Remove arrow function to remain compatible with older Node versions\n" }, { "from": "human", "value": "\"use strict\";\n\nvar MetafileMatcher = require('./metafile-matcher');\n\n// Not needed in Node 4.0+\nif (!Object.assign) Object.assign = require('object-assign')...
javascript
chosen
[ { "from": "system", "value": "Update to return the title Function" }, { "from": "human", "value": "import Route from '@ember/routing/route';\n\nexport default Route.extend({\n titleToken() {\n return 'Ember CLI';\n }\n});\n" }, { "from": "gpt", "value": "import Route from '@embe...
javascript
chosen
[ { "from": "system", "value": "Standardize on “//“ for all JS comments" }, { "from": "human", "value": "var Turbolinks = require(\"exports?this.Turbolinks!turbolinks\");\n\n/* Disable the Turbolinks page cache to prevent Tlinks from storing versions of\n * pages with `react-id` attributes in them...
javascript
chosen
[ { "from": "system", "value": "Add test for the search field.\n" }, { "from": "human", "value": "import React from 'react'\nimport { shallow } from 'enzyme'\nimport { shallowToJson } from 'enzyme-to-json'\nimport Search from './Search'\nimport ShowCard from './ShowCard'\nimport preload from '../p...
javascript
chosen
[ { "from": "system", "value": "Fix broken test by including babel polyfill on dummy app\n" }, { "from": "human", "value": "/* eslint-env node */\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n var app = new EmberAddon(defaults, {\n ...
javascript
chosen
[ { "from": "system", "value": "Use charCode instead of keyCode\n" }, { "from": "human", "value": ";(function(){\n var G = dijkstra.hexGrid(2);\n\n var view = new dijkstra.GraphView(G, document.getElementById('graph'), {\n placement: function(position){ return {\n 'x': 100 ...
javascript
chosen
[ { "from": "system", "value": "Refresh data for the user settings page when it is being accessed\n\nFix #1281\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('<%=angularAppName%>')\n .controller('SettingsController', function ($scope, Principal, Auth) {\n $scope.succe...
javascript
chosen
[ { "from": "system", "value": "Allow a block to be specified for loading" }, { "from": "human", "value": "/*\nLoad a block from github.io.\nAccepts a url as a parameter which can include url parameters e.g. https://megjlow.github.io/extension2.js?name=SUN&ip=10.0.0.1\n*/\n\nnew (function() {\n\tv...
javascript
chosen
[ { "from": "system", "value": "Stop relying on `ts-node` from the global scope\n" }, { "from": "human", "value": "const childProcess = require(\"child_process\");\nconst fs = require(\"fs\");\n\nif (process.argv.length !== 3) {\n throw new Error(\"Requires the base path as argument.\");\n}\n\n...
javascript
chosen
[ { "from": "system", "value": "Add use of navigation focus custom hook in usePopOver hook\n" }, { "from": "human", "value": "import React, { useState, useCallback, useRef } from 'react';\n\n/**\n * Hook which manages popover position over a DOM element.\n * Pass a ref created by React.createRef. ...
javascript
chosen
[ { "from": "system", "value": "Use vm instead of evals binding\n" }, { "from": "human", "value": "var Context = process.binding('evals').Context,\n // TODO: Remove .Script when bumping req'd node version to >= 5.0\n Script = process.binding('evals').NodeScript || process.binding('evals').Sc...
javascript
chosen
[ { "from": "system", "value": "Add tests for some submit controller actions.\n" }, { "from": "human", "value": "import { moduleFor, test } from 'ember-qunit';\n\nmoduleFor('controller:submit', 'Unit | Controller | submit', {\n // Specify the other units that are required for this test.\n // nee...
javascript
chosen
[ { "from": "system", "value": "Update editor key for docs site\n" }, { "from": "human", "value": "import FroalaEditorComponent from 'ember-froala-editor/components/froala-editor';\n\nexport default FroalaEditorComponent.extend({\n // eslint-disable-next-line ember/avoid-leaking-state-in-ember-ob...
javascript
chosen
[ { "from": "system", "value": "Add missing space in proj definition" }, { "from": "human", "value": "goog.provide('gmf.proj.EPSG21781');\n\ngoog.require('ol.proj');\n\nif (typeof proj4 == 'function') {\n proj4.defs('EPSG:21781',\n '+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333...
javascript
chosen
[ { "from": "system", "value": "Support |all| option when shimming DNS.lookup\n\nBefore, clients attempting an \"all\" style address lookup,\nsuch as the SQL Server database module tedious does in its connector.js\nwhen provided a hostname,\nwere liable to error out due to treating the argument as an array\nw...
javascript
chosen
[ { "from": "system", "value": "Test using an existing ID.\n" }, { "from": "human", "value": "/* eslint-env jest */\n\nimport tableNames from '../../tables'\nimport Charity from '../CharityModel'\n\njest.mock('../../database')\n\ndescribe('CharityModel', () => {\n it('implements the name property...
javascript
chosen
[ { "from": "system", "value": "Clean up comments and validity check\n" }, { "from": "human", "value": "angular.module('app').directive(\"validateBitcoinAddress\", function() {\n return {\n require: 'ngModel',\n link: function(scope, ele, attrs, ctrl) {\n\n ctrl.$parser...
javascript
chosen
[ { "from": "system", "value": "Complete the code to use the variable replyCount from inside the template string\n" }, { "from": "human", "value": "\"use strict\";\n\nlet replyCount = 21;\nlet message = `This topic has a total of replies`;" }, { "from": "gpt", "value": "\"use strict\"...
javascript
chosen
[ { "from": "system", "value": "Change interface for make change in implementation\n" }, { "from": "human", "value": "'use strict';\n\nconst EventEmitter = require('events');\n\n/**\n * Tracker Manager\n * @interface\n */\nclass ITrackerManager extends EventEmitter {\n\tconstructor() {\n\t\tsuper(...
javascript
chosen
[ { "from": "system", "value": "Fix generating icon name for files without extension\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n classNames: ['popover-confirm'],\n\n iconClass: function () {\n var filename = this.get('file...
javascript
chosen
[ { "from": "system", "value": "Remove click handler overriding default link behavior\n\nAn [issue](https://github.com/travis-ci/travis-ci/issues/5181) was reported in\nwhich the repository sidebar links were not functioning properly. I've\ntracked it down to the fact that a click handler was registered and\n...
javascript
chosen
[ { "from": "system", "value": "Make task async and only quit once process exits\n" }, { "from": "human", "value": "/*\n * grunt-appium\n * https://github.com/hungrydavid/grunt-appium\n *\n * Copyright (c) 2015 David Adams\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.exports...
javascript
chosen
[ { "from": "system", "value": "Fix spelling error in browser change modal" }, { "from": "human", "value": "import React from 'react';\n\nfunction Browser() {\n return (\n <div className=\"c-browser\">\n <h3>Browser not supported</h3>\n <p>The browser you are using is out-of-date and...
javascript
chosen
[ { "from": "system", "value": "Add quotes around the npm_execpath\n\n[fixes #19]\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar cp = require('child_process');\nvar assert = require('assert');\n\nvar partialDependencies = {\n \"concat-stream\": \"^1.4.7\",\n \"o...
javascript
chosen
[ { "from": "system", "value": "Add the key and value in option\n" }, { "from": "human", "value": "export default class Middleware {\n\n /**\n * Constructor\n */\n constructor(key, value) {\n key = key.toLowerCase();\n\n // In case of simple middleware\n if (key == \"middleware\") {\n...
javascript
chosen
[ { "from": "system", "value": "Remove use of the import 'goog:...' pattern\n\nSupport for this is soon to be removed.\n\n-------------\nCreated by MOE: https://github.com/google/moe\nMOE_MIGRATED_REVID=177366930\n" }, { "from": "human", "value": "// Copyright 2016 The Closure Rules Authors. All r...
javascript
chosen
[ { "from": "system", "value": "Fix not being able to delete first item of list\n" }, { "from": "human", "value": "export class Basefield {\n id = '';\n label = '';\n columns = 8;\n index = undefined;\n parent = undefined;\n\n init(id = '', {label = '', columns = 8, parent, index} = {}) {\n ...
javascript
chosen
[ { "from": "system", "value": "Allow `{local: true, id: 123}` specification for relationships (inside `data` hash)\n" }, { "from": "human", "value": "import { handleSuccess, handleFailure } from './assert-promise';\n\nfunction applyData(object, data) {\n return new Ember.RSVP.Promise(function(re...
javascript
chosen
[ { "from": "system", "value": "Fix eslint errors - 6\n" }, { "from": "human", "value": "angular.module('MainApp')\n .directive('uaf', () => { // uaf = Update after find\n return (scope, el, attrs) => {\n scope.$watch('tasks', (newVal) => {\n el[0].children[0].children[0].innerHTML...
javascript
chosen
[ { "from": "system", "value": "Sort tags by descending relevance\n" }, { "from": "human", "value": "import { TagRels } from './collection.js';\nimport { ensureIndex } from '../../collectionUtils';\n\nTagRels.addView('postsWithTag', terms => {\n return {\n selector: {\n tagId: terms.tagId...
javascript
chosen
[ { "from": "system", "value": "Hide main window until ready\n" }, { "from": "human", "value": "import { screen } from 'electron';\n\n/**\n * Create main window's settings.\n * @param {Object} rawopts - Configuration options for main window.\n * @return {Object} The main window configuration.\n */...
javascript
chosen
[ { "from": "system", "value": "Set up getUser axios to get all users\n" }, { "from": "human", "value": "import axios from 'axios';\n\nfunction getUsers() {\n return axios({\n url: '/api/users',\n timeout: 20000,\n method: 'get',\n responseType: 'json'\n })\n ...
javascript
chosen
[ { "from": "system", "value": "Add another test for double negation of `of`.\n" }, { "from": "human", "value": "import check from './support/check';\n\ndescribe('of operator', () => {\n it('turns into an `in` operator', () => {\n check(`\n a of b\n `, `\n a in b;\n `);\n });\...
javascript
chosen
[ { "from": "system", "value": "Increase the amount of data points\n" }, { "from": "human", "value": "var fs = require('fs');\n\nvar cronJob = require('cron').CronJob;\n\nvar config = require('./config');\nvar data = require('./data');\n\n\nfunction init() {\n writeJSON();\n}\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Add limit and offset in query string\n" }, { "from": "human", "value": "const db = require('../db.js');\n\nmodule.exports = (self, offSet) => {\n const queryStr = `SELECT teach.teach_id FROM (\n (\n SELECT users_languages...
javascript
chosen
[ { "from": "system", "value": "Add pseudocode in notes, begin skeleton of function\n" }, { "from": "human", "value": "// Harmless Ransom Note\n\n/* Rules:\n Takes two parameters\n First will be the note we want to write as a string.\n The second will be the magazine text we have available ...
javascript
chosen
[ { "from": "system", "value": "Add styles for code blocks\n" }, { "from": "human", "value": "import React from \"react\";\nimport { graphql, Link } from \"gatsby\";\n\nimport Layout from \"../app/layout\";\n\nimport \"./blog-post.scss\";\n\nexport const BLOG_POST_QUERY = graphql`\n query BlogPos...
javascript
chosen
[ { "from": "system", "value": "Fix linebreaks only for string values\n" }, { "from": "human", "value": "jsio('from shared.javascript import Class, bind')\njsio('import ui.Component')\n\nexports = Class(ui.Component, function(supr){\n\t\n\tthis._domTag = 'span'\n\tthis._className = 'Value'\n\t\n\t...
javascript
chosen
[ { "from": "system", "value": "Enable the Norwegian kindergartens again (not yet visible due to lack of data in the right repo)\n" }, { "from": "human", "value": "/**\n * Different datasets the tool can use\n *\n * The first-level keys are country names, in English,\n * as they will appear in the...
javascript
chosen
[ { "from": "system", "value": "Resolve options expressed as functions.\n" }, { "from": "human", "value": "/*\n * grunt-load-options\n * https://github.com/chriszarate/grunt-load-options\n *\n * Copyright (c) 2013 Chris Zarate\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nvar requir...
javascript
chosen
[ { "from": "system", "value": "Add site address to metadata service\n" }, { "from": "human", "value": "'use strict';\n\nexport default class metaDataService {\n constructor() {\n this.pageTitle = '';\n }\n\n getPageTitle() {\n return this.pageTitle;\n }\n\n setPageTit...
javascript
chosen
[ { "from": "system", "value": "Remove __webpack_public_path__ for a \"gotcha\"\n" }, { "from": "human", "value": "// Lazy-loaded modules are assumed on the hosting domain,\n// so we override the constant at runtime.\n// __webpack_public_path__ = process.env.NODE_ENV === \"production\"\n// ? \"h...
javascript
chosen
[ { "from": "system", "value": "Refactor date conversion into smaller, more modular methods\n" }, { "from": "human", "value": "module.exports = (function(){\n\treturn function unixToDate(unixTime) {\n\t\tconsole.log(unixTime)\n\t\tvar date = new Date(Number(unixTime));\n\t\tvar year = date.getFull...
javascript
chosen
[ { "from": "system", "value": "Use promises for special case tests\n\nI'm not too sure what is causing tests to fail because locally they pass\nand on travis `class` is turning into `undefined`.\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash');\nvar fs = re...
javascript
chosen
[ { "from": "system", "value": "Fix issues with the custom test runner\n" }, { "from": "human", "value": "var root = null;\n\nif (typeof window === 'undefined') {\n root = global;\n root.tryc = require('../../');\n} else {\n root = window;\n root.tryc = require('tryc');\n root.__karma__.start...
javascript
chosen
[ { "from": "system", "value": "Use gulp as a listener\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar uglify = require('gulp-uglify');\nvar concat = require('gulp-concat');\nvar sass = require('gulp-sass');\nvar minify = require('gulp-minify-css');\nvar del = require('del');\n...
javascript
chosen
[ { "from": "system", "value": "Remove accidental inclusion of commented-out code\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Renderable = require('./renderable');\n\nclass Collection extends Renderable {}\n\nCollection.Instance = require('./collectionInstance');\n/*\nconst Registr...
javascript
chosen
[ { "from": "system", "value": "Internal: Add lambda-match to plugins macros.\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst sweetjs = require(\"gulp-sweetjs\");\nconst sourcemaps = require('gulp-sourcemaps');\nconst concat = require('gulp-concat-util');\n\n// Macro packag...
javascript
chosen
[ { "from": "system", "value": "Change a variable name for clarity\n" }, { "from": "human", "value": "var GithubApi = require('github'),\n config = require('../config'),\n Promise = require('promise'),\n github = new GithubApi({\n debug: config.debug,\n version: '3.0.0'\n });...
javascript
chosen
[ { "from": "system", "value": "Fix early cache resolve bug\n" }, { "from": "human", "value": "var Q = require('q');\nvar _ = require('lodash');\nvar spawn = require('child_process').spawn;\n\nmodule.exports = function(args, options) {\n var deferred = Q.defer();\n\n options = options...
javascript
chosen
[ { "from": "system", "value": "Add usage and help commands\n" }, { "from": "human", "value": "/*\n\tMiscellaneous commands\n*/\n\nSettings.addPermissions(['pick', 'randomanswer']);\n\nexports.commands = {\n\tchoose: 'pick',\n\tpick: function (arg, by, room, cmd) {\n\t\tvar choices = arg.split(\",...
javascript
chosen
[ { "from": "system", "value": "test: Write test to catch invalid inserts\n" }, { "from": "human", "value": "'use strict';\nconst assert = require('assert');\nconst Event = require('../db/models/Event');\n\n\ndescribe('Validation of User records', () => {\n\n it('should require a name for every e...
javascript
chosen
[ { "from": "system", "value": "Use let in the detect test suite\n" }, { "from": "human", "value": "'use strict';\n\nvar bluebird = require('bluebird');\nvar fs = bluebird.promisifyAll(require('fs'));\nvar hljs = require('../../build');\nvar path = require('path');\nvar utility = re...
javascript
chosen
[ { "from": "system", "value": "Remove not-needed option.\nThe aurelia plugin already takes care of this.\n" }, { "from": "human", "value": "const protractor = require('protractor')\nconst phantomjs = require('phantomjs-prebuilt')\n\nexports.config = {\n framework: 'mocha',\n plugins: [{\n pa...
javascript
chosen
[ { "from": "system", "value": "Prepare log output as parseable JSON data\n" }, { "from": "human", "value": "// TODO: To decide and adopt to some logging utility like winston\nvar util = require('util');\n\nmodule.exports = {\n info: function(message,context) {\n if(context) {\n console.l...
javascript
chosen
[ { "from": "system", "value": "Resolve all the JS errors\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n /*Navigation initialization*/\n var navigation = $('#navigation');\n var navShown = false;\n $('#nav-controller').on('click', function () {\n if (navS...
javascript
chosen
[ { "from": "system", "value": "Set post page as the default page\n" }, { "from": "human", "value": "define([\n 'flight/lib/component',\n 'director'\n], function(defineComponent, Router) {\n 'use strict';\n\n function RouterService() {\n\n this.gotoPost = function(id) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove the yarn checking, as yarn itself is not stable yet and a lot of people are using old versions.\n\n" }, { "from": "human", "value": "import shell from 'shelljs';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport spawn from 'cross-spawn-promise';\n\n...
javascript
chosen
[ { "from": "system", "value": "Add ownerID in settingSlugs for idea hub.\n" }, { "from": "human", "value": "/**\n * `modules/idea-hub` base data store\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not us...
javascript
chosen
[ { "from": "system", "value": "Fix bot failing to respond to command with it's username\n\nFix #5\n" }, { "from": "human", "value": "class CommandSource {\n constructor(messageSource,botUsername){\n this.botUsername = botUsername;\n this.bindings = {};\n messageSource.on(\"text\",this.h...
javascript
chosen
[ { "from": "system", "value": "Support for shared secrets for authentication.\n\nProvide an enviroment variable \"shared_secret\" and you will\nbe able to authenticate with any username that is not matched\nin the \"database.\" Optionally, provide \"shared_username\" to\nset the username explicitly; otherwi...
javascript
chosen
[ { "from": "human", "value": "Implement some constructors and animation loop\n\nImplement Game, Screen and Item constructors. Implement DrawableEntity\nand InteractiveEntity prototypes. Implement the animation loop.\n" }, { "from": "gpt", "value": "(function(window, Object) {\n\n var diogenes = ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fix plotline getting removed when children present\"\n\nThis reverts commit d8dd4d977c3dcec578e083a2cd5beca4b9873e5c.\n" }, { "from": "human", "value": "import React, { useRef, useEffect, useState } from 'react';\nimport uuid from 'uuid/v4';\nimport { attem...
javascript
chosen
[ { "from": "system", "value": "Set up data for saucelabs\n" }, { "from": "human", "value": "require(\"./server\")\n\nexports.config = {\n directConnect: true,\n specs: 'tests/e2e/*.js',\n baseUrl: 'http://localhost:1234',\n framework: 'jasmine2',\n jasmineNodeOpts: {\n showColors: true,\n...
javascript
chosen
[ { "from": "system", "value": "Update elnPlugin to version to 0.1.2\n" }, { "from": "human", "value": "\nexport {default as OCLE} from 'https://www.lactame.com/lib/openchemlib-extended/1.13.0/openchemlib-extended.js';\nexport {default as SD} from 'https://www.lactame.com/lib/spectra-data/3.1.0/sp...
javascript
chosen
[ { "from": "system", "value": "Enable multiple file upload for attachments\n\nFixes #130.\n" }, { "from": "human", "value": "define([\"app/app\"], function(App) {\n \"use strict\";\n\n App.CreateAttachmentView = Ember.View.extend({\n tagName: 'input',\n type: 'file',\n attributeBinding...
javascript
chosen
[ { "from": "system", "value": "fix: Change endpoint to Space X\n" }, { "from": "human", "value": "var settings = {\n \"endpoints\": [\n {\n \"name\": \"World Cup\",\n \"url\": \"https://worldcup-graphql.now.sh/\",\n \"auth\": '',\n \"verb\": '...
javascript
chosen
[ { "from": "system", "value": "Remove old logging statements. Set up structure to build HTML\n" }, { "from": "human", "value": "$(\"#search-form\").submit(function (event) {\n var query = $(\"#search-box\").val();\n var path = window.location.pathname;\n //Split path, removing empty ent...
javascript
chosen
[ { "from": "system", "value": "[e2e] Switch back to chrome for tests, as phantomjs is not reliable\n" }, { "from": "human", "value": "'use strict';\n\nexports.config = {\n seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar',\n capabilities: {\n 'brow...
javascript
chosen
[ { "from": "system", "value": "Use Backbone destroy, instead of Girder's method\n" }, { "from": "human", "value": "isic.Model = girder.Model.extend({\n urlRoot: function () {\n return this.resourceName;\n }\n});\n" }, { "from": "gpt", "value": "isic.Model = girder.Model.e...
javascript
chosen
[ { "from": "system", "value": "Support for startMock mode in getData\n" }, { "from": "human", "value": "'use strict'\n\n/**\n * Sample API controller. Can safely be removed.\n */\n\nconst Sample = require('../models').sample.Sample\nconst co = require('co')\n\nmodule.exports = {\n getData: co.wr...
javascript
chosen
[ { "from": "system", "value": "Fix tests to delete the _site directory after running.\n" }, { "from": "human", "value": "var fs = require('fs')\n , path = require('path')\n , expect = require('chai').expect\n , shell = require('shelljs')\n , glob = require('glob')\n , _ = require('lodash')\n...
javascript
chosen
[ { "from": "system", "value": "Make sure there are no decimal points in the (pasteable) level change output.\n" }, { "from": "human", "value": "function numberToString(number) {\n var r = Math.round(number * 1000) / 1000;\n return \"\"+r;\n}\n\nfunction addCommas(nStr)\n{\n\tnStr += '';\n\t...
javascript
chosen
[ { "from": "system", "value": "Use gulp to generate one app.css, and separate 'fonts' task\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar sass = require('gulp-sass');\n\ngulp.task('default', ['sass'], function () {\n //gulp.src('./node_modules/font-awesome...
javascript
chosen