conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "fix(print): Print out errors now uses right variable\n" }, { "from": "human", "value": "\n// Taken from https://muffinresearch.co.uk/removing-leading-whitespace-in-es6-template-strings/\nexport const singleLineString = (strings, ...values) => {\n let output = '';\n...
javascript
chosen
[ { "from": "system", "value": "Fix browserstack test failures. Old puppeteer is not supported anymore.\n" }, { "from": "human", "value": "import Client from '../../client.js';\nimport { enterJob } from '../../../utils/buildmessage.js';\nimport { ensureDependencies } from '../../../cli/dev-bundle-...
javascript
chosen
[ { "from": "system", "value": "Fix up use of spread in env\n" }, { "from": "human", "value": "import { spawn } from 'child_process'\nimport electron from 'electron-prebuilt'\nimport browserSync from 'browser-sync'\nimport browserSyncConnectUtils from 'browser-sync/lib/connect-utils'\n\nconst bsyn...
javascript
chosen
[ { "from": "system", "value": "Fix double encoding that would bork Bertly redirect\n" }, { "from": "human", "value": "'use strict';\n\nconst request = require('superagent');\nconst querystring = require('querystring');\n\nconst config = require('../../config/lib/bertly');\n\n/**\n * executePost -...
javascript
chosen
[ { "from": "system", "value": "Support additional `meteor rebuild` flags via environment variable.\n" }, { "from": "human", "value": "// Command-line arguments passed to npm when rebuilding binary packages.\nvar args = [\n \"rebuild\",\n\n // The --no-bin-links flag tells npm not to create syml...
javascript
chosen
[ { "from": "system", "value": "Update iframe url (the poor video was removed)\n" }, { "from": "human", "value": "import React from 'react';\nimport { storiesOf } from '@kadira/storybook';\nimport AspectRatio from '../index';\n\nimport '../../aspect-ratio.css';\n\nstoriesOf('AspectRatio', module)\...
javascript
chosen
[ { "from": "system", "value": "Tidy gulp screenshots import directives\n" }, { "from": "human", "value": "'use strict';\n\nimport debug from 'gulp-debug';\nimport gulp from 'gulp';\n// import phantom from 'phantomjs2';\nimport phantom from 'phantomjs';\nimport plumber from 'gulp-plumber';\nimport...
javascript
chosen
[ { "from": "system", "value": "Remove click on nav event\n1.move the event to hover in css\n" }, { "from": "human", "value": "$(document).ready(function() {\n $(\"#design ul\").hide();\n $(\"#design\").on('click', function(event) {\n event.preventDefault();\n /* Act on the eve...
javascript
chosen
[ { "from": "system", "value": "Add hash parameter to forge decrypt.\n" }, { "from": "human", "value": "var Algorithm = require(\"./abstract\")(\"RSA-OAEP\")\n , RSA = require(\"./shared/RSA\")\n , forge = require(\"node-forge\")\n , types = Algorithm.types\n , public = types....
javascript
chosen
[ { "from": "system", "value": "Add fields to the query\n\nAdded the fields which are then by default in the profile normalisation.\n" }, { "from": "human", "value": "// Load modules\n\nvar Crypto = require('crypto');\n\n\n// Declare internals\n\nvar internals = {};\n\n\nexports = module.exports =...
javascript
chosen
[ { "from": "system", "value": "Mark selection on the nav bar\n" }, { "from": "human", "value": "import React from 'react'\nimport {Link} from \"react-static\";\n\nclass NavBar extends React.Component {\n constructor (props) {\n super(props)\n }\n\n compareCurrentLocationWith(link) {\n re...
javascript
chosen
[ { "from": "system", "value": "Rename JS logger from admin to udata.js\n" }, { "from": "human", "value": "import Raven from 'raven-js';\nimport config from 'config';\n\nif (config.sentry) {\n const options = {\n logger: 'admin',\n release: config.sentry.release,\n tags: co...
javascript
chosen
[ { "from": "system", "value": "Fix bug with message about sending message to user\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar _ = require('lodash'),\n\terrorHandler = require('../errors.server.controller'),\n\tmongoose = require('mongoose'),\n\tpassp...
javascript
chosen
[ { "from": "system", "value": "IMPROVE change re-export to proper es6 syntax\n" }, { "from": "human", "value": "import State from './src/State';\nimport Observer from './src/Observer';\n\nexport {\n State,\n Observer\n};\n" }, { "from": "gpt", "value": "export { default as State } f...
javascript
chosen
[ { "from": "system", "value": "Fix an issue with the Jasmine log not outputting the full string.\n" }, { "from": "human", "value": "var vui = vui || {};\nvui.matchers = vui.matchers || {};\n\nvui.matchers.jasmine = {\n\ttoMatchRecordedObjectAt: function() {\n\t\treturn {\n\t\t\tcompare: function ...
javascript
chosen
[ { "from": "system", "value": "Disable typescript instrument on tests\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Task = require('../Task'),\n gulp = require('gulp'),\n mocha = require('gulp-mocha'),\n istanbul = require('gulp-istanbul'),\n isparta = require('isparta')...
javascript
chosen
[ { "from": "system", "value": "Stop message event fireing as much\n" }, { "from": "human", "value": "\n\nfunction change_chat_tabs() {\n console.log(\"Event\");\n inject_image('._d97');\n jq('._d97').each(function(){\n for (var i = 0; i < image_decoder.length; i++) {\n console.log('Che...
javascript
chosen
[ { "from": "system", "value": "Refactor for more general usability\n" }, { "from": "human", "value": "var sum = 1;\nvar currentNumber = 1;\n\nfor (var increment = 2; currentNumber < 1002001; increment += 2) {\n for (var counter = 0; counter < 4; counter++) {\n currentNumber += increment;\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing newline at EOF\n" }, { "from": "human", "value": "function precommit_noop(object)\n{\n return object;\n}\n\nfunction precommit_append_value(object)\n{\n upd_data = object.values[[0]].data + \"_precommit_hook_was_here\";\n object.values[[0]].data...
javascript
chosen
[ { "from": "system", "value": "Fix another timing issue in tests.\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar count = require('count-substring');\n\nmodule.exports = function (browser) {\n describe(\"The tests written in Elm\", function () {\n it('should...
javascript
chosen
[ { "from": "system", "value": "Add tests for get, post and delete\n" }, { "from": "human", "value": "import RailsRanger from '../../src/rails-ranger'\n\ndescribe('railsRanger', () => {\n describe('.get', () => {\n beforeEach(() => {\n spy(RailsRanger.client, 'get')\n })\n\n it('tri...
javascript
chosen
[ { "from": "system", "value": "Fix setting content version on admin page.\n" }, { "from": "human", "value": "/**\n * Copyright 2014 Ian Davies\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.\n *\n * You...
javascript
chosen
[ { "from": "system", "value": "Fix bug in from location\n" }, { "from": "human", "value": "(function() {\n var BackgroundGeo = function($q) {\n var from;\n\n current()\n .then(function(data){\n from = new google.maps.LatLng(data.latitude, data.longitude);\n });\n\n inst...
javascript
chosen
[ { "from": "system", "value": "Remove logging statements from global state.\n" }, { "from": "human", "value": "var state = { };\n\nconst setAppState = newState => {\n console.log(\"Pre merge app state is\", state, newState);\n state = { ...state, ...newState };\n console.log(\"App state is\", ...
javascript
chosen
[ { "from": "system", "value": "Add bindings for vs extension. if you open projcet, it should auto run watch command\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n grunt.loadNpmTasks(\"grunt-browserify\");\n grunt.loadNpmTasks(\"grunt-contrib-watch\");\n\n gru...
javascript
chosen
[ { "from": "system", "value": "Fix char counter when init one more time\n" }, { "from": "human", "value": "var locastyle = locastyle || {};\n\nlocastyle.charCounter = (function() {\n 'use strict';\n\n function updateCounter(index, count) {\n $('.ls-number-counter-'+index).text(count);\n }\n...
javascript
chosen
[ { "from": "system", "value": "Use english locale as fallback for date-time-pickers.\n" }, { "from": "human", "value": "$(document).ready(function () {\n var locale = 'en' !== LOCALE ? LOCALE : '';\n var options = $.extend({}, $.datepicker.regional[locale], $.timepicker.regional[locale], {\...
javascript
chosen
[ { "from": "system", "value": "Use jQuery chaining, you dolt.\n" }, { "from": "human", "value": "$(document).ready(function() {\n var id = location.pathname.split('/').slice(-1)[0];\n if (id) {\n $('#paste').show();\n $.get('get/' + id, function(entry) {\n $('#paste...
javascript
chosen
[ { "from": "system", "value": "Handle errors a little better\n" }, { "from": "human", "value": "var User = require('../lib/users');\nvar tasks = require('../lib/tasks');\nvar _ = require('lodash');\n\nmodule.exports = function (server) {\n \n server.post('/messages', function (req, res, next) {...
javascript
chosen
[ { "from": "system", "value": "Implement another test for callback from another thread\n" }, { "from": "human", "value": "const gi = require('../lib/')\nconst GLib = gi.require('GLib', '2.0')\nconst Gio = gi.require('Gio', '2.0')\nconst common = require('./__common__.js')\n\ngi.startLoop()\n\ncom...
javascript
chosen
[ { "from": "system", "value": "Improve code: Add semi-colon after closing curly-braces for functions.\n" }, { "from": "human", "value": "var portal = require('/lib/xp/portal'); // Import the portal functions\nvar thymeleaf = require('/lib/xp/thymeleaf'); // Import the Thymeleaf rendering function...
javascript
chosen
[ { "from": "system", "value": "Fix node and gyp disagreeing on Windows OS name 'win32' and 'win'\n" }, { "from": "human", "value": "module.exports = require('appjs-' + process.platform);\n\n\n" }, { "from": "gpt", "value": "var platforms = {\n\twin32: 'win',\n\tmac: 'mac',\n\tlinux: '...
javascript
chosen
[ { "from": "system", "value": "Fix error when request omits the required Host header\n" }, { "from": "human", "value": "var https = require('https');\nvar express = require('express');\n\nvar config = require('./config')\nvar log = require('./logger').cat('redirect');\n\nvar app = express();\n\nv...
javascript
chosen
[ { "from": "system", "value": "Fix linter warning in a test file\n\nWhen running tests locally, I noticed that eslint warned here. Using\nsingle quotes satisfies the linter in this case.\n" }, { "from": "human", "value": "var React = require('react/addons');\n\nReact.createElement(React.addons.CS...
javascript
chosen
[ { "from": "system", "value": "Add if statement to gruntifle for conditionally watching LESS\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(grunt)\n{\n grunt.loadNpmTasks('grunt-contrib-less');\n grunt.loadNpmTasks('grunt-contrib-coffee');\n grunt.loadNpmTasks('g...
javascript
chosen
[ { "from": "system", "value": "[BUGFIX] Add a missing 'use strict;' statement\n" }, { "from": "human", "value": "/**\n * Grunt-Contrib-copy\n * @description Copy files and folders.\n * @docs https://github.com/gruntjs/grunt-contrib-copy\n */\n\nvar config = require(\"../Config\"),\n\tcreateNodeMd...
javascript
chosen
[ { "from": "system", "value": "Sort now works with underscore js\n" }, { "from": "human", "value": "'use strict'\n\nvar app;\n\napp = angular.module('cloudStorm.resourceFilter', [])\n\napp.factory('csResourceFilter', function(){\n\n this.filter = function(array){\n return array.reverse()\n }...
javascript
chosen
[ { "from": "system", "value": "Update minimum recommended browser versions\n" }, { "from": "human", "value": "TC.Cfg.acceptedBrowserVersions = [\n {\n \"name\": \"Chrome\",\n \"version\": 63\n },\n {\n \"name\": \"Firefox\",\n \"version\": 57\n },\n {\n \"name\": \"IE\",\n ...
javascript
chosen
[ { "from": "system", "value": "Fix a few issues with the POST tests.\n" }, { "from": "human", "value": "var request = require('request'),\n should = require('chai').should(),\n muxamp = require('../lib/server').getApplication(),\n testutils = require('../lib/testutils'),\n pla...
javascript
chosen
[ { "from": "system", "value": "Add function to create server and exporting test client\n" }, { "from": "human", "value": "var restify = require('restify');\nvar knex = require('knex')({\n client: 'mysql',\n connection: {\n host : '127.0.0.1',\n user : 'root',\n password : 'root...
javascript
chosen
[ { "from": "system", "value": "Use a logger that uses jxcore.utils.console\n\nWe had sometimes issues with the logging that uses console.log in jxcore\nenvironment, which seem to be going away with jxcore.utils.console.\n" }, { "from": "human", "value": "'use strict';\n\nvar winston = require('wi...
javascript
chosen
[ { "from": "system", "value": "Put code where comment is\n" }, { "from": "human", "value": "'use strict';\nvar ensureDb = require('dbjs/valid-dbjs')\n , memoize = require('memoizee');\n\nfunction TypeMapper(db, customCatalogs) {\n\tthis.db = db;\n\tthis.customCatalogs = customCatalogs;\n}\n\nTyp...
javascript
chosen
[ { "from": "system", "value": "Add error handling to user events\n" }, { "from": "human", "value": "var express = require('express');\r\nvar DataStore = require('./regard-data-store.js');\r\n\r\nvar router = express.Router();\r\nvar dataStore = new DataStore('regard', 'website');\r\n\r\nrouter.ge...
javascript
chosen
[ { "from": "system", "value": "Refactor the KonamiCode example JS code by using early added method\n" }, { "from": "human", "value": "(function () {\n var codes = [\n 38, // up\n 38, // up\n 40, // down\n 40, // down\n 37, // left\n 39, // right\n 37, // left\n 39, // rig...
javascript
chosen
[ { "from": "system", "value": "Remove magic this from serie select\n" }, { "from": "human", "value": "var D3ChartSerieSelect = (function () {\n\n function setChartSerie(){\n this.updateChart();\n }\n\n function createOptions(){\n var html_options = [];\n this.options.forEach(function(...
javascript
chosen
[ { "from": "system", "value": "Compress CSS in production mode build\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = {\n options: {\n cleancss: \"<%= prod %>\",\n sourceMap: \"<%= !prod %>\"\n },\n all: {\n files: [{\n expand: true,\n cwd: \"src/less\"...
javascript
chosen
[ { "from": "system", "value": "Include api docs in index\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar fs = require(\"fs\")\n , path = require(\"path\")\n , docdir = path.resolve(__dirname, \"..\", \"doc\")\n\nconsole.log(\n \"npm-index(1) -- Index of all npm documentation\\n\" +...
javascript
chosen
[ { "from": "system", "value": "Change deprecated call to res.json(status, body)\n\nFixes #74\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n ExperimentSchema = mongoose.model('ExperimentSchema');\n\n/**\n * List of Ex...
javascript
chosen
[ { "from": "system", "value": "Remove bad default baselayer setting.\n" }, { "from": "human", "value": "module.exports = {\n 'port': 9000,\n 'UIPort': 9000,\n 'tile_hostnames': [],\n 'default_baselayer': 'control_room',\n 'tiles': __dirname + '/tiles',\n 'features': {\n '...
javascript
chosen
[ { "from": "system", "value": "Use cookieSession instead of normal sessions.\n" }, { "from": "human", "value": "var express = require('express')\n , http = require('http')\n , passport = require('passport')\n , path = require('path')\n , User = require('....
javascript
chosen
[ { "from": "system", "value": "Refactor findById to use angular filter.\n" }, { "from": "human", "value": "(function() {\n angular.module('notely.notes.service', [])\n .service('notes', notesService);\n\n notesService['$inject'] = ['$http'];\n function notesService($http) {\n var notes =...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded brackets from one-line if clause\n" }, { "from": "human", "value": "define(['jquery', 'underscore', 'backbone'],\nfunction($ , _ , Backbone ) {\n var BaseView = Backbone.View.extend({\n setActivePage: function(name) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add JQuery to collapse open menu when click off the menu\n" }, { "from": "human", "value": "//= require jquery\n//= require jquery_ujs\n//= require turbolinks\n//= require_tree .\n//= require bootstrap-sprockets\n\n$(document).ready(function(){\n\n\t$('.contact-arti...
javascript
chosen
[ { "from": "system", "value": "Disable DB Logging by Default" }, { "from": "human", "value": "var Sequelize = require('sequelize');\n\nvar sequelize = new Sequelize('jsfinance', 'root', 'stingray', {\n host: '127.0.0.1',\n port : 3306,\n dialect: 'mysql',\n\n pool: {\n max: 5,\n min: 0,...
javascript
chosen
[ { "from": "system", "value": "Use collectStyles function for server-side rendering of styles\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport Helmet from 'react-helmet'\nimport { ServerStyleSheet, StyleSheetManager } from 'styled-components'\n\nexport default f...
javascript
chosen
[ { "from": "system", "value": "Simplify initial exposed static class methods\n" }, { "from": "human", "value": "import CACHE from './cache';\nimport UTILS from './utils';\nimport Compiler from './compiler';\nimport Render from './render';\n\nfunction getTemplateContent(possibleSelectorOrHTMLOrNod...
javascript
chosen
[ { "from": "system", "value": "Add route and templateUrl to /notes/edit/:id\n" }, { "from": "human", "value": "// js/routes\n\n(function() {\n \"use strict\";\n\n angular.module(\"NoteWrangler\")\n .config(config);\n\n function config($routeProvider) {\n $routeProvider\n .when(\"/no...
javascript
chosen
[ { "from": "system", "value": "Use Github's cache, but store for offline access\n" }, { "from": "human", "value": "import Rx from 'rx';\nimport request from 'axios';\nimport moment from 'moment';\n\nconst INDEX_URL = \"http://tldr-pages.github.io/assets/index.json\";\n\nlet search = (name) => {\n...
javascript
chosen
[ { "from": "system", "value": "Include hash on file name\n" }, { "from": "human", "value": "// Licensed under the Apache License, Version 2.0 (the “License”); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the License at\n//\n// http://www.apache...
javascript
chosen
[ { "from": "system", "value": "Remove placeholder from tab history after close\n" }, { "from": "human", "value": "\nfunction nt (newtab) {\n\tfunction waitForURL(tabId, changeInfo, tab) {\n\t\tif (changeInfo.title === '@NewTab') {\n\t\t\tbrowser.storage.local.get('newtaburl').then(function (ntu) ...
javascript
chosen
[ { "from": "system", "value": "Update userservice for get users list and single user.\n\n– saas-103\n– Get user.\n– Get users list.\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n angular.module('ncsaas')\n .service('usersService', ['RawUser', 'RawKey', usersService]);\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix date output in category view\n\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { Link } from 'react-router-dom'\n\nconst capitalize = require('capitalize')\n\nclass Post extends Component {\n\n voteClicker(id, vote){\n thi...
javascript
chosen
[ { "from": "system", "value": "Add a comment about behaviour of delegated fns\n\n... inside of directives. Not entirely sure what's happening here.\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.confEditor').directive('confAdder', function() {\n return {\n rest...
javascript
chosen
[ { "from": "system", "value": "Return a valid JSON object for a valid XML presskit\n" }, { "from": "human", "value": "// Convert presskit() data.xml file into the new JSON format\n'use strict'\nvar fs = require('fs')\nvar xmlParser = require('xml2js').parseString\n\n// ---------------------------...
javascript
chosen
[ { "from": "system", "value": "Set log level from environment var\n" }, { "from": "human", "value": "const winston = require('winston');\n\nconst flatten = (arr) => arr.reduce((a, b) => (\n Array.isArray(b) ? a.concat(flatten(b))\n : a.concat(b)\n), []);\n\nconst logger = new winston.Logger({...
javascript
chosen
[ { "from": "system", "value": "Change precision semantics + add scale property\n" }, { "from": "human", "value": "import NumberType from './Number';\n\nclass FloatType extends NumberType {\n\n constructor() {\n super();\n }\n\n set precision(v: number): void {\n this.props.precision = v;...
javascript
chosen
[ { "from": "system", "value": "Adjust URLs relative to new SW location\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\"use strict\";\nconst fs = require(\"fs\");\nconst exec = require(\"child_process\").exec;\nconst fileName = \"src/js/mainSiteURLs.json\";\n\nfunction fileFinder(dir, p...
javascript
chosen
[ { "from": "system", "value": "Switch app updates to use React.render()\n" }, { "from": "human", "value": "import React from 'react';\nimport AppComponent from './components/app';\n\nlet tempY = 0;\n\nlet app = React.render(\n React.createElement( AppComponent, {history: true} ),\n document...
javascript
chosen
[ { "from": "system", "value": "Update user-user script to provide an implementation\n" }, { "from": "human", "value": " rec.name = \"UserUser\"\n rec.module = org.grouplens.lenskit.knn.user.UserRecommenderModule\n rec.module.knn.similarityDamping = 50\n rec.module.core.baseline = org.grouplens.le...
javascript
chosen
[ { "from": "system", "value": "Add the generator version of fs.stat\n" }, { "from": "human", "value": "/**\n * Utils for Node library\n */\nvar Node = {};\n\n/**\n * Generator version of the module 'fs'\n */\nvar fs = require('fs');\nNode.fs = {\n /**\n * Check if a path exists\n */\n ...
javascript
chosen
[ { "from": "system", "value": "Update points if we can, rather than redrawing the whole chart\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport charts from 'regard-highcharts';\n\nexport default Ember.Component.extend({\n draw: function (data, xAxisLabel, yAxisLabel) {\n v...
javascript
chosen
[ { "from": "system", "value": "Remove some single quotes from a key\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular.module('app.config')\n .config(navigation);\n\n /** @ngInject */\n function navigation(NavigationProvider) {\n NavigationProvider.configure({\...
javascript
chosen
[ { "from": "system", "value": "Fix Chrome bug causing HTML5 video requests to sometimes remain forever in the 'pending' state\n" }, { "from": "human", "value": "// Copyright 2014 The Oppia Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// ...
javascript
chosen
[ { "from": "system", "value": "Convert MediaQueryable to return component\n" }, { "from": "human", "value": "(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['React', 'MediaListener'], factory);\n } else if (typeof exports === 'object') {\n module....
javascript
chosen
[ { "from": "system", "value": "Change timeTaken to default of Not yet completed\n" }, { "from": "human", "value": "var mongoose = require(\"mongoose\");\nvar Schema = mongoose.Schema;\n\nvar applicantSchema = new Schema({\n name: {\n type: String,\n required: true\n },\n em...
javascript
chosen
[ { "from": "system", "value": "Return new instance of filter state.\n" }, { "from": "human", "value": "import Ember from 'ember'\nimport layout from '../templates/components/filter-facet'\nimport _ from 'lodash'\n\nfunction callIfDefined (context, functionName, ...args) {\n let func = context.ge...
javascript
chosen
[ { "from": "system", "value": "Update config to be compatible with new docker-compose\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/plmaccounts',\n app: {\n title: 'PLMAccounts - Development...
javascript
chosen
[ { "from": "system", "value": "Add a product page URI pattern\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Close ordered item page on Amazon.co.jp\n// @namespace curipha\n// @description Close ordered item page automatically\n// @include https://www.amaz...
javascript
chosen
[ { "from": "system", "value": "Add spacing to isNumeric function.\n" }, { "from": "human", "value": "/**\n * Utility function related to checking if a given value is numeric.\n *\n * Site Kit by Google, Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens...
javascript
chosen
[ { "from": "system", "value": "Allow Lady-In-Waiting to only target cards that can be duped (owned and controlled)\n" }, { "from": "human", "value": "const DrawCard = require('../../../drawcard.js');\n\nclass LadyInWaiting extends DrawCard {\n setupCardAbilities() {\n this.playAction({\...
javascript
chosen
[ { "from": "system", "value": "Remove angular module from global scope\n" }, { "from": "human", "value": "// (function() {\n var app = angular.module(\"vackerApp\", []);\n\n var YearController = function($scope, $http) {\n\n var onYearsComplete = function(response) {\n $sc...
javascript
chosen
[ { "from": "system", "value": "Add display to game plugin, add redraw method on gsman\n" }, { "from": "human", "value": "import GameStateManager from \"./GameStates/GameStateManager\";\n// import CommandParser from \"./Commands/CommandParser\";\nimport GenerateName from \"./Generators/NameGenerat...
javascript
chosen
[ { "from": "system", "value": "Add bandwidth and metered as well from connection\n" }, { "from": "human", "value": "/**\n\\file mobile.js\nPlugin to capture navigator.connection.type on browsers that support it\n*/\n\nBOOMR.addVar(\"mob.ct\", (typeof navigator === 'object' && navigator.connection...
javascript
chosen
[ { "from": "system", "value": "Update and fix external history plugin\n" }, { "from": "human", "value": "\"use strict\";\n\nwindow.arethusaInitPlugin('external_history', function() {\n /* global HistoryObj */\n var obj = {\n name: 'external_history',\n\n api: window.arethusaExternalApi(),...
javascript
chosen
[ { "from": "system", "value": "Stop iteration if callback returned false value\n" }, { "from": "human", "value": "module.exports = {\n iterate: iterate\n};\n\nvar iterableProperties = {\n 'body': true,\n 'expression': true,\n\n // if\n 'test': true,\n 'consequent': true,\n 'a...
javascript
chosen
[ { "from": "system", "value": "Add function for reading file as array buffer\n" }, { "from": "human", "value": "(function () {\n var ns = $.namespace('pskl.utils');\n\n var stopPropagation = function (e) {\n e.stopPropagation();\n };\n\n ns.FileUtils = {\n readFile : function (file, cal...
javascript
chosen
[ { "from": "system", "value": "Clean up input text component\n" }, { "from": "human", "value": "import React from 'react';\nimport DropdownList from 'react-widgets/lib/DropdownList';\nimport 'react-widgets/lib/scss/react-widgets.scss';\n\nexport const InputText = ({\n input, label, type, default...
javascript
chosen
[ { "from": "system", "value": "Update language for over view charts\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n $meta: 'English translation file',\n navigation: {\n overview: {\n $filter: 'role',\n district: 'District Performance',\n...
javascript
chosen
[ { "from": "system", "value": "Update concat test to use 'assert' module and test for new String behavior.\n" }, { "from": "human", "value": "(function () {\n \"use strict\";\n\n require('../lib/concat');\n\n var abc = new Buffer('abc'),\n def = new Buffer('def'),\n ghi = new Buffer('ghi...
javascript
chosen
[ { "from": "system", "value": "Add viewDoctor to scroll event.\n" }, { "from": "human", "value": "import inputData from './data.js';\nimport infiniteDivs from './lib.js';\n\nlet divArray = [];\nlet root = document.getElementById('root');\n\nfor (let value of inputData) {\n let div = document.cre...
javascript
chosen
[ { "from": "system", "value": "Use latest version of ES\n" }, { "from": "human", "value": "module.exports = {\n extends: ['paazmaya'],\n rules: {\n 'no-console': 0,\n 'no-process-exit': 0\n }\n};\n" }, { "from": "gpt", "value": "module.exports = {\n extends: ['paazmaya'],\n ...
javascript
chosen
[ { "from": "system", "value": "[chore] Move `sanity/typescript` before prettier extensions\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n parser: '@typescript-eslint/parser',\n globals: {\n __DEV__: true,\n },\n env: {\n node: true,\n browser: true,\n },\n s...
javascript
chosen
[ { "from": "system", "value": "Stop validation error notification stack\n\ncloses #3383\n- Calls closePassive() if a new validation error is thrown to display\nonly the latest validation error\n" }, { "from": "human", "value": "/* jshint unused: false */\r\nimport ajax from 'ghost/utils/ajax';\r\...
javascript
chosen
[ { "from": "system", "value": "Add animation to cold bacon text\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { Text, View, Image} from 'react-native';\nimport { StackNavigator } from 'react-navigation';\nimport styles from './styles/LaunchScreenStyle';\nimp...
javascript
chosen
[ { "from": "system", "value": "Add cheat mode numbers back to cells, fix mismatch in animation times\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { CSSTransitionGroup } from 'react-transition-group';\nimport './Cell.css';\n\nclass Cell extends Component {\n...
javascript
chosen
[ { "from": "system", "value": "Fix function name and add missing else block in HMAC.\n" }, { "from": "human", "value": "/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n * HMAC - keyed-Hash Message Authentication Code\n**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
javascript
chosen
[ { "from": "system", "value": "Test pane animation with custom component pushing\n" }, { "from": "human", "value": "enyo.kind({\n /*\n * name:\n * name of this \"kind\" (optionally namespaced with a .)\n */\n name: 'Slides.Main',\n /*\n * components:\n * Array of \"kind\" objects...
javascript
chosen
[ { "from": "system", "value": "Read a port from an environment\n" }, { "from": "human", "value": "import express from 'express'\n\nconst app = express()\napp.get('/', (request, response) => {\n response.send('Hello, world!')\n})\n\nconst port = 3000\napp.listen(port, () => {\n console.log(`app ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessarily specific null check\n" }, { "from": "human", "value": "(function($) {\n$(document).ready(function() {\n\n(function markEmailsAsReadOnOpen() {\n $(\".panel-info\").click(function() {\n var $el = $(this);\n if ($el.hasClass(\"panel-info\"))...
javascript
chosen
[ { "from": "system", "value": "feat: Add user-setting method that returns current currency name\n\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Service.extend({\n store: Ember.inject.service(),\n\n currency () {\n return this.get('store').findRecord('s...
javascript
chosen