conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix issue with multiple files upload\n\nCorrectly handle onChange event using fileOrGroup primise" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc directive\n * @name angular-uploadcare.directive:Uploadcare\n * @description Provides a directive for t...
javascript
chosen
[ { "from": "system", "value": "Fix SyntaxError: Unexpected token < during scrapping\n" }, { "from": "human", "value": "\"use strict\";\nlet fetch = require('node-fetch');\nmodule.exports = function searchDeclaration(link) {\n return fetch(link)\n .then(response => response.text())\n ...
javascript
chosen
[ { "from": "system", "value": "Update now returns the account info\n" }, { "from": "human", "value": "var Account = require('../../app/models/account');\n\nexports.update = function (req, res) {\n Account.findById(req.params.id, function (err, account) {\n if (!account)\n ret...
javascript
chosen
[ { "from": "system", "value": "maint: Extend eslint config from @patternslib/dev.\n" }, { "from": "human", "value": "module.exports = {\n extends: [\"eslint:recommended\", \"prettier\"],\n root: true,\n env: {\n es6: \"true\",\n browser: true,\n node: true,\n ...
javascript
chosen
[ { "from": "system", "value": "Add 'getDataTable' function from old template." }, { "from": "human", "value": "function applyChanges(data, url, showResult) {\r\n\tvar success = false;\r\n\t$.ajax({\r\n\t\ttype : \"POST\",\r\n\t\turl : url,\r\n\t\tdata : JSON.stringify(data),// now data come in th...
javascript
chosen
[ { "from": "system", "value": "Use first visible background layer as active background layer\n" }, { "from": "human", "value": "angular.module('anol.layerswitcher', [])\n\n.directive('anolLayerswitcher', ['LayersService', function(LayersService) {\n return {\n restrict: 'A',\n tr...
javascript
chosen
[ { "from": "system", "value": "Send 201 status with student greeting\n" }, { "from": "human", "value": "//var Teachers = require('../models/teachers');\n//var TeacherClasses = require('../models/Teacher_classes');\n//var Classes = require('../models/classes');\n//var ClassLessons = require('../mo...
javascript
chosen
[ { "from": "system", "value": "Add simple test case for spread, rest syntax\n" }, { "from": "human", "value": "class Foo {\n constructor(a = 10, ...b) {\n this.a = a\n this.b = b\n }\n\n method() { return this.a + this.b }\n\n get x() { return `template${this.a}` }\n}\n\nlet x = 1\n\nco...
javascript
chosen
[ { "from": "system", "value": "Rewrite Customer tests to ES2015\n" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert');\nvar sinon = require('sinon');\n\nvar Customer = require('../../lib/endpoints/customer');\nvar Request = require('../../lib/request');\n\ndescribe('e...
javascript
chosen
[ { "from": "system", "value": "Change pretty-text2 choices dropdown to look like a link instead of a button\n" }, { "from": "human", "value": "'use strict';\n\nvar React = require('react/addons');\nvar _ = require('underscore');\n\n/*\n Choices drop down component for picking tags.\n */\nvar Ch...
javascript
chosen
[ { "from": "system", "value": "Add tracking event when clicking on Cookie Accept Button\n" }, { "from": "human", "value": "var $ = require('jQuery');\nvar onReady = require('kwf/on-ready');\nvar cookieOpt = require('kwf/cookie-opt');\n\nonReady.onRender('.kwcClass', function (el, config) {\n c...
javascript
chosen
[ { "from": "system", "value": "Change the order of the conditional for clarity\n\n- I think having current time after the streamed comment time made it unclear what I was looking for when I was reading it back.\r\n- I want to include comments which have been passed by currentTime." }, { "from": "huma...
javascript
chosen
[ { "from": "system", "value": "Set modelId data attribute for feeds\n" }, { "from": "human", "value": "var HTML = {\n \n createFeed: function(data) {\n var $clone = $('.template.feed').clone(true);\n $clone.removeClass('template');\n $clone.find('.title').text(data.titl...
javascript
chosen
[ { "from": "system", "value": "Add link to config documentation\n" }, { "from": "human", "value": "const Jetpack = require('fs-jetpack');\n\n/** File name to look for configuration */\nconst CONFIG_FILE_NAME = '.reconrc';\n\n/**\n * Generate a full config for a working directory and any user conf...
javascript
chosen
[ { "from": "system", "value": "Use lodash.map wrapper instead of native [].map\n" }, { "from": "human", "value": "import _ from '../wrap/lodash'\n\nimport tdFunction from '../function'\nimport isGenerator from './is-generator'\n\nexport default (original, names) => {\n if (_.isArray(original) ||...
javascript
chosen
[ { "from": "system", "value": "Remove sensitive data from returned user data\n" }, { "from": "human", "value": "const _ = require(\"lodash\");\nconst express = require(\"express\");\nconst router = express.Router();\nconst connect = require(\"../../utils/database.js\");\n\n// Route: {root}/api/us...
javascript
chosen
[ { "from": "system", "value": "Fix throw error instead of returning\n" }, { "from": "human", "value": "import {exec} from 'child_process';\nimport {isAbsolute} from 'path';\n\nfunction launch(path, options = {}) {\n if(!isAbsolute(path)) {\n return new Error('Application path \"%s\" is not ab...
javascript
chosen
[ { "from": "system", "value": "SERVER-290: Clear class room name if created ok\n" }, { "from": "human", "value": "/**\n * Created by erdi on 20/10/2016.\n */\n$(function () {\n var defaultErrMsg = '请求失败,请稍后重试,或联系管理员!';\n $('#form').submit(function () {\n var form = $(this);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix redirection url for GeoJSON\n" }, { "from": "human", "value": "/*\n** Module dependencies\n*/\nvar datasets = require('../controllers/datasets');\n\nmodule.exports = function(app) {\n\n // Params\n app.param('datasetId', datasets.dataset);\n\n // Routes...
javascript
chosen
[ { "from": "system", "value": "Make sure happo.nextExample always returns a promise\n\nBuilds are failing in Safari and I think it's because nextExample isn't\nconsistently returning a promise.\n" }, { "from": "human", "value": "window.happo = window.happo || {};\n\nwindow.happo.initChunk = () =>...
javascript
chosen
[ { "from": "system", "value": "Remove console logs from files..." }, { "from": "human", "value": "angular.module('events.events.filter', [])\n .filter('showEvents', function () {\n return function (events, filter) {\n var result = [];\n\n function filterIsSet () {\n return ty...
javascript
chosen
[ { "from": "system", "value": "Read ApiKey from parent only if it is set\n" }, { "from": "human", "value": "import invariant from 'invariant';\n\nimport PathStrategy from '../path';\nimport NativeStrategy from './nativeStrategy';\nimport FetchStrategy from './fetchStrategy';\n\nconst directionStr...
javascript
chosen
[ { "from": "system", "value": "Use match instead of query string for now.\n" }, { "from": "human", "value": "var elasticsearch = require('elasticsearch');\nvar client = new elasticsearch.Client({\n host: process.env.ELASTICSEARCH,\n});\n\nfunction query(q) {\n return client.search({\n ...
javascript
chosen
[ { "from": "system", "value": "Update profile picture 15 minutes after startup" }, { "from": "human", "value": "\n\n// server startup\nMeteor.startup(function() {\n \n /* server startup */\n\n // add environment variables from settings file to current process environment\n if (Settings.env)\n...
javascript
chosen
[ { "from": "system", "value": "Revert initE back to init, since change was breaking lots of things.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use...
javascript
chosen
[ { "from": "system", "value": "Fix globbing issue in mix/files\n" }, { "from": "human", "value": "'use strict';\n\nvar mime = require('mime');\nvar mix = require('mix');\nvar path = require('path');\nvar vfs = require('vinyl-fs');\n\nmodule.exports = function (options) {\n var base = path.reso...
javascript
chosen
[ { "from": "system", "value": "Fix evil eval warning in lint\n" }, { "from": "human", "value": "/**\n * Main controller for the Huna JS app. Shows the main (index) page\n */\napp.controller('ErrorController', function($scope, $interval){\n\n var stop;\n $scope.timeout = \"\";\n $scope.busy = f...
javascript
chosen
[ { "from": "system", "value": "Add dark mode to the create ticket modal\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport Modal from 'react-modal';\n\nclass CreateTicketModal extends PureComponent {\n render() {\n return (\n <Modal\n contentL...
javascript
chosen
[ { "from": "system", "value": "Use empty string for falsy character strings\n" }, { "from": "human", "value": "import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Character from \"./Character\";\n\nconst CharacterString = props => {\n const text = `${props.children}`;\n ...
javascript
chosen
[ { "from": "system", "value": "Increase current time widget update freq. to 4 Hz\n\n[rev: Matthew Gordon]\n\nPrevious update frequency of 1 Hz would result in inconsistent updating\nif a time format which displays seconds was passed to the widget.\n" }, { "from": "human", "value": "/*\n * Copyrig...
javascript
chosen
[ { "from": "system", "value": "Use prod website URL in dev env\n" }, { "from": "human", "value": "// App config the for development environment.\n// Do not require this directly. Use ./src/config instead.\n\n\nconst HOST = process.env.HOST || \"localhost\",\n apiBaseUrl = process.env.API_URL || ...
javascript
chosen
[ { "from": "system", "value": "fix(InfoViz): Add missing entry in Core module\n" }, { "from": "human", "value": "import D3MultiClick from './D3MultiClick';\nimport FieldProvider from './FieldProvider';\nimport Histogram2DProvider from './Histogram2DProvider';\nimport LegendProvider from './Legend...
javascript
chosen
[ { "from": "system", "value": "Convert string concat to template string\n" }, { "from": "human", "value": "import * as Pluggable from \"../../pluggable\";\nimport resolve from \"../../resolve\";\n\nconst createModule = Pluggable.sync(function createModule (overrides) {\n return Object.assign({\n...
javascript
chosen
[ { "from": "system", "value": "Return update time for the latest release\n" }, { "from": "human", "value": "import packageJson from 'package-json';\n\nexport const getLatestVersion = (req, res) => {\n packageJson('cncjs', 'latest')\n .then(json => {\n const {\n ...
javascript
chosen
[ { "from": "system", "value": "Check when no data is returned, which is the case with JWT expired token\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('<%=angularAppName%>')\n .factory('errorHandlerInterceptor', function ($q, $rootScope) {\n return {\n 're...
javascript
chosen
[ { "from": "system", "value": "Fix range error in randomColor test\n" }, { "from": "human", "value": "var lodash = require('lodash');\nvar expect = require('chai').expect;\nvar testPath = require('path').join(__dirname, '../../src/colors/randomColor');\nvar _ = require(testPath)(lodash);\n\nmodul...
javascript
chosen
[ { "from": "system", "value": "Change views directory to a relative path.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar debug = require('debug')('server');\nvar express = require('express');\n\nvar routes = require('./routes/index');\n\nvar app = express();\n\napp.use('/', routes);\n\...
javascript
chosen
[ { "from": "system", "value": "Fix timestamp on rss feeds" }, { "from": "human", "value": "(function($){\n$.fn.blogfeed = function(options) {\n var defaults = {\n postcount: 5\n };\n var options = $.extend(defaults, options);\n \n return this.each(function() {\n var $...
javascript
chosen
[ { "from": "system", "value": "Add Chats reference to User model\n" }, { "from": "human", "value": "'use strict';\n\nvar mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar UserSchema = new Schema({\n profile: {\n email: String,\n fname: String,\n lname: String,\n u...
javascript
chosen
[ { "from": "system", "value": "Use the \"spec\" reporter from Mocha instead of dot\n" }, { "from": "human", "value": "import {createRunner} from 'atom-mocha-test-runner';\nimport chai from 'chai';\nimport chaiAsPromised from 'chai-as-promised';\n\nchai.use(chaiAsPromised);\nglobal.assert = chai.a...
javascript
chosen
[ { "from": "system", "value": "Add a version constraint babel-compiler\n" }, { "from": "human", "value": "Package.describe({\n summary: 'Elm 0.16.0 for Meteor'\n, name: 'elm:make'\n, version: '0.3.0'\n, git: 'https://github.com/Kriegslustig/meteor-elm-make.git'\n})\n\nPackage.registerBuildPlugin...
javascript
chosen
[ { "from": "system", "value": "Add support for Meteor 1.2\n" }, { "from": "human", "value": "// Meteor package definition.\nPackage.describe({\n name: 'aramk:routes',\n version: '0.2.2',\n summary: 'Convenient utilities for setting up routes for a Meteor app.',\n git: 'https://github.com/aram...
javascript
chosen
[ { "from": "system", "value": "Add a little style to the nav\n" }, { "from": "human", "value": "import React from 'react'\nimport { Link } from 'react-router'\n\n\nconst UserNav = ({baseUrl, active}) => (\n <nav style={{display: 'flex', flexDirection: 'row'}}>\n <Link to={baseUrl}>Overview</L...
javascript
chosen
[ { "from": "system", "value": "Include svg and webfonts in default filepattern\n" }, { "from": "human", "value": "var Promise = require('ember-cli/lib/ext/promise');\n\nvar chalk = require('chalk');\nvar yellow = chalk.yellow;\nvar blue = chalk.blue;\nvar red = chalk.red;\n\nmodule.exports ...
javascript
chosen
[ { "from": "system", "value": "Fix sounds not playing in Safari\n" }, { "from": "human", "value": "/**\n * Initializes a single XMLHttpRequest object (avoiding memory leaks)\n * and exposes a closure to use it.\n */\nconst audioLoader = (audioContext) => {\n const xhr = new XMLHttpRequest();\n ...
javascript
chosen
[ { "from": "system", "value": "Modify the main launch file.\n" }, { "from": "human", "value": "/**\n * @author XU Kai(xukai.ken@gmail.com) botobe.net;\n * @version 0.0.1\n *\n */\n\n(function() {\n\n})();\n" }, { "from": "gpt", "value": "/**\n * @author XU Kai(xukai.ken@gmail.com) bot...
javascript
chosen
[ { "from": "system", "value": "Use consistent capitalization in comments\n" }, { "from": "human", "value": "/**\n * App Dependencies.\n */\n\nvar loopback = require('loopback')\n , app = module.exports = loopback()\n , fs = require('fs')\n , path = require('path')\n , request = require('reque...
javascript
chosen
[ { "from": "system", "value": "Add answers to a cooldown queue\n" }, { "from": "human", "value": "import Random from '../util/random';\nimport countries from '../data/countries';\n\nexport const QUIZ_OPTIONS_COUNT = 5;\n\nexport const generateQuizOptions = (num = QUIZ_OPTIONS_COUNT) => {\n const...
javascript
chosen
[ { "from": "system", "value": "Add check for ENV port variable.\n" }, { "from": "human", "value": "var express = require('express'), \n fs = require('fs');\n\nvar app = module.exports = express.createServer();\n\n// Configuration\napp.configure(function(){\n app.use(express.bodyParser());\n ...
javascript
chosen
[ { "from": "system", "value": "Edit server path in import statement\n" }, { "from": "human", "value": "import express from 'express';\nimport logger from 'morgan';\nimport bodyParser from 'body-parser';\nimport routes from './server/routes';\n\n\nconst app = express();\nconst http = require('http...
javascript
chosen
[ { "from": "system", "value": "Add title and shorten advisory\n" }, { "from": "human", "value": "'use strict';\n\nvar cvss = require('cvss');\n\nmodule.exports = function (err, data, pkgPath) {\n\tif (err) {\n\t\treturn 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : d...
javascript
chosen
[ { "from": "system", "value": "Add `{'ignoreSearch': true}` to cache.match()\n" }, { "from": "human", "value": "/* https://developers.google.com/web/ilt/pwa/offline-quickstart */\n\nvar CACHE = 'evilnickname-soundboard-cache';\nvar urlsToCache = [\n '.',\n 'index.html',\n 'megaphone.svg'...
javascript
chosen
[ { "from": "system", "value": "Create weatherAPI var for openweathermap forecast\n" }, { "from": "human", "value": "var primed = angular.module('primed', ['ngRoute', 'ngResource']);\n\nprimed.config(function($routeProvider) {\n $routeProvider\n .when('/', {\n templateUrl: 'pages/home.html',...
javascript
chosen
[ { "from": "system", "value": "Set non-zero exit code to fail the build if error.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst pino = require('pino');\nconst dependentBuild = require('./index');\n\nconst pretty = pino.pretty();\npretty.pipe(process.stdout);\n\nconst logLevel = ...
javascript
chosen
[ { "from": "system", "value": "Comment out heapdump for now.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/* eslint no-unused-expressions:0 */\n\n'use strict';\n\nrequire('heapdump');\nrequire('./lib/configure');\n\nconst yargs = require('yargs');\n\nyargs\n.strict()\n.wrap(Math.min(...
javascript
chosen
[ { "from": "system", "value": "Fix console.log in migration to display correctly in Rails debug log\n\nSigned-off-by: Alvaro Perez-Shirley <79f29b890b0238cfb202ad154c4598ac29519534@pivotal.io>\n" }, { "from": "human", "value": "exports.migrate = function(properties) {\n console.log('the proper...
javascript
chosen
[ { "from": "system", "value": "Return local strategy error message as string, not object\n" }, { "from": "human", "value": "// Sign in with Email and Password\npassport.use(new LocalStrategy({ usernameField: 'email' }, function(email, password, done) {\n User.findOne({ email: email.toLowerCase()...
javascript
chosen
[ { "from": "system", "value": "Disable logging in development. It can be turned on as needed.\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n environment: environment,\n baseURL: '/',\n locationType: 'hash',\n Emb...
javascript
chosen
[ { "from": "system", "value": "fix(Styling): Fix spacing for PATCH methods\n\nadd additional spacing to Method displays so we can see the entire content instead of PATCH not\n\nbeing displayed fully\n" }, { "from": "human", "value": "import React from 'react';\nimport styled from 'styled-componen...
javascript
chosen
[ { "from": "system", "value": "Add getIndices() method to 2D arrays\n" }, { "from": "human", "value": "export default function Array2 ({\n fill,\n size: [width, height]\n}) {\n const arr2 = []\n for (let i = 0; i < width; i++) {\n arr2.push(new Array(height).fill(fill))\n }\n\n // There ...
javascript
chosen
[ { "from": "system", "value": "Initialize AbstractComponent properties and children with empty array / dict if not provided\n" }, { "from": "human", "value": "/** @babel */\n\nimport etch from 'etch'\n\nimport {CompositeDisposable} from 'atom'\n\nexport default class AbstractComponent {\n constr...
javascript
chosen
[ { "from": "system", "value": "Use database ID, not filename, to identify documents to remove\n" }, { "from": "human", "value": "module.exports = function(conn) {\n return {\n list: function(businessId, callback) {\n conn.get('/businesses/'+businessId+'/audits', callback);\n },\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add \"scaled\" class after scaling elements.\n" }, { "from": "human", "value": "define([\n \"jquery\",\n \"../registry\"\n], function($, registry) {\n var _ = {\n name: \"autoscale\",\n trigger: \".pat-auto-scale\",\n\ttransform: $('html').has...
javascript
chosen
[ { "from": "system", "value": "Fix sending along arguments to parent on willTransition\n" }, { "from": "human", "value": "import { inject as service } from '@ember/service';\nimport EmberRouter from '@ember/routing/router';\nimport ENV from '../config/environment';\nimport Configuration from 'emb...
javascript
chosen
[ { "from": "system", "value": "Add guard for the case of a component causing its siblings to unsubscribe in the middle of the notification loop.\n" }, { "from": "human", "value": "\n// encapsulates the subscription logic for connecting a component to the redux store, as well as\n// nesting subscr...
javascript
chosen
[ { "from": "system", "value": "Add methods to the api\n" }, { "from": "human", "value": "'use strict';\nclass Activator {\n /**\n *\n * @param _super\n * @param constructorArgs\n */\n constructor(_super, constructorArgs) {\n let Class = Object.create(_super.__proto__)...
javascript
chosen
[ { "from": "system", "value": "Use self when refering to the closure's execution context\n" }, { "from": "human", "value": "quail.aLinkTextDoesNotBeginWithRedundantWord = function (quail, test, Case) {\n test.get('$scope').find('a').each(function () {\n var link = this;\n var $link = $(thi...
javascript
chosen
[ { "from": "system", "value": "Handle when no moduleDependencies delcared.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (gulp, gutil) {\n var scripts = require('../lib/scripts.js')(gulp, gutil);\n\n gulp.task('scripts', ['scripts-main', 'scripts-tpls', 'scripts-...
javascript
chosen
[ { "from": "system", "value": "Fix for bugs that stop parsing if underscores are found in declaration values and slashes inside comments\n" }, { "from": "human", "value": "/*! Parker v0.0.0 - MIT license */\n\n'use strict';\n\nvar _ = require('underscore');\n\nfunction CssStylesheet(raw) {\n t...
javascript
chosen
[ { "from": "system", "value": "Make the html progress callback return 100 when the iframe loads\n" }, { "from": "human", "value": "'use strict';\n\nvar React = require('react'),\n\tGenericViewer = require('../generic/viewer.js');\n\nvar NativeViewer = React.createClass({\n\tcomponentDidMount: fun...
javascript
chosen
[ { "from": "system", "value": "Remove defunct deferredComponentsLoadStatus items from popup load process\n" }, { "from": "human", "value": "\n// Used to trigger opera.isReady() functions\nvar deferredComponentsLoadStatus = {\n 'WIDGET_API_LOADED': false,\n 'WIDGET_PREFERENCES_LOADED': false\n ...
javascript
chosen
[ { "from": "system", "value": "Fix issue where unidentified mac's would not show up in device lists\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar fs = require('fs');\n\nrouter.get('/', function(req, res, next) {\n\n var stat_data = {}...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect request body in init command\n" }, { "from": "human", "value": "export default function createProject(apiClient, options) {\n return apiClient({\n requireUser: true,\n requireProject: false\n }).request({\n method: 'POST',\n uri: '/projec...
javascript
chosen
[ { "from": "system", "value": "[Dialog] Use a more descriptive name for parameters\n\nWe have no plans to generate the JS shim in a short term, so use a more\nverbose description of the parameters matching the IDL.\n" }, { "from": "human", "value": "// Copyright (c) 2013 Intel Corporation. All ri...
javascript
chosen
[ { "from": "system", "value": "Make Timeago elements update over time\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport cx from 'classnames';\n\nexport default class Timeago extends React.Component {\n static ...
javascript
chosen
[ { "from": "system", "value": "Use inputTrees for sass dir\n" }, { "from": "human", "value": "var CachingWriter = require('broccoli-caching-writer');\nvar Compass = require('compass-compile');\n\nCompassCompiler.prototype = Object.create(CachingWriter.prototype);\nCompassCompiler.prototype.constr...
javascript
chosen
[ { "from": "system", "value": "Fix packager script breakage when running `npm start`" }, { "from": "human", "value": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n */\n\n'use strict';\n\nvar spawn = require('child_process').spawn;\nvar path = require('path');\nvar install = requ...
javascript
chosen
[ { "from": "system", "value": "Update example to generate index.html files\n" }, { "from": "human", "value": "import React from 'react';\nimport { Route, IndexRoute } from 'react-router';\n\nimport { App, Home, About, NotFound } from './App.js';\nimport {\n Products,\n Product,\n ProductColors...
javascript
chosen
[ { "from": "system", "value": "Fix issue with dotenv path in travis.\n" }, { "from": "human", "value": "module.exports = {\n dotEnvConfig: require('dotenv').config()\n};\n" }, { "from": "gpt", "value": "'use strict';\n\nconst {\n join\n} = require('path');\n\nmodule.exports = {\n d...
javascript
chosen
[ { "from": "system", "value": "Enable all serahcs options by default\n" }, { "from": "human", "value": "// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.\n//\n// This software (Documize Community Edition) is licensed under\n// GNU AGPL v3 http://www.gnu.org/licenses/agpl-...
javascript
chosen
[ { "from": "system", "value": "Use slideToggle for brief animated show / hide\n" }, { "from": "human", "value": "$(document).ready(function() {\n $(\".additional-options-toggle\").on(\"click\", function(e) {\n e.preventDefault();\n $(\"#\" + $(this).data(\"export-section\") + \"_options\")...
javascript
chosen
[ { "from": "system", "value": "Add a default timeout of 120s\n" }, { "from": "human", "value": "const objectAssign = require('object-assign')\nconst urlParse = require('url-parse')\n\nexport const processOptions = opts => {\n const options = typeof opts === 'string'\n ? {url: opts}\n : obj...
javascript
chosen
[ { "from": "system", "value": "Fix promise in array resolution\n" }, { "from": "human", "value": "// Used by promise extensions that are based on array extensions.\n\n'use strict';\n\nvar callable = require('es5-ext/lib/Object/valid-callable')\n , deferred = require('../../deferred')\n\n , reje...
javascript
chosen
[ { "from": "system", "value": "Switch to to use instead of\n" }, { "from": "human", "value": "\nclass MainController {\n constructor($scope) {\n 'ngInject';\n\n this.locations = [];\n this.$scope = $scope;\n }\n\n addMarker(form) {\n ymaps.geocode(form.locati...
javascript
chosen
[ { "from": "system", "value": "Remove padding from icon button\n" }, { "from": "human", "value": "'use strict';\n\nconst TextButtonView = require('./button-text');\n\nclass IconButtonView extends TextButtonView {\n build() {\n super.build();\n\n this\n .element('button')\n .style...
javascript
chosen
[ { "from": "system", "value": "Change standard function to arrow function\n" }, { "from": "human", "value": "document.addEventListener(\"DOMContentLoaded\", function() {\n main();\n});\n\nconst main = () => {\n const button = document.getElementById(\"start\");\n button.addEventListener(\"clic...
javascript
chosen
[ { "from": "system", "value": "Validate that user flag is given\n" }, { "from": "human", "value": "'use strict';\nconst minimist = require('minimist');\nconst latestvid = require('./');\nconst version = require('./package.json').version;\n\nconst defaults = {\n boolean: [\n 'help',\n 'vers...
javascript
chosen
[ { "from": "system", "value": "Add 12 hour option and make it default\n" }, { "from": "human", "value": "Defaults = {};\n\nDefaults.Tweets = function () {\n return {\n userId: null,\n defaultText: '',\n date: new Date().getTime(),\n variations: Helpers.getVariations(null, Defaults.Se...
javascript
chosen
[ { "from": "system", "value": "Test HtmlApplicationMaifest href getter and setter\n" }, { "from": "human", "value": "/*global describe, it*/\nvar expect = require('../unexpected-with-plugins'),\n AssetGraph = require('../../lib');\n\ndescribe('relations/HtmlApplicationManifest', function () {\...
javascript
chosen
[ { "from": "system", "value": "Reset changes to User controller.\n" }, { "from": "human", "value": "/**\n * UsersController\n *\n * @description :: Server-side logic for managing Users\n * @help :: See http://links.sailsjs.org/docs/controllers\n */\nmodule.exports = {\n\n index: function ...
javascript
chosen
[ { "from": "system", "value": "Modify remote server to www.thiki.org.\n" }, { "from": "human", "value": "/**\n * Created by xubt on 22/11/2016.\n */\nkanbanApp.remote_entrance = \"http://127.0.0.1:8096/kanban/entrance\";\n" }, { "from": "gpt", "value": "/**\n * Created by xubt on 22/1...
javascript
chosen
[ { "from": "system", "value": "Add trailing slash to the invoice details link base location.\n" }, { "from": "human", "value": "// @ngInject\nexport default function invoicesService(baseServiceClass, $http, ENV, $state) {\n var ServiceClass = baseServiceClass.extend({\n init:function() {\n ...
javascript
chosen
[ { "from": "system", "value": "[web] Remove activeFetches and onMessage in StaticBackend.\n" }, { "from": "human", "value": "/*\n * This backend uses the REST API only to host static instances,\n * without any Websocket connection.\n */\nimport { fetchApi } from \"../utils\"\n\nconst CMD_RESET = ...
javascript
chosen
[ { "from": "system", "value": "Add new post on this keyowrd binding in react components\n" }, { "from": "human", "value": "---\nlayout: post\n---\n\nReact provides a default set of API methods withn a React component, such as render() and componentDidMount().\n\nWhen working within these default ...
javascript
chosen
[ { "from": "system", "value": "Dev: Build of search highlight plug-in\n" }, { "from": "human", "value": "/*!\n SearchHighlight for DataTables v1.0.0\n 2014 SpryMedia Ltd - datatables.net/license\n*/\n(function(f,c,b){b(c).on(\"init.dt.dth\",function(c,d){var a=new b.fn.dataTable.Api(d),e=b(a.tabl...
javascript
chosen
[ { "from": "system", "value": "Read protocol from window to determine home url\n" }, { "from": "human", "value": "/*\n Returns the url of the /api endpoint for the current environment.\n\n I haven't configured run or build time settings yet, so this handles\n differences between the prod and d...
javascript
chosen
[ { "from": "system", "value": "Unify indentation in tracing layer and add standard style header\n" }, { "from": "human", "value": "/**\n * The tracing layer that hosts the tracing data\n */\nfunction TracingLayer( stack )\n{\n\n var self = this;\n\n this.svgOverlay = new SkeletonAnnotations.SVG...
javascript
chosen
[ { "from": "system", "value": "Use Boolean type in conditional\n" }, { "from": "human", "value": "/*\n * Believe it or not, you can declare and use functions in EJS templates too.\n */\n\nvar ejs = require('../')\n , read = require('fs').readFileSync\n , join = require('path').join\n , path = ...
javascript
chosen
[ { "from": "system", "value": "Clean up autocomplete API load code\n\nMove the logic to a separate function, call it from componentDidMount().\n" }, { "from": "human", "value": "'use strict';\n\nimport React, { Component, PropTypes } from 'react';\nimport Button from './Button';\nimport TextInput...
javascript
chosen
[ { "from": "system", "value": "Fix bug when less artists than one page\n" }, { "from": "human", "value": "/* global app:true */\n\n'use strict';\n\napp.controller('MusicCtrl', ['$scope', 'Music', 'PER_PAGE', function($scope, Music, PER_PAGE) {\n var artistNum = 0;\n var finished = false;\n var...
javascript
chosen