conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add unit tests for date formats\n" }, { "from": "human", "value": "import { describe, it } from 'mocha';\nimport { expect } from 'chai';\nimport helpers from '../lib/helpers';\n\ndescribe('Helpers', () => {\n it('should be an object', () => {\n expect(help...
javascript
chosen
[ { "from": "system", "value": "Make sure translations are applied when converting to JSON\n\nset getters to true which makes sure the decorated get is called when\nrunning toJSON and hence the output is translated. Required to make sure\nthe JS version used in templates for things like adding memberships is\...
javascript
chosen
[ { "from": "system", "value": "Fix youtube search input handlers binding\n" }, { "from": "human", "value": "/**\n*\n* YoutubeSearchInput\n*\n*/\n\nimport React, { Component, PropTypes } from 'react';\nimport classNames from 'classnames';\n\n\nclass YoutubeSearchInput extends Component {\n\n hand...
javascript
chosen
[ { "from": "system", "value": "Refactor watchWorkspaceItem to use a class\n" }, { "from": "human", "value": "import {CompositeDisposable} from 'atom';\n\nimport URIPattern from './atom/uri-pattern';\n\nexport function watchWorkspaceItem(workspace, pattern, component, stateKey) {\n const uPattern...
javascript
chosen
[ { "from": "system", "value": "Increase mocha timeout to see if that helps.\n" }, { "from": "human", "value": "import helperFixture from './lib/fixture';\nimport observer from '../src/native/document-observer';\n\nafterEach(function () {\n // Ensure perf tests have enough time to cleanup after t...
javascript
chosen
[ { "from": "system", "value": "Add empty state to search results\n" }, { "from": "human", "value": "import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\nimport styled from \"styled-components\";\nimport SearchResult from \"../containers/SearchResult.js\";\n\nconst C...
javascript
chosen
[ { "from": "system", "value": "Split up the long html string\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('no highlighting', function() {\n it('should keep block unchanged', function() {\n var expected = '<div id=\"contents\">\\n <p>Hello, World!c\\n</div>',...
javascript
chosen
[ { "from": "system", "value": "Set webpack hot middleware to false\n\n- because of annoying eslint errors\n" }, { "from": "human", "value": "import webpack from 'webpack'\nimport merge from 'webpack-merge'\nimport common from './webpack.common'\n\n\nconst DEV_PORT = 3000\n\nexport default merge(c...
javascript
chosen
[ { "from": "system", "value": "Update data-channels example to put messages in DOM instead of console\n" }, { "from": "human", "value": "/* eslint-env browser */\n\nlet pc = new RTCPeerConnection()\nlet log = msg => {\n document.getElementById('logs').innerHTML += msg + '<br>'\n}\n\nlet sendChan...
javascript
chosen
[ { "from": "system", "value": "Make artist page acceptance test more tolerant\n" }, { "from": "human", "value": "/* eslint-disable jest/expect-expect */\ndescribe(\"/artist/:id\", () => {\n before(() => {\n cy.visit(\"/artist/pablo-picasso\")\n })\n\n it(\"renders metadata\", () => {\n c...
javascript
chosen
[ { "from": "system", "value": "Fix real keyboard tab navigation between KeyboardedInput elements\n\n* Current react-generated KeyboardedInput \"input\" elements will not navigate to\n the next KeyboardedInput element upon pressing tab with a real keyboard.\n* This happens because the next element in the DOM...
javascript
chosen
[ { "from": "system", "value": "Remove input required test as it is not being used\n" }, { "from": "human", "value": "/*\n* ADR Reporting\n* Copyright (C) 2017 Divay Prakash\n* GNU Affero General Public License 3.0 (https://github.com/divayprakash/adr/blob/master/LICENSE)\n*/\nvar dataUriTest;\nMo...
javascript
chosen
[ { "from": "system", "value": "Add \"primary\" style for buttons, etc\n" }, { "from": "human", "value": "module.exports = [\n 'default', 'info', 'warning', 'success', 'danger'\n];\n" }, { "from": "gpt", "value": "module.exports = [\n 'default', 'info', 'warning', 'success', 'dan...
javascript
chosen
[ { "from": "system", "value": "Refactor unused var and function call\n" }, { "from": "human", "value": "angular.module('app').directive('tagsInput', function () {\n return {\n restrict: 'E',\n templateUrl: '/directives-templates/tags-input/tags-input',\n scope: {\n tags: '=?',\n ...
javascript
chosen
[ { "from": "system", "value": "Update URL to point to test server.\n" }, { "from": "human", "value": "/* global describe, it, browser, expect, element, by, beforeEach */\n'use strict';\n\ndescribe('settings view', function () {\n beforeEach(function () {\n this.settingsView = element(by...
javascript
chosen
[ { "from": "system", "value": "Make explicit that MapBuilder is in the global namespace\n" }, { "from": "human", "value": "// Create map object\nvar MapBuilder = {};\n\n// initialize map\nMapBuilder.init = function(id) {\n // Create map container\n var leafletMap = L.mapbox.map(id, 'codeforamer...
javascript
chosen
[ { "from": "system", "value": "Add locationsAreEqual to top-level exports\n" }, { "from": "human", "value": "export createHistory from './createBrowserHistory'\nexport createHashHistory from './createHashHistory'\nexport createMemoryHistory from './createMemoryHistory'\n\nexport useBasename from ...
javascript
chosen
[ { "from": "system", "value": "Trim existing content to fix test" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = function makeSettingsPatch(name, dependencyConfig, projectConfig) {\n const relative = path.relative(\n path.dirname(projectConfig.settingsGradle...
javascript
chosen
[ { "from": "system", "value": "Add model hook for single Article route\n\nFixes the problem where an article wouldn't load when directly accessed.\nThis can't be released until SCPRv4 is deployed with the url-safe obj\nkeys\n" }, { "from": "human", "value": "Kpcc.Router.map(function() {\n this...
javascript
chosen
[ { "from": "system", "value": "Hide back button when hasEvent\n" }, { "from": "human", "value": "// @flow\nimport React, { Component } from 'react';\nimport type { Children } from 'react';\nimport { bindActionCreators } from 'redux';\nimport { connect } from 'react-redux';\n// ===================...
javascript
chosen
[ { "from": "system", "value": "Change location api to ip-api.com, rename conditions function to data\n" }, { "from": "human", "value": "\n//Geolocation Function is listed below.\n\nfunction geoLocation() {\n var output = document.getElementById(\"out\");\n\n $.getJSON('https://ipinfo.io/geo...
javascript
chosen
[ { "from": "system", "value": "Add support for older Node versions\n" }, { "from": "human", "value": "require('babel-register')({\n presets: ['es2015', 'flow'],\n ignore: /node_modules(?!\\/haul-cli)/,\n retainLines: true,\n sourceMaps: 'inline',\n});\n\nif (process.argv.indexOf('--webpack-co...
javascript
chosen
[ { "from": "system", "value": "Add an error handling function\n" }, { "from": "human", "value": "var seeds = require('./features.json');\nvar mongoose = require('mongoose');\nmongoose.connect('mongodb://localhost/rose');\n\nvar Feature = mongoose.model('Feature', {\n name: String,\n examples: O...
javascript
chosen
[ { "from": "system", "value": "FIX keep-fnames for minify now works\n" }, { "from": "human", "value": "const webpack = require('webpack');\nconst webpackMerge = require('webpack-merge');\nconst path = require('path');\nconst commonConfig = require('./webpack.config.common.js');\nconst AppCachePlu...
javascript
chosen
[ { "from": "system", "value": "Allow visibility to be toggled." }, { "from": "human", "value": "/*jslint nomen: false*/\n/*global lib*/\nlib.showable = function (_public, _protected) {\n\n lib.model(_public, _protected, 'visible');\n lib.destroyable(_public, _protected);\n\n _public.visi...
javascript
chosen
[ { "from": "system", "value": "Fix cursor problem in Playground\n" }, { "from": "human", "value": "import express from 'express';\n\nimport { ApolloServer } from 'apollo-server-express';\n\nimport dataSources from '../connectors';\nimport schema from '../schema';\nimport resolvers from '../resolv...
javascript
chosen
[ { "from": "system", "value": "Use stream functionality to split and inspect stdout and stderr\n" }, { "from": "human", "value": "#!/user/bin/env node\n\nvar spawn = require('child_process').spawn;\n\nvar mcServer = spawn('python', [], { stdio: ['inherit', 'inherit', 'inherit'] });\n\nmcServer.on...
javascript
chosen
[ { "from": "system", "value": "Use iteration rather than recursion to read through the pull requests\n" }, { "from": "human", "value": "import GitHubApi from \"github\";\nimport _ from \"lodash\";\n\nconst github = new GitHubApi({\n protocol: \"https\",\n Promise,\n timeout: 5000,\n});\n\nfunc...
javascript
chosen
[ { "from": "system", "value": "Use flat mysql connection string\n" }, { "from": "human", "value": "const mysql = require('mysql');\n\nvar connection = mysql.createConnection({\n host : process.env.RELISTEN_DB_HOST || '127.0.0.1',\n user : process.env.RELISTEN_DB_USER || 'root',\n datab...
javascript
chosen
[ { "from": "system", "value": "Set an internal object for settings, let defaults be entirely user set\n" }, { "from": "human", "value": "'use strict';\n\nvar assign = require('lodash.assign');\nvar ResultList = require('./result-list');\n\nvar _defaults = {\n page: 1,\n per_page: 20,\n safesea...
javascript
chosen
[ { "from": "system", "value": "Add ng-app attribute after bootstrapping\n\nor e2e tests just won't run\n" }, { "from": "human", "value": "/* pg.js\n * This file is run from index.html, \n * and is the intial phase in the run-cycle.\n * Use this file to do things before the\n * mobile device / Pho...
javascript
chosen
[ { "from": "system", "value": "Add getContent, setContent, getAst, setAst method to plugin\n" }, { "from": "human", "value": "import {asyncReplace} from 'stc-helper';\n\n/**\n * stc plugin abstract class\n */\nexport default class {\n /**\n * constructor\n */\n constructor(file){\n this....
javascript
chosen
[ { "from": "system", "value": "Add redux dev tool support\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { createStore } from 'redux';\n\nimport App from './components/app';\nimport reducers from '....
javascript
chosen
[ { "from": "system", "value": "Move error catch outside of the returned promise\n" }, { "from": "human", "value": "import Promise from 'bluebird';\nimport {EventEmitter} from 'events';\nimport lodash from 'lodash';\n\nexport class Store extends EventEmitter {\n constructor(dispatcher) {\n ...
javascript
chosen
[ { "from": "system", "value": "Disable music by default again.\n" }, { "from": "human", "value": "import Phaser from 'phaser'\n\nexport const centerGameObjects = objects => {\n objects.forEach(\n object => object.anchor.setTo(0.5)\n )\n}\n\nexport const enableMusicForState = (trackName, stat...
javascript
chosen
[ { "from": "system", "value": "Change some logic to the filter instead.\n" }, { "from": "human", "value": "var fs = require('fs');\nvar utils = require('amd-utils');\n\nvar task = {\n id : 'init',\n author : 'Indigo United',\n name : 'Init',\n options : {\n name: {\...
javascript
chosen
[ { "from": "system", "value": "Add missing done() on success\n" }, { "from": "human", "value": "/**\n * grunt-dco\n *\n * Copyright (c) 2014 Rafael Xavier de Souza\n * Licensed under the MIT license.\n */\n\n\"use strict\";\n\nmodule.exports = function(grunt) {\n\n var dco = require(\"dco\");\n\...
javascript
chosen
[ { "from": "system", "value": "Add comment for test account\n" }, { "from": "human", "value": "import config from 'config';\nimport { Router } from 'express';\n\nconst router = Router();\nrouter.post('/student', (req, res) => {\n\tif (req.body.username === 'test' && req.body.password === 'test') ...
javascript
chosen
[ { "from": "system", "value": "Fix bug in webpackCompiler definition\n" }, { "from": "human", "value": "function run(protractorConfigPath, webpackConfig, port) {\n var webpack = require('webpack');\n var WebpackDevServer = require('webpack-dev-server');\n var reqlib = require('app-root-path')....
javascript
chosen
[ { "from": "system", "value": "Add feature to layout blocks\n" }, { "from": "human", "value": "const $ = require('jquery');\nconst Board = require('./board');\n\n$(document).ready(() => {\n\tconst board = new Board();\n\tconst $selectedBlock = $('.panel .block[selected]').first();\n\n\t$('.panel ...
javascript
chosen
[ { "from": "system", "value": "Add function name for debugging\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function(opts) {\n opts.dbname = opts.dbname || 'yamb';\n\n if (!opts.storage) {\n // TODO: fix error message\n throw new Error('error with storage');\n }...
javascript
chosen
[ { "from": "system", "value": "Return an empty string if the emojis are not supported" }, { "from": "human", "value": "\"use strict\";\n\nconst emojisPath = require.resolve(\"emojilib/emojis.json\")\n , rJson = require(\"r-json\")\n , camelo = require(\"camelo\")\n , iterateObject = requ...
javascript
chosen
[ { "from": "system", "value": "Update basic app to reflect change in api\n" }, { "from": "human", "value": "window.addEvent(\"domready\", function() {\n var BasicApp = new Class({\n Extends: App,\n initialize: function(element, options) {\n this.parent(element, options...
javascript
chosen
[ { "from": "system", "value": "Update to handle new Travis images\n" }, { "from": "human", "value": "/* eslint-env node */\nmodule.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chrome'\n ],\n launch_in_dev: [\n 'Chrome'\n ],\n ...
javascript
chosen
[ { "from": "system", "value": "Use the library to buffer the callbacks\n" }, { "from": "human", "value": "var CallbackBuffering = require(\"../lib\");\n\nvar cb = new CallbackBuffering();\n\nvar buffer = [];\nfunction callbacks() {\n for (var i = 0; i < buffer.length; ++i) {\n buffer[i]...
javascript
chosen
[ { "from": "system", "value": "Remove cards from default state\n\nAdding initial state, actioncreators and reducers did not remove errors being thrown; issue must be with the fundamental setup rather than lack of live data" }, { "from": "human", "value": "//@flow\n\nimport { createStore, compose,...
javascript
chosen
[ { "from": "system", "value": "Fix assert.deepEqual was deprecated since v10.0.0\n" }, { "from": "human", "value": "const test = require('testit')\nconst assert = require('assert')\nconst list = require('../list')\nconst json = require('..')\n\ntest('list-of-jstransformers.json is up to date', do...
javascript
chosen
[ { "from": "system", "value": "Stop propagation when opening options page\n" }, { "from": "human", "value": "import dom from '../utils/dom';\nimport messenger from '../utils/messenger';\nimport toggle from '../pages/popup/toggle';\n\nmessenger.sendToTab('popup-toggle-ready');\n\ntoggle({\n el: d...
javascript
chosen
[ { "from": "system", "value": "Remove extra line from example\n" }, { "from": "human", "value": "\"use strict\";\n\nvar sphero = require(\"../\");\nvar orb = sphero(process.env.PORT);\n\norb.connect(function() {\n orb.streamVelocity();\n orb.streamMotorsBackEmf();\n\n orb.on(\"motorsBackEmf\",...
javascript
chosen
[ { "from": "system", "value": "Set default log level to warn\n" }, { "from": "human", "value": "var winston = require('winston');\n\nvar sharedLogger = new winston.Logger({\n transports: [\n new winston.transports.Console({\n prettyPrint: true,\n level: 'debug'\n })\n ]\n});\n\n...
javascript
chosen
[ { "from": "system", "value": "Use mapDispatchToProps to bind actions efficiently\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { bindActionCreators } from 'redux';\nimport { connect } from 'react-redux';\nimport Header from '../components/Header'...
javascript
chosen
[ { "from": "system", "value": "Remove react devtools exact path\n" }, { "from": "human", "value": "const { app, BrowserWindow } = require('electron');\n\n//Window settings\nconst WINDOW_WIDTH = 1280;\nconst WINDOW_HEIGHT = 720;\nconst WINDOW_FRAME = false;\nconst WINDOW_SHOW = true;\nconst WINDOW...
javascript
chosen
[ { "from": "system", "value": "Set Default Value for Email Secret\n\nPeople were complaining they didn't know how to\nset up the API because an error was being thrown.\nThis prevents the error from being thrown.\n" }, { "from": "human", "value": "export default {\n mailgun: {\n secret: proces...
javascript
chosen
[ { "from": "system", "value": "Clean up name field assignments\n" }, { "from": "human", "value": "import generateActions from './actions';\nimport generateApi from './api';\nimport generateNames from './names';\nimport generateStore from './store';\n\n/**\n * Base Flux resource class\n *\n * This...
javascript
chosen
[ { "from": "system", "value": "Fix ctrl/meta for macosx shortcuts\n" }, { "from": "human", "value": "(function () {\n\tvar ns = $.namespace(\"pskl\");\n\n\tns.KeyManager = function () {\n\t\t$(document.body).keyup($.proxy(this.onKeyUp_, this));\n\t};\n\n\t// Kind of object that make you want to s...
javascript
chosen
[ { "from": "system", "value": "Enable the inspection tool for Node.\n" }, { "from": "human", "value": "const cli = require('commander')\nconst nodemon = require('nodemon')\nconst forever = require('forever')\nconst fs = require('fs')\nconst path = require('path')\nconst mkdirp = require('mkdirp')...
javascript
chosen
[ { "from": "system", "value": "Change convoList into a component\n" }, { "from": "human", "value": "// Written by Joshua Paul A. Chan\n(function() {\n\"use strict\";\n\n// `$convoListService`\n//\nangular.module('wr.services')\n.service('$convoListService', function($http) {\n\n});\n}());\n" },...
javascript
chosen
[ { "from": "system", "value": "Test onionoo instance contains endpoint methods\n" }, { "from": "human", "value": "import test from 'ava'\nimport Onionoo from '../'\n\ntest('Onionoo is a function', t => {\n t.is(typeof Onionoo, 'function')\n})\n\ntest('Onionoo cannot be invoked without \\'new\\''...
javascript
chosen
[ { "from": "system", "value": "Remove global variable from Juxta.CreateUser\n" }, { "from": "human", "value": "/**\n * @class Create User\n * @extend Juxta.FloatBox\n * @param {jQuery} element\n */\nJuxta.CreateUser = function(element) {\n\n\tJuxta.FloatBox.prototype.constructor.call(this, elemen...
javascript
chosen
[ { "from": "system", "value": "Update Simple Modal Component Documentation and Styling\n" }, { "from": "human", "value": "/*!\n Copyright (C) 2017 Google Inc.\n Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n */\n\n(function (can, GGRC) {\n 'use strict';\n\n var t...
javascript
chosen
[ { "from": "system", "value": "Exclude sub-pages from URL matches\n" }, { "from": "human", "value": "var self = require('sdk/self');\nvar pageMod = require(\"sdk/page-mod\");\n\npageMod.PageMod({\n\tinclude: \"*.sg.hu\",\n\tcontentScriptWhen: \"start\",\n\tattachTo: [\"existing\", \"top\"],\n\tco...
javascript
chosen
[ { "from": "system", "value": "Test coverage is now 100%.\n" }, { "from": "human", "value": "\nvar http = require('http'),\n express = require('express'),\n cookieSession = require('cookie-session'),\n request = require('supertest'),\n expect = require('chai').expect,\n hsu = requi...
javascript
chosen
[ { "from": "system", "value": "Rename Contributer (sic) role to Contributor\n\nThe role spelling has been fixed in the database on the live and QA\nservers, so the code needs to know about the new default.\n" }, { "from": "human", "value": "import { Model } from 'objection';\n\nclass Role extends...
javascript
chosen
[ { "from": "system", "value": "Store the user data on key -2 for now - it's just for development\n" }, { "from": "human", "value": "var finServer = require('./lib/fin/api/server'),\n\tengine = require('./lib/fin/engines/development')\n\nfinServer\n\t.on('client_connect', _handleConnect)\n\t.on('c...
javascript
chosen
[ { "from": "system", "value": "Add comments to main file\n" }, { "from": "human", "value": "/// <reference path=\"typings/node/node.d.ts\"/>\n// Load environment variables\nrequire('dotenv').load();\n\nvar express = require('express');\nvar app = express();\nvar http = require('http').Server(app)...
javascript
chosen
[ { "from": "system", "value": "Remove unneccesary get path. Catch all route. Comments.\n\n" }, { "from": "human", "value": "const express = require('express');\nconst app = express();\n\napp.use(express.static('public'));\n\napp.get('/', (req, resp) => {\n\tresp.sendStatus(200);\n});\n\napp.all('...
javascript
chosen
[ { "from": "system", "value": "Remove an unnecessary console log\n" }, { "from": "human", "value": "var express = require('express');\nvar compression = require('compression');\nvar app = express();\n\napp.all('*', function(req, res, next) {\n console.log(req.headers);\n if (req.headers.host.ma...
javascript
chosen
[ { "from": "system", "value": "Increase the cargo-cult test timeout to 16 milliseconds\n\nThis seems to work better, at least on my machine. We'll have to figure\nout a real solution at some point, though.\n" }, { "from": "human", "value": "export const pasteEventMock = (html) => ({\n type: 'p...
javascript
chosen
[ { "from": "system", "value": "Use poteto's url instead of a local file.\n" }, { "from": "human", "value": "var request = require('request')\n , Promise = require('bluebird')\n , md = require('markdown').markdown\n , _ = require('lodash')\n , yt = require('youtube-dl')\n , fs = require('fs')...
javascript
chosen
[ { "from": "system", "value": "Add aliases for help and version flags\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\nvar meow = require('meow');\nvar itunesRemote = require('./');\n\nvar cli = meow([\n\t'Usage',\n\t' $ itunes-remote [input]',\n\t'',\n\t'Options',\n\t' --...
javascript
chosen
[ { "from": "system", "value": "Use `svelte:compiler` 2.5.0_1 and bump version to 3.0.0\n" }, { "from": "human", "value": "Package.describe({\n name: 'svelte:tracker',\n version: '2.1.1',\n summary: 'Tracker integration for Svelte',\n git: 'https://github.com/meteor-svelte/svelte-tracker.git'\...
javascript
chosen
[ { "from": "system", "value": "Set the correct prefix for searching places\n" }, { "from": "human", "value": "define([\"backbone\", \"underscore\", \"places/models/CategoryModel\", \"moxie.conf\"], function(Backbone, _, Category, conf) {\n\n var CategoryCollection = Backbone.Collection.extend(...
javascript
chosen
[ { "from": "system", "value": "Add events controller link to available v1 methods\n" }, { "from": "human", "value": "'use strict';\n\nconst WebController = require('./WebController');\n\nclass ApiWebController extends WebController {\n constructor(...args) {\n super(...args);\n // Bind web...
javascript
chosen
[ { "from": "system", "value": "Fix issue with Button Toggle Group properties priorities.\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react'\nimport autobind from 'autobind-decorator'\nimport {ButtonGroup, Button} from 'react-bootstrap'\n\nexport default class But...
javascript
chosen
[ { "from": "system", "value": "Deployment: Add host to environment variables\n" }, { "from": "human", "value": "const path = require('path'),\n env = process.env.NODE_ENV || 'development';\nrequire('dotenv').config({ silent: true });\n\nconst config = {\n development: {\n port: 5432,\n db...
javascript
chosen
[ { "from": "system", "value": "Add support for Redux devtools\n" }, { "from": "human", "value": "DTile.createStore = () => {\n const { createStore, combineReducers } = window.Redux;\n\n const entities = combineReducers(DTile.reducers.entities);\n const reducers = combineReducers({\n ...
javascript
chosen
[ { "from": "system", "value": "Fix typo on Master Alchemist dishonor action chat message\n" }, { "from": "human", "value": "const DrawCard = require('../../drawcard.js');\nconst { CardTypes } = require('../../Constants');\n\nclass MasterAlchemist extends DrawCard {\n setupCardAbilities(ability...
javascript
chosen
[ { "from": "system", "value": "Allow modal dismiss on click.\n\n" }, { "from": "human", "value": "// context_help.js\n\n\n// Tab info\n$(document).on({\n click: function(e) {\n var text = document.getElementById('x-' + this.id).textContent;\n var title = this.text;\n var t...
javascript
chosen
[ { "from": "system", "value": "Implement actual script to load data-original & data-src urls.\n" }, { "from": "human", "value": "(function(){\n})();\n" }, { "from": "gpt", "value": "(function(){\n var imgs = document.getElementsByTagName('imgs');\n var imgs_size = imgs.length;\n...
javascript
chosen
[ { "from": "system", "value": "Remove duplicate validation error messages\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar util = require('util');\nvar BaseError = require('./base_error');\n\n// convert errors given by jsonschema\nfunction getErrorMessage(errors) {\n if (_.isAr...
javascript
chosen
[ { "from": "system", "value": "Use location.pathname as a key for transition\n" }, { "from": "human", "value": "import React from 'react';\nimport Transition from 'react-transition-group/CSSTransitionGroup';\nimport {\n BrowserRouter as Router,\n Route,\n Switch,\n} from 'react-router-dom';\ni...
javascript
chosen
[ { "from": "system", "value": "Add bulk of available browsers on Sauce Labs for integration tests.\n" }, { "from": "human", "value": "module.exports = {\n server: {\n address: function() {\n return 'http://127.0.0.1:4445/wd/hub';\n }\n },\n\n browsersToTest: [\n {\n browserN...
javascript
chosen
[ { "from": "system", "value": "Adjust height based on width\n" }, { "from": "human", "value": "$(function () {\n\n var canvas = new fabric.Canvas('drawing_board', {\n backgroundColor: 'rgb(255,255,224)',\n height: window.innerHeight,\n width: window.innerWidth\n });\n var socket = io(...
javascript
chosen
[ { "from": "system", "value": "Switch to using our API call for the data fetch\n" }, { "from": "human", "value": "var express = require('express'),\n fs = require('fs');\nvar router = express.Router();\n\n// TODO: Switch to API calls like originally planned\nvar readFile = function(fname) {\n ...
javascript
chosen
[ { "from": "system", "value": "Set sourceRoot in source maps\n\nThis removes the full source path of whoever last published the package\nfrom the stacktraces we show when `EXPO_DEBUG` is enabled and instead\nuses `exp@<version>` or `xdl@<version>` as the path.\n\nfbshipit-source-id: a12977a\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Fix plumber not work bug\n" }, { "from": "human", "value": "var gulp = require(\"gulp\");\nvar browserify = require(\"browserify\");\nvar source = require(\"vinyl-source-stream\");\nvar buffer = require(\"vinyl-buffer\");\nvar reactify = require(\"reactify\");\nvar ...
javascript
chosen
[ { "from": "system", "value": "Add qunit task for failing test.\n" }, { "from": "human", "value": "/* eslint-disable */\n'use strict';\n\nvar gulp = require('gulp'),\n eslint = require('gulp-eslint'),\n mocha = require('gulp-mocha'),\n qunit = require('./index');\n\nvar paths = {\n sc...
javascript
chosen
[ { "from": "system", "value": "Revert \"Replace `unshift()` with `push()` plus `reverse()`\"\n\nThis reverts commit f21c36ed85f277522593f1aed902d18f787a34b1.\n" }, { "from": "human", "value": "/**\n * Copyright 2003-present Greg Hurrell. All rights reserved.\n * Licensed under the terms of the MI...
javascript
chosen
[ { "from": "system", "value": "Handle client TCP socket errors\n" }, { "from": "human", "value": "'use strict';\n\n\nconst http = require('http');\n\nconst { getPromise } = require('../../utilities');\nconst { host, port } = require('../../config');\nconst { addStopMethods } = require('./stop');\...
javascript
chosen
[ { "from": "system", "value": "Clear the message box once it's done.\n" }, { "from": "human", "value": "// Defines the top-level angular functionality. This will likely be refactored\n// as I go.\nvar pyrcApp = angular.module(\"pyrcApp\", []);\n\npyrcApp.controller(\"ircCtrl\", function($scope) {...
javascript
chosen
[ { "from": "system", "value": "Insert documents given to the database (5/16).\n" }, { "from": "human", "value": "var express = require('express');\nvar cors = require('cors');\nvar bodyParser = require('body-parser');\nvar nano = require('nano')('http://localhost:8984');\nvar todo = nano.db.use('...
javascript
chosen
[ { "from": "system", "value": "Add in ajax for newadminbox" }, { "from": "human", "value": "$.fn.editable.defaults.mode = 'inline';\r\n\r\n$(document).ready(function() {\r\n $('#newelectionbox').submit(function(event) {\r\n document.getElementById(\"submitbtn\").disabled = true;\r\n ...
javascript
chosen
[ { "from": "system", "value": "Remove coveralls step from travis task\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Grunt aliases\n * @type {Object}\n */\nmodule.exports = {\n\n // Make sure code styles are up to par and there are no obvious mistakes.\n lint: [\n 'jshin...
javascript
chosen
[ { "from": "system", "value": "Add root route for serving index.html\n" }, { "from": "human", "value": "// BASE SETUP\n// =============================================================================\nvar express = require('express');\nvar server = express();\nvar port = process.e...
javascript
chosen
[ { "from": "system", "value": "Configure source maps to work with sentry (SDESK-3663)\n\n" }, { "from": "human", "value": "var webpack = require('webpack');\n\nmodule.exports = function(grunt) {\n var config = require('../../webpack.config.js')(grunt);\n\n config.progress = !grunt.option('w...
javascript
chosen
[ { "from": "system", "value": "Set Promise test exit code based on failure count\n\nPreviously, the exit was always zero, which is not very useful as part\nof a continuous integration system.\n\nChange-Id: I3fd5e9061f605950c48240419c2a093c74005144\n" }, { "from": "human", "value": "#!/usr/bin/env...
javascript
chosen
[ { "from": "system", "value": "Change the spanish translation as we are now starting the array with Sunday\n" }, { "from": "human", "value": "jQuery.extend(DateInput.DEFAULT_OPTS, {\n month_names: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septie...
javascript
chosen
[ { "from": "system", "value": "Update types container to include Vector3\n" }, { "from": "human", "value": "import Color from 'flockn/types/color';\nimport Vector2 from 'flockn/types/vector2';\n\nlet Types = {};\n\nTypes.Color = Color;\nTypes.Vector2 = Vector2;\n\nexport default Types;\nexport {C...
javascript
chosen
[ { "from": "system", "value": "Add support for displaying sub components inside a moon header\n" }, { "from": "human", "value": "enyo.kind({\n\tname: \"moon.Header\",\n\tclasses: \"moon-header\"\n});" }, { "from": "gpt", "value": "enyo.kind({\n\tname: \"moon.Header\",\n\tclasses: \"mo...
javascript
chosen
[ { "from": "system", "value": "Disable `compress` option for UglifyJS by default. Just 1% gain in gzipped, but possible huge perfomance loss with minified src.\n" }, { "from": "human", "value": "/**\n * class UglifyCompressor\n *\n * Engine for CSS minification. You will need `uglify-js` Node m...
javascript
chosen