conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use larger page size for ga4gh.\n" }, { "from": "human", "value": "/*global require: false, module: false */\n'use strict';\nvar ga4gh = require('ga4gh-rxjs');\nvar clinvarMeta = require('./metadataStub');\nvar Rx = require('rx');\nrequire('rx.experimental');\nvar _...
javascript
chosen
[ { "from": "system", "value": "Add ES6 string interpolation in template\n" }, { "from": "human", "value": "import React from 'react';\n\nconst Item = ({ \n onDeleteClick,\n name,\n year,\n rated,\n runtime,\n genre,\n director,\n actors,\n description,\n country,\n awards,\n poster,\n...
javascript
chosen
[ { "from": "system", "value": "Add a reset action type\n" }, { "from": "human", "value": "const prefix = '@@redux-simple-auth'\n\nexport const AUTHENTICATE = `${prefix}/AUTHENTICATE`\nexport const AUTHENTICATE_FAILED = `${prefix}/AUTHENTICATE_FAILED`\nexport const AUTHENTICATE_SUCCEEDED = `${pref...
javascript
chosen
[ { "from": "system", "value": "Fix watchify by enabling poll option\n\nhttps://github.com/substack/watchify/issues/216#issuecomment-104284044\n" }, { "from": "human", "value": "var browserify = require('browserify');\nvar watchify = require('watchify');\nvar gulp = require('gulp');\nvar gutil = r...
javascript
chosen
[ { "from": "system", "value": "Use correct check for not undefined\n" }, { "from": "human", "value": "const path = require('path');\nconst port = process.env.PORT || 3000;\nconst screenshotPath = path.resolve(__dirname, '..', 'test', 'acceptance', 'report', 'screenshots');\nconst reportPath = pat...
javascript
chosen
[ { "from": "system", "value": "client: Fix mui internal sheetsManager being shared between requests.\n" }, { "from": "human", "value": "import React from 'react'\nimport Document, { Head, Main, NextScript } from 'next/document'\nimport { JssProvider, SheetsRegistry } from 'react-jss'\n\nexport de...
javascript
chosen
[ { "from": "system", "value": "Fix PointText size test on new Safari...\n" }, { "from": "human", "value": "/*\n * Paper.js - The Swiss Army Knife of Vector Graphics Scripting.\n * http://paperjs.org/\n *\n * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey\n * http://scratchdisk.com/ & ht...
javascript
chosen
[ { "from": "system", "value": "Hide overlay on ajax error\n" }, { "from": "human", "value": "jQuery(document).ready(function($) {\n var container = $('#splashing_images');\n $.LoadingOverlaySetup({\n color : \"rgba(241,241,241,0.8)\",\n maxSize : \"80px\",\n ...
javascript
chosen
[ { "from": "system", "value": "Remove whitespace in speed formatter\n" }, { "from": "human", "value": "var moment = require('moment');\n\nvar _floor = function(val) {\n return Math.floor(val);\n};\n\nvar Formatters = {\n speed: function(speed) {\n var str;\n speed *= 8;\n ...
javascript
chosen
[ { "from": "system", "value": "Change Scatter Plot to Scatterplot in default title\n" }, { "from": "human", "value": "Settings = {\n chart: {\n padding: { right: 40, bottom: 100 },\n margins: { top: 30, bottom: 0, right: 35 },\n dots: {\n size: 5,\n color: '#378E00',\n op...
javascript
chosen
[ { "from": "system", "value": "Remove Carlos from footer ;(\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\n\n// Styles\nimport './footer.css';\n\nclass Footer extends PureComponent {\n render() {\n return <footer className=\"Footer pa3 flex justify-between f...
javascript
chosen
[ { "from": "system", "value": "Support urls that are not relative by leaving them un-changed\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar less = require('../thirdparty/less');\n\nmodule.exports = fixUrls;\nfunction fixUrls(getURL) {\n less.tree.URL.prototy...
javascript
chosen
[ { "from": "system", "value": "Add site footer to each documentation generator\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tac...
javascript
chosen
[ { "from": "system", "value": ":lipstick: Use JSLint, shrink Errors descriptions\n" }, { "from": "human", "value": "/*jshint node:true, browser:true */\n\n'use strict';\n\nvar Output = require('./output');\nvar output = null;\n\n/**\n * Try to request MIDI access, and select first\n * defined out...
javascript
chosen
[ { "from": "system", "value": "Add routing for /:page and /pages/:page\n\nRender them from their corresponding view directories\n" }, { "from": "human", "value": "var express = require('express');\nvar router = module.exports = express.Router();\nvar path = require('path');\n\nvar appDir = path.j...
javascript
chosen
[ { "from": "system", "value": "Set fallback language for angular-translate\n" }, { "from": "human", "value": "/**\n * Translation configuration\n */\nfunction translationConfig($translateProvider) {\n $translateProvider.useStaticFilesLoader({\n prefix: '/locale/locale-',\n suffix: '.json'\...
javascript
chosen
[ { "from": "system", "value": "Remove unnessesary var on gl object\n" }, { "from": "human", "value": "/**\n * @fileoverview script.js - JS Orrery - A CS323 Assignment\n * @author Ben Brooks (beb12@aber.ac.uk)\n * @version 1.0\n */\n\nvar gl;\n\nfunction init() {\n canvas = document.getElementByI...
javascript
chosen
[ { "from": "system", "value": "Stop opening link when clicking on ID" }, { "from": "human", "value": "// copy card id on click\nconst input = document.createElement('input');\ndocument.body.appendChild(input);\n\ndocument.addEventListener('click', (e) => {\n\n\tconst elem = e.originalTarget;\n\tc...
javascript
chosen
[ { "from": "system", "value": "Allow port to be set by heroku\n" }, { "from": "human", "value": "var path = require(\"path\");\nvar express = require(\"express\");\n\nvar app = express();\napp.set('port', 8080);\napp.use('/data', express.static('data'))\napp.use('/dist', express.static('dist'))\n...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Make host address configurable in ENV" }, { "from": "human", "value": "var express = require('express')\nvar requireAll = require('./lib/require-all')\n\ncontrollers = requireAll({\n dirname: __dirname + '/app/controllers',\n filter: /(.+)\\.js(on)?$/\n}...
javascript
chosen
[ { "from": "system", "value": "Set up contact form api endpoint\n" }, { "from": "human", "value": "/* jshint node: true, asi: true, laxcomma: true, esversion: 6 */\n'use strict'\n\nvar path = require('path');\nvar ghost = require('./ghost-middleware.js');\n\nconst express = require('express')\nco...
javascript
chosen
[ { "from": "system", "value": "Remove object from cache when unregistered\n\nAfter removing the object from the service on the bus, the Service was\nstill holding a reference in its internal cache, causing introspection\nto list the object when it didn't exist anymore.\n" }, { "from": "human", "v...
javascript
chosen
[ { "from": "system", "value": "Remove button from update notif\n\n- buttons aren't supported in FF notifs; error gets thrown\n- this is documented: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/notifications/NotificationOptions\n- this button also just did the same thing as notif click\n" }...
javascript
chosen
[ { "from": "system", "value": "Fix editor document id creation\n" }, { "from": "human", "value": "\nexport const getCKEditorDocumentId = (documentId, userId, formType) => {\n if (documentId) return `${documentId}-${userId}-${formType}`\n return `${userId}-${formType}`\n}\n\nexport function gene...
javascript
chosen
[ { "from": "system", "value": "Add the project to the environment\n" }, { "from": "human", "value": "'use strict';\n\nlet requireAsHash = require('../utils/require-as-hash'),\n Command = require('../models/command'),\n commands = requireAsHash('../commands/*.js', Command),\...
javascript
chosen
[ { "from": "system", "value": "Add px if needed before prefixing\n\nSince the list in `appendPxIfNeeded` does not include prefixed variants.\n" }, { "from": "human", "value": "/* @flow */\n\nimport appendPxIfNeeded from './append-px-if-needed';\nimport camelCasePropsToDashCase from './camel-case-...
javascript
chosen
[ { "from": "system", "value": "Fix jshint and missing semicolon\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport {module, test} from 'qunit';\nimport startApp from 'unicodeparty/tests/helpers/start-app';\n\nlet application;\n\nfunction getChars() {\n return new Set(Ember.$('...
javascript
chosen
[ { "from": "system", "value": "Make sure we only call focus() on focusable elements.\n\n\nsvn commit r1621\n" }, { "from": "human", "value": "function SwatForm(id)\n{\n\tthis.id = id;\n\tthis.form_element = document.getElementById(id);\n}\n\nSwatForm.prototype.setDefaultFocus = function(element_i...
javascript
chosen
[ { "from": "system", "value": "Update my poor man’s JavaScript error event tracking code.\n" }, { "from": "human", "value": "/* global ga */\n\nvar eventTracking = (function() {\n\n 'use strict';\n\n // http://blog.gospodarets.com/track_javascript_angularjs_and_jquery_errors_with_google_analyti...
javascript
chosen
[ { "from": "system", "value": "Handle a load order case\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this file,\n * You can obtain one at http://mozilla.org/MPL/2.0/. */...
javascript
chosen
[ { "from": "system", "value": "Add message if definition not found\n" }, { "from": "human", "value": "var request = require('request');\nmodule.exports = function(bot){\n\tbot.addCommand('define', 'Define', '[<keyword>]', USER_LEVEL_NORMAL, false, function(event){\n\t\tvar keyword = event.params....
javascript
chosen
[ { "from": "system", "value": "Create case for only external data.\n" }, { "from": "human", "value": "// if you don't specify a html file, the sniper will generate a div\nvar app = require(\"ProtVista\");\nnew app(\n {\n el: yourDiv, text: 'biojs',\n uniprotacc : 'P05067',\n ...
javascript
chosen
[ { "from": "system", "value": "feat(config): Add custom port, UI port (commeted out) to default config\n" }, { "from": "human", "value": "/* jshint node: true */\n\n'use strict';\n\nvar path = require('path');\n\nfunction getTaskConfig(projectConfig) {\n\t// Browser Sync options object\n\t// http...
javascript
chosen
[ { "from": "system", "value": "Fix a few things because it's sunday\n" }, { "from": "human", "value": "(function() {\n\tvar impl = document.implementation;\n\tvar mother;\n\tif (impl && impl.createHTMLDocument) {\n\t\tif (impl.custom) return;\n\t\tmother = impl.createHTMLDocument(\"\");\n\t} else...
javascript
chosen
[ { "from": "system", "value": "Fix MongoDB URL for heroku\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\n// var dbUrl = 'mongodb://username:password@mongodb:port/database';\n// var dbUrl = process.env.MONGO_DB_URL; // AWS\n// var dbUrl = process.env.MONGODB_URI; // Heroku...
javascript
chosen
[ { "from": "system", "value": "Fix non existing .env.json file\n" }, { "from": "human", "value": "/** Created by hhj on 1/26/16. */\nexport default function loadEnv(envFile) {\n let env\n if (process.env.IS_BROWSER !== true) {\n const fs = require('fs')\n const nodeEnv = process.env.NODE_...
javascript
chosen
[ { "from": "system", "value": "Create tests result file explicitly.\n" }, { "from": "human", "value": "global.__onUncaughtError = function(error){\n\tif(error.nativeException){\n\t\t__log(\"err.message: \" + error.message);\n\t\t__log(\"err.stackTrace: \" + error.stackTrace);\n\t\t// false == do ...
javascript
chosen
[ { "from": "system", "value": "Update @postman/shipit to version v0.3.0\n" }, { "from": "human", "value": "#!/usr/bin/env node\n// ---------------------------------------------------------------------------------------------------------------------\n// This script is intended to automate the vers...
javascript
chosen
[ { "from": "system", "value": "Make sure pages in search index do not have HTML extension\n" }, { "from": "human", "value": "---\n---\nwindow.search_data = {\n {%- assign documents = site.documents | concat: site.pages %}\n {%- for document in documents %}\n {%- unless document.title %}{% cont...
javascript
chosen
[ { "from": "system", "value": "Add lib and conf directories\n" }, { "from": "human", "value": "'use strict';\n\nvar moduleSrc = ['module-name.js'];\nvar specDir = 'spec';\nvar specs = specDir + '/**/*spec.js';\nvar gulpTasks = ['gulpfile.js', 'gulp/**/*.js'];\nvar allSrc = moduleSrc.concat(specs)...
javascript
chosen
[ { "from": "system", "value": "Join the rest of the tokens after slicing the param\n" }, { "from": "human", "value": "/* @flow */\n\nconst router = require('express').Router();\nconst SpotifyController = require('./SpotifyController');\nconst controller = new SpotifyController();\n\nconst validPa...
javascript
chosen
[ { "from": "system", "value": "Change style variables role name\n" }, { "from": "human", "value": "import {resolveRoles} from '@sanity/resolver'\nimport isPlainObject from 'lodash/isPlainObject'\nimport merge from 'lodash/merge'\n\nlet resolving = false\nconst waiting = []\nconst roleName = 'vari...
javascript
chosen
[ { "from": "system", "value": "Add missing data to the projects table.\n" }, { "from": "human", "value": "'use strict';\nconst Sequelize = require('sequelize');\n\n// projects-model.js - A sequelize model\n//\n// See http://docs.sequelizejs.com/en/latest/docs/models-definition/\n// for more of wh...
javascript
chosen
[ { "from": "system", "value": "Add Git info to server response\n" }, { "from": "human", "value": "// Load the http module to create an http server.\nvar http = require('http');\n\n// Configure our HTTP server to respond with Hello World to all requests.\nvar server = http.createServer(function (r...
javascript
chosen
[ { "from": "system", "value": "Handle 0 download counts in CLI" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar addCommas = require('add-commas')\nvar columnify = require('columnify')\nvar minimist = require('minimist')\nvar npmme = require('./')\n\nvar argv = minimist(process.arg...
javascript
chosen
[ { "from": "system", "value": "Allow {{include}} helper to load not only partials, but also files\n" }, { "from": "human", "value": "(function() {\n module.exports.register = function(Handlebars, options) {\n var fs = require('fs')\n , path = require(\"path\")\n , _ = require('...
javascript
chosen
[ { "from": "system", "value": "Add site footer to each documentation generator\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tac...
javascript
chosen
[ { "from": "system", "value": "Add clone and update serialization\n" }, { "from": "human", "value": "import Vector2 from 'flockn/types/vector2';\n\nclass Rect {\n constructor(x = 0, y = 0, w = 0, h = 0) {\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n }\n\n toString() {\...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary call to promisify\n" }, { "from": "human", "value": "const { promisify } = require(\"util\");\n\nconst command = {\n command: \"console\",\n description:\n \"Run a console with contract abstractions and commands available\",\n builder: {},\n...
javascript
chosen
[ { "from": "system", "value": "Fix page count for zero items\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nclass PagerNumbers extends React.Component {\n constructor(props, context) {\n super(props, context);\n }\n render(){\n const...
javascript
chosen
[ { "from": "system", "value": "Fix home when user is member of one organization\n" }, { "from": "human", "value": "angular.module('mainApp').controller('mainCtrl', function ($scope, $http) {\n\n if ($scope.loggedIn) {\n $scope.organizations = $scope.me.organizations.map(function (organi...
javascript
chosen
[ { "from": "system", "value": "Use defaultValue as a template, fix critical sync issue\n" }, { "from": "human", "value": "const Sequelize = require('sequelize');\n\nmodule.exports = {\n JSONType: (fieldName, {defaultValue = {}} = {}) => ({\n type: Sequelize.TEXT,\n get: function get() {\n ...
javascript
chosen
[ { "from": "system", "value": "Increase timeout for elm tests.\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar count = require('count-substring');\nvar htmlToText = require('html-to-text');\n\nmodule.exports = function (browser) {\n describe(\"The tests written in ...
javascript
chosen
[ { "from": "system", "value": "Add 'nan' to list of packages to remove from shrinkwrap\n" }, { "from": "human", "value": "/* eslint-disable no-var */\n// NPM 5 now adds optional dependencies, which older versions of npm\n// try to install even if it is the wrong architecture.\n\nvar fs = require(...
javascript
chosen
[ { "from": "system", "value": "Swap out Q for Promise and remove superfluous StatsD.\n" }, { "from": "human", "value": "// Copyright 2014-2015, Renasar Technologies Inc.\n/* jshint node: true */\n\n\"use strict\";\n\nvar di = require('di');\n\nmodule.exports = Runner;\n\ndi.annotate(Runner, new d...
javascript
chosen
[ { "from": "system", "value": "Use environment variables for Redis connection" }, { "from": "human", "value": "/**\n * Notifications system server front-end.\n *\n * @package randy\n * @author Andrew Sliwinski <andrew@diy.org>\n */\n\n/**\n * Dependencies\n */\nvar _ = require('underscore')...
javascript
chosen
[ { "from": "system", "value": "Enable dynamic update/recreation of sl-tooltip\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Mixin.create({\n\n /**\n * Attribute bindings for mixin's component element\n * @property {array} attributeBindings\n ...
javascript
chosen
[ { "from": "system", "value": "Watch unit tests and rerun on change\n" }, { "from": "human", "value": "module.exports = function(grunt) {\r\n grunt.initConfig({\r\n concat: {\r\n options: {\r\n separator: ''\r\n },\r\n app: {\r\n ...
javascript
chosen
[ { "from": "system", "value": "Increase timeout a lot because Windows is slow.\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n // Project configuration.\n grunt.initConfig({\n release: {},\n simplemocha: {\n options: {\n timeout: 60000,\n repo...
javascript
chosen
[ { "from": "system", "value": "Add button to main layout\nEncapsulate the page with a view so that the search bar appears at the\ntop, the search button right below and when data is entered the list\nwould be populated\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n...
javascript
chosen
[ { "from": "system", "value": "Define globals for lodash in rollup\n" }, { "from": "human", "value": "export default {\n entry: 'lib/src/index.js',\n dest: 'lib/apollo.umd.js',\n format: 'umd',\n sourceMap: true,\n moduleName: 'apollo',\n external: [\n 'lodash'\n ]\n};\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Fix naming bug that was bombing out lineitem autopopulate\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n\nvar Objectid = mongoose.Schema.Types.ObjectId;\nvar Organisation = require(\"./organisation_m...
javascript
chosen
[ { "from": "system", "value": "Save initial scope cookie if public and private\n" }, { "from": "human", "value": "var $ = require('jquery-browserify');\nvar _ = require('underscore');\nvar Backbone = require('backbone');\nvar templates = require('../../dist/templates');\nvar auth = require('../co...
javascript
chosen
[ { "from": "system", "value": "Add 3000 port to dev config\n" }, { "from": "human", "value": "/**\n * Development environment settings\n * @description :: This section overrides all other config values ONLY in development environment\n */\n\nmodule.exports = {\n log: {\n level: 'silly'\...
javascript
chosen
[ { "from": "system", "value": "Remove extends class for policies\n" }, { "from": "human", "value": "'use strict'\n\nconst Policy = require('trails-policy')\n\n/**\n * @module <%= name %>Policy\n * @description <%= answers.desc %>\n */\nmodule.exports = class <%= name %>Policy extends Policy {\n\n...
javascript
chosen
[ { "from": "system", "value": "Rename class to avoid copyright issue\n" }, { "from": "human", "value": "'use strict'\n\nclass Pokemon {\n\n constructor(name) {\n this.name = name;\n this.cp = 100;\n }\n\n attack() {\n console.log(`Attack ${this.cp} points!`);\n }\n\n p...
javascript
chosen
[ { "from": "system", "value": "Add type to search results\n" }, { "from": "human", "value": "// User Model\nmodule.exports = function(sequelize, DataTypes) {\n var User = sequelize.define('User', {\n type: { type: DataTypes.INTEGER, allowNull: false },\n name: { type: DataTypes.STR...
javascript
chosen
[ { "from": "system", "value": "Send a 404 if not found.\n" }, { "from": "human", "value": "module.exports = function(req, res, next){\n \"use strict\";\n var Strings = require('../../../strings'),\n Response = require('../../helpers/response'),\n content = require('../../../en...
javascript
chosen
[ { "from": "system", "value": "Use server constant in Items-service\n" }, { "from": "human", "value": "'use strict';\n\n/* Services */\nvar SERVER_URL = 'http://localhost:8081';\n\nangular.module('myApp.services', ['ngResource']).factory('Items', function ($resource) {\n return $resource('http...
javascript
chosen
[ { "from": "system", "value": "Remove the section from deptnums, to match with crsid.\n\nWRIT 111A and WRI111B have the same crsid, so now they'll have the same deptnum, too.\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar courses = require('./db').courses\n\nfunction splitDeptN...
javascript
chosen
[ { "from": "system", "value": "Set stroke properly for hexabins\n" }, { "from": "human", "value": "var _ = require('underscore');\nvar SimpleStyleDefaults = require('./simple-style-defaults');\nvar defaultFormValues = require('../../../data/default-form-styles.json');\nvar rampList = require('car...
javascript
chosen
[ { "from": "system", "value": "Add getRestaurantsFromYelp function, Remove ApiCall function and yelp.accessToken function\n" }, { "from": "human", "value": "const yelp = require('yelp-fusion');\nconst ApiSecrets = require('./apisecrets.js');\n\nconst searchRequest = {\n term: 'restaurant chinese...
javascript
chosen
[ { "from": "system", "value": "Fix for the blood module for travis\n" }, { "from": "human", "value": "import React from 'react';\nimport Analyzer from 'Parser/Core/Analyzer';\nimport SPELLS from 'common/SPELLS';\nimport SpellIcon from 'common/SpellIcon';\nimport AbilityTracker from 'Parser/Core/M...
javascript
chosen
[ { "from": "system", "value": "Fix error cause by payment number\n" }, { "from": "human", "value": "/**\n * Created by Wayne on 16/3/11.\n */\n'use strict';\n\nvar newTenderService = require('../../../libraries/services/new_tender_payment'),\n fs = require('fs');\n\nexports.examine = function (r...
javascript
chosen
[ { "from": "system", "value": "Rewrite old prototype--fixes a bug when parent setState inside callback calls old render\n" }, { "from": "human", "value": "'use strict';\n\nvar setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {\n /* jshint proto:true */\n obj.__proto__ = proto;\n ...
javascript
chosen
[ { "from": "system", "value": "Reformat to a commonly accepted coding style\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar path = require('path'),\n optimist = require('optimist'),\n usage = require('./usage'),\n commands = require('../lib/commands'),\n properties = req...
javascript
chosen
[ { "from": "system", "value": "Remove former getters/setters from Glyph\n" }, { "from": "human", "value": "import Game from './game';\n\nexport default class Glyph {\n\tconstructor(chr, fg, bg){\n\t\tthis.chr = chr || ' ';\n\t\tthis.fg = fg || null;\n\t\tthis.bg = bg || null;\n\t}\n\t//Setters an...
javascript
chosen
[ { "from": "system", "value": "Add unique constraint on username.\n" }, { "from": "human", "value": "var db = require('../db');\n\n\nmodule.exports = function() {\n\n db.serialize(function() {\n db.run(\"CREATE TABLE IF NOT EXISTS users (username TEXT, hashed_password BLOB, salt BLOB, name TE...
javascript
chosen
[ { "from": "system", "value": "Use single quote instead of backticks\n" }, { "from": "human", "value": "module.exports = {\n siteMetadata: {\n title: `JavaScript Zagreb`\n },\n plugins: [\n 'gatsby-plugin-styled-components',\n `gatsby-plugin-react-helmet`,\n 'gatsby-transformer-rem...
javascript
chosen
[ { "from": "system", "value": "Add id and class to calendar component\n" }, { "from": "human", "value": "import Day from './day';\n\nconst MS_IN_DAY = 1000*60*60*24;\n\nconst Calendar = ({ events }) => {\n\n let id = 0;\n let lastEpochDays = 0;\n let daysEvents = [];\n let allDays = [];\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add getFirst method to customers service (saas-185)\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n angular.module('ncsaas')\n .service('customersService', ['RawCustomer', customersService]);\n\n function customersService(RawCustomer) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove requiring unused module 'util'." }, { "from": "human", "value": "/**\n * Home controller\n */\n\nvar util = require('util');\n\nvar home = {\n index: function index(req, res, next) {\n res.locals.title = 'Home';\n res.render('index');\n },...
javascript
chosen
[ { "from": "system", "value": "Fix for user PS analysis.\n" }, { "from": "human", "value": "'use strict';\n\nvar User = require('../models/user');\nvar Person = require('../models/person');\nvar OperationalNumber = require('../models/psquare/op-number');\n\nvar express = require('express');\nvar ...
javascript
chosen
[ { "from": "system", "value": "Fix remove query causing tests to hang\n" }, { "from": "human", "value": "if (Meteor.isServer) {\n const _resetDatabase = function (options) {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'resetDatabase is not allowed outside ...
javascript
chosen
[ { "from": "system", "value": "Fix bug where station config wouldn't load when loaded in a subdirectory\n" }, { "from": "human", "value": "const Backbone = require(\"backbone\");\n\nmodule.exports = class StationConfig extends Backbone.Model {\n urlRoot = '/api/stations';\n\n defaults() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add a space before install command\n\nsee\nhttps://github.com/ForbesLindesay/spawn-sync/commit/b3d17f770571bd38fb66\nf0206d9bf549e165e58c#commitcomment-11172494\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar cp = require('child_proc...
javascript
chosen
[ { "from": "human", "value": "Implement simple singly and double linked list builders and node classes.\n" }, { "from": "gpt", "value": "//very basic implementation of singly and doubly linked lists. list constructors only create a list from an array, no helper methods\n//\n\nclass SinglyLinkedL...
javascript
chosen
[ { "from": "system", "value": "Fix logic, add fun non-primary colors\n" }, { "from": "human", "value": "function turnRed(){\n $('.nav-main-container').css('background-color', 'red');\n };\n\nfunction turnPurple(){\n $('.nav-main-container').css('background-color', 'purple');\n };\n\nvar url =...
javascript
chosen
[ { "from": "system", "value": "Add mongoDB from jitsu URL\n" }, { "from": "human", "value": "module.exports = {\n db : {\n URL : 'mongodb://localhost/wapm',\n port : 3000\n },\n port : 8000\n}\n" }, { "from": "gpt", "value": "module.exports = {\n db : {\n URL : 'mongodb:/...
javascript
chosen
[ { "from": "system", "value": "FailureOnlyReporter: Add missing newline character to `report()` method\n" }, { "from": "human", "value": "const TapReporter = require('testem/lib/reporters/tap_reporter');\n\nclass FailureOnlyReporter extends TapReporter {\n constructor(...args) {\n super(...ar...
javascript
chosen
[ { "from": "system", "value": "Change to import from index instead of main\n" }, { "from": "human", "value": "/* to run: babel-node albums.js */\n\nglobal.fetch = require('node-fetch');\n\nimport { searchAlbums } from '../src/main';\n\nconst albums = searchAlbums('Incubus');\n\nalbums.then(data =...
javascript
chosen
[ { "from": "system", "value": "Repair option if params not exists.\n" }, { "from": "human", "value": "var PermissionConstructor = require('./PermissionConstructor').PermissionConstructor;\n\nfunction WebService(currentUser) {\n\tthis._currentUser = currentUser;\n\tthis._dependencies = {};\n\tthis...
javascript
chosen
[ { "from": "system", "value": "Test fix for IE8 delete-confirm problem.\n" }, { "from": "human", "value": "(function() {\n\twindow.utils = {\n\t\tinitDeleteConfirm: function(formSelector) {\n\t\t\t$(\".delete-btn\").click(function() {\n\t\t\t\twindow.utils.openDeleteConfirm(formSelector);\n\t\t\t...
javascript
chosen
[ { "from": "system", "value": "Add tests for parsing a book with option \"root\"\n" }, { "from": "human", "value": "var Book = require('../../models/book');\nvar createMockFS = require('../../fs/mock');\n\ndescribe('parseBook', function() {\n var parseBook = require('../parseBook');\n\n pit...
javascript
chosen
[ { "from": "system", "value": "Fix Input Iterator Checker for whiteList\n" }, { "from": "human", "value": "module.exports = {\n generateQueryString: function (data) {\n var ret = []\n for (var d in data)\n if (data[d])\n ret.push(encodeURIComponent(d) + \"=\" + encodeURICompone...
javascript
chosen
[ { "from": "system", "value": "Tidy JSDoc of server parser module\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar Parser = require('htmlparser2/lib/Parser');\nvar DomHandler = require('domhandler');\n\n/**\n * Parse HTML string to DOM nodes.\n *\n * This...
javascript
chosen
[ { "from": "system", "value": "Fix settings manager override with null key\n" }, { "from": "human", "value": "\"use strict\";\n\nvar JSONSerializer = require('./JSONSerializer'),\n _ = require('lodash');\n\nvar SettingsManager = function (data, serializer) {\n this._data = data || {};\n ...
javascript
chosen
[ { "from": "system", "value": "Add iscroll reference into the element in order to allow the element to manipulate if (for instance the refresh) NOT REALY NICE WAY DO TO THAT, BUT SIMPLE\n" }, { "from": "human", "value": "\nvinisketch.directive ('vsScrollable', function () {\n\n return {\n rep...
javascript
chosen
[ { "from": "system", "value": "Refactor mixin with a $watch\n" }, { "from": "human", "value": "\"use strict\";\n\n/* Directives */\n\nangular.module( \"TrelloBlogDirectives\", [\"ngSanitize\"] )\n .directive( \"markdown\", [\"$sanitize\", function ( $sanitize ) {\n var converter = new Showdow...
javascript
chosen
[ { "from": "system", "value": "Fix wcag issues by correcting a aria-describedby reference and improving a link-tekst\n\nKB-524\nKB-527\nKB-530\nKB-532\n" }, { "from": "human", "value": "const config = require('collections-online/shared/config');\nrequire('cookieconsent/build/cookieconsent.min.js'...
javascript
chosen