conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix search input redirect to gqlsearch\n" }, { "from": "human", "value": "// auth sagas live here\nimport { put, call, takeEvery } from 'redux-saga/effects';\nimport { push } from 'react-router-redux';\nimport client from 'utils/client';\nimport {\n SESSION_CHECKED...
javascript
chosen
[ { "from": "system", "value": "Change help text for parse configuration\n" }, { "from": "human", "value": "// Requires\nvar _ = require('underscore');\n\nfunction setup(options, imports, register) {\n var deploy = imports.deploy;\n var shells = imports.shells;\n\n /*\n Documentation a...
javascript
chosen
[ { "from": "system", "value": "Use Twitter API v1.1 to verify_credentials\n" }, { "from": "human", "value": "(function () {\n\n Accounts.oauth.registerService('twitter', 1, function(oauthBinding) {\n var identity = oauthBinding.get('https://api.twitter.com/1/account/verify_credentials.json')....
javascript
chosen
[ { "from": "system", "value": "Update validate func to reflect new signature\n" }, { "from": "human", "value": "/**\n\n Copyright 2015 Covistra Technologies Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License...
javascript
chosen
[ { "from": "system", "value": "Add TODO comment in loadRepos method to remind me to improve error handling\n" }, { "from": "human", "value": "import * as types from './actionTypes';\nimport GithubAPI from '../api/githubAPI';\n\nexport function reposLoaded(repos){\n return {type: types.REPOS_LOAD...
javascript
chosen
[ { "from": "system", "value": "Add a console log to detect which event triggers the dirty flag" }, { "from": "human", "value": "this.GobiertoAdmin.DirtyFormsComponent = (function() {\n var isDirty;\n\n function DirtyFormsComponent() {}\n\n DirtyFormsComponent.prototype.handle = function(messag...
javascript
chosen
[ { "from": "system", "value": "Use parseInt to test Babel major version.\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regener...
javascript
chosen
[ { "from": "system", "value": "Fix an issue with the signup container's props\n" }, { "from": "human", "value": "import React from 'react'\nimport { MainView } from '../components/views/MainView'\nimport RegistrationRequestForm from '../components/forms/RegistrationRequestForm'\n\nexport default ...
javascript
chosen
[ { "from": "system", "value": "Clean up: template init script\n" }, { "from": "human", "value": "/*!\n * Start Bootstrap - Creative Bootstrap Theme (http://startbootstrap.com)\n * Code licensed under the Apache License v2.0.\n * For details, see http://www.apache.org/licenses/LICENSE-2.0.\n */\n\...
javascript
chosen
[ { "from": "system", "value": "Add license preamble to empty test file\n\nChange-Id: I749654e71151e2f694cf150d09ee944c6e4d442c\n" }, { "from": "human", "value": "/**\n * @fileoverview Intentionally blank - will contain shared Polymer 2 test setup\n * code.\n */\n\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Remove duplicate declaration of CONFIG.\n" }, { "from": "human", "value": "/**\n * This is the default (fallback) configuration file for the web application.\n */\n\n// Create empty CONFIG object as fallback if it does not exist.\nvar CONFIG = CONFIG || {};\n\n// De...
javascript
chosen
[ { "from": "system", "value": "Add dotenv import to knexjs script\n" }, { "from": "human", "value": "/* eslint import/no-extraneous-dependencies: 0 */\nrequire('babel-register')({ presets: ['env'] });\nrequire('babel-polyfill');\nconst config = require('./knexdata');\n\nmodule.exports = config;\n...
javascript
chosen
[ { "from": "system", "value": "Fix bug in for-each loop and correct comments\n" }, { "from": "human", "value": "// Get messages from the newest to oldest\nchannel.getMessages(20 /* by pages of 20 messages */ )\n .then(messagesPage => {\n messagesPage.items.forEach(message => {\n // do ...
javascript
chosen
[ { "from": "system", "value": "OptBox: Use jQuery instead of ext.\n\nSimplifies code, step forward to remove ext from frontend.\n" }, { "from": "human", "value": "Kwf.onContentReady(function statisticsOptBox(body, param) {\n if (!param.newRender) return;\n if (Kwf.Statistics.defaultOptValue...
javascript
chosen
[ { "from": "system", "value": "Change style watch from Sass to Stylus\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\n\ngulp.task('watch', ['clean', 'styles', 'lint:all' ], function() {\n gulp.watch('src/stylesheets/**/*.scss', ['styles']);\n gulp.watch('src...
javascript
chosen
[ { "from": "system", "value": "Make port dynamic for Heroku\n" }, { "from": "human", "value": "var express = require('express'),\n cons = require('consolidate'),\n app = express(),\n mustacheRender = require(\"./lib/mustacheRender\").mustacheRender;\n\n// Application settings\napp.engine...
javascript
chosen
[ { "from": "system", "value": "Move CORS header setting into separate function\n" }, { "from": "human", "value": "var _ = require('underscore')\n , request = require('request')\n , qs = require('querystring')\n , express = require('express')\n , app = express();\n\napp.get('/ta...
javascript
chosen
[ { "from": "system", "value": "Remove old route that is no longer in user\n" }, { "from": "human", "value": "const express = require('express')\nconst users = require('../Controllers/userCtrl')\nconst jwt = require('../Lib/jwt.js')\n\nconst router = express.Router()\n\nconst isAuthenticated = fun...
javascript
chosen
[ { "from": "system", "value": "Use !== instead of !=\n" }, { "from": "human", "value": "if (typeof angular != 'undefined') {\r\n\r\n var app = angular.module('app', []);\r\n\r\n app.config(function ($routeProvider) {\r\n if (typeof AddUserRoutes != 'undefined') {\r\n AddUserRoutes($rout...
javascript
chosen
[ { "from": "system", "value": "Correct path to package.json after template path move\n" }, { "from": "human", "value": "var project = require('../../../package.json');\n\nmodule.exports = [\n'/*\\n\\\nTheme Name: ', project.prettyName, '\\n\\\nAuthor: ', project.author, '\\n\\\nAuthor URI: ...
javascript
chosen
[ { "from": "system", "value": "Convert to autonomous script (from grunt task)\n" }, { "from": "human", "value": "var lunr = require('lunr'),\n fs = require('fs'),\n views = require('./views'),\n textNodes = require('./textNodeProcessor'),\n config = require('../config'),\n path = require('pa...
javascript
chosen
[ { "from": "system", "value": "Read the correct amount of bytes to also support MKV\n\nFixes #1\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\nconst readChunk = require('read-chunk');\nconst meow = require('meow');\nconst fileType = require('file-type');\n\nconst cli = meo...
javascript
chosen
[ { "from": "system", "value": "Add placeholder knob to stories.\n\n" }, { "from": "human", "value": "import React from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { withKnobs, boolean, number } from '@storybook/addon-knobs'\n\nimport { BasicSelect, BasicMultiSelect, BasicSearchS...
javascript
chosen
[ { "from": "system", "value": "Fix file format dowload selector\n" }, { "from": "human", "value": "import React, { useState } from 'react';\n\nimport { withStyles, Fab } from '@material-ui/core';\nimport { ToggleButtonGroup, ToggleButton } from '@material-ui/lab';\nimport DownloadIcon from '@mate...
javascript
chosen
[ { "from": "system", "value": "Add parsing compId from local storage\n" }, { "from": "human", "value": "import \"./App.css\";\n\nimport React, { useState } from \"react\";\nimport { Route } from \"react-router-dom\";\n\nimport CreateCompetition from \"./containers/CreateCompetition/CreateCompetit...
javascript
chosen
[ { "from": "system", "value": "Make iniForm a jQuery plugin so it can be called with context\n" }, { "from": "human", "value": "function listProperties(obj) {\n var propList = \"\";\n for(var propName in obj) {\n if(typeof(obj[propName]) != \"undefined\") {\n propList += (propNam...
javascript
chosen
[ { "from": "system", "value": "Add onInit default dispatch for weather\n\n" }, { "from": "human", "value": "import { connect } from 'react-redux'\nimport Weather from './weather'\n\nconst getLocation = (location) => {\n return location\n}\n\nconst onInit = () => {\n console.log('onInit-----')\n...
javascript
chosen
[ { "from": "system", "value": "Refactor and improved the tree's appearance.\n" }, { "from": "human", "value": "qx.Class.define(\"vcms.client.widgets.PageTree\",\n{\n extend : qx.ui.tree.Tree,\n \n construct : function()\n {\n this.base(arguments);\n \n var root = thi...
javascript
chosen
[ { "from": "system", "value": "fix(PropertyPanel): Add support of show function on prop group\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport style from 'PVWStyle/ReactProperties/PropertyPanel.mcss';\nimport factory from '../PropertyFac...
javascript
chosen
[ { "from": "system", "value": "Remove hard-coded SNS topic ARN\n" }, { "from": "human", "value": "var SNS = require('aws-sdk/clients/sns');\n\nexports.lambda_handler = function(event, context, callback) {\n var sns = new SNS();\n console.log(\"About to process \" + event.Records.length + \" eve...
javascript
chosen
[ { "from": "system", "value": "Update to support soundcloud sets." }, { "from": "human", "value": "(function(module) {\n\t\"use strict\";\n\n\tvar SoundCloud = {},\n\t\tembed = '<iframe width=\"100%\" height=\"166\" scrolling=\"no\" frameborder=\"no\" src=\"https://w.soundcloud.com/player/?url=ht...
javascript
chosen
[ { "from": "system", "value": "Add 'suppressComments' and 'suppressTypes' options\n\nThey were not implemented, even though they were mentioned in: https://codemix.github.io/flow-runtime/#/docs/pragmas" }, { "from": "human", "value": "/* @flow */\n\nimport ConversionContext from './ConversionCont...
javascript
chosen
[ { "from": "system", "value": "Add coverage reporting for machines\n" }, { "from": "human", "value": "// Karma configuration\n// Generated on Mon Oct 02 2017 17:31:27 GMT-0400 (EDT)\n/* globals module */\n\nmodule.exports = function(config) {\n 'use strict';\n\n config.set({\n plugins: [\n ...
javascript
chosen
[ { "from": "system", "value": "Update the store from localstorage upon refreshing from any page\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport 'semantic-ui-css/semantic.min.css';\n\nimport { Provider } from 'react-redux';\nimport { createS...
javascript
chosen
[ { "from": "system", "value": "Fix broken menu commands when no feeds\n" }, { "from": "human", "value": "const LocalizedPrompt = require('./utils/LocalizedPrompt.js')\nconst Translator = require('../../../structs/Translator.js')\n\n/**\n * @typedef {Object} Data\n * @property {import('../../../st...
javascript
chosen
[ { "from": "system", "value": "Fix login success status code\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n var jsonfile = require('jsonfile');\n var path = require('path');\n var authcontroller = require('./../src/authcontroller');\n\n authcontroller.authori...
javascript
chosen
[ { "from": "system", "value": "Mend multiple executes ; work on mending node.js\n" }, { "from": "human", "value": "var inarea = document.getElementById('input');\nvar outarea = document.getElementById('output');\nfunction get_line_char()\n{\n me = arguments.callee;\n if (typeof me.i == 'un...
javascript
chosen
[ { "from": "system", "value": "Add Authorization header to requests\n" }, { "from": "human", "value": "// @flow\n\nexport function normalizeBaseURL(url: string): string {\n return url.replace(/\\/+$/, \"\");\n}\n\nexport function createAJAXSettings(\n serverConfig: Object,\n uri: string = \"/\...
javascript
chosen
[ { "from": "system", "value": "Refactor code for search in rotated sorted array\n" }, { "from": "human", "value": "/**\n * @param {number[]} numbers\n * @param {number} target\n * @return {number}\n */\nconst search = function (numbers, target) {\n if (!numbers || numbers.length === 0) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add test for conditional describe\n" }, { "from": "human", "value": "var assert = require('assert'),\n when = require('../');\n\ndescribe('when', function () {\n when(true).it('should be executed', function () {\n assert.ok(true);\n });\n\n when(fal...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded comma from BoxGeometry test\n" }, { "from": "human", "value": "(function () {\n\n\t'use strict';\n\n\tvar parameters = {\n\t\twidth: 10,\n\t\theight: 20,\n\t\tdepth: 30,\n\t\twidthSegments: 2,\n\t\theightSegments: 3,\n\t\tdepthSegments: 4,\n\t};\n\n\...
javascript
chosen
[ { "from": "system", "value": "MAke Eventer.removeListener work if no cbs bound for event, yet." }, { "from": "human", "value": ";(function(exports) {\n function Eventer() {\n var callbacks = {};\n\n this.addListener = function(obj, event, callback) {\n callbacks[event] = callbacks[ev...
javascript
chosen
[ { "from": "system", "value": "Fix didTransition deprecation on Ember 3.6+\n" }, { "from": "human", "value": "export function initialize(appInstance) {\n // Support Ember 1.13+\n const owner = appInstance.lookup ? appInstance : appInstance.container;\n\n const router = owner.lookup('router:mai...
javascript
chosen
[ { "from": "system", "value": "Use new marketing.scss in gulp workflow\n" }, { "from": "human", "value": "var elixir = require('laravel-elixir');\n\n/*\n |--------------------------------------------------------------------------\n | Elixir Asset Management\n |------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Fix relative path for plugin system\n" }, { "from": "human", "value": "export default {\n data () {\n return {\n plugins: {\n list: ['Invoice'],\n loaded: []\n }\n }\n },\n methods: {\n loadPlugin (name) {\n if (this.plugins....
javascript
chosen
[ { "from": "system", "value": "Move mobile menu functions into object\n" }, { "from": "human", "value": "require('./mobile-menu.sass');\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const menuButton = document.querySelector('.top-bar button.ion-md-menu');\n const menu = document.ge...
javascript
chosen
[ { "from": "system", "value": "Reset upload form, reload list on song upload\n" }, { "from": "human", "value": "/**\n * @class Admin_Page_Songs\n * @extends Admin_Page_Abstract\n */\nvar Admin_Page_Songs = Admin_Page_Abstract.extend({\n\n\t/** @type String */\n\t_class: 'Admin_Page_Songs'\n});\n"...
javascript
chosen
[ { "from": "system", "value": "Use full path of meteor-async-await module to register plugin.\n" }, { "from": "human", "value": "exports.getDefaults = function getDefaults(features) {\n var options = {\n compact: false,\n sourceMap: \"inline\",\n externalHelpers: true,\n ast: false,\...
javascript
chosen
[ { "from": "system", "value": "Include underscore as a dependency on both client and server" }, { "from": "human", "value": "Package.describe({\n summary: \"DB less realtime communication for meteor\"\n});\n\nPackage.on_use(function (api, where) {\n api.add_files(['lib/ev.js', 'lib/server.js', ...
javascript
chosen
[ { "from": "system", "value": "Refactor and fix merge sort implementation\n" }, { "from": "human", "value": "function mergeSort(elements) {\n const n = elements.length;\n const halfArr = Math.floor(n / 2);\n if (n > 1) {\n let restArr;\n if (n % 2 !== 0) {\n restArr = (halfArr) + 1;...
javascript
chosen
[ { "from": "system", "value": "Update characters included in the unicode test\n" }, { "from": "human", "value": "var common = require(\"./common\")\n , odbc = require(\"../\")\n , db = new odbc.Database()\n , assert = require(\"assert\")\n ;\n\ndb.open(common.connectionString, function(err) {...
javascript
chosen
[ { "from": "system", "value": "Add method rowNumber and indents generator\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport ThreadingRow from './ThreadingRow';\nimport '../styles/Threading.css';\n\nclass Threading extends Component {\n render() {\n return ...
javascript
chosen
[ { "from": "system", "value": "Make sure that an empty time component does not trigger infinite onChange events.\n" }, { "from": "human", "value": "import moment from 'moment';\nimport TextFieldComponent from '../textfield/TextField';\n\nexport default class TimeComponent extends TextFieldCompone...
javascript
chosen
[ { "from": "system", "value": "Add German translation for 'Close'\n" }, { "from": "human", "value": "/*!\n * This is a i18n.locale language object.\n *\n *<de> German translation by Tim Latz, latz.tim@gmail.com\n *\n * @author\n * Tim Latz (latz.tim@gmail.com)\n *\n * @see\n * me-i18n.js\n *\...
javascript
chosen
[ { "from": "system", "value": "Reset basic file with finishing tutorial\n\nDelete zero added in Git tutorial\n" }, { "from": "human", "value": "// Given a _sharedData from instagram script, return a JSON.\n\nclass YourClass {\n constructor(say) {\n this.say = say;\n }\n\n speak() {\n con...
javascript
chosen
[ { "from": "system", "value": "Update renderer logger to log all arguments.\n\nCloses #60.\n" }, { "from": "human", "value": "import app from 'ampersand-app';\nimport electron from 'electron';\nimport { partial } from 'lodash';\n\nmodule.exports = function configureLogger() {\n const colorMap = ...
javascript
chosen
[ { "from": "system", "value": "Print version on `-v | --version`\n\nCloses #6\n" }, { "from": "human", "value": "var readJson = require('read-package-json');\nvar minimist = require('minimist');\nvar path = require('path');\nvar url = require('url');\n\nvar shields = require('../');\n\nvar argv =...
javascript
chosen
[ { "from": "system", "value": "Allow connecting to MySQL instances that ask for the old (insecure) authentication method\n" }, { "from": "human", "value": "var mysql = require('mysql')\n , inquirer = require('inquirer');\n\n/**\n * Create a MySQL connection\n * \n * @param {String} host\n * ...
javascript
chosen
[ { "from": "system", "value": "[fix]: Use router.all to catch all requests to endpoint\n" }, { "from": "human", "value": "import express from 'express';\nimport UserController from '../controllers/UserController';\n\nconst userRouter = express.Router();\nuserRouter.post('/api/user/signup', UserCo...
javascript
chosen
[ { "from": "system", "value": "Swap out link with unread: 0 on download\n" }, { "from": "human", "value": "$(function () {\n var all = $(\"#select_all\");\n var none = $(\"#select_none\");\n var checkboxes = $(\":checkbox\");\n\n all.css('cursor', 'pointer');\n none.css('cursor', 'pointer');...
javascript
chosen
[ { "from": "system", "value": "Make method to create an empty 'circuit element'\n" }, { "from": "human", "value": "(function(app) {\n 'use strict';\n\n var circuit = require('circuit');\n\n var Wrapper = function(self) {\n this.unwrap = Wrapper.unwrap.bind(self);\n };\n\n Wrapper.unwrap =...
javascript
chosen
[ { "from": "system", "value": "Add debug options for tests\n" }, { "from": "human", "value": "module.exports = {\n host: process.env.MYSQL_HOST || 'localhost',\n port: process.env.MYSQL_PORT || 3306,\n user: process.env.MYSQL_USER || 'root',\n password: process.env...
javascript
chosen
[ { "from": "system", "value": "Use renamed module in the examples\n" }, { "from": "human", "value": "var app = angular.module('example', ['ngSpy']).run(function() {\n console.log('I am running');\n});\n" }, { "from": "gpt", "value": "var app = angular.module('example', ['spy']).run...
javascript
chosen
[ { "from": "system", "value": "Add test for order sorting.\n" }, { "from": "human", "value": "\"use strict\";\n\nconst fs = require(\"fs\"),\n assert = require(\"chai\").assert,\n lib = require(\"../tasks/lib/index\");\n\nconst replacements = lib({\n excludes: [],\n replacements: []\n});\n\nf...
javascript
chosen
[ { "from": "system", "value": "Add `no_muxer=1` for filename searching" }, { "from": "human", "value": "export var name = '射手网 (伪)'\n\nexport function search (name) {\n let token = window.app.config.subtitleServices.shooterFake.token\n return window.fetch(`http://api.assrt.net/v1/sub/search?tok...
javascript
chosen
[ { "from": "system", "value": "Change input widths also on resize.\n" }, { "from": "human", "value": "\njQuery(document).ready(function($) {\n\n // Set widths of text inputs.\n\n // Get current widths.\n var form_width = $('#serchilo-shortcut-call-form').outerWidth();\n var keyword_width =...
javascript
chosen
[ { "from": "system", "value": "Change new AJV option 'format'\n" }, { "from": "human", "value": "'use strict';\n\nconst Ajv = require('ajv');\nconst ajvKeywords = require('ajv-keywords');\n\nconst getValidator = function () {\n const ajv = new Ajv(AJV_OPTIONS);\n\n // Add JSON keywords:\n // ...
javascript
chosen
[ { "from": "system", "value": "Replace custom shadow with Tachyon shadow class\n" }, { "from": "human", "value": "import React from 'react'\n\nclass Nav extends React.Component {\n componentDidMount() {\n // initSideNav()\n }\n render() {\n return (\n <div>\n <p className=\"t...
javascript
chosen
[ { "from": "system", "value": "Fix ApolloClient tests in phantomjs\n" }, { "from": "human", "value": "/* eslint-disable prefer-arrow-callback, func-names */\n/* eslint-env mocha */\nimport chai from 'chai';\nimport gql from 'graphql-tag';\nimport { ApolloClient } from 'apollo-client';\nimport { I...
javascript
chosen
[ { "from": "system", "value": "Fix webpack public path for phantom.\n" }, { "from": "human", "value": "var webpack = require('webpack');\nvar config = require('./webpack.config');\n\nconfig.output.filename = \"testBundle.js\";\nconfig.entry = 'mocha!./test/all.js';\nmodule.exports = config;\n" ...
javascript
chosen
[ { "from": "system", "value": "Move function declaration to function body root\n" }, { "from": "human", "value": "$(document).ready(function() {\n var formFields = $(\"[data-hook='admin_customer_return_form_fields'], \\\n [data-hook='admin_return_authorization_form_fields']\"...
javascript
chosen
[ { "from": "system", "value": "Make a utf-8 string in getLine for Node\n" }, { "from": "human", "value": "var i$putStr = (function() {\n var fs = require('fs');\n return function(s) {\n fs.write(1,s);\n };\n})();\n\nvar i$getLine = (function() {\n var fs = require( \"fs\" )\n\n return fun...
javascript
chosen
[ { "from": "system", "value": "Add wfImageSrcPath to access the webframework image from reactJs\n" }, { "from": "human", "value": "/* We have to setup the global variables which will be used for web application. \n As now everything comes from webframework globally so I put it here temprarily.\n...
javascript
chosen
[ { "from": "system", "value": "Clone data object before templating. Ensures only one format is set when templating.\n" }, { "from": "human", "value": "// Templating\n// ---------\nwax.template = function(x) {\n var template = {};\n\n function urlX(url) {\n // Data URIs are subject to...
javascript
chosen
[ { "from": "system", "value": "Revert \"Change to history mode\"\n\nThis reverts commit 2996372a65c1c6e842aa554e89fdf561845c16a6.\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport App from './App'\nimport VueMarkdown from 'vue-markdown'\nimport VueAutosuggest from 'vue-autosuggest'...
javascript
chosen
[ { "from": "system", "value": "Add support to StaticFile so that it works with non-textual files.\n\nPreviously binary files were being interpreted as UTF8 encoded bytestreams\nthis isn't an ideal for pushing out static files such as images.\n\nI've modified the StaticFile type so that it explicitly declares...
javascript
chosen
[ { "from": "system", "value": "refactor(settings): Remove extra withTheme hoc on styled components.\n" }, { "from": "human", "value": "/* @flow */\nimport React from 'react'\nimport styled, { withTheme } from 'styled-components'\nimport Label from 'components/Label'\nimport Input from 'components...
javascript
chosen
[ { "from": "system", "value": "Replace email with typeform, update help menu\n" }, { "from": "human", "value": "import $ from 'browser/menus/expressions';\n\nexport default {\n label: '&Help',\n role: 'help',\n submenu: [{\n label: 'App Website',\n click: $.openUrl('https://messengerford...
javascript
chosen
[ { "from": "system", "value": "Use an object for the queue of unsent events\n" }, { "from": "human", "value": "module.exports = class ReporterProxy {\n constructor () {\n this.reporter = null\n this.timingsQueue = []\n\n this.eventType = 'find-and-replace-v1'\n }\n\n setReporter (re...
javascript
chosen
[ { "from": "system", "value": "Use the function form of \"use strict\"\n" }, { "from": "human", "value": "'use strict';\n\n(function () {\n describe('Give it some context', function () {\n describe('maybe a bit more context here', function () {\n it('should run here few assertions', func...
javascript
chosen
[ { "from": "system", "value": "Add getters and setters to order book util\n" }, { "from": "human", "value": "\n/*\n *\n * poloniex-unofficial\n * https://git.io/polonode\n *\n * Yet another unofficial Node.js wrapper for the Poloniex cryptocurrency\n * exchange APIs.\n *\n * Copyright (c) 2016 Ty...
javascript
chosen
[ { "from": "system", "value": "Fix matching with terms specified\n" }, { "from": "human", "value": "function(head, req) {\n var row;\n var count = 0;\n var ids = [];\n\n while (row = getRow()) {\n count = count + 1;\n var queries = JSON.parse(req.query.data)[\"q\"];\n var match = tru...
javascript
chosen
[ { "from": "system", "value": "Print banner to console in browser environment only\n" }, { "from": "human", "value": "import { version, homepage } from '../../package.json'\nimport Logger from 'js-logger'\nimport './polyfills.js'\n\n// Bootstrap logger\nLogger.useDefaults()\n\n// print header to ...
javascript
chosen
[ { "from": "system", "value": "Fix a JS error in ContactActions\n" }, { "from": "human", "value": "var ContactActions = {\n getDrawerFingerprints : function(jid) {\n var store = new ChatOmemoStorage();\n store.getLocalRegistrationId().then(deviceId => {\n ContactAction...
javascript
chosen
[ { "from": "system", "value": "Fix error removing drawings that were done\n" }, { "from": "human", "value": "var p;\nvar drawings = [];\n\nvar DrawingManager = function (p5Sketch) {\n p = p5Sketch;\n};\n\nDrawingManager.prototype.add = function (drawing) {\n console.log('Added ' + drawing);\n ...
javascript
chosen
[ { "from": "system", "value": "Change createUser to an async function\n" }, { "from": "human", "value": "// @flow\n/* eslint-disable max-len */\nimport type {\n CreateUserType,\n PasswordLoginUserType,\n LoginReturnType,\n} from '@accounts/common';\n\nexport interface TransportInterface {\n c...
javascript
chosen
[ { "from": "system", "value": "Improve code style in main export file\n" }, { "from": "human", "value": "'use strict';\n\n/**\n* Logistic distribution quantile function.\n*\n* @module @stdlib/math/base/dist/logistic/quantile\n*\n* @example\n* var quantile = require( '@stdlib/math/base/dist/logist...
javascript
chosen
[ { "from": "system", "value": "Add in logic to change window location on recycle submit\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n\n $('#search').on('submit', function(event){\n event.preventDefault();\n initializeMap();\n });\n\n})\n" }, { "from": "gpt",...
javascript
chosen
[ { "from": "system", "value": "Add base element at start of head (in freeze-dry)\n" }, { "from": "human", "value": "export default async function fixLinks({rootElement, docUrl}) {\n const head = rootElement.querySelector('head')\n if (head) {\n const base = head.ownerDocument.createE...
javascript
chosen
[ { "from": "system", "value": "Rewrite Chrome injection script in ES6\n" }, { "from": "human", "value": "(function() {\r\n window.stop();\r\n\r\n var IS_LOCAL = false;\r\n var URL_OUT;\r\n var inject = new XMLHttpRequest();\r\n if (IS_LOCAL) {\r\n URL_OUT = chrome.extension....
javascript
chosen
[ { "from": "system", "value": "Implement service callback and set response\n" }, { "from": "human", "value": "AdminDashboardController.$inject = ['$rootScope', '$stateParams', 'sectionProjects'];\n\nfunction AdminDashboardController ($rootScope, $stateParams, sectionProjects) {\n\tconst vm = this...
javascript
chosen
[ { "from": "system", "value": "Add failing tests for enhance-collection\n" }, { "from": "human", "value": "import test from \"ava\"\n\nimport enhanceCollection from \"..\"\n\ntest(\"statinamic/lib/enhance-collection\", (t) => {\n\n const collec = [\n { k: \"ey\" },\n { k: \"ay\" },\n { ...
javascript
chosen
[ { "from": "system", "value": "Convert greeting bar to react-intl\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Message } from 'retranslate';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { Shimmer } from '../../...
javascript
chosen
[ { "from": "system", "value": "Add git workflow to change version script\n" }, { "from": "human", "value": "// Sepcific a new version, like 2.0.1 -> 2.0.2\n\nconst fs = require('fs')\n\nconst version = process.argv[2]\n\nif (!version) {\n throw Error('No version specified')\n}\n\n;['chrome/manif...
javascript
chosen
[ { "from": "system", "value": "Send page info to ga\n" }, { "from": "human", "value": "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.p...
javascript
chosen
[ { "from": "system", "value": "Add Hastings, New Zealand to cities list\n\n[#141865805]\n" }, { "from": "human", "value": "const CITY_DATA = [\n {\n \"name\": \"Urbana, Illinois\",\n \"lat\": 40.11,\n \"long\": -88.2\n },\n {\n \"name\": \"Washington, D.C.\",\n \"lat\": 38.54,\n...
javascript
chosen
[ { "from": "system", "value": "Fix insecure youtube embed url\n" }, { "from": "human", "value": "import React from 'react';\n\nconst caontinerStyle = {\n\tposition: 'relative',\n\tpaddingBottom: '56.25%', // 16:9\n\tpaddingTop: 25,\n\theight: 0\n};\n\nconst videoStyle = {\n\tposition: 'absolute',...
javascript
chosen
[ { "from": "system", "value": "Allow to override test client\n" }, { "from": "human", "value": "'use strict';\n\nrequire('../helper');\nvar assert = require('assert');\nvar appServer = require('../../app/server');\n\nfunction response(code) {\n return {\n status: code\n };\n}\n\nvar ...
javascript
chosen
[ { "from": "system", "value": "Add extension to URL() in Webpack 5 specific entry\n" }, { "from": "human", "value": "import * as pdfjs from 'pdfjs-dist/build/pdf';\n\nimport Document from './Document';\nimport Outline from './Outline';\nimport Page from './Page';\n\nimport { displayWorkerWarning ...
javascript
chosen
[ { "from": "system", "value": "Make Yeoman's greeting more cromulent.\n" }, { "from": "human", "value": "'use strict';\nvar yeoman = require('yeoman-generator');\nvar chalk = require('chalk');\nvar yosay = require('yosay');\n\nmodule.exports = yeoman.generators.Base.extend({\n prompting: functio...
javascript
chosen