conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Comment out import of basic interaction module\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport BasicInteraction from './BasicInteraction'\n\nexport default class ActivityFeed extends Component {\n constructor(props) {\n super(...
javascript
chosen
[ { "from": "system", "value": "Fix example server to grab config from test/config instead of test/data\n" }, { "from": "human", "value": "\n/**\n * Module dependencies.\n */\n\nvar express = require('express');\nvar WPCOM = require('../../');\n\n/**\n * wpcon app data\n */\n\nvar wpapp = require(...
javascript
chosen
[ { "from": "system", "value": "Update test runner to accept a single file.\n\n On branch mixins\n\tmodified: management/run_tests.js\n" }, { "from": "human", "value": "var NFS = require('fs')\n , NPATH = require('path')\n\n , NODEUNIT = require('nodeunit')\n\n , testPath = NPATH.resolve(proc...
javascript
chosen
[ { "from": "system", "value": "Revert \"updated MongoDB connection url\"\n\nThis reverts commit ff376619996ac5a04489440932dbbe2b2b0ffa43.\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar mongoUrl;\n\nif (process.env.NODE_ENV === 'production') {\n mongoUrl = process.e...
javascript
chosen
[ { "from": "system", "value": "Remove options from service usage\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst program = require(\"commander\");\nconst _ = require(\"lodash\");\nconst utils = require(\"./utils\");\nconst cwd = process.cwd();\n\nprogram\n .usage(\"<service-nam...
javascript
chosen
[ { "from": "system", "value": "Allow empty model value for color inputs\n" }, { "from": "human", "value": "angular.module('anol.featurestyleeditor')\n\n.directive('color', function() {\n var COLOR_REGEX = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/;\n return {\n require: 'ngModel',\n ...
javascript
chosen
[ { "from": "system", "value": "Add full url in js to get graph.\n" }, { "from": "human", "value": "$(document).ready(function(){\n var graph = Graph ();\n\n function getGraph(url, btnLoading) {\n $(\"#graph\").html(\"\");\n url = url ? url : \"/graph\";\n $('#graph-loading')....
javascript
chosen
[ { "from": "system", "value": "Prepare logic to translate english data to supported languages\n" }, { "from": "human", "value": "const promise = require(\"bluebird\");\nconst { SUPPORTED_LANGUAGES } = require(\"./../constants.js\");\nconst { find } = require(\"lodash\");\nconst options = {\n // ...
javascript
chosen
[ { "from": "system", "value": "Move dependencies into their own bundle to improve caching\n" }, { "from": "human", "value": "var path = require('path')\n\nmodule.exports = {\n entry: {\n app: './src/main.js',\n },\n output: {\n path: path.resolve(__dirname, '../dist'),\n ...
javascript
chosen
[ { "from": "system", "value": "Structure de la function principal\n" }, { "from": "human", "value": "/**\n * jQuery Async Me\n * Un plug-in jQuery pour charger de manière asynchrone vos contenu multimédia.\n * http://github.com/Jok3rDev/async-me\n *\n * Licensed under the MIT license.\n * Copyrig...
javascript
chosen
[ { "from": "system", "value": "Fix windows build by replacing back to forward slashes in icon paths.\n" }, { "from": "human", "value": "import fs from 'fs';\nimport rrs from 'recursive-readdir-sync';\n\nconst outArray = [];\nconst svgIconPath = 'src/svg-icons/';\n\nrrs(svgIconPath).forEach((file)...
javascript
chosen
[ { "from": "system", "value": "Update tests with diacritical cases\n" }, { "from": "human", "value": "const expect = require('chai').expect;\nconst path = require('path');\nconst _ = require(path.join(__dirname, '../../dist/lodash-addons'));\n\ndescribe('slugify', function() {\n it('exists', f...
javascript
chosen
[ { "from": "system", "value": "Use test helpers in InputObjectValuesAreCamelCased tests\n" }, { "from": "human", "value": "import assert from 'assert';\nimport { parse } from 'graphql';\nimport { validate } from 'graphql/validation';\nimport { buildASTSchema } from 'graphql/utilities/buildASTSche...
javascript
chosen
[ { "from": "system", "value": "Add message to logged-out homescreen\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { connect } from 'react-redux';\n\nclass Home extends Component {\n render () {\n return (\n <div>\n {this.props.error && (\n ...
javascript
chosen
[ { "from": "system", "value": "Fix math tests to testacular main require.js file\n\nrherlitz/GooEngine#52\n" }, { "from": "human", "value": "require.config({\n paths: {\n \"goo\": \"src/goo\",\n \"test\": \"test\"\n },\n waitSeconds: 5\n });\nrequire([\n 'test/mathTest'...
javascript
chosen
[ { "from": "system", "value": "Add Data Hub header colours\n" }, { "from": "human", "value": "/**\n * Convert a color hex to an rgb value\n *\n * Note that this currently only works with 6 digit hexes.\n */\nexport const hexToRgb = (colorHex) => {\n const colorValue = parseInt(colorHex.replace('...
javascript
chosen
[ { "from": "system", "value": "Fix missing default empty options\n" }, { "from": "human", "value": "module.exports = client => async (key, get, options) => {\n if ((typeof options === 'object' && options.asSeconds) || typeof options === 'number') {\n options = { expire: options };\n }\n if ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with creating new document\n" }, { "from": "human", "value": "import React from \"react\";\nimport styled from \"styled-components\";\nimport AddIcon from \"@atlaskit/icon/glyph/add\";\nimport ListIcon from \"@atlaskit/icon/glyph/list\";\nimport Button, { ...
javascript
chosen
[ { "from": "system", "value": "Clear autofill when leaving /new form\n" }, { "from": "human", "value": "import React from 'react';\nimport Helmet from 'react-helmet';\nimport { connect } from 'react-redux';\nimport { clearPetition } from 'actions/PetitionActions';\nimport { clearSuggestionInputVa...
javascript
chosen
[ { "from": "system", "value": "Use /start command as login and use proper webhook remover function\n" }, { "from": "human", "value": "const Telegraf = require('telegraf');\nconst commandParts = require('telegraf-command-parts');\nconst cfg = require('../config');\nconst commander = require('./com...
javascript
chosen
[ { "from": "system", "value": "Fix <EditableBasicRow> isn't exported to bundle\n" }, { "from": "human", "value": "import './styles/index.scss';\n\n// Visual elements\nimport BasicRow from './BasicRow';\nimport Icon from './Icon';\nimport StatusIcon from './StatusIcon';\nimport Tag from './Tag';\n...
javascript
chosen
[ { "from": "system", "value": "Remove acorn from destructuring (N/A)" }, { "from": "human", "value": "import 'better-log/install';\n\nmodule.exports = function ({ Plugin, acorn, types: t }) {\n\treturn new Plugin('hello-world', {\n\t\tvisitor: {\n\t\t\tProgram(node, parent, scope, file) {\n\t\t\t...
javascript
chosen
[ { "from": "system", "value": "Fix issues with the deprecated `chrome.app`\n" }, { "from": "human", "value": "var formatLocale = require('./utils').formatLocale\n\nfunction getLocale(locale) {\n if (locale) return locale\n\n if (global.Intl && typeof global.Intl.DateTimeFormat === 'function') {...
javascript
chosen
[ { "from": "system", "value": "Update adapter factory to throw if no storage is given.\n" }, { "from": "human", "value": "/**\n * External imports\n */\nimport libdebug from 'debug';\n\n// create debug logger\nconst debug = libdebug('storage-adapter');\n\nconst PROTOTYPE = {\n find() {},\n};\n\n...
javascript
chosen
[ { "from": "system", "value": "Set up indexing for data events.\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\n// A data event holds an object that represents the event.\n// There are many possible properties for it, besides custom ones....
javascript
chosen
[ { "from": "system", "value": "Fix PM2 start commands for next-scripts\n" }, { "from": "human", "value": "module.exports = {\n /**\n * Application configuration section\n * http://pm2.keymetrics.io/docs/usage/application-declaration/\n */\n apps: [\n {\n name: 'SMTHOME-APP',\n ...
javascript
chosen
[ { "from": "system", "value": "Change html and event listeners for translated text\n" }, { "from": "human", "value": "//returns rendered template\nvar MessageView = Backbone.View.extend({\n className: 'message-display',\n\n template : _.template(\n '<span>'+\n '<img src=\"client/images/...
javascript
chosen
[ { "from": "system", "value": "Make expand hints underline on mouseenter\n" }, { "from": "human", "value": "function expandInfo(elem) {\n $(elem).children('.section-expand-hint').slideUp();\n $(elem).children('.section-hidden-text').slideDown();\n}\n\nfunction retractInfo(elem) {\n $(ele...
javascript
chosen
[ { "from": "system", "value": "Make String polyfills configurable and writable\n\nThis prevents breakage when used with other shims, and more closely follows the ECMAScript specification. Fixes #487." }, { "from": "human", "value": "// String.startsWith polyfill\nif (! String.prototype.startsWith...
javascript
chosen
[ { "from": "system", "value": "chore(gulp): Add component's js files to watched files for hologram\n\nsince we now have react examples in their respective js files\n" }, { "from": "human", "value": "import gulp from 'gulp';\nconst runSequence = require('run-sequence').use(gulp);\n\ngulp.task('set...
javascript
chosen
[ { "from": "system", "value": "Change error message in Transction constructor\n\nThe Error messages no lists the valid keys instead\nof the valid values.\n" }, { "from": "human", "value": "import TransactionTypes from '../constants/TransactionTypes';\n\nconst validTypes = Object.values(Transactio...
javascript
chosen
[ { "from": "system", "value": "test: Use mongodb on localhost under CI\n\nOverride default (which is loopbackrc) to use mongodb instance on\nlocalhost when running under CI (Jenkins or Travis).\n" }, { "from": "human", "value": "module.exports = require('should');\n\nvar DataSource = require('loo...
javascript
chosen
[ { "from": "system", "value": "Add actual setting of new json\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\nimport moment from 'moment';\nimport french from 'moment/locale/fr';\nimport english from 'moment/locale/en-nz';\n\nimport {\n au...
javascript
chosen
[ { "from": "system", "value": "Test now passing when parameters filled in\n" }, { "from": "human", "value": "var UA = require(\"../lib/urban-airship\"),\n\tua = new UA(\"<api key>\", \"<api secret key>\", \"<api master key>\");\n\nvar payload0 = {\n\t\"device_tokens\": ['device_id(s)'],\n\t\"aps\...
javascript
chosen
[ { "from": "system", "value": "Add unittests for code heatmap rendering.\n" }, { "from": "human", "value": "var code_heatmap = require('./code_heatmap.js');\n\ndescribe('Code heatmap test suite', function() {\n\n});\n" }, { "from": "gpt", "value": "var code_heatmap = require('./code_h...
javascript
chosen
[ { "from": "system", "value": "Define $ and jQuery globally, as they used to be.\n\nFixes #5819.\n" }, { "from": "human", "value": "exports.$ = exports.jQuery = require(\"./jquery.js\");\n" }, { "from": "gpt", "value": "var jQuery = require(\"./jquery.js\");\nvar global = this;\n\n// ...
javascript
chosen
[ { "from": "system", "value": "Use tag instance variable; add query keywords: tag\n" }, { "from": "human", "value": "Template.taggedCourses.onCreated(function(){\n // Get reference to template instance\n var instance = this;\n\n // Accessing the Iron.controller to invoke getParams method of Ir...
javascript
chosen
[ { "from": "system", "value": "Remove `inverted` prop and conditional CSS class name\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport Box from '../box';\nimport cx from 'classnames';\nimport theme from './theme.css';\n\n...
javascript
chosen
[ { "from": "system", "value": "Use a better doc format\n" }, { "from": "human", "value": "/**\n Symbols Index\n @description provides the symbols used by the middleware\n @exports {symbol} RemoteResource\n @default\n**/\n\nconst Symbol = require('core-js/library/fn/symbol');\n\nconst RemoteRe...
javascript
chosen
[ { "from": "system", "value": "Set register route as public\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = function(){\n\n var user = new app.controllers.user();\n\n return [\n {\n method: 'get',\n url: '/users',\n action: user...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary use of underscore\n\nIt's clearer to just use the map function on an array directly, since\nit's always there in node.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar util = require('util');\nvar _ = require('underscore');\nvar validate ...
javascript
chosen
[ { "from": "system", "value": "Replace storybook-state usage from qTip story with useState\n" }, { "from": "human", "value": "import React from 'react';\nimport { addStoryInGroup, MID_LEVEL_BLOCKS } from '../../../.storybook/utils';\nimport { Store, State } from '@sambego/storybook-state';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Fix webpack server for uri containing /\n" }, { "from": "human", "value": "const path = require('path');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst HtmlWebpackPluginConfig = new HtmlWebpackPlugin({\n template: './src/index.html',\n filen...
javascript
chosen
[ { "from": "system", "value": "Enable development mode and source maps for webpack\n" }, { "from": "human", "value": "module.exports = {\n entry: './src/app.js',\n output: {\n path: __dirname + '/dist',\n filename: 'bundle.js'\n },\n module: {\n rules: [\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the provided value dist/umd is not an absolute path\n" }, { "from": "human", "value": "// UMD config\n\nconst path = require('path')\nconst webpack = require('webpack')\n\nmodule.exports = {\n devtool: 'source-map',\n entry: {\n 'js-search': './source/index...
javascript
chosen
[ { "from": "system", "value": "Fix linter issues in webpack file\n" }, { "from": "human", "value": "/* eslint no-use-before-define: 0 */\nvar path = require('path');\n\nmodule.exports = {\n entry: './src/Native/HMAC.pack.js',\n output: {\n filename: 'HMAC.out.js',\n path: path...
javascript
chosen
[ { "from": "system", "value": "Use UMD for CLI; fix\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst jsf = require('../dist/bundle.js');\n\n// FIXME: load faker/change on startup?\n\nconst sample = process.argv.slice(2)[0];\n\nconst { inspect } = require('util');\nconst { Transform...
javascript
chosen
[ { "from": "system", "value": "ui: Use 'jQuery' instead of '$'\n" }, { "from": "human", "value": "var app = angular.module('hadtodoApp', ['satellizer']);\n\napp.controller('AppCtrl', ['$scope', function ($scope) {\n $scope.initNavbar = function () {\n $('.dropdown').dropdown({\n ...
javascript
chosen
[ { "from": "system", "value": "Implement a create function that allows creating a customized module\n" }, { "from": "human", "value": "define(['knockout', 'jquery'], function (ko, $) {\n var getContext = function (elementAccessor) {\n var context;\n var element;\n\n if (!elementAccessor...
javascript
chosen
[ { "from": "system", "value": "Change the colour of the key to reflect model state\n" }, { "from": "human", "value": "var app = app || {};\n\napp.KeyView = app.SvgBackboneView.extend({\n tagName: 'rect',\n\n className: 'white key',\n\n initialize: function(){\n this.listenTo(this.model, 'ch...
javascript
chosen
[ { "from": "system", "value": "Set username properties on user search and fetch\n" }, { "from": "human", "value": "var Backbone, $, app, User;\n\n$ = require('jquery');\nBackbone = require('backbone');\nBackbone.$ = $;\nUser = require('../models/user');\n\nmodule....
javascript
chosen
[ { "from": "system", "value": "Allow modifying settings path through env var.\n" }, { "from": "human", "value": "'use strict';\n\nconst { app } = require('electron');\nconst fs = require('fs');\nconst path = require('path');\n\nmodule.exports = {\n\tinit(callback) {\n\t\tthis.settingsFile...
javascript
chosen
[ { "from": "system", "value": "Use \"pods\" to organize each widget's code into a single place.\n" }, { "from": "human", "value": "import Resolver from 'ember/resolver';\nimport AuthenticationInitalizer from 'appkit/initializers/authentication';\nimport FayeClientInitalizer from 'appkit/initializ...
javascript
chosen
[ { "from": "system", "value": "Fix comment - tooltips expand on hover\n" }, { "from": "human", "value": "import assert from 'assert';\n\nimport { Tooltips } from './Tooltips';\nimport { Utils } from '../../tests/Utils';\n\nconst selectors = {\n toggler: `.js-tooltip-toggle`,\n toggleable: `.js-...
javascript
chosen
[ { "from": "system", "value": "Add listeners to Backbone question view that render and exit form\n-rendering adds model attributes to template and posts them to the page after syncing\n-exiting the form hides the form after submission\n" }, { "from": "human", "value": "app = app || {};\n\napp.Que...
javascript
chosen
[ { "from": "system", "value": "Make sure to check that the entry exists when returning the payload\n" }, { "from": "human", "value": "'use strict'\n\nclass DocumentIndex {\n constructor () {\n this._index = {}\n }\n\n get (key, fullOp = false) {\n return fullOp\n ? this._index[key]\...
javascript
chosen
[ { "from": "system", "value": "Print usage info on no-args\n\nCloses #5\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 = minim...
javascript
chosen
[ { "from": "system", "value": "Use String instead of interpolation" }, { "from": "human", "value": "import {\n name as LIB_NAME,\n version as LIB_VERSION\n} from '../package.json';\n\nfunction pretty(arg) {\n let objs = [];\n let keys = [];\n\n return JSON.stringify(arg, (k, v) => {\n if ...
javascript
chosen
[ { "from": "system", "value": "Add missing `var`s in animation code\n\nJavaScript isn't CoffeeScript!\n" }, { "from": "human", "value": "var updateClock = (function() {\n var sDial = document.getElementById(\"secondDial\");\n var mDial = document.getElementById(\"minuteDial\");\n var hDial = d...
javascript
chosen
[ { "from": "system", "value": "Move event and helper into the new template\n" }, { "from": "human", "value": "Template.editUniverse.helpers({\n\tworkshops() {\n\t\treturn Workshops.find({\n\t\t\t'universesLinked.universeId': {\n\t\t\t\t$ne: this._id\n\t\t\t}\n\t\t});\n\t},\n\tworkshopData() {\n\t...
javascript
chosen
[ { "from": "system", "value": "Add items to prescription state\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nimport { ROUTES } from '../navigation/constants';\n\nimport { PRESCRIPTION_ACTIONS } from '../actions/PrescriptionActions';\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix syntax errors in protractor.conf.js\n" }, { "from": "human", "value": "var url = 'http://127.0.0.1:8000/'; // This should be local webserver\nvar capabilities = {\n 'browserName': 'firefox'\n},\nif (process.env.TRAVIS) {\n url = 'https://b3ncr.github.io/an...
javascript
chosen
[ { "from": "system", "value": "Change tests to ignore Illustrator's faulty bounds calculation of symbols.\n" }, { "from": "human", "value": "module('Placed Symbol');\n\ntest('placedSymbol bounds', function() {\n\tvar doc = new Document();\n\tvar path = new Path.Circle([50, 50], 50);\n\tpath.strok...
javascript
chosen
[ { "from": "system", "value": "Test still fails - but because of a timeout\n\nThe asynchronous file test still fails. Now it fails because the Mocha\nbelieves the test takes longer than (the default) 2000 ms.\n\nThe previous commit passed in the test parameter, `done`. The\nconsequence of this change means t...
javascript
chosen
[ { "from": "system", "value": "Fix notification icon on MacOS\n" }, { "from": "human", "value": "import NotificationProvider from \"./NotificationProvider\";\n\n\nexport default class NotificationProviderNative extends NotificationProvider {\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tstatic test(...
javascript
chosen
[ { "from": "system", "value": "Add debug tool to view particle count\n" }, { "from": "human", "value": "// A bit of pseudo-code\n//\n// tickModel\n// var dt\n// for each canvas\n// canvasParticles = canvasParticles.filterOut(particlesOutsideOrTimeout)\n//\n// for each particle in canvasPa...
javascript
chosen
[ { "from": "system", "value": "Add environment property for cloud production.\n" }, { "from": "human", "value": "let path = require('path');\nlet rootPath = path.normalize(__dirname + '/../../');\n\nconst connectionStrings = {\n production: 'mongodb://ilian82:123456@ds113958.mlab.com:13958/pro...
javascript
chosen
[ { "from": "system", "value": "Fix clientside tests to use plugin interface\n" }, { "from": "human", "value": "'use strict';\n/*jshint asi: true */\n\nvar proxyquire = require('../..');\nvar vm = require('vm');\n\nfunction run(name) {\n\n var src = '';\n\n proxyquire.browserify()\n ...
javascript
chosen
[ { "from": "system", "value": "Fix a Bad Codemod Import\n" }, { "from": "human", "value": "import { isEmpty } from '@ember/utils';\nimport { helper } from '@ember/component/helper';\nimport { htmlSafe } from '@ember/template';\nimport jquery from 'jquery';\nimport markdownit from 'markdown-it';\n...
javascript
chosen
[ { "from": "system", "value": "Fix deprecation warnings in Ember 1.13.6\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default function(helper) {\n if (Ember.Helper && Ember.Helper.detect(helper)) {\n return helper;\n }\n\n return Ember.HTMLBars.makeBoundHelper(help...
javascript
chosen
[ { "from": "system", "value": "Update event firing to check first if event type exists\n" }, { "from": "human", "value": "/**\n * Event handler.\n * @constructor\n */\n\nfunction EventTarget(){\n this._listeners = {};\n}\n/**\n * @method\n * @param {string} type\n * @param {function} listener\...
javascript
chosen
[ { "from": "system", "value": "Use api without rate limit for example\n" }, { "from": "human", "value": "import * as Github from './api/github';\nimport * as Wikipedia from './api/wikipedia';\nimport { createDatastore, registerApi, registerMiddleware, build } from 'datastore';\nimport * as Cachin...
javascript
chosen
[ { "from": "system", "value": "Data: Allow fetchXml a few tries if it fails\n" }, { "from": "human", "value": "import axios from 'axios'\n\nimport { parseString } from 'xml2js'\n\nconst cache = {}\n\nfunction parseXmlPromiseWrapper(xml) {\n return new Promise((resolve, reject) => {\n parseStr...
javascript
chosen
[ { "from": "system", "value": "[DDW-608] Implement new About dialog design - small fix\n" }, { "from": "human", "value": "// @flow\nimport React, { Component } from 'react';\nimport { inject, observer } from 'mobx-react';\nimport ReactModal from 'react-modal';\nimport About from '../../components...
javascript
chosen
[ { "from": "system", "value": "Add controllers for the activity form\n" }, { "from": "human", "value": ";(function(){\n angular.module(\"Jal-Stats\", ['ngRoute'], function($routeProvider){\n $routeProvider\n .when('/', {\n redirectTo: '/login'\n })\n .when('/login', {\n tem...
javascript
chosen
[ { "from": "system", "value": "Fix a target window of keyboard shortcuts for tab\n" }, { "from": "human", "value": "chrome.commands.onCommand.addListener(function(command) {\n var callback;\n if ( command === \"show-next-tab\" ) {\n callback = function(tabs) {\n var tab = tabs[0];\n ...
javascript
chosen
[ { "from": "system", "value": "Update: Create worker methods at prototype level\n\nThis approach is slightly faster since the code is executed only once.\nRather constructor code is executed every time a new instance is created.\n\nSerious advantage of prototype over constructor is that the former is compati...
javascript
chosen
[ { "from": "system", "value": "Fix a regression from b10a76c\n" }, { "from": "human", "value": "import get from 'lodash/get';\n\nconst isEmptyMetadata = (metadata) => {\n const keys = [\n 'description',\n 'citation',\n 'source',\n 'applicationProperties.cautions',\n 'applicationPr...
javascript
chosen
[ { "from": "system", "value": "Use cartodb_id as FID column in gpkg\n" }, { "from": "human", "value": "var ogr = require('./../ogr');\n\nfunction GeoPackageFormat() {}\n\nGeoPackageFormat.prototype = new ogr('gpkg');\n\nGeoPackageFormat.prototype._contentType = \"application/x-sqlite3; charset=ut...
javascript
chosen
[ { "from": "system", "value": "Move back session storage creation\n" }, { "from": "human", "value": "import { hot } from 'react-hot-loader/root';\nimport React from 'react';\nimport { ProtonApp, Loader, useAuthentication, useInstance } from 'react-components';\nimport createSecureSessionStorage f...
javascript
chosen
[ { "from": "system", "value": "Fix typo for facebook callback endpoint\n" }, { "from": "human", "value": "module.exports = function(app, express) {\n\n app.get('/auth/facebook', function(req, res) {\n res.send('Facebook OAuth');\n });\n\n app.get('auth/facebook/callback', function(req, res)...
javascript
chosen
[ { "from": "system", "value": "Increase jasmine timeout for ts_devserver e2e test.\n\nThere was a timeout in https://circleci.com/gh/bazelbuild/rules_typescript/527\n\nPiperOrigin-RevId: 179857679\n" }, { "from": "human", "value": "exports.config = {\n specs: ['bazel-bin/examples/app/*_e2e_test....
javascript
chosen
[ { "from": "system", "value": "Fix invalid error code from test\n" }, { "from": "human", "value": "var\n\tpath = require('path'),\n\texec = require('child_process').exec,\n\trimraf = require('rimraf')\n;\n\n\nexports.tests = {\n\n\t'setUp': function(done) {\n\t\tdone();\n\t},\n\n\t'tearDown': fun...
javascript
chosen
[ { "from": "system", "value": "Update comment to remind about existing bug.\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Core routing.\n */\nmodule.exports = function(app) {\n var core = require('../controllers/core.server.controller');\n\n // Define HTTP error pages.\n app.route...
javascript
chosen
[ { "from": "system", "value": "Sort cache channels and keys alphabetically\n" }, { "from": "human", "value": "var crypto = require('crypto');\n\nfunction DatabaseTables(tables) {\n this.namespace = 't';\n this.tables = tables;\n}\n\nmodule.exports = DatabaseTables;\n\n\nDatabaseTables.proto...
javascript
chosen
[ { "from": "system", "value": "Fix for typed arrays not being transferred\n" }, { "from": "human", "value": "var ResultCollector = require('./result_collector');\nvar work = require('webworkify');\n\nvar workers = [];\n\nObject.defineProperty(module.exports, 'length', {\n get: function(){\n r...
javascript
chosen
[ { "from": "system", "value": "Use jQuery 'cause it's loaded anyways\n" }, { "from": "human", "value": "/*\n* ---\n* HIDE CUSTOM PROFILE CSS MODULE\n* ---\n*\n* Disables custom CSS on a profile (imagine that!)\n*\n* Interacts with the Page Action popup as well as the profileCSSHandler\n* content ...
javascript
chosen
[ { "from": "system", "value": "Check if not null first.\n" }, { "from": "human", "value": "function showDeleteConfirmation(){\n\tdocument.getElementById(\"confirm-delete-prompt\").style.display = \"block\";\n}\n\ndocument.getElementById(\"confirm-delete\").addEventListener(\"click\", showDeleteCo...
javascript
chosen
[ { "from": "system", "value": "Add some friendly help back\n" }, { "from": "human", "value": "import React from 'react';\n\nimport FormTextField from '../shared/FormTextField';\nimport ValidationErrors from '../../lib/ValidationErrors';\n\nclass Form extends React.Component {\n static propTypes ...
javascript
chosen
[ { "from": "system", "value": "HOTFIX: Replace Object.values with old-node friendly code\n" }, { "from": "human", "value": "var locationGraph = require('../assets/data/dummy-picker-data-2.json')\n\nfunction isCanonicalNode (node) {\n return node.meta.canonical\n}\n\nfunction presentableName (nod...
javascript
chosen
[ { "from": "system", "value": "Fix a warning in chrome" }, { "from": "human", "value": "/*\n * - scrolled.js -\n * Licence MIT\n * Written by Gabriel Delépine\n * Current version 0.1 (2014-02-12)\n * Requirement : No one, it is a framework-free fonction (ie : You do not need to include any other...
javascript
chosen
[ { "from": "system", "value": "Support direct wiki string passed to calli.parseCreole\n" }, { "from": "human", "value": "// parse-creole.js\n/*\n * Copyright (c) 2014 3 Round Stones Inc., Some Rights Reserved\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no...
javascript
chosen
[ { "from": "system", "value": "Add thunk to redux store\n" }, { "from": "human", "value": "import { render } from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { createStore } from 'redux';\nimport rootReducer from './reducers';\n\nimport React from 'react';\nimport ReactDOM from ...
javascript
chosen
[ { "from": "system", "value": "Check if SMART_SURVEY_CID is set before include js for survey\n" }, { "from": "human", "value": " 'use strict';\n\n moj.Modules.SmartSurvey = {\n init: function() {\n window._ssq={'cid':window.SMART_SURVEY_CID};\n var ss=document.createElement('script...
javascript
chosen
[ { "from": "system", "value": "Fix for server warning flipping on/off on connection problems\n" }, { "from": "human", "value": "app.factory('serverWarning', function(noty, socket) {\n var SECONDS = 30;\n var timeoutWarning;\n\n function reset() {\n if (timeoutWarning !== undefined) {\n ...
javascript
chosen
[ { "from": "system", "value": "Create API method for saving a backpack object\n" }, { "from": "human", "value": "import xhr from 'xhr';\n\nconst getBackpackContents = ({\n host,\n username,\n token,\n limit,\n offset\n}) => new Promise((resolve, reject) => {\n xhr({\n met...
javascript
chosen
[ { "from": "system", "value": "Remove the leading zero from the arrival time\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport moment from 'moment';\nimport stringToHue from 'bus-detective/utils/string-to-hue';\nvar inject = Ember.inject;\n\nexport default Ember.Component.exte...
javascript
chosen
[ { "from": "system", "value": "Fix bootstrap class for qTip2 master\n" }, { "from": "human", "value": "define(['backbone', 'timetable_data'], function(Backbone, timetable_data) {\n 'use strict';\n\n var AppView = Backbone.View.extend({\n el: 'body',\n\n events: {\n 'show a[href=\"#mo...
javascript
chosen
[ { "from": "system", "value": "Enable debug-websocket on https connections\n\nThe relevant code is not under test since it would require to many\nfixtures.\n\nChange-Id: Ia471c2adf364391342a987bada53463348506e3c\n" }, { "from": "human", "value": "/* global tabris:false WebSocket:false debugClient...
javascript
chosen
[ { "from": "system", "value": "Fix temporary directory name in jQuery test\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path');\nvar helpers = require('yeoman-generator').test;\nvar assert = require('yeoman-assert');\n\ndescribe('jquery', function () {\n describe('on', f...
javascript
chosen