conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Replace now does multiple recurrances of emoticon code\n" }, { "from": "human", "value": "function insert_emoticons(ident, classes) {\n classes = classes || \"\";\n decoder = image_decoder.images;\n console.log(\"Replacing \" + $(ident).length + \" instances of \...
javascript
chosen
[ { "from": "system", "value": "Clarify logic around codesGenerated boolean\n" }, { "from": "human", "value": "var utils = require(\"./utils\");\n\nfunction CodeManager() {\n this.codes = [];\n this.currentSession = -1;\n this.codesGenerated = false;\n}\n\nCodeManager.prototype.nextSessio...
javascript
chosen
[ { "from": "system", "value": "Remove course from courses list when refunded\n" }, { "from": "human", "value": "import { find } from 'lodash';\nimport moment from 'moment';\nimport {\n BaseModel, identifiedBy, field, identifier, belongsTo, computed, observable,\n} from '../base';\n\nimport { Tim...
javascript
chosen
[ { "from": "system", "value": "Use `removeClass` instead of `toggle`\n" }, { "from": "human", "value": "$(document).ready(function()\n{ \n $(\"#invite-form\").on('submit', function()\n { \n var inviteeEmail = $(\"#email\").val();\n console.log(inviteeEmail)\n\n if (...
javascript
chosen
[ { "from": "system", "value": "Remove version constraint from `standard-minifier-js`.\n\nThis was only intended to be there during the publishing of\n`standard-minifier-js` as part of meteor/meteor#8414 and is normally\nnot necessary as part of the `meteor publish-release` process.\n" }, { "from": "h...
javascript
chosen
[ { "from": "system", "value": "Revert \"Only unshift support libs once\"\n\nThis reverts commit 0950083da24377142418e0a8dd14e883ba7db210.\n" }, { "from": "human", "value": "\nif (require.paths.indexOf(__dirname + '/support/ext/lib') === -1) {\n require.paths.unshift(__dirname + '/support/ext/lib...
javascript
chosen
[ { "from": "system", "value": "Add catarse.js missing local dependency\n\nSigned-off-by: Vinicius Andrade <16687ac525c18d05db54be8266913435a820383c@gmail.com>\n" }, { "from": "human", "value": "//= require ../analytics\n//= require i18n/translations\n//= require jquery\n//= require catarse.js/dis...
javascript
chosen
[ { "from": "system", "value": "Add mouse input to tap input\n" }, { "from": "human", "value": "function TapInput(element, tapRegions) {\n this.element = typeof element !== 'undefined' ? element : document;\n this.tapRegions = Array.isArray(tapRegions) ? tapRegions : [];\n this.upCount = ...
javascript
chosen
[ { "from": "system", "value": "Fix nbits bug where value should be 8, instead of 16\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar floor = require( '@stdlib/math/base/special/floor' );\n\n\n// VARIABLES //\n\nvar NBITS = 16;\n\n\n// DIV2 //\n\n/**\n* FUNCTION: div2( x )\...
javascript
chosen
[ { "from": "system", "value": "[FIX] Create alias for title & description.\n\nAs per the documentation for the deprecation of object controllers,\nmodel properties must now be referenced explicitly via the model as\nproxying behaviour has been removed:\nhttp://emberjs.com/deprecations/v1.x/#toc_objectcontrol...
javascript
chosen
[ { "from": "system", "value": "Use the new dispatcher framework" }, { "from": "human", "value": "\nvar cgi = require('juice/engine/cgi');\n\nfunction application(env) {\n return [\n 200,\n {contentType: 'text/html'},\n function() {\n yield \"Hi!\";\n yield \"<h2>Title</h2>\";\...
javascript
chosen
[ { "from": "system", "value": "Add function for retrieving team name from URL\n" }, { "from": "human", "value": "function retrieveGetParameters(){\n let parameters = {}\n window.location.search\n .substring(1) //Remove '?' at beginning\n ....
javascript
chosen
[ { "from": "system", "value": "Insert block node after current node.\n" }, { "from": "human", "value": "import { Editing } from 'substance'\n\n/*\n EXPERIMENTAL: an 'Editing' interface that takes the XML schema into account.\n TODO: try to generalize this and add it to the 'app dev kit'\n*/\nex...
javascript
chosen
[ { "from": "system", "value": "Fix IDE complaining about Cache.put only expecting 2 arguments\n" }, { "from": "human", "value": "var azurecache = require('azurecache');\n\nmodule.exports = function(fake){\n if(fake){\n exports.get = function(data,callback){ if(typeof callback === 'funct...
javascript
chosen
[ { "from": "system", "value": "Server: Update Backbone model for Analysis\n" }, { "from": "human", "value": "define([\n 'backbone.associations',\n '../qt_basemodel'\n],\n\nfunction (Backbone,BaseModel) {\n\n 'use strict';\n\n return BaseModel.extend({\n defaults: {\n url : '',\n ...
javascript
chosen
[ { "from": "system", "value": "Add in a <just-gage-dynamic> and rename original to <just-gage-static>\n" }, { "from": "human", "value": "angular.module(\"ngJustGage\", [])\n .directive('justGage', function ($compile, $timeout) {\n return {\n restrict: 'E',\n scope: { \n i...
javascript
chosen
[ { "from": "system", "value": "Use absolute path for serving static assets.\n" }, { "from": "human", "value": "const express = require(\"express\");\nconst bodyParser = require(\"body-parser\");\nconst methodOverride = require(\"method-override\");\nconst api = require(\"./api\");\n\nfunction ser...
javascript
chosen
[ { "from": "system", "value": "Add support for Node.js 6\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction removeContainer(container, onResultCallback) {\n let options = {\n \"v\": true,\n \"force\": true\n };\n\n container.remove(options, onResultCallback || () => { });\n}\...
javascript
chosen
[ { "from": "system", "value": "Fix for wrong parameter check in processPayment method.\n" }, { "from": "human", "value": "if(Meteor.isClient){\n\n processPayment = function(checkout, next){\n Meteor.call(\"processPayment\", checkout, next);\n };\n\n getReceipt = function(key, next){\n re...
javascript
chosen
[ { "from": "system", "value": "Throw error instead of logging.\n" }, { "from": "human", "value": "function parseResponse(response) {\n let text;\n\n if (response && response.content && (typeof response.content === 'string')) {\n text = response.content;\n }\n\n if (response && response.tex...
javascript
chosen
[ { "from": "system", "value": "Rewrite and simplify prepareModelPayload function\n\n" }, { "from": "human", "value": "import _ from 'lodash';\n\n\nexport const unexistedUID = '00000000-0000-0000-C000-000000000046';\n\nexport function initObject(classDef, attrs, id, params) {\n return new classDe...
javascript
chosen
[ { "from": "system", "value": "Fix doubling of js module definition\n" }, { "from": "human", "value": "cordova.define(\"com.moust.cordova.videoplayer.VideoPlayer\", function(require, exports, module) {\nvar exec = require(\"cordova/exec\");\n\nmodule.exports = {\n\n DEFAULT_OPTIONS: {\n ...
javascript
chosen
[ { "from": "system", "value": "Build the test jar file from the tests.\n" }, { "from": "human", "value": "\"use strict\"\n\nvar Jar = require(\"../src/Jar.js\")\n\ndescribe(\"Jar\", function () {\n \n})" }, { "from": "gpt", "value": "\"use strict\"\n\nvar Jar = require(\"../src/Jar...
javascript
chosen
[ { "from": "system", "value": "Add workaround for running chrome headless on travis\n" }, { "from": "human", "value": "/* eslint-env node */\nmodule.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chrome'\n ],\n launch_in_dev: [\n ...
javascript
chosen
[ { "from": "system", "value": "Add \"requires\" entry to .jshintrc entry in blueprint (overlooked in previous commit)\n" }, { "from": "human", "value": "/* globals module */\n\nvar EOL = require('os').EOL;\n\nmodule.exports = {\n description: 'Register test helpers',\n\n afterInstall: funct...
javascript
chosen
[ { "from": "system", "value": "Fix import statement triggering in Mist\n" }, { "from": "human", "value": "import Web3 from 'web3';\n\n// set providor\nif(typeof web3 !== 'undefined')\n web3 = new Web3(web3.currentProvider);\nelse\n web3 = new Web3(new Web3.providers.HttpProvider(\"http://localh...
javascript
chosen
[ { "from": "system", "value": "Add update fns to TreebankPersister\n" }, { "from": "human", "value": "'use strict';\n/*\n *\n */\nangular.module('arethusa').factory('TreebankPersister', [\n 'documentStore',\n 'configurator',\n function (documentStore, configurator) {\n return function() {\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"travis fail karma fix\"\n\nThis reverts commit 603eb5ee8bba3c881cee80d4e89a9faa82449c24." }, { "from": "human", "value": "import React from 'react'\nimport ReactTestUtils from 'react-addons-test-utils'\nimport assert from 'assert'\nimport {getKaomoji, getYm...
javascript
chosen
[ { "from": "system", "value": "Add second argument to parse()\n" }, { "from": "human", "value": "\"use strict\";\n\nvar renderNull = function () { return 'NULL' }\n , parser\n\nparser = require('editorsnotes-markup-parser')({\n projectBaseURL: '/',\n resolveItemText: renderNull,\n makeBibliog...
javascript
chosen
[ { "from": "system", "value": "Change var to let by ES6" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst o = Ember.observer;\nconst on = Ember.on;\n\nexport default Ember.ObjectProxy.extend({\n /*\n * Add method from content\n * @param method[function]\n * @return funct...
javascript
chosen
[ { "from": "system", "value": "Order imports and load VueRoiuter config\n" }, { "from": "human", "value": "// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue'\nimport { VueRouter, route...
javascript
chosen
[ { "from": "system", "value": "Add click even on whale to hide input filter\n" }, { "from": "human", "value": "// ORDER MATTERS!\nimport physicalVisualization from './vis-physical';\nimport provider from './data-provider';\nimport { hasClass, removeClass, addClass, uuidRegExp } from './utils/help...
javascript
chosen
[ { "from": "system", "value": "Fix a bug that .content does not fit with the window (instead, blank area appears on the right side) when the window is resized.\n" }, { "from": "human", "value": "const $ = require('jquery');\r\n\r\n$(document).ready(function(){\r\n $('#splitter').mousedown(functi...
javascript
chosen
[ { "from": "system", "value": "Update tests for `res.url` and `err.url`" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert');\nvar Response = require('../');\n\nvar res = new Response(200, {\n 'Foo-Bar': 'baz-Bosh',\n 'bar-foo': 'bish-Bosh'\n}, 'foo bar baz');\nasser...
javascript
chosen
[ { "from": "system", "value": "Update test to reflect new version\n" }, { "from": "human", "value": "import assert from 'assert';\nimport uakari from '../lib';\n\ndescribe('uakari', function () {\n it('should determine the version of the local packge', function () {\n assert.equal(uakari.vers...
javascript
chosen
[ { "from": "system", "value": "Trim a bit more text\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { Link } from 'react-router-dom'\nimport Icon from '@components/Icon'\nimport noop from '@utils/noop'\n\nexport default class Tag extends Component {\n static d...
javascript
chosen
[ { "from": "system", "value": "Remove debug statement and setTimeout. Its annoying that exceptions get caught on the rtjp layer - would probably be better to hand off control somewhere in the stack with a setTimeout\n" }, { "from": "human", "value": "jsio.path.common = 'js';\njsio.path.browser = ...
javascript
chosen
[ { "from": "system", "value": "Add error handling for http request\n" }, { "from": "human", "value": "\"use strict\";\n\n/**\n * TODO: make this ingest steam IDs as an event stream, and \n * cache them and then poll the steam API in batches \n * every now and again. Or not, depending ...
javascript
chosen
[ { "from": "system", "value": "Include basic_auth_token in gobierto plans factories header\n" }, { "from": "human", "value": "import axios from \"axios\";\n\nconst baseUrl = location.origin;\nconst endPoint = `${baseUrl}/api/v1/plans`;\nconst headers = {\n \"Content-type\": \"application/json\",...
javascript
chosen
[ { "from": "system", "value": "Add navigation to create job screen from developer screen\n" }, { "from": "human", "value": "import React from 'react';\nimport { View, Button } from 'react-native';\n\n/*\nDeveloper screen.\nProvides access to components during development.\n*/\nexport default clas...
javascript
chosen
[ { "from": "system", "value": "Use a faster blank object creator\n\nhttp://justin.ridgewell.name/browser-benchmark/blank-object/index.html\n\nCreation is 2-10x faster (depends on the browser), and access is the\nsame for both existent and non-existent properties.\n" }, { "from": "human", "value":...
javascript
chosen
[ { "from": "human", "value": "Complete lesson 17 - scrollable view\n" }, { "from": "gpt", "value": "function ScrollableView() {\n\tvar self = Ti.UI.createWindow({});\n\t\n\tvar views = [],\n\tviewHeight = 200,\n\tviewWidth = 200,\n\tpageCount = 5;\n\t\n\tfor (var i = 0; i < pageCount; i++) {\n\t\...
javascript
chosen
[ { "from": "system", "value": "Add integrity test for touch events\n" }, { "from": "human", "value": "window.addEventListener('load', function(){\n\n module('touchstart');\n\n test('should use touchstart when touchstart is supported', function() {\n ok(false, 'not implemented');\n // asse...
javascript
chosen
[ { "from": "system", "value": "Fix return user ProfileID not accessToken\n\n" }, { "from": "human", "value": "const profileService = require(\"../../../Db/Service/profileService\");\n\nconst errors = require(\"../Mojang/Errors\");\n\nmodule.exports.joinserver = (req, res, next) => {\n let acce...
javascript
chosen
[ { "from": "system", "value": "Fix for scooch carousel next/prev buttons\n" }, { "from": "human", "value": "$('.m-scooch').scooch();\n\nif ( $('.m-item:first-child' ).hasClass('m-active') ) {\n $('.m-scooch-controls [data-m-slide=\"prev\"]').addClass('hide');\n};\n\n$('.m-scooch-controls a').c...
javascript
chosen
[ { "from": "system", "value": "Change stream test to not require additional dependency\n" }, { "from": "human", "value": "var fs = require('fs');\nvar endpoint = require('endpoint');\n\ndescribe('Writeable Stream Input API', function () {\n\n var feedPath = __dirname + '/feeds/rss2sample.xml';\n...
javascript
chosen
[ { "from": "system", "value": "Remove reference to openshfit specifics." }, { "from": "human", "value": "//Dependencies\nvar restify = require('restify');\nvar cors = require('cors');\nvar appInfo = require('./package.json');\n\n//Configuration\n//var address = process.env.OPENSHIFT_NODEJS_IP ||...
javascript
chosen
[ { "from": "system", "value": "Use relative path for translationLoader\n" }, { "from": "human", "value": "const { join } = require('path');\nconst { transform } = require('babel-core');\n\nmodule.exports = function testPlugin(code) {\n const loaderPath = join(__dirname, 'exampleTranslationLoader...
javascript
chosen
[ { "from": "system", "value": "Change on theoretical method in async-testing\n" }, { "from": "human", "value": "var asyncTesting = require(\"async_testing\");\nvar fs = require(\"fs\");\nvar path = require(\"path\");\n\n// extend cobbled together from suggestions in\n// http://groups.google.com/g...
javascript
chosen
[ { "from": "system", "value": "Decrease concurrency of Selenium tests\n" }, { "from": "human", "value": "define({\r\n suites: false,\r\n proxyPort: 9090,\r\n proxyUrl: \"http://localhost:9090/\",\r\n capabilities: {\r\n \"selenium-version\": \"2.45.0\"\r\n },\r\n tunnel: ...
javascript
chosen
[ { "from": "system", "value": "Add modal dummy open/close function\n" }, { "from": "human", "value": "/**\n * main.js\n *\n * Author: Marian Friedmann\n *\n */\n\n$(function() {\n\n});\n" }, { "from": "gpt", "value": "/**\n * main.js\n *\n * Author: Marian Friedmann\n *\n */\n\n$(func...
javascript
chosen
[ { "from": "system", "value": "Make the window full screen.\n" }, { "from": "human", "value": "var app = require('app');\nvar BrowserWindow = require('browser-window');\nvar menu = require('./menu');\n\nprocess.env.PATH += ':/usr/local/bin';\n\nvar mainWindow;\n\napp.on('ready', function () {\n\t...
javascript
chosen
[ { "from": "system", "value": "Increase attempts for loading ticker\n" }, { "from": "human", "value": "import req from '../req.js';\nimport Event from '../Event';\n\n\nexport default function Ticker() {\n this.event = new Event();\n\n this.ready = false;\n this.data = {};\n\n this.load();\n\n...
javascript
chosen
[ { "from": "system", "value": "Use headless chrome only on CI" }, { "from": "human", "value": "/* eslint-env node */\n\nmodule.exports = {\n 'test_page': 'tests/index.html?hidepassed',\n 'disable_watching': true,\n 'launch_in_ci': [\n 'Chrome'\n ],\n 'launch_in_dev': [\n ...
javascript
chosen
[ { "from": "system", "value": "Allow retrieving list of supported charsets\n" }, { "from": "human", "value": "'use strict';\n\nconst { DEFAULT_INPUT_CHARSET } = require('./constants');\nconst { validateCharset } = require('./validate');\nconst { decodeCharset } = require('./transform');\n\n// Nor...
javascript
chosen
[ { "from": "system", "value": "Fix issue causing api to connect to incorrect mail host\n" }, { "from": "human", "value": "import nodemailer from 'nodemailer'\nimport Mailgen from 'mailgen'\nimport path from 'path'\nimport config from '../config'\n\n/**\n * Class for managing sending emails\n */\n...
javascript
chosen
[ { "from": "system", "value": "Use checkForFlag in render mixin\n" }, { "from": "human", "value": "import Graphics from 'flockn/graphics';\n\nvar isVisible = function isVisible() {\n var hasVisibleFlag = Object.hasOwnProperty.call(this, 'visible');\n\n if (hasVisibleFlag) {\n return this.vis...
javascript
chosen
[ { "from": "system", "value": "Use post filter for schema\n" }, { "from": "human", "value": "export default {\n COUNTRIES: 'filter:countries',\n COLLECTIONS: 'filter:collection_id',\n SCHEMA: 'filter:schema'\n};\n" }, { "from": "gpt", "value": "export default {\n COUNTRIES: 'filte...
javascript
chosen
[ { "from": "system", "value": "Use velocity rather than just changing positions\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n function Game() {\n this.player = null;\n this.cursors = null;\n }\n\n Game.prototype = {\n\n create: function () {\n this.game.wo...
javascript
chosen
[ { "from": "system", "value": "Replace storybook-state usage from buttonGroup 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';...
javascript
chosen
[ { "from": "system", "value": "Use debug option instead of verbose already used by main executable\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nconst program = require('commander');\nconst fs = require('extfs');\nconst caller = require('./docsmith...
javascript
chosen
[ { "from": "system", "value": "Load thumbnails only at startup\n" }, { "from": "human", "value": "var fs = require('fs');\n\nmodule.exports.controller = function(app) {\n\n app.get('/', function(req, res) {\n fs.readdir(process.cwd() + '/public/photos/', function(err, data) {\n ...
javascript
chosen
[ { "from": "system", "value": "Hide extra courses when the page is sufficiently loaded" }, { "from": "human", "value": "// ==UserScript==\n// @name HideExtraCourses\n// @namespace https://www.github.com/zeta12ti/DuolingoCourseSwitcher\n// @description Hides extra courses from the update ...
javascript
chosen
[ { "from": "system", "value": "Add tests against path handling via user set or pop state\n" }, { "from": "human", "value": "'use strict'\n\nvar test = require('tape')\nvar proxyquire = require('proxyquire')\n\ntest('router (server)', function (t) {\n var Router = proxyquire('../router', {\n '...
javascript
chosen
[ { "from": "system", "value": "Add process.env.PORT in webpack server config\n" }, { "from": "human", "value": "/* eslint-disable import/no-unresolved, global-require */\nimport nodeExternals from 'webpack-node-externals';\nimport webpack from 'webpack';\n\nimport common from './common';\n\nconst...
javascript
chosen
[ { "from": "system", "value": "Handle PUT request to user profile\n" }, { "from": "human", "value": "var userController = require('../users/userController.js');\nvar helpers = require('./helpers.js'); // our custom middleware\n\nmodule.exports = function (app, express) {\n app.get('/api/users/pr...
javascript
chosen
[ { "from": "system", "value": "Add build package.json to blacklist\n" }, { "from": "human", "value": "// @flow\n\nconst path = require('path');\n\n/**\n * This list is basically copy pasted from Metro Bundler but the tests\n * folders are excluded so we can execute tests in the Playground.\n *\n ...
javascript
chosen
[ { "from": "system", "value": "Update welcome and help responses.\n" }, { "from": "human", "value": "import tmpl from '~/lib/tmpl.js';\n\n/**\n * This module contains functions to help standardize the responses used to send back to ASK. The\n * constants are all functions, built by the `tmpl` tag...
javascript
chosen
[ { "from": "system", "value": "Remove init from scene definition\n" }, { "from": "human", "value": "define(function(require){\r\n var scene = new THREE.Object3D();\r\n var camera = new THREE.PerspectiveCamera(75, 16 / 9, 0.1, 5000);\r\n var loader = new THREE.JSONLoader(true);\r\n var...
javascript
chosen
[ { "from": "system", "value": "Add open up lastDownloadFailed to other error cases\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2021\n */\nimport { syncStrings } from '../localization';\n\nexport const selectTemperatureSyncMessage = ({ vaccine }) =...
javascript
chosen
[ { "from": "system", "value": "Remove console statement. Move initialization logic for controller into init() method.\n" }, { "from": "human", "value": "Application.Controllers.controller(\"FilesController\", [\"$state\", FilesController]);\nfunction FilesController($state) {\n //console.log(\...
javascript
chosen
[ { "from": "system", "value": "Use custom interpolation for client templates.\n" }, { "from": "human", "value": "/**\n * Precompiles Underscore templates to a `.jst` file.\n *\n * ---------------------------------------------------------------\n *\n * (i.e. basically it takes HTML files and turns...
javascript
chosen
[ { "from": "system", "value": "Send report to all admins.\n" }, { "from": "human", "value": "import Queue from 'bull'\n\nexport const SEND_AUDIT_EMAIL = {\n queueName: 'send_audit_email',\n jobName: 'Send audit email',\n}\n\nexport default (app) => {\n const queue = new Queue(SEND_AUDIT_EMAIL....
javascript
chosen
[ { "from": "system", "value": "Make ga always an existing variable\n" }, { "from": "human", "value": "export default function initGoogleAnalytics(port) {\n port.subscribe((path) => {\n ga && ga('set', 'page', path);\n ga && ga('send', 'pageview');\n });\n}\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Fix test scenario expected incorrect type of error\n" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert');\nvar wres = require('..');\n\ndescribe('Error Handling', function() {\n it('null resume throws error', function() {\n assert.th...
javascript
chosen
[ { "from": "system", "value": "Make port configurable by ENV variable" }, { "from": "human", "value": "module.exports = {\n server: {\n options: {\n port: 8000,\n hostname: '0.0.0.0',\n base: 'tmp/public',\n middleware: middleware\n }\n }\n};\n\n// works with tasks/loc...
javascript
chosen
[ { "from": "system", "value": "Add function for Time and for Data Studio format" }, { "from": "human", "value": "/*\nUse joliDate() to get date formatted as dd/mm/YYYY hh:mm\n*/\n\nfunction joliDate(d){\n var date = d;//d is a date object if d is a text we an use var date = new Date(d);\n retur...
javascript
chosen
[ { "from": "system", "value": "Add prompts to fix-entity generator\n" }, { "from": "human", "value": "// modules used by the generator\nconst generator = require('yeoman-generator');\nconst chalk = require('chalk');\n\n\nmodule.exports = generator.extend({\n // check current project state, get...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded supportedProjections config property\n" }, { "from": "human", "value": "import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';\nimport EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';\n\n\nexport default {\n themesUrl: undefined,\n projection:...
javascript
chosen
[ { "from": "system", "value": "Use res.end() to send a dynamic IP address\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar named = require('../named')\n\nvar port = +(process.argv[2] || 5321)\nnamed.createServer(function(req, res) {\n console.log('%s:%s/%s %j', req.connection.remote...
javascript
chosen
[ { "from": "system", "value": "firefox: Disable some more unused features\n" }, { "from": "human", "value": "user_pref(\"accessibility.typeaheadfind.flashBar\", 0);\nuser_pref(\"accessibility.typeaheadfind.prefillwithselection\", true);\nuser_pref(\"browser.backspace_action\", 2);\nuser_pref(\"br...
javascript
chosen
[ { "from": "system", "value": "Add assert for page text\n" }, { "from": "human", "value": "var Application = require('../index').Application\nvar assert = require('assert')\nvar path = require('path')\n\nvar describe = global.describe\nvar it = global.it\nvar beforeEach = global.beforeEach\nvar a...
javascript
chosen
[ { "from": "system", "value": "Add body parser to test server\n\n- previously handlers called in tests did not receive request.body\n" }, { "from": "human", "value": "import {defer} from 'q';\r\nimport {createServer} from 'restify';\r\nimport registerResources from '../src/register';\r\nimport {s...
javascript
chosen
[ { "from": "system", "value": "Use the global flag on regexps.\n" }, { "from": "human", "value": "// Brequire - CommonJS support for the browser\nfunction require(path) {\n var module = require.modules[path];\n if(!module) {\n throw(\"couldn't find module for: \" + path);\n }\n if(!module....
javascript
chosen
[ { "from": "system", "value": "Use proper name for 'vow'\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('vow-fs');\nvar linter = require('./linter');\nvar Vow = require('Vow');\n\nvar LessHint = function () {\n\n};\n\nLessHint.prototype.checkDirectory = function (path) {\n ...
javascript
chosen
[ { "from": "system", "value": "Switch to external source map\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\nvar webpackSettings = require('./webpack-helper');\n\nmodule.exports = webpackSettings({\n entry: {\n 'backbone': path.join(__dirname...
javascript
chosen
[ { "from": "system", "value": "fix(constraints): Return details if we have them\n\n" }, { "from": "human", "value": "'use strict';\nconst windoze = require('windoze');\n\nmodule.exports.getWindowInfo = function (title) {\n\tconst details = windoze.getWindowDetailsByTitle(title, true);\n\tif (!det...
javascript
chosen
[ { "from": "system", "value": "Add registration link and 2020 logo" }, { "from": "human", "value": "$(document).ready(function()\n{\n $('#navbar_replacement').replaceWith('\\\n <div class=\"navbar navbar-inverse navbar-static-top\">\\\n <div class=\"container\">\\\n <d...
javascript
chosen
[ { "from": "system", "value": "Complete equality tests to pass\n" }, { "from": "human", "value": "\nmodule(\"About Equality (topics/about_equality.js)\");\n\ntest(\"numeric equality\", function() {\n equal(3 + __, 7, \"\");\n});\n\ntest(\"string equality\", function() {\n equal(\"3\" + __,...
javascript
chosen
[ { "from": "system", "value": "Test modified to use 'asserts'." }, { "from": "human", "value": "// Array length test\n\nvar myArray = [ 1, 2, 3, 4, 5 ];\nvar myArray2 = [ 1, 2, 3, 4, 5 ];\nmyArray2[8] = 42;\n\nresult = myArray.length == 5 && myArray2.length == 9;\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "[fix] Correct bad paths from rebase.\n" }, { "from": "human", "value": "/*\n * transports.js: Set of all transports Winston knows about\n *\n * (C) 2010 Charlie Robbins\n * MIT LICENCE\n *\n */\n\nObject.defineProperty(exports, 'Console', {\n configurable: true,\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the tragic ternary mistake\n" }, { "from": "human", "value": "var makeNode = require(\"../node/make_node\"),\n\tminify = require(\"../graph/minify\"),\n\tprettier = require(\"prettier\");\n\nmodule.exports = function(bundle, options){\n\tvar source = prettier.fo...
javascript
chosen
[ { "from": "system", "value": ":new: Set tabindex on panel messages to allow text selection\n" }, { "from": "human", "value": "'use babel'\n\n/* @flow */\n/** @jsx React.h */\n\nimport { CompositeDisposable } from 'atom'\nimport React from 'preact'\nimport Message from './message'\nimport { sortM...
javascript
chosen
[ { "from": "system", "value": "Remove add field logInteraction as we'll do it in spec service instead\n\n(See https://github.com/uwdata/voyager2/commit/2d7c23fc2d0bbd2ebf89194aed61aec840ced416)\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc directive\n * @name polestar.directi...
javascript
chosen
[ { "from": "system", "value": "Change div to Box and give a data-teamleader-ui\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\nimport theme from './theme.css';\n\nclass TimerPulser extends PureCom...
javascript
chosen
[ { "from": "system", "value": "BAP-11411: Update system configuration for languages\n - updated js component\n" }, { "from": "human", "value": "define(function(require) {\n 'use strict';\n\n var LanguageSelectView;\n var BaseView = require('oroui/js/app/views/base/view');\n var _ = re...
javascript
chosen
[ { "from": "system", "value": "perf(util): Change back to template string\n\nIRHydra says that possible deopt can be in concatenation\n" }, { "from": "human", "value": "/**\n * Bytes to encode to VT100 control sequence.\n *\n * @param {String} code Control code that you want to encode\n * @return...
javascript
chosen
[ { "from": "system", "value": "Remove until ready to create\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class Table extends PureComponent {\n static propTypes = {\n\n }\n\n render() {\n return (\n ...
javascript
chosen
[ { "from": "system", "value": "Modify apex config to use nodejs 4.3 without the shim\n\nSetting \"shim\": false isn't documented. Hopefully it will be\nsupported by Apex going forward.\n" }, { "from": "human", "value": "import path from 'path'\nimport fs from 'fs'\nimport rimraf from 'rimraf'\nim...
javascript
chosen
[ { "from": "system", "value": "Move location of server start in conference" }, { "from": "human", "value": "'use strict';\n\nrequire('dotenv').config({path: __dirname + '/../.env'});\n\nconst NEXMO_FROM_NUMBER = process.env.NEXMO_FROM_NUMBER;\nconst NEXMO_TO_NUMBER = process.env.NEXMO_TO_NUMBER;\...
javascript
chosen