conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use a json file instead of console\n" }, { "from": "human", "value": "var Clairvoyance = require('./clairvoyance');\n\nmodule.exports = new CLI();\n\nfunction CLI() {}\n\nCLI.prototype.start = function(options) {\n this.parser = new Clairvoyance(options);\n this.p...
javascript
chosen
[ { "from": "system", "value": "Add test-app command to help output\n" }, { "from": "human", "value": "'use strict';\n\nvar hasArgument = require('./hasArgument');\nvar isCommand = require('./isCommand');\nvar replaceArgument = require('./replaceArgument');\nvar replaceCommand = require('./replace...
javascript
chosen
[ { "from": "system", "value": "Move the CURRENT_USER_STORAGE_KEY constant to SessionManager\n" }, { "from": "human", "value": "'use strict';\n\nvar React = require('react-native');\nvar Constants = require('./constants');\n\nvar { AsyncStorage } = React;\n\nvar SessionManager = {\n login: functi...
javascript
chosen
[ { "from": "system", "value": "Add more objects to cache in the service worker.\n" }, { "from": "human", "value": "/**\n * Created by Alvaro on 18/03/2017.\n */\n\n// use a cacheName for cache versioning\nvar CACHE_NAME = 'static-v1';\nvar urlsToCache = [\n './',\n './js/main.js'\n];\n\n// duri...
javascript
chosen
[ { "from": "system", "value": "Exclude test suite from jsdoc\n" }, { "from": "human", "value": "include('helma/webapp/response');\ninclude('helma/jsdoc');\nrequire('core/array');\n\nvar log = require('helma/logging').getLogger(module.id);\n\nexports.index = function index(req, module) {\n var ...
javascript
chosen
[ { "from": "system", "value": "Comment out favicon. No icon added to project\n" }, { "from": "human", "value": "var express = require('express');\n\nvar routes = require('./routes');\nvar http = require('http');\nvar path = require('path');\n\nvar app = express();\n\n// all environment...
javascript
chosen
[ { "from": "system", "value": "Replace only the first part of the require call\n\nThis permits replacement of submodule require statements like\n`require('this-package/some-submodule')`.\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar replace = require('stream-replace')\nvar path = re...
javascript
chosen
[ { "from": "system", "value": "Add note to enable unicorn/prefer-node-protocol on ESLint 8 release\n" }, { "from": "human", "value": "let base = require('./ts')\n\nmodule.exports = {\n ...base,\n plugins: [...base.plugins],\n rules: {\n ...base.rules,\n 'unicorn/prefer-module': 'error',\...
javascript
chosen
[ { "from": "system", "value": "Replace storybook-state usage from radio story with useState\n" }, { "from": "human", "value": "import React from 'react';\nimport { addStoryInGroup, LOW_LEVEL_BLOCKS } from '../../../.storybook/utils';\nimport { Store, State } from '@sambego/storybook-state';\nimpo...
javascript
chosen
[ { "from": "system", "value": "Add all of the states\n" }, { "from": "human", "value": "/*global exports */\n\n(function () {\n \"use strict\";\n\n var popularNamesPerState = function(req, res) {\n var body = JSON.stringify([\n {name: 'Smith', geo: {lat: -37.716, lon: 144....
javascript
chosen
[ { "from": "system", "value": "Fix text vert margin on RoundedButton\n" }, { "from": "human", "value": "'use strict'\n\nimport { StyleSheet } from 'react-native'\nimport { Fonts, Colors, Metrics } from '../../Themes/'\n\nexport default StyleSheet.create({\n button: {\n height: 45,\n border...
javascript
chosen
[ { "from": "system", "value": "Add tr.fuelx.com as the request uri\n" }, { "from": "human", "value": "const child = require('child_process');\n\nconst forkCount = parseInt(process.argv[2]);\nconst forkCalls = parseInt(process.argv[3])\nconst intervalTime = parseInt(process.argv[4]);\nconst targ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Prevent link processing for dropdowns\"\n\nThis reverts commit 2cb937a4405627c94c05c391dd610b85ba7e1cad.\n" }, { "from": "human", "value": "'use strict';\n\n\n/**\n * client\n **/\n\n/**\n * client.common\n **/\n\n\n/*global $, _, nodeca, window, document...
javascript
chosen
[ { "from": "system", "value": "Remove .export-action-download now that reports.download_export.js is gone\n" }, { "from": "human", "value": "hqDefine(\"reports/js/base\", function() {\n $(function() {\n hqImport(\"reports/js/filters/main\").init();\n\n var initial_page_data = hqI...
javascript
chosen
[ { "from": "system", "value": "Use LocalDisk as data storage\n" }, { "from": "human", "value": "/**\n * Default model configuration\n * (sails.config.models)\n *\n * Unless you override them, the following properties will be included\n * in each of your models.\n *\n * For more info on Sails mode...
javascript
chosen
[ { "from": "system", "value": "Fix assign member to the team\n" }, { "from": "human", "value": "import Ember from 'ember';\n\n\nconst {\n Route,\n RSVP\n} = Ember;\n\nexport default Route.extend({\n\n deactivate() {\n this.store.peekAll('team-member').forEach((team) => {\n if (team.get...
javascript
chosen
[ { "from": "system", "value": "Update cors port to bind to default addr\n" }, { "from": "human", "value": "// Heroku defines the environment variable PORT, and requires the binding address to be 0.0.0.0\nvar host = process.env.PORT ? '0.0.0.0' : '127.0.0.1';\nvar port = process.env.PORT || 9199;\...
javascript
chosen
[ { "from": "system", "value": "Revert \"rough demo of multiple storage service solution\"\n\nThis reverts commit b48f0ad1777790b931dbec1ae5c0e448fa8f1fc5.\n" }, { "from": "human", "value": "'use strict';\n\napp.factory('locationStorageService', function() {\n\tvar STORAGE_ID = 'locations-angularj...
javascript
chosen
[ { "from": "system", "value": "Fix for plugins directory not being available\n" }, { "from": "human", "value": "var express = require('express');\n\nvar app = express();\n\napp.get('/', function(request, response) {\n response.sendfile(__dirname + '/index.html');\n});\n\napp.configure(function...
javascript
chosen
[ { "from": "system", "value": "Add api example usage inside configure method\n" }, { "from": "human", "value": "angular.module('MyApp', ['ngResource', 'ngMessages', 'ngRoute', 'ngAuth', 'mgcrea.ngStrap'])\n .config(function($routeProvider, AuthProvider) {\n $routeProvider\n .when('/', {\...
javascript
chosen
[ { "from": "system", "value": "Create basic proof of concept\n" }, { "from": "human", "value": "// The module 'vscode' contains the VS Code extensibility API\n// Import the module and reference it with the alias vscode in your code below\nvar vscode = require('vscode');\n\n// this method is calle...
javascript
chosen
[ { "from": "system", "value": "Add error for invalid pda transitions\n" }, { "from": "human", "value": "export class UnknownCharError extends Error {\n constructor(unknownChar) {\n super(`Character '${unknownChar}' is not a part of the alphabet.`)\n }\n}\n\nexport class UnknownStateE...
javascript
chosen
[ { "from": "system", "value": "Change jquery `find` to `querySelectorAll`\n\nUsing `querySelectorAll` rather than `querySelector` as input is a list\nof radio buttons or checkboxes\n\nRemove global JQuery object as we're no longer using it.\n" }, { "from": "human", "value": "window.GOVUK = window...
javascript
chosen
[ { "from": "system", "value": "Enable debug comments in grunt-sass output file\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n //grunt-sass\n grunt.config('sass', {\n options: {\n outputStyle: 'expanded',\n //includePaths: ['<%= config....
javascript
chosen
[ { "from": "system", "value": "Return the authorization url when `authorize` fails\n\ns.t. the user can manually authorize and set the token in `config.js`\n" }, { "from": "human", "value": "/**\n * The authorization token with which calls to the API are made.\n * @type {String}\n */\nlet token =...
javascript
chosen
[ { "from": "system", "value": "Add autoHide prop to pass down\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react'\nimport {Scrollbars} from 'react-custom-scrollbars'\n\nclass FancyScrollbox extends Component {\n constructor(props) {\n super(props)\n }\n\n re...
javascript
chosen
[ { "from": "system", "value": "Fix forceUpdate sometimes called on unmounted component.\n" }, { "from": "human", "value": "/* @flow */\nimport React from 'react'\nimport MessageView from '../Message'\nimport type { Message } from 'types'\nimport styles from './style.css'\n\ntype Props = {\n mess...
javascript
chosen
[ { "from": "system", "value": "Add ability to change image\n\nUses the strait image property with a url.\n" }, { "from": "human", "value": "function doClick(e) { \n alert($.label.text);\n}\n\n$.index.open();\n" }, { "from": "gpt", "value": "// var FileLoader = require(\"file_loade...
javascript
chosen
[ { "from": "system", "value": "Add support for Bower to Webpack\n" }, { "from": "human", "value": "var path = require(\"path\")\n\nconst PROJECT_ROOT = path.resolve(__dirname)\n\nmodule.exports = {\n entry: [\n \"./scripts/dash-spinner/bar.js\",\n \"./scripts/dash-spinner/foo.js\",\n \"...
javascript
chosen
[ { "from": "system", "value": "Make REPL context properties read-only\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar r = require( 'repl' );\nvar getKeys = require( 'object-keys' ).shim();\nvar namespace = require( '@stdlib/namespace' );\nvar defaults = require( './defaul...
javascript
chosen
[ { "from": "system", "value": "Support filtering table contents before copying\n" }, { "from": "human", "value": "/* ============================================================\n tableCopy plugin\n Copy the selected table to the clipboard\n Returns a promise, which resolves true if the cop...
javascript
chosen
[ { "from": "system", "value": "Fix exponent/js tests, fix up error message in PushRouter\n\nfbshipit-source-id: 08de963\n" }, { "from": "human", "value": "/**\n * Copyright 2015-present 650 Industries. All rights reserved.\n *\n * @providesModule Config\n */\n'use strict';\n\nexport default {\n ...
javascript
chosen
[ { "from": "system", "value": "Make $log available within our DomainsCtrl\n" }, { "from": "human", "value": "app.controller('DomainsCtrl', ['$scope', 'Domains',\n function($scope, Domains) {\n $scope.domains = Domains.query();\n }\n]);\n\n\n" }, { "from": "gpt", "value": ...
javascript
chosen
[ { "from": "system", "value": "Move functionality into a createModel method. Allows for model instantiation outside of this static class. Creating getters for model retrieval." }, { "from": "human", "value": "// ### Part of the [Rosy Framework](http://github.com/ff0000/rosy)\n/* site.js */\n\n// ...
javascript
chosen
[ { "from": "system", "value": "Update example to include a text area to input text.\n" }, { "from": "human", "value": "import React from 'react';\nimport AutoLinkText from 'react-autolink-text';\n\nReact.render(<AutoLinkText />, document.getElementById('app'));\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Use util.log for logging example.\n" }, { "from": "human", "value": "exports.conf = {\n \"tasks\": {\n \"all_docs\": function (util, doc) {\n console.log(doc);\n }\n }\n};\n" }, { "from": "gpt", "value": "exports.conf = {\n \"tasks\": {\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor parser again to remove use of exceptions\n" }, { "from": "human", "value": "define(function() {\n 'use strict';\n\n /**\n * @class\n */\n function CurrencyParser() { }\n\n function ParseError() { }\n\n var penceOnlyParser = function (...
javascript
chosen
[ { "from": "system", "value": "Call done() only when really done.\n" }, { "from": "human", "value": "/**\n * Module Dependencies.\n */\n\nvar debug = require('debug')('metalsmith-static');\nvar ncp = require('ncp').ncp;\nvar path = require('path');\nvar fsextra = require('fs-extra');\n\n\n/...
javascript
chosen
[ { "from": "system", "value": "Use 'postcompose' event to export the map as png image\n" }, { "from": "human", "value": "goog.require('ol.Map');\ngoog.require('ol.RendererHint');\ngoog.require('ol.View2D');\ngoog.require('ol.layer.Tile');\ngoog.require('ol.source.OSM');\n\n\nvar map = new ol.Map(...
javascript
chosen
[ { "from": "system", "value": "Remove remnants of JS layout resizing code\n" }, { "from": "human", "value": "\n// UI is a singleton with events\nfunction UI(){};\nUI.prototype = new EventEmitter();\nUI = new UI();\n\n// fires a custom event after the user has finished resizing the window\nUI.once...
javascript
chosen
[ { "from": "system", "value": "Hide new / delete button on welcome page\n" }, { "from": "human", "value": "/**\n * garp.welcomepanel.js\n * \n * Convenience Class, creates a panel with a message from HTML markup in de view.\n * \n * @class Garp.WelcomePanel\n * @extends Panel\n * @author Peter\n ...
javascript
chosen
[ { "from": "system", "value": "Allow output path to be changed when invoking with envir variables\n" }, { "from": "human", "value": "'use strict';\n\nconst GtfsGenerator = require('../lib/GtfsGenerator');\n\n/* Invoke the generator based on environment variables. */\nGtfsGenerator.fromEnvironment...
javascript
chosen
[ { "from": "system", "value": "Add distance field present check\n" }, { "from": "human", "value": "var Observable = require(\"FuseJS/Observable\");\nvar GeoLocation = require(\"FuseJS/GeoLocation\");\nvar Model = require('Sanntidsappen/Model');\n\n\nvar search_string = Observable('');\nvar search...
javascript
chosen
[ { "from": "system", "value": "refactor: Prepare to move preact renderer out.\n" }, { "from": "human", "value": "// @flow\n\nimport { h, render } from 'preact';\nimport { withProps } from './with-props';\nimport { withRender } from './with-render';\nimport { withUnique } from './with-unique';\n\n...
javascript
chosen
[ { "from": "system", "value": "Remove unused require-jsdoc override from react env\n" }, { "from": "human", "value": "/**\n * Js-coding-standards\n *\n * @author Robert Rossmann <rr.rossmann@me.com>\n * @copyright 2016 STRV\n * @license http://choosealicense.com/licenses/bsd-3-clause ...
javascript
chosen
[ { "from": "system", "value": "Add current time/duration for Deezer connector\n" }, { "from": "human", "value": "'use strict';\n\n/* global Connector */\n\nConnector.playerSelector = '#page_sidebar';\n\nConnector.getArtist = function() {\n\tvar artists = $.map($('.player-track-artist').children()...
javascript
chosen
[ { "from": "system", "value": "Support hours place in colonSeparateDuration\n" }, { "from": "human", "value": "var cbus = {};\n\nvar xhr = function(url, callback) {\n var oReq = new XMLHttpRequest();\n oReq.onload = function(e){\n callback(this.responseText, e);\n };\n oReq.ope...
javascript
chosen
[ { "from": "system", "value": "Support for controller API concerning graphs.\n" }, { "from": "human", "value": "App.Graphs = Ember.Object.extend({\n graph: function(emberId, entityName, entityType) {\n $.ajax({\n url: ((!localStorage.apiDomain) ? '' : '//' + localStorage.apiDomain) + '/g...
javascript
chosen
[ { "from": "system", "value": "Set the link status to 'up' when init done\n" }, { "from": "human", "value": "_INJ = new Object();\n(function() { //setup\nvar pre = document.getElementById('edoutput');\nvar cv = document.getElementById('injectedcanvas');\nif (cv == null)\n{\n\tcv = document.create...
javascript
chosen
[ { "from": "system", "value": "Add close handler to bootstrap alerts.\n" }, { "from": "human", "value": "/* Serialize a form to a Javascript object. */\n$.fn.serializeObject = function()\n{\n var o = {};\n var a = this.serializeArray();\n $.each(a, function() {\n if (o[this.name] ...
javascript
chosen
[ { "from": "system", "value": "Set up watch task in Gulp\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n plugins = require('gulp-load-plugins')();\n\ngulp.task('sass', () => gulp\n .src('css/quis.scss')\n .pipe(plugins.sass({\n outputStyle: 'compressed'\n }))\n .pipe(gu...
javascript
chosen
[ { "from": "system", "value": "Remove location lookup console statements\n" }, { "from": "human", "value": "import CanvasClass from './CanvasClass';\nimport TextOverlay from './TextOverlay';\nimport mapboxgl from 'mapbox-gl';\n\n/**\n * Location Lookup class - Binds Google places to text box and ...
javascript
chosen
[ { "from": "system", "value": "Remove useless babel-polyfill import in tests\n" }, { "from": "human", "value": "import \"babel-polyfill\";\nimport formatter from \"../src/formatter\";\n\ndescribe(\"formatter\", function() {\n beforeEach(function() {\n this.n1qlFormatter = {\n ...
javascript
chosen
[ { "from": "system", "value": "Correct comment about codepoints in Dashycode unit tests\n" }, { "from": "human", "value": "'use strict';\n\nconst assert = require('assert');\nconst Dashycode = require('./../../.lib-dist/dashycode');\n\ndescribe('Dashycode', function () {\n\t// Technically we shou...
javascript
chosen
[ { "from": "system", "value": "Fix test by setting a large timeout\n\nThis is needed as downloading and extracting Magento could take a while\nso I've just a large timeout. Improvements welcome\n" }, { "from": "human", "value": "/*global describe, beforeEach, it*/\n'use strict';\n\nvar path = ...
javascript
chosen
[ { "from": "system", "value": "Fix indent in jQuery file\n" }, { "from": "human", "value": "/*!\n * jQuery special event \"tap\" using tap.js\n * Released under MIT license\n */\n(function ($) {\n 'use strict';\n \n $.event.special.tap = (function () {\n \n // Fallback to click events in...
javascript
chosen
[ { "from": "system", "value": "Call it \"accountName\" for consistency.\n" }, { "from": "human", "value": "import DS from 'ember-data';\n\nexport default DS.Model.extend({\n username: DS.attr('string'),\n apiKey: DS.attr('string'),\n});\n" }, { "from": "gpt", "value": "import DS fro...
javascript
chosen
[ { "from": "human", "value": "Add roundDecimal() function, edit the function's comment. Add the console.log(\"Library has finished loading.\"); statement\n" }, { "from": "gpt", "value": "/*\n * Developed by Radu Puspana\n * Date August 2017\n * Version 1.0\n */\n\n\n// Round the n-th decimal of a...
javascript
chosen
[ { "from": "system", "value": "Add addDays to JS Date\n" }, { "from": "human", "value": "(function(fn, _, undefined) {\n fn.fromString = function(string) {\n var [year, month, day] = _.map(string.split('-'), function(s) {\n return Number.parseInt(s);\n });\n return new Date(year, m...
javascript
chosen
[ { "from": "system", "value": "Disable `add tag` shortcut on mobile\n" }, { "from": "human", "value": "export default {\n bind(_el, _, { context: $vue }) {\n const el = _el;\n\n el.addEventListener('keydown', (e) => {\n const { key } = e;\n\n if (typeof key === 'undefined') retur...
javascript
chosen
[ { "from": "system", "value": "Check for oninput support instead of browser type\n" }, { "from": "human", "value": "/*\n * Every time the form field is changed, sanitize its contents with the given\n * function to only allow input of a certain form.\n */\n(function ($) {\n jQuery.fn.restrict =...
javascript
chosen
[ { "from": "system", "value": "Disable the offline plugin for Gatsby\n" }, { "from": "human", "value": "module.exports = {\n siteMetadata: {\n title: `Neon Tsunami`,\n author: `Dwight Watson`,\n description: `A blog on Laravel & Rails.`,\n siteUrl: `https://www.neontsunami.com`,\n ...
javascript
chosen
[ { "from": "system", "value": "Fix a tiny issue in date module unit test\n" }, { "from": "human", "value": "/* eslint-env mocha, jest */\n\nimport {\n parse,\n dayStart,\n dayEnd,\n addDays,\n} from '../date';\n\nconst sampleUnixDate = 1511100000000;\n\nit('should parse date correctly', () =>...
javascript
chosen
[ { "from": "system", "value": "Adjust JSDoc comment to be more descriptive\n" }, { "from": "human", "value": "import * as React from 'react';\n\n/**\n * Main List Element to be displayed on the Navigation.\n *\n * @param {href: a URL String to a resource, innerText: The display text}\n */\nconst ...
javascript
chosen
[ { "from": "system", "value": "Set file log level from INFO -> DEBUG\n" }, { "from": "human", "value": "'use strict'\n\nconst path = require('path')\nconst bunyan = require('bunyan')\n\nconst isRunningTests = process.env.npm_lifecycle_event === 'test'\nconst stdoutLevel = isRunningTests ? 'FATAL'...
javascript
chosen
[ { "from": "system", "value": "Fix .setStrokeColor() and .setStrokeWidth() using CSS instead of SVG attributes\n" }, { "from": "human", "value": "\"use strict\"\n\nvar SVGElement = require(\"./SVGElement.js\")\n , inherits = require(\"util\").inherits\n\nvar SVGShape = module.exports = function ...
javascript
chosen
[ { "from": "system", "value": "Remove \"/donate\" from opencollective link\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/* eslint-disable */\n/* Adapted from nodemon's postinstall: https://github.com/remy/nodemon/blob/master/package.json */\n\nvar msg = 'Take a look at https://opencoll...
javascript
chosen
[ { "from": "system", "value": "DNS: Change name value to \"Answer\". Add error checking of api_result.\n" }, { "from": "human", "value": "(function(env){\n 'use strict';\n \n env.ddg_spice_dns = function(api_result) {\n\n var records = DDG.getProperty(api_result, 'response.records...
javascript
chosen
[ { "from": "system", "value": "Switch API host to production\n" }, { "from": "human", "value": "window.config = {\n\tGA_code : \"\",\n\tAPI_HOST : \"http://develop.codedoodl.es\",\n\tSITE_URL : \"http://codedoodl.es\",\n\tassets_url : \"http://assets.codedoodl.es\",\n\tdoodles_url : \"...
javascript
chosen
[ { "from": "system", "value": "Rework default validation to new api\n" }, { "from": "human", "value": "module.exports = {\n 'default': {\n message: 'Something is wrong with this field.'\n },\n email: {\n rule: /\\S+@\\S+\\.\\S+/,\n message: 'Wrong email format.'\n },\n required: {\n...
javascript
chosen
[ { "from": "system", "value": "Replace isFunction check with more open isCallable\n" }, { "from": "human", "value": "'use strict';\n\nvar slice = Array.prototype.slice\n , isFunction = require('es5-ext/lib/Function/is-function')\n , silent = require('es5-ext/lib/Function/prototype/sile...
javascript
chosen
[ { "from": "system", "value": "Change delta to use 'change:delta' event\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n var app = this.app\n , _ = require('lodash')\n , debug = require('debug')('signalk-server:interfaces:ws')\n , Primus = require('prim...
javascript
chosen
[ { "from": "system", "value": "Add fuction to detect team\n" }, { "from": "human", "value": "'use strict';\n\nconst GitHubApi = require(\"github\");\n\nclass GitHubApiClient {\n constructor() {\n this.github = new GitHubApi({\n debug: !!process.env.DEBUG,\n timeout: 5000\n });\n\...
javascript
chosen
[ { "from": "system", "value": "Add space in requireEnhancedObjectLiterals error\n\nThis adds a missing space to the second } in the error message for consistency." }, { "from": "human", "value": "var assert = require('assert');\n\nmodule.exports = function() { };\n\nmodule.exports.prototype = {\n...
javascript
chosen
[ { "from": "system", "value": "Add also target to sendMessage payload\n" }, { "from": "human", "value": "// # action-creators\n//\n// Pure functions for creating action-objects which the platform bots then\n// translates to actual operations on that platform.\n\nconst types = require('./action-...
javascript
chosen
[ { "from": "system", "value": "Add second alternative to solution\n" }, { "from": "human", "value": "var MaxProduct = function(){};\n\n/*\nalternative could be to sort it in descending order and multiply the first two elements, but it would be slower.\n arr.sort(function(a, b){\n return b-a;\...
javascript
chosen
[ { "from": "system", "value": "Add description to JS template function\n" }, { "from": "human", "value": "function AstronomyLibs_Template_int2Float(number) {\n var outvar = parseFloat(number.toString());\n\n return outvar;\n}" }, { "from": "gpt", "value": "/*\n * AstronomyLibs_T...
javascript
chosen
[ { "from": "system", "value": "Remove undefined version from CLI\n" }, { "from": "human", "value": "import 'babel-polyfill';\nimport fs from 'fs';\nimport readline from 'readline';\nimport program from 'commander';\nimport { observer as globalObserver } from '../../common/utils/observer';\nimport...
javascript
chosen
[ { "from": "system", "value": "Add comment about async dictionary\n" }, { "from": "human", "value": "define(['./helpers/trie'], function(Trie){\n function BoggleSolver(board){\n var solutions = new Set();\n var solArray;\n var trie = Trie.loadDictionary();\n solve(b...
javascript
chosen
[ { "from": "system", "value": "Add mouseover and mouse leave to ShapeEventEmitter\n" }, { "from": "human", "value": "var Vector = require('./vector.js');\nvar EventEmitter = require('events').EventEmitter;\nvar util = require('util');\n\n/**\n *\n * @constructor\n */\nvar ShapeEventEmitter = fun...
javascript
chosen
[ { "from": "system", "value": "Fix export annotation on abstract IReleasable\n\nIt does not make sense to truly export an abstract interface. This\nshould always have used the exportInterface annotation.\n\nChange-Id: If170b41b89728dd549669cee0c606de492b79ad9\n" }, { "from": "human", "value": "/...
javascript
chosen
[ { "from": "system", "value": "Update to a working example of async and await" }, { "from": "human", "value": "async function tellYouLater(sayWhat) {\n // Do something asynchronous, such as DB access, web access, etc.\n const result = await somethingAsync(sayWhat);\n return result;\n}\n"...
javascript
chosen
[ { "from": "system", "value": "Add link to MapConfig spec\n" }, { "from": "human", "value": "var Crypto = require('crypto');\n\n// Map configuration object\n\n/// API: Create MapConfig from configuration object\n//\n/// @param obj js MapConfiguration object\n///\nfunction MapConfig(cfg) {\n // T...
javascript
chosen
[ { "from": "system", "value": "feat(logger): Add date/time stamp to log output\n\nThe `\"%d{DATE}\"` in the log pattern adds a date and time stamp to log\nlines.\nSo you get output like this from karma's logging:\n```\n30 06 2015 15:19:56.562:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-43808925\n```\nT...
javascript
chosen
[ { "from": "system", "value": "Use html tech from bemhtml library\n" }, { "from": "human", "value": "var PATH = require('path'),\n\n pjoin = PATH.join,\n presolve = PATH.resolve.bind(null, __dirname),\n\n PRJ_ROOT = presolve('../../'),\n\n PRJ_TECHS = presolve('../techs/'),\n BEMBL...
javascript
chosen
[ { "from": "system", "value": "Hide load more button if no stories\n" }, { "from": "human", "value": "import React from 'react';\r\nimport {\r\n ListView,\r\n RefreshControl,\r\n View\r\n} from 'react-native';\r\n\r\nimport Footer from './Footer';\r\nimport Story from './Story';\r\n\r\nconst r...
javascript
chosen
[ { "from": "system", "value": "Config: Read Stripe key from the file system\n\n... the private one.\n" }, { "from": "human", "value": "// Don't put secret values nto the source tree.\r\nmodule.exports = {\r\n\r\n};" }, { "from": "gpt", "value": "var fs = require('fs');\r\nmodule.expor...
javascript
chosen
[ { "from": "system", "value": "Set disqus page title and hardcode url to nusmods.com\n" }, { "from": "human", "value": "define(['backbone.marionette', 'hbs!../templates/module'],\n function (Marionette, template) {\n 'use strict';\n\n return Marionette.ItemView.extend({\n template: te...
javascript
chosen
[ { "from": "system", "value": "Fix bug when user directly navigates to different routes via URL change\n" }, { "from": "human", "value": "var express = require('express');\nvar path = require('path');\nvar cors = require('cors');\nvar proxy = require('http-proxy-middleware');\n\nvar app = express...
javascript
chosen
[ { "from": "system", "value": "Use javascript to control the affixing\n" }, { "from": "human", "value": "$('[data-toggle=collapse]').click(function(){\n var attr = $(this).attr(\"data-target\");\n $('a.collapsible[data-toggle=collapse]').each(function(){\n var new_attr = $(this).attr(\"data-...
javascript
chosen
[ { "from": "system", "value": "Rename env var to PUSHOVER_TOKEN\n" }, { "from": "human", "value": "exports.name = 'task.pushover';\nexports.version = '1.0.0';\n\nexports.register = function(plugin, options, next) {\n var app = plugin.app;\n var request = app.service.request;\n var url ...
javascript
chosen
[ { "from": "system", "value": "Remove broken reference to the 'add-module-exports' Babel plugin.\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n entry: path.resolve('./src/script/index.js'),\n devtool: 'eval',\n resolve: {\n extensions: ['.js', '.jsx',...
javascript
chosen
[ { "from": "system", "value": "Add helpers for VAT calculations\n" }, { "from": "human", "value": "'use strict';\nvar stripe = require('stripe');\nvar Promise = require('promise');\nvar validateVAT = require('validate-vat');\nvar models = require('../../models');\n\n\nmodule.exports = function (s...
javascript
chosen
[ { "from": "system", "value": "Remove Redux DevTools in production\n" }, { "from": "human", "value": "import React from 'react';\nimport {render} from 'react-dom';\nimport {Provider} from 'react-redux';\nimport Store from 'core/Store';\nimport Routes from 'core/Routes';\n\nimport { DevTools, Debu...
javascript
chosen
[ { "from": "system", "value": "Add in a missing change from r67143 for print preview options.\n\nBUG=none\nTEST=none\nReview URL: http://codereview.chromium.org/5334002\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@67155 0039d316-1c4b-4281-b951-d872f2087c98\n" }, { "from": "human", "val...
javascript
chosen
[ { "from": "system", "value": "Create the dist dir if not exists\n" }, { "from": "human", "value": "var fs = require('fs');\n\nvar copy = {\n 'app/main.js': 'dist/main.js',\n 'node_modules/p5/lib/p5.min.js' : 'dist/p5.min.js',\n 'node_modules/p5/lib/addons/p5.dom.js' : 'dist/p5.dom.js',\...
javascript
chosen
[ { "from": "system", "value": "Add missing displayed event trigger in embed manager\n" }, { "from": "human", "value": "// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nvar manager = require('./manager-base');\n\nvar EmbedManager = exports....
javascript
chosen
[ { "from": "system", "value": "Fix updating chart data and options\n\nThis should resolve #78" }, { "from": "human", "value": "/* global Chart */\nimport Ember from 'ember';\n\nexport default Ember.Component.extend({\n tagName: 'canvas',\n attributeBindings: ['width', 'height'],\n\n didInsertE...
javascript
chosen
[ { "from": "system", "value": "Use only contract name for migrate require cache\n\nRely on existing limitation that contracts may not share the same name.\r\n\r\nStrip off all leading path information, so that, e.g., `\"./Migrations.sol\"` resolves to the `\"Migrations\"`." }, { "from": "human", ...
javascript
chosen
[ { "from": "system", "value": "Fix error in Moment format call\n" }, { "from": "human", "value": "/* eslint no-console:0 */\n// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n//...
javascript
chosen