conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove automatic localtunnel (crashes periodically)\n" }, { "from": "human", "value": "const CONFIG = {\n ports: {\n frontend: 8080,\n backend: 4900\n }\n};\n\n\nconst browserSync = require('browser-sync');\nconst ecstatic = require('ecstatic');\...
javascript
chosen
[ { "from": "system", "value": "Add alert class and make delay 2 seconds\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/ja...
javascript
chosen
[ { "from": "system", "value": "Make external api to a factory function\n" }, { "from": "human", "value": "\"use strict\";\n\nwindow.ArethusaExternalApi = (function () {\n var obj = {};\n\n obj.isArethusaLoaded = function() {\n try {\n angular.module('arethusa');\n } catch(err) {\n ...
javascript
chosen
[ { "from": "system", "value": "Set default values for data fields\n" }, { "from": "human", "value": "var os = require ('os');\nvar request = require ('request');\n\nvar HONEYBADGER_API_KEY = process.env.HONEYBADGER_API_KEY;\n\nexports.notify = function(data) {\n console.log(\"Exception: \" + dat...
javascript
chosen
[ { "from": "system", "value": "Fix unused webpack eslint error\n" }, { "from": "human", "value": "const webpack = require('webpack')\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\nconst WebpackOnBuildPlugin = require('on-build-webpack')\nconst replace = require('replace')\nconst path ...
javascript
chosen
[ { "from": "system", "value": "Use only one instance of mongo to create querys\n" }, { "from": "human", "value": "var database = require(\"../config/database\");\nvar pivotal = require(\"../libs/pivotal\");\nvar bcrypt = require('bcrypt');\nvar inspect = require('eyes').inspector({ stream: nu...
javascript
chosen
[ { "from": "system", "value": "Change level and experience to regular integers.\n" }, { "from": "human", "value": "module.exports = function(sequelize, DataTypes) {\n var User = sequelize.define('User', {\n username: {\n type: DataTypes.STRING,\n allowNull: false,\...
javascript
chosen
[ { "from": "system", "value": "Make sure to return promise created by pretask.\n\nAlso update exemple to fetch page title instead of url.\n" }, { "from": "human", "value": "module.exports = {\n run(context) {\n console.log('In pretask!!!');\n return context.runWithDriver((driver) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix property name with default value for colorLight" }, { "from": "human", "value": "import Ember from 'ember';\nimport QRCode from 'qrcode';\n\nexport default Ember.Component.extend({\n\n text: null,\n\n light: '#ffffff',\n\n colorDark: '#000000',\n\n width: 12...
javascript
chosen
[ { "from": "system", "value": "Implement XMPP get roster request\n" }, { "from": "human", "value": "'use strict';\n\nvar MessageProcessor = require('./../msg-processor'),\n settings = require('./../../config');\n\nmodule.exports = MessageProcessor.extend({\n\n if: function() {\n retu...
javascript
chosen
[ { "from": "system", "value": "Revert \"Converts the child with the type of number to string\"\n\nThis reverts commit e13e57750557263eff361f8127893139cf1535ac.\n" }, { "from": "human", "value": "const createElement = (nodeName, attributes, ...args) => {\n let children, i;\n\n for(i = 0; i < arg...
javascript
chosen
[ { "from": "system", "value": "Use .forEach() instead of a for loop for image handling.\n" }, { "from": "human", "value": "var chat = require('../lib/server'),\n\trouter = require(\"../lib/router\");\n\nvar chatServer = chat.createServer();\nchatServer.listen(8001);\nchatServer.addChannel({ baseP...
javascript
chosen
[ { "from": "system", "value": "Fix single quotes issues of Counter.js\n" }, { "from": "human", "value": "import React from 'react'\nimport Counter from '../Counter/Counter'\n\nconst Percent = ({value, total, label, icon, size, description=\"\"}) => {\n const percent = value ? Math.floor((value /...
javascript
chosen
[ { "from": "system", "value": "Clear out form field on submit.\n" }, { "from": "human", "value": "Template.showResponses.helpers({\n 'responses' : function () {\n Session.set('queryId', this._id);\n return Responses.find({queryId: this._id});\n }\n});\n\nTemplate.addResponse.e...
javascript
chosen
[ { "from": "system", "value": "Load size on right click\n" }, { "from": "human", "value": "$(document).ready(function() {\n // Allow all sortable rows to be sortable \n $(\".sortable\").sortable();\n // Disallow selection\n $(\".sortable\").disableSelection();\n\n $(document)...
javascript
chosen
[ { "from": "system", "value": "Disable admin page auto refresh\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('hornbyApp')\n .controller('HornbyAdminCtrl', function ($scope, $http, socket, $log) {\n\n var refreshMeasurements = function () {\n $http.get('/api/measureme...
javascript
chosen
[ { "from": "system", "value": "Make 'Add to your website' toggleable\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n\t$('#fileSharingSettings button.pop-up').click(function() {\n\t\tvar url = $(this).data('url');\n\t\tif (url) {\n\t\t\tvar width = 600;\n\t\t\tvar height = 40...
javascript
chosen
[ { "from": "system", "value": "Fix list of examples at ‘/examples.’\n" }, { "from": "human", "value": "/* eslint-disable no-console */\n\nimport React from 'react';\nimport request from 'superagent';\n\nimport JsonFormatter from './JsonFormatter';\nimport AttributesKit from '../../src';\n\n\nclas...
javascript
chosen
[ { "from": "system", "value": "Allow controller to have the same path\n" }, { "from": "human", "value": "const Router = use('core/router');\nconst Errors = use('core/errors');\n\nconst getHandlersDefinitions = require('./handlersDefinitions');\n\nconst con...
javascript
chosen
[ { "from": "system", "value": "Remove inaccurate DocBlock tag from function\n\n" }, { "from": "human", "value": "const chalk = require('chalk')\nconst exitWithError = require('./error')\nconst packageConfig = require('../package.json')\n\n/**\n * Sample program execution command used in error mes...
javascript
chosen
[ { "from": "system", "value": "Add link to classification details from item details\n\n" }, { "from": "human", "value": "import React from 'react'\nimport { connectFromRoute } from '../router-mapping'\nimport { sparqlConnect } from '../sparql/configure-sparql'\nimport { LOADING, LOADED, FAILED } ...
javascript
chosen
[ { "from": "system", "value": "Remove previous cheap hack by changing the 'key doesn't exist in map' logic from === 'undefined' to !== 'number'\n" }, { "from": "human", "value": "'use strict';\n\nvar markovDictionaryBuilder = (function() {\n\n\tfunction buildDict(wordSet, chainSize) {\n\n\t\tcons...
javascript
chosen
[ { "from": "system", "value": "Use dato data instead of contentful\n" }, { "from": "human", "value": "import React from 'react';\nimport Img from 'gatsby-image';\nimport { Container, Section, Title } from 'bloomer';\nimport Markdown from 'react-markdown';\n\nfunction SpeakerTemplate(props) {\n c...
javascript
chosen
[ { "from": "system", "value": "Make q variables local to function scope\n\nIn execute and nestedExecute functions, changed q variable to \"var q\" so that it's not in the global scope" }, { "from": "human", "value": "angular.module('ngCordova.plugins.sqlite', [])\n\n .factory('$cordovaSQLite', [...
javascript
chosen
[ { "from": "system", "value": "Make sure search supports capital letters\n" }, { "from": "human", "value": "function matchesSearch( searchString, location ) {\n if ( searchString.length < 2 ) return true;\n return ( ~ location.name.toLowerCase().indexOf( searchString ) || ~ location.address.toL...
javascript
chosen
[ { "from": "system", "value": "Add Month/Year selectors to default datetime widget\n" }, { "from": "human", "value": "jQuery( function($) {\n$(document).ready(function(){\n\t$('[datepicker=1]').datepicker({'dateFormat': window.jsi18n_bika('date_format_short_datepicker')});\n});\n});\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix typo in CSS class name\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport Alternative from './Alternative';\nimport css from './Alternatives.css';\n\nconst Alternatives = ({ disabled, alternatives, handleChange, selectedVote }) ...
javascript
chosen
[ { "from": "system", "value": "Fix user state in contact form\n" }, { "from": "human", "value": "// @flow\nimport * as React from 'react';\nimport { Route, Switch } from 'react-router-dom';\nimport ContactRoute from './ContactRoute';\nimport PageNotFoundRoute from '../pageNotFound/PageNotFoundRou...
javascript
chosen
[ { "from": "system", "value": "Deploy to GitHub pages [ci skip]\n" }, { "from": "human", "value": "export LogoIosApp from \"./logo-ios-app.svg\"\nexport LogoWhite from \"./logo-white.svg\"\n" }, { "from": "gpt", "value": "export LogoIosApp from \"./logo-ios-app.svg\"\nexport LogoWhite...
javascript
chosen
[ { "from": "system", "value": "Write ajax request in the pin js\n" }, { "from": "human", "value": "$(document).ready(function() {\n $(\"PLACE ON MAP\").on(\"click\", function(event){\n event.preventDefault()\n\n $.ajax({\n url: '/prototypes/' + id,\n type: 'get',\n })....
javascript
chosen
[ { "from": "system", "value": "Add male/female couple to the family constellation auto update scripts.\n" }, { "from": "human", "value": "exports.create = {\n\t'Family Constellation': [{\n\t\tfamilyConstellation: 'single male'\n\t}, {\t\n\t\tfamilyConstellation: 'single gay male'\n\t}, {\t\n\t\tf...
javascript
chosen
[ { "from": "system", "value": "Create story floating button is not shown if no contact is selected\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport CreateStoryButton from './CreateStoryButton'\nimport Story from './Story'\nimport reactCSS from 'reactcss'\n\nexpo...
javascript
chosen
[ { "from": "system", "value": "Add specific errors for get*Schema returning !200\n" }, { "from": "human", "value": "var request = require('request');\n\nmodule.exports = function(uri, serviceName, invokeUri){\n this.uri = uri;\n this.serviceName = serviceName;\n this.invokeUri = invokeUr...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Remove balanceId from ripple transactions table\n" }, { "from": "human", "value": "var dbm = require('db-migrate');\nvar type = dbm.dataType;\n\nexports.up = function(db, callback) {\n db.createTable('ripple_transactions', { \n\t\tid: { type: 'int', prima...
javascript
chosen
[ { "from": "system", "value": "Fix argument coercion in `query` to use `queryBuilder` if present.\n" }, { "from": "human", "value": "import Orbit from '../main';\nimport { assert } from '../lib/assert';\nimport { extend } from '../lib/objects';\nimport Query from '../query';\nimport Source from '...
javascript
chosen
[ { "from": "system", "value": "Fix bug of hatena star\n" }, { "from": "human", "value": "Hatena.Star.Token = '1509a63676578c07e2c82ee86c136049078c6565';\nHatena.Star.SiteConfig = {\n entryNodes: {\n 'article': {\n uri: 'h2 a',\n title: 'h2',\n container: 'h2'\n }\n }\n};\n"...
javascript
chosen
[ { "from": "system", "value": "Implement proposed changes + add `== null` check" }, { "from": "human", "value": "import store from '../../store';\n\nconst __ = store.getters[ 'localisation/__' ];\n\nexport default function (key, params) {\n if (!store.getters[ 'localisation/isInitialised' ]) {...
javascript
chosen
[ { "from": "system", "value": "Make splitVarName a static method\n" }, { "from": "human", "value": "const DocumentedItem = require('./item');\n\nclass DocumentedVarType extends DocumentedItem {\n\tregisterMetaInfo(data) {\n\t\tthis.directData = data;\n\t}\n\n\tserialize() {\n\t\tconst names = [];...
javascript
chosen
[ { "from": "system", "value": "Use intercept instead of callbacks on last commit\n" }, { "from": "human", "value": "module.exports = (function () {\n\n 'use strict';\n\n /** Delete cache entries\n *\n * @function\n * @description\n * @return void{}\n * @arg {Object} query - Optio...
javascript
chosen
[ { "from": "system", "value": "Reorganize the CreateServer to allow optimization.\n" }, { "from": "human", "value": "'use strict';\r\n\r\nvar NET = require('net');\r\nvar PORTS = {};\r\n\r\nfunction CreateServer(\r\n port,\r\n callback\r\n){\r\n \r\n if(\r\n (typeof port === 'number')\r\...
javascript
chosen
[ { "from": "system", "value": "Throw errors if either arg is wrong\n" }, { "from": "human", "value": "var async = require('async');\n\nvar DoWhen = function(obj, ev) {\n var objCallback,\n triggerCallbacks,\n args = null,\n callbacks = [];\n\n if (typeof(obj) == 'undefi...
javascript
chosen
[ { "from": "system", "value": "Remove js for removal button which is no longer displayed\n" }, { "from": "human", "value": "document.addEventListener(\"DOMContentLoaded\", function(event){\n\tvar editorContainer = document.querySelector(\"textarea#post-body\")\n\tvar containerStyle = getComputedS...
javascript
chosen
[ { "from": "system", "value": "Make sure we actually run JSCS..... @jwilsson\n" }, { "from": "human", "value": "module.exports = function( grunt ) {\n 'use strict';\n\n var srcFiles = [\n 'bot.js',\n '*.botplug.js',\n 'Gruntfile.js'\n ];\n\n grunt.initConfig({\n ...
javascript
chosen
[ { "from": "system", "value": "Enable SLURM allocation synchronization action.\n" }, { "from": "human", "value": "// @ngInject\nexport default function actionConfig(ActionConfigurationProvider, DEFAULT_EDIT_ACTION) {\n ActionConfigurationProvider.register('SLURM.Allocation', {\n order: [\n ...
javascript
chosen
[ { "from": "system", "value": "Update error message when flask sparql app does not work\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n function SparqlController($scope, AuthenticationService, SparqlService) {\n this.resultText = '';\n this.errorMessage = '';\n\n A...
javascript
chosen
[ { "from": "system", "value": "Resolve discrepancy in ES5/ES6 behavior by always casting to an object\n" }, { "from": "human", "value": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not u...
javascript
chosen
[ { "from": "system", "value": "Refactor spec for using should.\n" }, { "from": "human", "value": "import NullPiece from '../../../frontend/src/shogi/pieces/nullPiece';\nimport memo from 'memo-is';\nimport _ from 'lodash';\n\ndescribe('NullPiece', () => {\n describe('#constructor', () => {\n i...
javascript
chosen
[ { "from": "system", "value": "Add a working logout link and redirect to sign-up\n" }, { "from": "human", "value": "{\n angular\n .module('meganote.users')\n .directive('userLinks', [\n\n 'CurrentUser',\n (CurrentUser) => {\n\n class UserLinksController {\n user()...
javascript
chosen
[ { "from": "system", "value": "ADD : Dummy writing results\n" }, { "from": "human", "value": "'use strict'\n\nvar _ = require('lodash');\n\n\nfunction process(result){\nconsole.log(\"TODO\");\n}\n\nmodule.exports = {\n\tprocess : process\n}" }, { "from": "gpt", "value": "'use strict'\...
javascript
chosen
[ { "from": "system", "value": "Trim whitespace when comparing file equality in tests\n\nThis is needed because some operating systems add newlines at the end\nof generated files, and others do not.\n" }, { "from": "human", "value": "'use strict';\nvar expect = require('chai').expect;\nvar fs = re...
javascript
chosen
[ { "from": "system", "value": "Extend page_size on grantor lookup\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Controller.extend({\n store: Ember.inject.service(),\n contestSortProperties: [\n 'organizationKindSort',\n 'awardQualifier',\n 'award...
javascript
chosen
[ { "from": "system", "value": "Remove autocomplete from the legacy JS\n\nThis component is only used with the design system interface\n" }, { "from": "human", "value": "// This file is used as the root JS file for the govuk_admin_template\n// system aspects of Collections Publisher\n\n//= require...
javascript
chosen
[ { "from": "system", "value": "Fix misnamed variable for authChange observable\n" }, { "from": "human", "value": "export default {\n template: require('./layman-login.html'),\n bindings: {\n url: '=',\n },\n controller: function ($scope, HsCommonLaymanService) {\n 'ngInject';\n this....
javascript
chosen
[ { "from": "system", "value": "Make sure ProgressView still exists when animating width.\n" }, { "from": "human", "value": "Flame.ProgressView = Flame.View.extend({\n classNames: ['flame-progress-view'],\n\n value: null,\n maximum: null,\n animate: false,\n\n handlebars: function()...
javascript
chosen
[ { "from": "system", "value": "Add preventDefault argument for UpfCheckbox\n\n" }, { "from": "human", "value": "import Component from '@ember/component';\nimport { observer } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nexport default Component.extend({\n classNames:...
javascript
chosen
[ { "from": "system", "value": "Correct object call for clean urls\n" }, { "from": "human", "value": "var path = require('path');\nvar minimatch = require('minimatch');\n\nvar static = function (req, res, next) {\n var router = internals.router = req.ssRouter;\n \n if (req.ss.config.clean_urls ...
javascript
chosen
[ { "from": "system", "value": "PendingOwnerInviteRow: Convert `isAccepted/Declined` to tracked properties\n" }, { "from": "human", "value": "import Component from '@ember/component';\nimport { inject as service } from '@ember/service';\n\nimport { task } from 'ember-concurrency';\n\nexport defaul...
javascript
chosen
[ { "from": "system", "value": "Handle new AndroidManifest.xml location in cordova-android@^7.0.0\n" }, { "from": "human", "value": "module.exports = function(ctx) {\n var fs = ctx.requireCordovaModule('fs'),\n path = ctx.requireCordovaModule('path'),\n xml = ctx.requireCordovaMod...
javascript
chosen
[ { "from": "system", "value": "Increase font size in HyperTerm\n" }, { "from": "human", "value": "module.exports = {\n config: {\n // default font size in pixels for all tabs\n fontSize: 12,\n\n // font family with optional fallbacks\n fontFamily: 'Hasklig, Menlo, \"DejaVu Sans Mono\...
javascript
chosen
[ { "from": "system", "value": "Remove old, problematic linkifying methods\n" }, { "from": "human", "value": "function msToTime(ms) {\n\tvar d = new Date(ms),\n\t\th = d.getHours(),\n\t\tm = d.getMinutes();\n\th = h < 10 ? \"0\" + h : h;\n\tm = m < 10 ? \"0\" + m : m;\n\n\treturn h + \":\" + m;\n}...
javascript
chosen
[ { "from": "system", "value": "Fix ember-table column definition importing\n" }, { "from": "human", "value": "import EmberTableColumnDefinition from '../column-definition';\nimport ListFormPageController from '../controllers/list-form-page';\n\nexport default ListFormPageController.extend({\n _c...
javascript
chosen
[ { "from": "system", "value": "Use === instead of ==\n" }, { "from": "human", "value": "Template.registerHelper('isEmpty', function(collection) {\n return collection.count() == 0;\n});\n\n// Just a cosmetic change - when logging out, route to '/'.\nTemplate._loginButtons.events({\n\t'click #logi...
javascript
chosen
[ { "from": "system", "value": "Fix stop description generator using route destination (api)\n" }, { "from": "human", "value": "const _ = require('lodash');\n\nconst db = require('../../db.js');\n\nmodule.exports = async () => {\n\tconst stops = await db.query(`\n\t\tSELECT stop_id, GROUP_CONCAT(t...
javascript
chosen
[ { "from": "system", "value": "Move key definition into pmore.trigger\n" }, { "from": "human", "value": "var Viewer = {\n\t/**\n\t * Scroll to specified position.\n\t * \n\t * @param {string} type \"frame\", \"line\", or \"page\".\n\t * @param {int} number The offset or the index of destinati...
javascript
chosen
[ { "from": "system", "value": "Fix return messages to be limited\n" }, { "from": "human", "value": "/* globals module Promise */\n\n'use strict';\n\nmodule.exports = function ({ models }) {\n const {\n Message\n } = models;\n \n return {\n createMessage(message) {\n let messageMode...
javascript
chosen
[ { "from": "system", "value": "Fix the initial factionId bug\n" }, { "from": "human", "value": "import { List } from 'immutable';\nimport { Reducer } from 'flux-reducer';\nimport factions from '../models/faction';\n\nexport default class ShipInputReducer extends Reducer({\n shipName: '',\n fact...
javascript
chosen
[ { "from": "system", "value": "Fix cose options in demo\n" }, { "from": "human", "value": "Promise.all([\n fetch('cy-style.json', {mode: 'no-cors'})\n .then(function(res) {\n return res.json()\n }),\n fetch('data.json', {mode: 'no-cors'})\n .then(function(res) {\n return res....
javascript
chosen
[ { "from": "system", "value": "Fix production build for rails-ujs.\n" }, { "from": "human", "value": "import '../font_awesome_icons';\nimport '../reports';\nimport dataTablesInit from 'datatables.net';\nimport dataTablesBs5Init from 'datatables.net-bs5';\nimport Rails from 'rails-ujs';\nimport $ ...
javascript
chosen
[ { "from": "system", "value": "Use import instead of System.import\n" }, { "from": "human", "value": "import global from 'global';\nimport '../../shared/regenerator';\n\nexport default function loadPolyfills() {\n const promises = [];\n\n if (!global.Intl) {\n promises.push(\n System.im...
javascript
chosen
[ { "from": "system", "value": "Use two values in the state for editor & frameList\n\nThis reduces confusion between what is currently rendering.\n This will avoid duck type checks in the view and allow the\n rendering wrapper to have a slightly different container\n for each type of widget.\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Send bbox for Point features\n" }, { "from": "human", "value": "var mongoose = require('mongoose'),\n _ = require('cloneextend'),\n adHocModels = {};\n\n\nvar adHocModel = function(collectionName, Schema, options) {\n if (!adHocModels[collectionName]) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use explicit addEventListener instead of onclick\n" }, { "from": "human", "value": "/* -------------------------------------------------------------------------- *\\\n JavaScript for animated navigation bar\n -----------------------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Fix slide deck store slide adding & - activation.\n" }, { "from": "human", "value": "export default {\n state: {\n slides: [],\n activeSlideId: 0,\n activeSlide: {},\n },\n activateSlide: function activateSlide(slideId) {\n if (this.state.slides[slide...
javascript
chosen
[ { "from": "system", "value": "Change the way to find a store saved\n\nSigned-off-by: Aitor Magán <a93a7d273b830b2e8a26461c1a80328a1d7ad27a@conwet.com>\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2015, CoNWeT Lab., Universidad Politécnica de Madrid\n * Code licensed under BSD 3-Cla...
javascript
chosen
[ { "from": "system", "value": "Refactor test to use assert.deepEqual for arrays\n" }, { "from": "human", "value": "\r\nvar simpleturing = require('../'),\r\n assert = require('assert');\r\n\r\nvar machine = simpleturing('s0', {\r\n\t's0': {\r\n\t\t0: [0, 's0', 1],\r\n\t\t1: [0, 's1', 1]\r\n\t}...
javascript
chosen
[ { "from": "system", "value": "Remove unused import breaking build\n" }, { "from": "human", "value": "var webpack = require('webpack');\n\nmodule.exports = {\n node: {\n // Enable dirname and filename so we can link back to the GitHub source\n __filename: true,\n __dirname: true\n },\n...
javascript
chosen
[ { "from": "system", "value": "Remove sync io from tests.\n" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('chai').assert,\n fs = require('fs'),\n hartopage = require('../lib/index');\n\ndescribe('index', function() {\n\n describe('#redirecting', function() {\n var h...
javascript
chosen
[ { "from": "system", "value": "Fix ExactlyXCard Selector pretarget bug\n" }, { "from": "human", "value": "const BaseCardSelector = require('./BaseCardSelector.js');\n\nclass ExactlyXCardSelector extends BaseCardSelector {\n constructor(numCards, properties) {\n super(properties);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add listener for hardware back button\n" }, { "from": "human", "value": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n */\n'use strict';\nimport React, {\n AppRegistry,\n Component,\n StyleSheet\n} from 'react-native';\n\nimport R...
javascript
chosen
[ { "from": "system", "value": "Convert all strings/chars to Ints\n" }, { "from": "human", "value": "export const myMax = (list) => {\n return Math.max(...list);\n};\n\nconst vowels = 'aeiouyAEIOUY';\n\nexport const vowelCount = (string) => {\n let count = 0;\n\n for (const c of string) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix Editor Save Button not allowing unpublish\n\nCloses #2918\n" }, { "from": "human", "value": "/* global console */\n\nvar EditorControllerMixin = Ember.Mixin.create({\n //## Computed post properties\n isPublished: Ember.computed.equal('status', 'published')...
javascript
chosen
[ { "from": "system", "value": "Revert \"Added \"condition\" property and clearAllFormData()\"\n\nThis reverts commit 77e70b36553e8a334c246608413a4ef69009897a.\n" }, { "from": "human", "value": "//\n// schema.js\n//\napp.schema = function()\n{\n\t// public methods\n\tfunction user(email, password)...
javascript
chosen
[ { "from": "system", "value": "Revert rename of webpack config in test file\n" }, { "from": "human", "value": "import 'babel-polyfill';\nimport {Jasmine} from 'pui-react-tools';\nimport devWebpack from './webpack.config.babel';\n\nprocess.env.NODE_ENV = process.env.NODE_ENV || 'development';\n\nJ...
javascript
chosen
[ { "from": "system", "value": "Add support for arg \"body\" in rpc method proxy/requests\n" }, { "from": "human", "value": "// Requires\nvar Q = require('q');\nvar _ = require('underscore');\nvar request = require('request');\n\nfunction ProxyRPCService() {\n _.bindAll(this);\n}\n\n\n\nProxyRP...
javascript
chosen
[ { "from": "system", "value": "Set user service to always create a display name if one is not supplied\n" }, { "from": "human", "value": "'use strict';\n\nconst bcrypt = require('bcrypt-nodejs');\n\nclass UsersService {\n constructor(options, usersRepository) {\n const self = this;\n self....
javascript
chosen
[ { "from": "system", "value": "Make sure the stage is always set to appropriate smoothed value.\n" }, { "from": "human", "value": "/** @constructor */\nPuzL.GameScreen = function( game )\n{\n this.gameShell = null;\n this.parentScreen = null;\n};\n//window['GameScreen'] = PuzL.GameScreen;\n\...
javascript
chosen
[ { "from": "system", "value": "[CB-595] Check that Cordova global exists (for now, until we axe it)\n" }, { "from": "human", "value": "describe('Platform (cordova)', function () {\n it(\"should exist\", function() {\n expect(cordova).toBeDefined();\n });\n describe('Platform (Cord...
javascript
chosen
[ { "from": "system", "value": "Add pre and post run functions (needs cleanup).\n" }, { "from": "human", "value": "var path = require('path')\n , fs = require('fs')\n , TOML = require('toml')\n , bundles = require('./bundles')\n , useIfAvailable = require('./utils/useifavailable');\n\n\nfuncti...
javascript
chosen
[ { "from": "system", "value": "Use new bucket that has properly sized SVG assets\n" }, { "from": "human", "value": "import React from \"react\"; // eslint-disable-line no-unused-vars\n\nclass CountryMap extends React.Component {\n constructor(props) {\n super(props);\n this.state = { SVG: ...
javascript
chosen
[ { "from": "system", "value": "Add ability to convert JS interpolater to an array\n\nThis is used when writing interpolator values to the python server\n" }, { "from": "human", "value": "class Interpolator {\n constructor() {\n this.data = [];\n }\n\n addIndexValue(index, value) {...
javascript
chosen
[ { "from": "system", "value": "Increase update time for compliments.\n" }, { "from": "human", "value": "var config = {\n lang: 'nl',\n time: {\n timeFormat: 12\n },\n weather: {\n //change weather params here:\n //units: metric or imperial\n params: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add toggle view of the comments of a question\n" }, { "from": "human", "value": "$(document).ready(function() {\n $(\"comment\").hide\n $(\".question\").on(\"click\" function(event){\n event.preventDefault();\n\n\n })\n});\n" }, { "from": "gpt", "v...
javascript
chosen
[ { "from": "system", "value": "Fix typo of magic point model\n" }, { "from": "human", "value": "function filter(v, min, max) {\n v = Math.min(v, max);\n v = Math.max(v, min);\n return v;\n}\n\nclass MagicPoint {\n constructor(current, max) {\n this.max = max;\n this.min ...
javascript
chosen
[ { "from": "system", "value": "Add unit test for the internal state after removing controls\n" }, { "from": "human", "value": "describe('Creating custom map controls', function () {\n var map;\n\n beforeEach(function() {\n map = map || new GMaps({\n el : '#basic-map',\n lat: -12.04...
javascript
chosen
[ { "from": "system", "value": ":art: Make manifestPath search two level up\n" }, { "from": "human", "value": "'use strict'\n\n/* @flow */\n\nimport Path from 'path'\nimport FS from 'fs'\n\nexport function exists(path: string): Promise<boolean> {\n return new Promise(function(resolve) {\n FS.a...
javascript
chosen
[ { "from": "system", "value": "Rename UMD build product to `ngx-restangular` (to match `package.json`)\n" }, { "from": "human", "value": "'use strict';\n\nconst nodeExternals = require('webpack-node-externals');\n\nmodule.exports = {\n entry: './src/index.ts',\n output: {\n path: __dirname +...
javascript
chosen
[ { "from": "system", "value": "Change setUser() argument in CardController\n" }, { "from": "human", "value": "\n// ----------------------------------------------------------------\n// Card Class\n\nclass CardModel extends SwitchModel {\n constructor({\n name,\n lsKeyView,\n triggerSelec...
javascript
chosen
[ { "from": "system", "value": "refactor: Use raw console.log in win32 platform\n\n#169\n" }, { "from": "human", "value": "const Logger = require('chalklog');\nconst parrotSay = require('parrotsay-api');\n\nfunction createLogger(scope) {\n const logger = new Logger(scope);\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Add different api urls for staging and production\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('myApp.apiService', [])\n .factory('Api', ['$http',\n function ($http) {\n return {\n login: function(user, onSuccess, ...
javascript
chosen
[ { "from": "system", "value": "Remove warning on deprecated mui typography variants\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Router } from 'react-router';\nimport createBrowserHistory from 'history/createBrowserHistory';\n\nimport ...
javascript
chosen