conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Disable fluxible logs in production\n" }, { "from": "human", "value": "import polyfill from 'babel-polyfill'; // eslint-disable-line no-unused-vars\n\nimport d from 'debug';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Router, browserHist...
javascript
chosen
[ { "from": "system", "value": "Refactor modal region for better readability.\n" }, { "from": "human", "value": "Teikei.module(\"Base\", function(Base, App, Backbone, Marionette, $, _) {\n\n Base.ModalRegion = Backbone.Marionette.Region.extend({\n el: \"#modal-container\",\n\n constructor: ...
javascript
chosen
[ { "from": "system", "value": "Remove reference to removed radiodan client\n" }, { "from": "human", "value": "var services = [],\n radios = [],\n helperApp;\n\nif(!helperApp) {\n connectToHelperApp();\n}\n\nchrome.runtime.onMessageExternal.addListener(function (message) {\n console.log(...
javascript
chosen
[ { "from": "system", "value": "Revert f3f8d6b electron webpack config\n" }, { "from": "human", "value": "const path = require('path');\nconst ExtractTextPlugin = require('extract-text-webpack-plugin');\n\nmodule.exports = {\n\tmodule:{\n\t\tloaders: [\n\t\t\t{\n\t\t\t\ttest: /\\.json$/,\n\t\t\t\t...
javascript
chosen
[ { "from": "system", "value": "Revert \"Set meta description for the main page.\"\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport Router from 'vue-router'\nimport index from '@/components/index'\nimport four from '@/components/four'\n\nVue.use(Router)\n\nexport default new Router...
javascript
chosen
[ { "from": "system", "value": "Update: Refactor Javascript Directive Complex to match best practices\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('<%= scriptAppName %>')\n .directive('<%= cameledName %>', function () {\n return {\n templateUrl: '<%= htmlUrl %>',\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing espace before parentheses\n" }, { "from": "human", "value": "var React = require('react');\n\nmodule.exports = React.createClass({\n render: function() {\n return (\n <h1>{'Hello world!'}</h1>\n );\n }\n});\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Use Unique Property in Model instead of doing in DB\n\n" }, { "from": "human", "value": "'use strict';\n\nconst mongoose = require('mongoose');\n\nconst Schema = mongoose.Schema;\n\nconst userSchema = mongoose.Schema({ \n\n\tname \t\t\t: String,\n\temail\t\t\t: Stri...
javascript
chosen
[ { "from": "system", "value": "CSRA-000: Increase timeout for title display wait in browswer E2E\n" }, { "from": "human", "value": "/* eslint-disable class-methods-use-this */\nclass BasePage {\n\n get mainHeading() { return browser.getText('h1'); }\n waitForMainHeadingWithDataId(id) {\n bro...
javascript
chosen
[ { "from": "system", "value": "Change cookies from array to object\n" }, { "from": "human", "value": "chrome.runtime.onMessage.addListener(\n function(request, sender, sendResponse) {\n if (request.want == \"cookies\") {\n chrome.cookies.getAll({}, function(cookieList) {\n var coo...
javascript
chosen
[ { "from": "system", "value": "Disable clear homeLocation session variable\n" }, { "from": "human", "value": "import { browserHistory } from 'react-router';\nimport { Meteor } from 'meteor/meteor';\nimport { Bert } from 'meteor/themeteorchef:bert';\n\nexport const getHandleLogout = (options) => (...
javascript
chosen
[ { "from": "system", "value": "Fix Wysiwyg field type usage outside the monorepo\n\nThe Field view path was pointing to the source file rather than the preconstruct entrypoint so when the field type was used outside the monorepo, the compiled version wasn't being used." }, { "from": "human", "val...
javascript
chosen
[ { "from": "system", "value": "Fix for finding Beyond Compare 4 on Windows (don't unconditionally overwrite with BC3 path)\n" }, { "from": "human", "value": "var autils = require('../../AUtils');\nvar osTool = require('../../osTools');\nvar shelljs = require('shelljs');\nvar GenericDiffReporterBa...
javascript
chosen
[ { "from": "system", "value": "Access token fix take 2\n" }, { "from": "human", "value": "var ncApp = angular.module('ncApp', []);\n\nncApp.controller('GhCtrl', function($scope, $http) {\n\n\t\n var userName = 'novicell',\n userType = 'orgs',\n str1 = '0a1fde2db5ef80ea6d7f',\n\t str2 ...
javascript
chosen
[ { "from": "system", "value": "Use NCMBInstallationEx instead of NCMB.Installation to register device.\n" }, { "from": "human", "value": "\"use strict\"\n\nvar Converter = module.exports = (function() {\n\n function Converter(ncmb, type) {\n\tthis.__proto__.ncmb = ncmb;\n\tthis._type = type;\n...
javascript
chosen
[ { "from": "system", "value": "Make entire authObject available globally for now\n" }, { "from": "human", "value": "var userID;\n\nfunction checkUserInDatabase(authData){\n\tuserID = authData.google.id;\n\tvar usersDatabase = new Firebase(\"https://tinderpreneurship.firebaseio.com/users/\" + user...
javascript
chosen
[ { "from": "system", "value": "Add \"delete\" as a supported method.\n" }, { "from": "human", "value": "module.exports = function(req, res, next) {\n var supportedMethods = ['patch'];\n\n var requestMethod = req.param('method');\n var proposedMethod = ( requestMethod ) ? requestMethod.toLower...
javascript
chosen
[ { "from": "system", "value": "Disable pushStateEnabled so the browser (including history) sees the actual\nURLs in all their hashy glory. Now browser back button and page refresh\nwork fine.\n\nMore spectacularly, the crippling Chrome \"Port error: Could not establish\nconnection. Receiving end does not exi...
javascript
chosen
[ { "from": "system", "value": "Rename Tokenizer _make* functions to _render*\n\nBest practice: the purpose of this code is for rendering\npart of DOM structure for render: call this _renderX instead of\n_makeX\n" }, { "from": "human", "value": "/**\n * @jsx React.DOM\n */\n\nvar React = window.Re...
javascript
chosen
[ { "from": "system", "value": "Add stubs for nodeGraph unit tests\n" }, { "from": "human", "value": "const chai = require('chai')\nconst sinon = require('sinon')\nconst sinonChai = require('sinon-chai')\nconst expect = chai.expect;\n\nchai.use(sinonChai);\n\nimport Graph from '../src/nodeGraph'\n...
javascript
chosen
[ { "from": "system", "value": "Increase time out for MS browsers on Angular JS.\n" }, { "from": "human", "value": "\n\ndescribe('angularjs homepage todo list', function() {\n it('should add a todo', function() {\n browser.get('https://angularjs.org');\n\n element(by.model('todoList.todoTex...
javascript
chosen
[ { "from": "system", "value": "Update: Add few tests for Linked List\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst LinkedList = require('../src').DataStructures.LinkedList;\nconst assert = require('assert');\n\ndescribe('LinkedList', () => {\n it('should be empty when initiali...
javascript
chosen
[ { "from": "system", "value": "Add improved logging and instance iteration\n" }, { "from": "human", "value": "'use strict';\n\nvar co = require('co');\nvar util = require('util');\n\n/**\n * StaticPublisher yields a set of static endpoints as produced by the passed factory.\n * @param {Array.<st...
javascript
chosen
[ { "from": "system", "value": "Add date input to sanity input resolver\n" }, { "from": "human", "value": "import array from 'role:@sanity/form-builder/input/array?'\nimport boolean from 'role:@sanity/form-builder/input/boolean?'\nimport email from 'role:@sanity/form-builder/input/email?'\nimport ...
javascript
chosen
[ { "from": "system", "value": "Fix some double quote issues.\n" }, { "from": "human", "value": "import $ from \"jquery\";\nrequire(\"../vendor/jqconsole\");\n\nfunction ConsoleController($rootScope) {\n var ctrl = this;\n // Handle non-login websocket responses, meaning, EvalResponse\n $...
javascript
chosen
[ { "from": "system", "value": "Update the function header declaration\n\nSo that it looks not that horrible." }, { "from": "human", "value": "var c_a = function (a, b) {\n \"use strict\";\n var c, d, obj;\n obj = {\n \"difference\": [],\n \"same_elements\": []\n };\n ...
javascript
chosen
[ { "from": "system", "value": "Use actual user avatar in passport mock\n" }, { "from": "human", "value": "var User = require('./models').User;\n\nmodule.exports = {\n initialize: function(sessionUserObject) {\n return function(req, res, next) {\n var passport = this;\n\n User.fi...
javascript
chosen
[ { "from": "system", "value": "Add setGlobal and setPref vararg support to the test preference handler \n\ngit-svn-id: 6772fbf0389af6646c0263f7120f2a1d688953ed@5079 e969d3be-0e28-0410-a27f-dd5c76401a8b\n" }, { "from": "human", "value": "/* See license.txt for terms of usage */\nvar Format = {};\n...
javascript
chosen
[ { "from": "system", "value": "Fix a potential logging bug\n" }, { "from": "human", "value": "'use strict';\n\nvar logger = require('restify-logger');\n\nlogger.token('user', function(req) {\n return (req.accessToken._id.toString() || '???') + ':';\n});\n\nlogger.token('append', function(req, re...
javascript
chosen
[ { "from": "system", "value": "Use shallow copy and avoid mutation\n" }, { "from": "human", "value": "export const getNewState = ({ id, state }) => {\n const clone = (state) => {\n let newState = {}\n\n Object.keys(state).forEach((value) => {\n newState[value] = { ...state[value] }\n ...
javascript
chosen
[ { "from": "system", "value": "Allow single service object for workers\n" }, { "from": "human", "value": "module.exports = function(services) {\n var self = this;\n\n if(!Array.isArray(services)) {\n throw new Error('Services is not array');\n }\n\n services.forEach(function(s) {\n if(t...
javascript
chosen
[ { "from": "system", "value": "Remove white background in high level element\n\n" }, { "from": "human", "value": "import React from 'react';\nimport PrimaryNav from '../../components/PrimaryNav';\nimport {ReactRouter, Router, Link, withRouter} from 'react-router';\n\nclass Layout extends React.Co...
javascript
chosen
[ { "from": "system", "value": "Add icons used in trip card.\n" }, { "from": "human", "value": "import { library } from '@fortawesome/fontawesome-svg-core';\n\nimport { faMapMarkerAlt } from '@fortawesome/free-solid-svg-icons';\n\nlibrary.add(\n faMapMarkerAlt,\n);\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Update test env to pass on ember 2.0 beta\n" }, { "from": "human", "value": "module.exports = {\n scenarios: [\n {\n name: 'default',\n dependencies: { }\n },\n {\n name: 'ember-release',\n dependencies: {\n 'ember': 'components/...
javascript
chosen
[ { "from": "system", "value": "Allow `package.php` to proxy the original one\n" }, { "from": "human", "value": "var rest = require('rest-sugar');\nvar sugar = require('object-sugar');\n\nvar Library = require('./schemas').Library;\n\n\nmodule.exports = function(app) {\n var root = '/api/v1';\n...
javascript
chosen
[ { "from": "system", "value": "Fix bug with express routes\n" }, { "from": "human", "value": "const path = require('path');\n\nconst express = require('express');\nconst bodyParser = require('body-parser');\nconst logger = require('morgan');\nconst dotenv = require('dotenv');\n\nconst webpack = r...
javascript
chosen
[ { "from": "system", "value": "Fix linter errors in JS source files\n" }, { "from": "human", "value": "import './index.css';\n\nif (navigator.serviceWorker) {\n navigator.serviceWorker.register('sw.js');\n}\n\nconst html = document.querySelector('html');\nconst themeButton = document.querySele...
javascript
chosen
[ { "from": "system", "value": "Fix the update operation name\n\nSigned-off-by: Zhang Wei <d6fa6f3f4186ada68220f9e69e7ddc7f2c936bdf@lambdacloud.com>\n" }, { "from": "human", "value": "var elastic = require('elasticsearch');\nvar util = require('util');\nvar Writable = require('stream').Writable;\n...
javascript
chosen
[ { "from": "system", "value": "Reformat bandwidth data return section\n" }, { "from": "human", "value": "const chart = require('ascii-chart');\n\nfunction pointsFromBandwidthData(values, numPoints) {\n\n // Define vars\n const len = values.length;\n const points = [];\n let i = 0;\n let size...
javascript
chosen
[ { "from": "system", "value": "Make test asynchronous if it wants to be\n" }, { "from": "human", "value": "/* global describe, it */\n\nimport {exec} from '../../../src/utils/util';\nimport assert from 'assert';\nrequire('chai').should();\n\ndescribe(\"Oi CLI\", () => {\n\n it(\"can be invoked\"...
javascript
chosen
[ { "from": "system", "value": "Watch only path and search\n" }, { "from": "human", "value": "if ('angular' in window) {\n angular.module('ng').run(['$rootScope', '$location', function ($rootScope, $location) {\n\n \tfunction updateEventEmitter(e, newUrl) {\n var evt = document.createEvent(...
javascript
chosen
[ { "from": "system", "value": "Update button now works again, mostly.\n" }, { "from": "human", "value": "\nvar astroEmpires = new AEObject(localStorage['server'], localStorage['email'], localStorage['password']);\n\njQuery('document').ready(function ($) {\n // Populate values from local storag...
javascript
chosen
[ { "from": "system", "value": "Add link to my pantry from landing page\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Link } from 'react-router';\nimport TopBar from '../TopBar/TopBar';\nimport TokenStore from '../../services/TokenStore';\n\nclass LandingPa...
javascript
chosen
[ { "from": "system", "value": "[ALIEN-624] Configure tasks so splitted ui tests run on chrome\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n var tasks = ['clean:server', 'concurrent:test', 'autoprefixer', 'connect:test', 'protractor_webdriver:start'];\n\n var registerI...
javascript
chosen
[ { "from": "system", "value": "Hide load indicator on pjax back\n" }, { "from": "human", "value": "$(document).pjax('a:not(.no-pjax)', 'main');\n$(document).on('submit', 'form[data-pjax-get]', function(event) {\n event.preventDefault()\n $.pjax({'container': 'main', 'url' :this.action + '?'...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect usage of location replace code in reroute-verification initializer\n" }, { "from": "human", "value": "import { getUrlParameter } from '../utils/url-parameters';\nimport { replaceLocation } from '../utils/location';\n\nexport function initialize(contain...
javascript
chosen
[ { "from": "system", "value": "Load stream + net modules before loading app code\n\nSee #628 and #634\n" }, { "from": "human", "value": "\nglobal.process.removeAllListeners();\n\nglobal.process.on( \"uncaughtException\", function( err ) {\n\t// do nothing if window was fully initialized\n\tif ( w...
javascript
chosen
[ { "from": "system", "value": "Update tests, add org test\n" }, { "from": "human", "value": "var chai = require('chai');\nvar chaiHttp = require('chai-http');\nvar server = require('../server');\nvar should = chai.should();\n\nchai.use(chaiHttp);\n\ndescribe('GeoIP', function () {\n describe('/G...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Revert \"Revert \"Revert \"Try child process\"\"\"\"\"\n\nThis reverts commit 394a376e4c608d21f431c03844ec01f8cc130117.\n" }, { "from": "human", "value": "const { spawn } = require('child_process')\n\nmodule.exports = {\n onPreBuild({ utils: { sta...
javascript
chosen
[ { "from": "system", "value": "Add option for custom CSS styling of typeahead component; actual styling forthcoming\n" }, { "from": "human", "value": "import React, { PropTypes, Component } from 'react';\nimport { Typeahead } from 'react-typeahead';\nimport _ from '...
javascript
chosen
[ { "from": "system", "value": "Add new `render` method to replace `yield` which is now a reserved keyword\n" }, { "from": "human", "value": "var Layout\n , Partial = require('./partial').Partial;\n\n// Subclass of Partial\nLayout = function (layoutPath, templatePath, data) {\n var self = this;\...
javascript
chosen
[ { "from": "system", "value": "Fix and clean up iterator\n" }, { "from": "human", "value": "class Group {\n\tconstructor() {\n\t\tthis.members = [];\n\t}\n\n\tadd(element) {\n\t\tif (!this.has(element)) {\n\t\t\tthis.members.push(element);\n\t\t}\n\t}\n\n\tdelete(element) {\n\t\tthis.members = th...
javascript
chosen
[ { "from": "system", "value": "Make fix-arena-sessions script run across all classrooms\n" }, { "from": "human", "value": "// Updates all sessions for a given level and classroom to match the classroom language setting.\n// Usage:\n// mongo <address>:<port>/<database> <script file> -u <username> ...
javascript
chosen
[ { "from": "system", "value": "Fix watch on rollup sample\n" }, { "from": "human", "value": "import commonjs from \"@rollup/plugin-commonjs\";\nimport del from \"rollup-plugin-delete\";\nimport serve from \"rollup-plugin-serve\";\nimport livereload from \"rollup-plugin-livereload\";\nimport resol...
javascript
chosen
[ { "from": "system", "value": "Test that alternating colors are placed on board\n" }, { "from": "human", "value": "const expect = require('chai').expect;\nimport Column from '../lib/columns.js';\nimport Board from '../lib/board.js';\nimport $ from 'jquery';\n\ndescribe('Column', function() {\n b...
javascript
chosen
[ { "from": "system", "value": "Add env variable for process id in forked processes\n" }, { "from": "human", "value": "let Promise\ntry {\n Promise = require('bluebird')\n} catch (err) {\n Promise = global.Promise\n}\n\nconst child = require('child_process')\n\n/**\n * Shard cluster structure\n ...
javascript
chosen
[ { "from": "system", "value": "Add timestamp to queried fields\n" }, { "from": "human", "value": "exports.createHaikuMutation = `\nmutation createHaiku($haiku: HaikuInput) {\n createHaiku(haikuInput: $haiku) {\n id\n authors\n lines\n timestamp\n }\n}`;\n\nexports.getHaikuByIdQuery ...
javascript
chosen
[ { "from": "system", "value": "Allow overriding of vee-validate built-in validation messages\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport VueI18n from 'vue-i18n'\nimport deepmerge from 'deepmerge'\n\nimport availableLocales from './availableLocales'\n\nimport en from '@/locale...
javascript
chosen
[ { "from": "system", "value": "Fix undefined isard cookie of frontend\n" }, { "from": "human", "value": "import * as cookies from 'tiny-cookie'\n\nexport default {\n state: {\n user: {}\n },\n getters: {\n getUser: state => {\n return state.user\n }\n },\n actions: {\n setUs...
javascript
chosen
[ { "from": "system", "value": "Add option to create an admin user.\n" }, { "from": "human", "value": "var http = require('http'),\n querystring = require('querystring');\n\nfunction httpRequest(method, path, payload) {\n var query = {u: 'root', p: 'root'};\n\n var req = http.request({\n h...
javascript
chosen
[ { "from": "system", "value": "Add static fallback in Express (for React routing)\n" }, { "from": "human", "value": "'use strict'\n\nvar opbeat = require('opbeat').start({\n active: process.env.NODE_ENV === 'production'\n})\n\nvar express = require('express')\n\nvar app = express()\n\napp.use(ex...
javascript
chosen
[ { "from": "system", "value": "Change Change from Redis to S3\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar prerender = require('./lib');\n\nvar server = prerender({\n workers: process.env.PHANTOM_CLUSTER_NUM_WORKERS,\n iterations: process.env.PHANTOM_WORKER_ITERATIONS || 10,\...
javascript
chosen
[ { "from": "system", "value": "Remove duplicate addFiles in test-in-browser\n\nThis actually resulted in two copies of diff_match_patch in the package!\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Run tests interactively in the browser\",\n version: '1.0.7',\n documentati...
javascript
chosen
[ { "from": "system", "value": "Add comments to Path Bounds tests.\n" }, { "from": "human", "value": "module('Path Bounds');\n\ntest('path.bounds', function() {\n\tvar doc = new Doc();\n\tvar path = new Path([\n\t\tnew Segment(new Point(121, 334), new Point(-19, 38), new Point(30.7666015625, -61.5...
javascript
chosen
[ { "from": "system", "value": "Remove if that was making the view to behave unexpectedly\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('eMarketApp')\n .directive('itemView', function (User) {\n return {\n templateUrl: 'views/itemView.html',\n restrict: '...
javascript
chosen
[ { "from": "system", "value": "Fix undefined in homepage, bugs and repo url\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Ask for Github account info.\n */\nmodule.exports = function () {\n\n const done = this.async();\n let suggestedGithubUsername;\n\n if (this.authorName && 'st...
javascript
chosen
[ { "from": "system", "value": "Fix filenames of DisableLoadBalancerForAgents and EnableLoadBalancerForAgents\n" }, { "from": "human", "value": "/*******************************************************************************\n* Copyright (C) 2012 eBay Inc.\n*\n* Licensed under the Apache License,...
javascript
chosen
[ { "from": "system", "value": "Add default text to paste view\n" }, { "from": "human", "value": "'use strict';\n\nvar controllers = angular.module('blinky.controllers', ['ui.router']);\n\ncontrollers.controller('NewPasteCtrl', function ($scope, $state, $http) {\n $scope.submit = function () {\n ...
javascript
chosen
[ { "from": "system", "value": "Change the worker mock to adjust to Jason's workerjs changes\n" }, { "from": "human", "value": "import Worker from 'workerjs';\n\nconst workerFiles = {\n 'zee-worker': '../../res/zee-worker.js',\n 'worker': '../../dist/worker.js',\n};\n\nconst workerInstances = []...
javascript
chosen
[ { "from": "system", "value": "Remove query and hash from Discourse URLs.\n\nIn some cases, hackdash adds a query to the URL of the projects. This patch ignore the query, to ensure that 2 different Discourse forums are not created for the same project." }, { "from": "human", "value": "var discour...
javascript
chosen
[ { "from": "system", "value": "Add comment on header component\n" }, { "from": "human", "value": "import React from 'react';\nimport styled from 'styled-components';\nimport {Link} from 'react-router';\nimport Wrapper from './Wrapper';\nimport Navigation from './Navigation';\n\n// Main Header Com...
javascript
chosen
[ { "from": "system", "value": "Add support for background image styles\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nclass Poster extends Component {\n render() {\n return (\n <div className=\"column\">\n <header>\n <h3 className=\"poster...
javascript
chosen
[ { "from": "system", "value": "Make sure we add any flickr metadata into the tag cloud too.\n" }, { "from": "human", "value": "function queryFlickr(keywords) {\n // Clear out any old data that's hanging about.\n var flickr = document.getElementById('flickr');\n flickr.innerHTML = \"\";\n\n va...
javascript
chosen
[ { "from": "system", "value": "Add environment variable for exported views\n\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Promise = require('bluebird');\nconst Task = require('../Task');\nconst path = require('path');\nconst ProjectType = require('../../ProjectType');\nconst fs = r...
javascript
chosen
[ { "from": "system", "value": "[front] Change validator to accomodate more standards.\n" }, { "from": "human", "value": "import _ from \"npm:lodash\"\n\nexport default function validateDepth() {\n return (key, oldValue) => {\n let depthObj = _.chain(Object.values(oldValue))\n .map(standa...
javascript
chosen
[ { "from": "system", "value": "Change ‘let’ to ‘const’ in test.\n" }, { "from": "human", "value": "\nimport { getDisplayName } from 'dummy/helpers/get-display-name';\nimport { module, test } from 'qunit';\n\nmodule('Unit | Helper | get display name');\n\ntest('username greater than 40 chars', fun...
javascript
chosen
[ { "from": "system", "value": "Fix logged out revision access\n" }, { "from": "human", "value": "import schema from './schema.js';\nimport { createCollection, getDefaultResolvers /*, getDefaultMutations */} from 'meteor/vulcan:core';\nimport { extractVersionsFromSemver } from '../../editor/utils'...
javascript
chosen
[ { "from": "system", "value": "Fix ID handling of rst widget\n" }, { "from": "human", "value": "// Copyright (c) 2012 gocept gmbh & co. kg\n// See also LICENSE.txt\n\n(function($) {\n\n\nzeit.cms.RestructuredTextWidget = gocept.Class.extend({\n\n construct: function(widget_id) {\n var s...
javascript
chosen
[ { "from": "system", "value": "Fix React Hot Loader, use ‘react-hot-loader/webpack.’\n" }, { "from": "human", "value": "import path from 'path';\n\nconst isProduction = process.env.NODE_ENV === 'production';\n\nexport default {\n context: path.join(__dirname, '../'),\n\n entry: undefined,\n ou...
javascript
chosen
[ { "from": "system", "value": "Use `navigator.userAgentData` for platform detection when available\n" }, { "from": "human", "value": "var IS_MAC = /Mac/.test(navigator.userAgent);\n\nvar KEY_A = 65;\nvar KEY_COMMA = 188;\nvar KEY_RETURN = 13;\nvar KEY_ESC = 27;\nvar KE...
javascript
chosen
[ { "from": "system", "value": "Fix getting size into options form\n" }, { "from": "human", "value": "editor.registerElementHandler('spacer', new function() {\n\n Element.apply(this, arguments);\n\n this.editor;\n\n\tthis.getName = function() {\n\t\treturn 'spacer';\n\t};\n\n\tthis.getIcon =...
javascript
chosen
[ { "from": "system", "value": "Add missing alias for webpack-test\n" }, { "from": "human", "value": "var path = require(\"path\");\nvar tests = path.resolve(__dirname, \"frontend/tests\");\nvar js = path.resolve(__dirname, \"frontend\");\n\nmodule.exports = {\n entry: {\n testsuite: path.reso...
javascript
chosen
[ { "from": "system", "value": "Fix offset issue with sauce.ns\n\nWasn't being used, but noticed it.\n" }, { "from": "human", "value": "/* global sauce */\n\nwindow.sauce = window.sauce || {};\n\nsauce.ns = async function(ns, callback) {\n let offt = sauce;\n const assignments = callback && ...
javascript
chosen
[ { "from": "system", "value": "Clean up and fix warnings\n" }, { "from": "human", "value": "'use strict';\n\nvar cheerio = require('cheerio');\nvar curl = require('../../curl');\n\nfunction messageListener(db, from, channel, message, reply) {\n var match = /(https?:\\/\\/[^ ]+)/.exec(message);\n...
javascript
chosen
[ { "from": "system", "value": "Improve cached icon handling to support browser navigation\n" }, { "from": "human", "value": "function iconLoadListener() {\n var icons = document.querySelectorAll(\".icon__preview\");\n\n Array.prototype.forEach.call(icons, function(icon, i) {\n icon.o...
javascript
chosen
[ { "from": "system", "value": "Make a single template for markdown editor\n" }, { "from": "human", "value": "'use strict';\n\nangular\n .module('flashcardModule.directives')\n .directive('markdownEditor', function() {\n var converter = new Showdown.converter();\n var previewTe...
javascript
chosen
[ { "from": "system", "value": "Add filter to award manager route\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';\n\nexport default Ember.Route.extend(AuthenticatedRouteMixin, {\n currentUser:...
javascript
chosen
[ { "from": "system", "value": "Use map instead of for loop\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport EventImage from '../components/EventImage';\nimport CompanyPropTypes from '../proptypes/CompanyPropTypes';\nimport ImagePropTypes from '../pro...
javascript
chosen
[ { "from": "system", "value": "Add more tests for ccfy\n" }, { "from": "human", "value": "const test = require('tape');\nconst ccfy = require('./ccfy');\n\ntest('ccfy should be a function', (assert) => {\n assert.equal(typeof ccfy, 'function');\n assert.end();\n});\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Bring game logic to the server\n" }, { "from": "human", "value": "var Backbone = require('backbone');\nvar _ = require('underscore');\n\napplication.models.card = Backbone.Model.extend({\n\n db: null,\n socket: null,\n sessionid: null,\n cbid: null,\n\n ...
javascript
chosen
[ { "from": "system", "value": "test(lorax): Add config reset for linkToIssue tests\n" }, { "from": "human", "value": "var lorax = require('../index');\nvar linkToIssue = lorax.linkToIssue;\n\nexports.linkToIssueTest = {\n basicTest: function(test) {\n var output = linkToIssue('123');\n \n ...
javascript
chosen
[ { "from": "system", "value": "Fix Blanket config to ignore generated files\n" }, { "from": "human", "value": "// jscs: disable\n/* globals blanket, module */\n\nvar options = {\n modulePrefix: 'component-integration-tests',\n filter: /^component-integration-tests\\//,\n antifilter: [\n 'co...
javascript
chosen
[ { "from": "system", "value": "Add redraw method for the Sprite plugin\n" }, { "from": "human", "value": "function SpritePlugin() {\n\n this.settings = {\n 'x': {\n 'value': 0,\n 'type': 'number',\n },\n 'y': {\n 'value': 0,\n 't...
javascript
chosen
[ { "from": "system", "value": "Remove invalid arg in influxdb test.\n\nCopy paste bug from graphite. Namespace doesn't apply to InfuxDb.\n" }, { "from": "human", "value": "'use strict';\n\nconst DataGenerator = require('../lib/plugins/influxdb/data-generator'),\n expect = require('chai').expect;...
javascript
chosen
[ { "from": "system", "value": "Add test for 'init from dir' feature of repo module\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs-extra'),\n path = require('path'),\n exec = require('child_process').exec,\n init = require('../lib/common/init');\n\nvar git_folder...
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 var navController = $('#nav-controller');\n if (navController...
javascript
chosen
[ { "from": "system", "value": "Remove old commented out junk\n" }, { "from": "human", "value": "var express = require('express');\nvar fs = require('fs');\nvar exec = require('child_process').exec;\n\nexec('cake build');\n\nvar app = express();\n\napp.get('/', function(request, response) {\n res...
javascript
chosen
[ { "from": "system", "value": "Add toggleIsCopied to UI actions\n" }, { "from": "human", "value": "import * as types from '../constants/UIConstants'\n\nexport function selectKey(id) {\n return { type: types.SELECT_KEY, id }\n}\n\nexport function toggleComposer() {\n return { type: types.TOGGLE_...
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 test coverage for error handling\n" }, { "from": "human", "value": "// jshint node: true\nvar expect = require('chai').expect;\nvar GitTaggingAdapter = require('../../../lib/git-tag');\n\ndescribe('git-tag', function() {\n describe('#createTag', function() {\n ...
javascript
chosen