conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Convert tests to es6 format\n" }, { "from": "human", "value": "var fs = require('fs')\nvar slSystems = require('../src/slSystemsCrawler')\nvar webTimmi = require('../src/webTimmiCrawler')\n\ndescribe('sls systems crawler', function () {\n var obj\n var expecte...
javascript
chosen
[ { "from": "system", "value": "Update Rx require to point to local utility version\n" }, { "from": "human", "value": "/*globals describe, it*/\nvar Record = require('../../lib/model/record'),\n Rx = require('rx');\n\nrequire('should');\n\ndescribe('Record', function () {\n describe('#has(ke...
javascript
chosen
[ { "from": "human", "value": "Add tests for Current Game component\n" }, { "from": "gpt", "value": "import Vue from 'vue'\nimport CurrentGame from 'src/components/CurrentGame'\n\ndescribe('CurrentGame.vue', () => {\n let vm\n let Ctor\n beforeEach(() => {\n const title = 'Gex'\n const im...
javascript
chosen
[ { "from": "system", "value": "Simplify JS for sliding menu\n" }, { "from": "human", "value": "$(document).ready(function(){\n $('.js-menu-trigger').on('click touchstart', function(e){\n $('.js-menu').toggleClass('is-visible');\n $('.js-menu-screen').toggleClass('is-visible');\n e.preve...
javascript
chosen
[ { "from": "system", "value": "Fix transient error in pikadayToString" }, { "from": "human", "value": "import { pad, pikadayToString } from '~/lib/utils/datefix';\n\ndescribe('datefix', () => {\n describe('pad', () => {\n it('should add a 0 when length is smaller than 2', () => {\n expec...
javascript
chosen
[ { "from": "system", "value": "Throw status code on error\n" }, { "from": "human", "value": "export default function fetchJSON(url, options = {}) {\n const requestOptions = {\n credentials: 'same-origin',\n ...options,\n };\n\n return fetch(url, requestOptions).then(response => {\n if...
javascript
chosen
[ { "from": "system", "value": "Check to see if KeyboardEvent.code is supported" }, { "from": "human", "value": "window.addEventListener('keydown', function(event) {\n ChromeSamples.log('KeyboardEvent.code:', event.code);\n});\n" }, { "from": "gpt", "value": "window.addEventListener('...
javascript
chosen
[ { "from": "system", "value": "Add button class to click event\n" }, { "from": "human", "value": "Template.editActivityButton.events({\n \"click button\": function (event, template) {\n // Get Activity ID from template instance\n var activityId = this.activityId;\n\n // Show the Edit Ac...
javascript
chosen
[ { "from": "system", "value": "Add rollup and bundle options\n\nThis enables inline sourcemaps\n" }, { "from": "human", "value": "'use strict';\n\nvar rollup = require('rollup');\n\n// @param args {Object} - Config object of custom preprocessor.\n// @param config {Object} - Config object of rollu...
javascript
chosen
[ { "from": "system", "value": "feat(shape): Implement simple text shape with FIG fonts support\n" }, { "from": "human", "value": "import Text from 'kittik-shape-text';\n\nexport default class FigText extends Text {\n constructor(options = {}) {\n super(options);\n }\n}\n" }, { "from"...
javascript
chosen
[ { "from": "system", "value": "flow: Remove unused entry from AuthenticationMethods\n" }, { "from": "human", "value": "/* @flow */\nimport type { PresenceState } from '../types';\n\nexport type ApiResponse = {\n result: string,\n msg: string,\n};\n\nexport type ApiResponseWithPresence = ApiResp...
javascript
chosen
[ { "from": "system", "value": "Add shebang to non-es6 bin\n" }, { "from": "human", "value": "var fs = require('fs');\n\nrequire('babel/register')({stage: 0});\n\nfs.exists('spec/support/jasmine.json', function(configExists) {\n if (!configExists) {\n process.env.JASMINE_CONFIG_PATH =\n p...
javascript
chosen
[ { "from": "system", "value": "Hide overlay when undo/redoing changes\n" }, { "from": "human", "value": "import { win, isIframe } from 'classes/helpers';\nimport UndoStack from 'classes/UndoStack';\n\nconst trackedMutations = {\n\tupdateFieldValue: 'Update to block field',\n\taddBlock: 'Added blo...
javascript
chosen
[ { "from": "system", "value": "Fix options callback passing not existing element in firefox\n" }, { "from": "human", "value": "var CurrentAppID,\n\tGetCurrentAppID = function()\n\t{\n\t\tif( !CurrentAppID )\n\t\t{\n\t\t\tCurrentAppID = location.pathname.match( /\\/([0-9]{1,6})(?:\\/|$)/ );\n\t\t\...
javascript
chosen
[ { "from": "system", "value": "[DDW-589] Fix development fallback epoch call\n" }, { "from": "human", "value": "// @flow\nimport type { CardanoExplorerResponse } from '../types';\nimport { externalRequest } from '../../utils/externalRequest';\nimport { getNetworkExplorerUri } from '../../../utils...
javascript
chosen
[ { "from": "system", "value": "Fix the bug webviews can not be loaded\n\nWebviews are not loaded after inserting a node which contains <webview> tags\nContributed by yupingx.chen@intel.com\n\n\nBUG=222663\n\n\nReview URL: https://chromiumcodereview.appspot.com/12465019\n\ngit-svn-id: de016e52bd170d2d4f2344f9...
javascript
chosen
[ { "from": "system", "value": "Add required message for Highligher language.\n" }, { "from": "human", "value": "/*\n\n ___ usage ___ en_US ___\n node highlight.bin.js <options> [sockets directory, sockets directory...]\n\n options:\n\n --help display help ...
javascript
chosen
[ { "from": "system", "value": "Change input type to tel for mobile safari\n" }, { "from": "human", "value": "import {Observable} from 'rx'\nimport {div, input, label} from '@cycle/DOM'\n\nfunction renderInputField(value) {\n return input('.number-input .mdl-textfield__input',\n {\n type:...
javascript
chosen
[ { "from": "system", "value": "Set the template_name on the task when a template is added.\n" }, { "from": "human", "value": "angular.module('materialscommons').component('mcTaskTemplate', {\n templateUrl: 'app/project/experiments/experiment/components/tasks/components/mc-task-template.html',\...
javascript
chosen
[ { "from": "system", "value": "Add a nodelist unregistr when the document element is removed\n" }, { "from": "human", "value": "module.exports = function(data){\n\tvar later = setTimeout;\n\n\tfunction getEither(propName, moduleName) {\n\t\treturn (data.modules && data.modules[propName]) || requi...
javascript
chosen
[ { "from": "system", "value": "Update format and colors of the notifications\n" }, { "from": "human", "value": "const Hipchat = require('./Hipchat');\nconst hipchat = new Hipchat( process.env.HIPCHAT_KEY || '' );\n\nconst STATUS = {\n Started: 'lozenge-current',\n Completed: 'lozenge-success',\...
javascript
chosen
[ { "from": "system", "value": "Improve examples to make composition order clear\n\nAddress comment made regarding ambiguous execution order:\r\nhttps://github.com/Gozala/functional/commit/dda3adec7201114ef53356d4b4d5b93ce3c5c639#commitcomment-3348727" }, { "from": "human", "value": "\"use strict\...
javascript
chosen
[ { "from": "system", "value": "Add title to anchors in panel descriptions\n" }, { "from": "human", "value": "define([\n\t\"Ember\",\n\t\"hbs!templates/components/PanelItemComponent\"\n], function(\n\tEmber,\n\tlayout\n) {\n\n\treturn Ember.Component.extend({\n\t\tlayout: layout,\n\t\ttagName: \"l...
javascript
chosen
[ { "from": "system", "value": "Fix reference to md5 helper in test\n\nFixes reference to md5 helper and removes reference to js client\nas the md5 function is now provided by utils.\n" }, { "from": "human", "value": "'use strict'\nvar net = require('net')\nvar helper = require(__dirname + '/../te...
javascript
chosen
[ { "from": "system", "value": "Add version log on app start\n" }, { "from": "human", "value": "import debug from \"debug\";\n\nconst debugMask = process.env.DEBUG || \"*\";\n\nif (\"production\" !== process.env.NODE_ENV) {\n debug.enable(debugMask);\n} else {\n debug.disable();\n}\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Fix bug where document element would never be allowed as valid element\n" }, { "from": "human", "value": "'use strict';\n\n// Holds the selected target. We need to fetch this from either contextmenu (obviously the best),\n// or the mousedown event (filtered by butto...
javascript
chosen
[ { "from": "system", "value": "Update the version reference to 2.1.0\n" }, { "from": "human", "value": "var VERSION='2.0.0';\nvar scripts = document.getElementsByTagName('script');\nvar cordovaPath = scripts[scripts.length - 1].src.replace('cordova.js', 'cordova-'+VERSION+'.js');\n\ndocument.writ...
javascript
chosen
[ { "from": "system", "value": "style: Add a space and user frappe.session.user instead of just user\n" }, { "from": "human", "value": "// Copyright (c) 2016, Frappe Technologies and contributors\n// For license information, please see license.txt\n\nfrappe.ui.form.on('Page', {\n\trefresh: functio...
javascript
chosen
[ { "from": "system", "value": "Swap name order so firstname is first in Educator\n" }, { "from": "human", "value": "(function() {\n window.shared || (window.shared = {});\n var dom = window.shared.ReactHelpers.dom;\n var createEl = window.shared.ReactHelpers.createEl;\n var merge = window.sha...
javascript
chosen
[ { "from": "system", "value": "Correct environment test to deal with async.\n" }, { "from": "human", "value": "var exec = require('child_process').exec;\n\ndescribe('the environment', function(){\n\n it('can find espeak', function(){\n exec('espeak -h', function(error, stdout, stderr){\n ...
javascript
chosen
[ { "from": "system", "value": "Move TeamCity check above the imports\n" }, { "from": "human", "value": "import {findParentFolder, copyHookFiles, verifyHooksFolder} from './fs-utils.js';\nimport path from 'path';\n\nif (process.env.TEAMCITY_VERSION) {\n console.log('TeamCity Detected not installi...
javascript
chosen
[ { "from": "system", "value": "Change title message cycling variable to bool from int\n" }, { "from": "human", "value": "UI.once('init', function(){\n\tvar UI = this\n\t\t, should_notify = false\n\t\t, notify_cycle = 1\n\t\t, interval_id = null\n\t\t, missed_messages = 0\n\t\t, standard_title = d...
javascript
chosen
[ { "from": "system", "value": "631: Change the article_lead to only allow 160 characters in the input form.\n" }, { "from": "human", "value": "\n// function updateCount() {\n\n//$('#characters').text(cs);\n// }\n$(\"#id_lead\").on(\"change paste keyup keydown keypress\", function(){\n console...
javascript
chosen
[ { "from": "system", "value": "[FIX] Fix issue with register form being animated on scroll\n" }, { "from": "human", "value": "import React from 'react';\nimport RegisterForm from './RegisterForm';\nimport Title from '../Title';\nimport ScrollAnimation from 'react-animate-on-scroll';\n\nimport '.....
javascript
chosen
[ { "from": "system", "value": "MMLC-137: Set an explicit log level on live.\n" }, { "from": "human", "value": "/**\n * Production environment settings\n *\n * This file can include shared settings for a production environment,\n * such as API keys or remote database passwords. If you're using\n ...
javascript
chosen
[ { "from": "system", "value": "Create a global variable to select each main component in the DOM\n" }, { "from": "human", "value": "/*-----------------------------------------------------------------\n\nModular - JS Extension\nMade by @esr360\nhttp://github.com/esr360/Modular/\n\t\n--------------...
javascript
chosen
[ { "from": "system", "value": "Move to the correct catch\n" }, { "from": "human", "value": "import DataLoader from 'dataloader';\nimport cache from '../cache';\nimport timer from '../timer';\nimport { throttled } from '../throttle';\nimport { error, verbose } from '../loggers';\n\nexport default ...
javascript
chosen
[ { "from": "system", "value": "Move PhoneNumber section to new api\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * PhoneNumber\n *\n **/\n\n\nvar Helpers = require('./helpers');\nvar definitions = require('./definitions');\n\n/**\n * PhoneNumber#phoneNumber(format = null) -> String\n ...
javascript
chosen
[ { "from": "system", "value": "Update get e post for mongoose\n" }, { "from": "human", "value": "var express = require('express'),\n mongoose = require('mongoose');\n\nvar db = mongoose.connect('mongodb://192.168.88.103:27017/bookApi');\n\nvar Book = require('./models/bookModel');\nvar app = e...
javascript
chosen
[ { "from": "system", "value": "Update for 1.11.0 and 1.12.0-beta.1." }, { "from": "human", "value": "var path = require('path');\nvar fs = require('fs');\n\nfunction config(options){\n var configFile = path.join(options.project.root, 'config', 'ember-try.js');\n if(fs.existsSync(configFile)){...
javascript
chosen
[ { "from": "system", "value": "Add version and help option\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar wrap = require('wrap-stream');\n\nvar result = '', args = process.argv.slice(2);\n\n//no args passed\nif (!args.length) {\n\tprocess.stdout.write([\n\t\t'',\n\...
javascript
chosen
[ { "from": "system", "value": "Add missing null check in GM_menuCommander.onPopupShowing.\n\nThis prevents the popup from showing all registered menu commands in windows with file://- and about:-URIs.\nFixes #1424\n" }, { "from": "human", "value": "Components.utils.import('resource://greasemonkey...
javascript
chosen
[ { "from": "system", "value": "Use the form's attributes for URL and method instead of hardcoding values\n" }, { "from": "human", "value": "document.addEventListener('DOMContentLoaded', () => {\n const contactForm = document.getElementById('contact-form');\n const formSubmitButton = document.ge...
javascript
chosen
[ { "from": "system", "value": "Make sure all properties are set during insert and errors are logged properly\n" }, { "from": "human", "value": "import sqlite3 from 'sqlite3';\nimport { createLogObject } from './csv.js';\n\nconst SQL = `\n INSERT INTO log (event_id, date, id, name, type, value,...
javascript
chosen
[ { "from": "system", "value": "Update configuration format and add configurable mail service\n" }, { "from": "human", "value": "import nodemailer from 'nodemailer';\nimport config from '../../config';\nimport templates from './templates';\n\n// library configuration -------------------------...
javascript
chosen
[ { "from": "system", "value": "Handle enter key on tenant switch.\n" }, { "from": "human", "value": "(function ($) {\n var _accountService = abp.services.app.account;\n\n var _$form = $('form[name=TenantChangeForm]');\n\n _$form.closest('div.modal-content').find(\".save-button\").click(...
javascript
chosen
[ { "from": "system", "value": "Update inline documentation for `NodeList` -> `Array` change.\n" }, { "from": "human", "value": "import settings from './settings';\n\n/*\n The findAll test helper uses `querySelectorAll` to search inside the test\n DOM (based on app configuration for the rootElem...
javascript
chosen
[ { "from": "system", "value": "Update route to serve correct json object\n" }, { "from": "human", "value": "import {Router} from 'express'\nimport models from '../models';\nimport tasks from './tasks'\n\nexport default () => {\n\tlet app = Router({mergeParams: true})\n\n\tapp.use('/:userId/tasks'...
javascript
chosen
[ { "from": "system", "value": "Set code coverage threshold to 91\n" }, { "from": "human", "value": "var argv = require('yargs').argv;\n\nmodule.exports = {\n plugins: {\n istanbul: {\n dir: './coverage',\n reporters: ['text-summary', 'lcov'],\n include: [\n '**/vaadin-da...
javascript
chosen
[ { "from": "system", "value": "Fix call id parameter name\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Module for juggling call state.\n */\n\nangular.module('call', [])\n.factory('callFactory', function (apiFactory) {\n var callStates = {\n error: 'error',\n not_an...
javascript
chosen
[ { "from": "system", "value": "Fix `externals` option of webpack config\n" }, { "from": "human", "value": "import path from 'path'\n\nconst library = 'style-script'\nconst srcPath = path.resolve(__dirname, 'src')\nconst libPath = path.resolve(__dirname, 'lib')\n\nexport default {\n devtool: 'sou...
javascript
chosen
[ { "from": "system", "value": "Update to new more restrictive Slack OAuth2 scopes\n\nAll we need to read is users, so just ask for that.\n\nhttps://api.slack.com/docs/oauth-scopes\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Base from 'simple-auth/authenticators/base';\ni...
javascript
chosen
[ { "from": "system", "value": "Enable btree_gist extension before running tests\n" }, { "from": "human", "value": "'use strict';\nvar Support = require('../support');\n\nbefore(function() {\n var dialect = Support.getTestDialect();\n\n if (dialect !== 'postgres' && dialect !== 'postgres-native'...
javascript
chosen
[ { "from": "system", "value": "Add license header to web app.\n" }, { "from": "human", "value": "#!/bin/env node\n\nvar http = require('http');\n\nvar host = process.env.OPENSHIFT_NODEJS_IP;\nvar port = process.env.OPENSHIFT_NODEJS_PORT || 8080\n\n\nhttp.createServer(function (req, res) {\n res....
javascript
chosen
[ { "from": "system", "value": "Refactor current user method inside Session service\n" }, { "from": "human", "value": "import 'babel-polyfill';\nimport $ from 'jquery';\nimport Backbone from 'backbone';\nimport AppConfig from 'config';\nimport User from 'models/user';\nimport Storage from 'service...
javascript
chosen
[ { "from": "system", "value": "Add fetch project on mount\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { push } from 'react-router-redux';\nimport { connect } from 'react-redux';\nimport Project from './../components/Project'\nimport Button from './../compo...
javascript
chosen
[ { "from": "system", "value": "Make the port binding work?\n" }, { "from": "human", "value": "var io = require('socket.io').listen(port);\nvar redis = require('redis');\nvar url = require('url');\nvar redisURL = url.parse(process.env.REDISCLOUD_URL);\n\nvar sub = redis.createClient(redisURL.port,...
javascript
chosen
[ { "from": "system", "value": "Improve the toggle text trigger selector\n" }, { "from": "human", "value": "var locastyle = locastyle || {};\n\nlocastyle.toggleText = (function() {\n 'use strict';\n\n var config = {\n trigger: '[data-ls-module=toggleText]',\n triggerChange: 'toggleText:cha...
javascript
chosen
[ { "from": "system", "value": "Tests: Make valid-jsdoc an error (instead of warning)\n\nNow that the documentation is updated, this makes it an error.\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n extends: ['eslint:recommended', 'prettier'],\n plugins: ['prettier'],\n ...
javascript
chosen
[ { "from": "system", "value": "Update URL for supported browsers" }, { "from": "human", "value": "module.exports = (ctx) => ({\n map: ctx.file.dirname.startsWith('docs') ? false : {\n inline: false,\n annotation: true,\n sourcesContent: true\n },\n plugins: {\n autoprefixer: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add /dist to prettier ignore\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n parser: \"@typescript-eslint/parser\",\n parserOptions: {\n project: './tsconfig.json'\n },\n ignorePatterns: [\"*.txt\"],\n plugins: [\"@typescript-eslint\"]...
javascript
chosen
[ { "from": "system", "value": "Move promise handler into the factory.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('fivefifteenApp')\n .controller('MainCtrl', function ($scope, $routeParams, Data, Steps) {\n\n // Simple Data service to persist form values.\n $scope.da...
javascript
chosen
[ { "from": "system", "value": "Add uninstall into the build\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n \"use strict\";\n var exec = require(\"child_process\").exec, fs = require(\"fs\");\n grunt.initConfig({\n compress : {\n main : {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix : Le niveau peut aller de 6 à 3 (plutot que 4)\n" }, { "from": "human", "value": "/**\n * Course Model\n * @file app/models/CourseModel.js\n */\n\n\"use strict\";\n\nmodule.exports = function(mongoose) {\n var Schema = mongoose.Schema;\n\n var CourseSchema = n...
javascript
chosen
[ { "from": "system", "value": "Fix Restrict on mtTimeValidator Directive\n" }, { "from": "human", "value": "(function(){\n 'use strict';\n angular.module('mtTimeValidator', [])\n .constant('TIMEREGEXP', /^(0?[1-9]|1[012])(:[0-5]\\d)[APap][mM]$/)\n .directive('time', ti...
javascript
chosen
[ { "from": "system", "value": "Replace == with === to test for equality" }, { "from": "human", "value": "(function($) {\n $.fn.extend({\n hotwire: function(delegate) {\n var target = this,\n args = $.makeArray(arguments),\n events = args.slice(1, args.length);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Set the button to be at the minimum width possible.\n" }, { "from": "human", "value": "qx.Class.define(\"vcms.client.widgets.WidgetList\",\n{\n extend : qx.ui.tabview.TabView,\n \n construct : function()\n {\n this.base(arguments);\n \n ...
javascript
chosen
[ { "from": "system", "value": "feat(react-router): Fix \"Start Over\" menu link to work w/ react-router basename\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport { connect } from 'react-redux'\nimport { DropdownButton, MenuIte...
javascript
chosen
[ { "from": "system", "value": "Make sure a cell exists in the round trip test\n" }, { "from": "human", "value": "import { expect } from 'chai';\n\nimport { launchNewNotebook } from '../../build/main/launch';\ndescribe('launch', () => {\n describe('launchNewNotebook', () => {\n it('launches a ...
javascript
chosen
[ { "from": "system", "value": "Sort the post list by submitted.\n" }, { "from": "human", "value": "Template.postsList.helpers({\n posts: function () {\n return Posts.find();\n }\n});\n" }, { "from": "gpt", "value": "Template.postsList.helpers({\n posts: function () {\n...
javascript
chosen
[ { "from": "system", "value": "FIX disable exception throwing story in Chromatic\n" }, { "from": "human", "value": "export default {\n title: 'Core|Errors',\n};\n\n// Comment this story out until Chromatic supports skipping stories via parameters (soon I promise!)\n// export const exception = ()...
javascript
chosen
[ { "from": "system", "value": "Change order-details path and Order includes\n" }, { "from": "human", "value": "(function(){\n 'use strict';\n\n angular.module('app.states')\n .run(appRun);\n\n /** @ngInject */\n function appRun(routerHelper) {\n routerHelper.configureStates(getStates())...
javascript
chosen
[ { "from": "system", "value": "Add quick documentation to fallback strategy\n" }, { "from": "human", "value": "const bodyClassNameFallback = support => {\n const COOKIE_NAME = 'browser-fallback-raised'\n const CLASS_NAME = '-browser-not-supported'\n const DISMISS_ID = 'dismiss-browser-not-supp...
javascript
chosen
[ { "from": "system", "value": "Comment out until matrices are supported\n" }, { "from": "human", "value": "'use strict';\n\n// FIXME\nreturn;\n\nvar matrix = require( 'dstructs-matrix' );\nvar isMatrix = require( './../lib' );\n\nvar mat = matrix( [10,10] );\n\nconsole.log( isMatrix( mat ) );\n//...
javascript
chosen
[ { "from": "system", "value": "Add try catch to execution errors" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar filename = '{test.wasm}';\nvar ret = read(filename, \"binary\");\n\nfunction instantiate(bytes, imports) {\n return WebAssembly.compile(bytes).then(\n m => new WebAssem...
javascript
chosen
[ { "from": "system", "value": "Fix a bug that urls which webpack-dev-server exports are broken\n" }, { "from": "human", "value": "// Common configuration for webpacker loaded from config/webpack/paths.yml\n\nconst { join, resolve } = require('path');\nconst { env } = require('process');\nconst { ...
javascript
chosen
[ { "from": "system", "value": "Allow disabling of native PG driver\n" }, { "from": "human", "value": "var pg = null\n\ntry {\n\tpg = require('pg')\n\tpg = pg.native\n} catch (__e) {\n\tif (!pg) {\n\t\texports.create = exports.createQuery = function () {\n\t\t\tthrow new Exception(\"pg driver fail...
javascript
chosen
[ { "from": "system", "value": "Add a \"listening on port...\" message\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar express = require('express');\nvar app = express();\n\nvar server = require('http').Server(app);\nvar io = require('socket.io')(server);\n\nvar monitor = require('./...
javascript
chosen
[ { "from": "system", "value": "Make token creation a little easier to read\n" }, { "from": "human", "value": "var assert = require('assert');\nvar connect = require('connect');\nvar csrf = require('csrf-lite');\nvar extend = require('obj-extend');\n\nmodule.exports = function (options) {\n optio...
javascript
chosen
[ { "from": "system", "value": "Fix API URL to /api/*\n" }, { "from": "human", "value": "angular.module('questionServices', ['ngResource']).\n factory('Question', function($resource) {\n return $resource('questions/:id/:action', {id:\"@id\"}, {\n update: { method: 'PUT' },\n ...
javascript
chosen
[ { "from": "system", "value": "Increase initial scrollback to 40 messages.\n" }, { "from": "human", "value": "Hummingbird.ChatRoute = Ember.Route.extend({\n pingInterval: null,\n\n model: function() {\n return [];\n },\n\n afterModel: function() {\n Hummingbird.TitleManager.setTitle(\"C...
javascript
chosen
[ { "from": "system", "value": "Set travis / sauce labs selenium remote web driver.\n" }, { "from": "human", "value": "//@ts-check\nvar assert = require('assert')\n , test = require('selenium-webdriver/testing')\n , webdriver = require('selenium-webdriver')\n , server = require('../server...
javascript
chosen
[ { "from": "system", "value": "Fix bug where empty viewer mock breaks stuff\n" }, { "from": "human", "value": "var extend = require('extend')\n\nvar Crocodoc,\n createViewer\n\nmodule.exports.mock = function (mocks) {\n Crocodoc = window.Crocodoc\n createViewer = Crocodoc.createViewer\n\n Cro...
javascript
chosen
[ { "from": "system", "value": "Remove extra logger creation from binary\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// accepts conf through .env file\n// suitable for configuring this in the docker env\nvar configuration = require('ms-amqp-conf');\nvar bunyan = require('bunyan');\n\...
javascript
chosen
[ { "from": "system", "value": "Use firefox on CI, chrome at home\n" }, { "from": "human", "value": "exports.config = {\n capabilities: {\n 'browserName': 'firefox'\n },\n specs: ['spec/**.spec.js'],\n onPrepare: function () {\n require(\"babel-core/register\");\n ...
javascript
chosen
[ { "from": "system", "value": "Use const instead of let.\n\n* because the variables don't reuse.\n" }, { "from": "human", "value": "import { createStore, compose } from 'redux';\nimport DevTools from '../components/devTools';\nimport Shogi from '../reducers';\n\nlet enhancer = compose(\n DevTool...
javascript
chosen
[ { "from": "system", "value": "Implement test for JS compilation\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport { findModules, compileModules } from '../src/module';\n\ndescribe.only('module.js', () => {\n describe('Module compilation', () => {\n it('should li...
javascript
chosen
[ { "from": "system", "value": "Fix HMR for sync reducers" }, { "from": "human", "value": "/**\n * Create the store with asynchronously loaded reducers\n */\n\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport { fromJS } from 'immutable';\nimport { routerMiddleware } from 'rea...
javascript
chosen
[ { "from": "system", "value": "Remove explicit propagation of change event from SettingsModel to\nSettingsCollectaion - it already happens implicitly. This eliminates a\nduplicate save.\n" }, { "from": "human", "value": "/**\n * SettingsModels.js\n */\n(function (spiderOakApp, window, undefined)...
javascript
chosen
[ { "from": "system", "value": "Use https for loading the tiles\n" }, { "from": "human", "value": "import {normalizeActionName} from '../common/helpers.js';\n\nexport const MAP_URL = 'http://tiles.hel.ninja/styles/hel-osm-light/{z}/{x}/{y}.png';\nexport const MAP_RETINA_URL = MAP_URL.replace('.png...
javascript
chosen
[ { "from": "system", "value": "Add theme to no result tooltip\n" }, { "from": "human", "value": "const noResult = () => (`\n <aside id=\"backdrop\">\n <div id=\"tooltip\">\n <header>No gene information available</header>\n </div>\n </aside>\n`);\n\nexport default noResult;\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Apply ember codemods on tests\n" }, { "from": "human", "value": "import { moduleForComponent, test, todo } from 'ember-qunit';\nimport hbs from 'htmlbars-inline-precompile';\n\nmoduleForComponent('bs-datetimepicker', 'Integration | Component | bs datetimepicker', {\...
javascript
chosen
[ { "from": "system", "value": "Add another assertion for the fraction helper test\n" }, { "from": "human", "value": "'use strict';\n\nvar fraction = require('../').fraction;\nvar tape = require('tape');\nvar Entities = require('html-entities').Html5Entities;\nvar Handlebars = require('handlebars'...
javascript
chosen
[ { "from": "system", "value": "Use anonymous functions instead of arrow functions for backward compatibility with node < v4.0\n" }, { "from": "human", "value": "/* globals module */\n\nvar EOL = require('os').EOL;\n\nmodule.exports = {\n description: 'Register test helpers',\n\n afterInstal...
javascript
chosen
[ { "from": "system", "value": "Refactor spec test into two parts, isPingPong and pingPong\n" }, { "from": "human", "value": "var pingPong = function(i) {\n if ((i % 5 === 0) || (i % 3 === 0)) {\n return true;\n } else {\n return false;\n }\n};\n\n$(function() {\n $(\"#game\").submit(fun...
javascript
chosen
[ { "from": "system", "value": "Fix whenAllSettled: tolerate non-promise elements.\n" }, { "from": "human", "value": "// Like Promise.all, but it does not mind if any of the promises reject.\nexport default function whenAllSettled(promises, {\n onRejection = err => {},\n} = {}) {\n return Pr...
javascript
chosen
[ { "from": "system", "value": "Make the automatic header modification a bit safer." }, { "from": "human", "value": "require.paths.unshift(\"lib\");\n\nvar fishback = require(\"fishback.js\");\n\nvar server = fishback.createServer();\n\nserver.addResFilter(function (res) {\n // If origin doesn'...
javascript
chosen
[ { "from": "system", "value": "Exclude node modules from webpack using dir name\n" }, { "from": "human", "value": "var webpack = require('webpack')\n\n\nmodule.exports = function(config) {\n config.set({\n basePath: '',\n frameworks: ['jasmine'],\n files: [\n 'test/**/*.js'\n ],...
javascript
chosen
[ { "from": "system", "value": "Save query string instead of json representation, namespaced to timetable/:academicYear/sem:semester - same as url\n" }, { "from": "human", "value": "define([\n 'underscore',\n 'app',\n 'backbone.marionette',\n 'localforage',\n '../collections/Timetab...
javascript
chosen
[ { "from": "system", "value": "Add eventgroup_id as param option to orders list\n" }, { "from": "human", "value": "angular.module('billett.admin').config(function ($stateProvider) {\n $stateProvider\n .state('admin-order', {\n url: '/a/order/:id',\n templateUrl: 'a...
javascript
chosen