conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Disable forgotten returns for server promises\n" }, { "from": "human", "value": "require('babel-register');\nrequire('babel-polyfill');\n\nconst Bluebird = require('bluebird');\nconst WebpackIsomorphicTools = require('webpack-isomorphic-tools');\nconst config = requ...
javascript
chosen
[ { "from": "system", "value": "Throw on non-int array lenghts\n" }, { "from": "human", "value": "'use strict';\n\nconst EasyObjectValue = require('../values/EasyObjectValue');\nconst ObjectValue = require('../values/ObjectValue');\nconst ArrayValue = require('../values/ArrayValue');\n\nclass Arra...
javascript
chosen
[ { "from": "system", "value": "Set feeds post limit as Reactive Var\n" }, { "from": "human", "value": "import { createContainer } from 'meteor/react-meteor-data';\n\nimport { Posts, Comments } from '../../api';\nimport PostList from '../components/posts/post-list';\n\nconst PostListContainer = cr...
javascript
chosen
[ { "from": "system", "value": "Add missing license header to js files\n" }, { "from": "human", "value": "'use strict';\n// Define each block's generated code\n\nBlockly.JavaScript['simple_input_output'] = function(block) {\n return ['simple_input_output', Blockly.JavaScript.ORDER_ATOMIC];\n};\n\...
javascript
chosen
[ { "from": "system", "value": "Add chapter 9, exercise 1\n" }, { "from": "human", "value": "// Fill in the regular expressions\n\nverify(/ca[rt]/,\n [\"my car\", \"bad cats\"],\n [\"camper\", \"high art\"]);\n\nverify(/pr?op/,\n [\"pop culture\", \"mad props\"],\n [\"plop\...
javascript
chosen
[ { "from": "system", "value": "Update GroupAttribute deduplication code to handle multi-value attributes." }, { "from": "human", "value": "\"use strict\";\n\nimport React from \"react\";\n\nimport SearchActions from \"../actions/SearchActions.js\";\n\nfunction dedupArray(arr) {\n var t = {};\n ...
javascript
chosen
[ { "from": "system", "value": "Add cors header for browser testing\n" }, { "from": "human", "value": "const _ = require('lodash');\nconst router = require('express').Router();\n\nrouter.get('/cookie', (req, res) => {\n const data = JSON.stringify(req.headers);\n\n let response = '';\n response...
javascript
chosen
[ { "from": "system", "value": "Add navigation to login 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 class Dev...
javascript
chosen
[ { "from": "system", "value": "[DOC] Add jsdoc to getDomain http call.\n" }, { "from": "human", "value": "var gateway = require(__dirname+'/../../../../');\n\nmodule.exports = function(req, res){\n\n gateway.config.set('DOMAIN', req.body.domain);\n gateway.config.save(function(){\n res.send(...
javascript
chosen
[ { "from": "system", "value": "Disable WebSocket in 'ruby-runtime-opal' modular-module\n" }, { "from": "human", "value": "if (typeof globalThis === 'undefined') {\n // define `globalThis` for IE\n self.globalThis = this;\n}\n\nself.importScripts('opal.min.js');\n\n// disable network access\nsel...
javascript
chosen
[ { "from": "system", "value": "Use one var declaration per variable" }, { "from": "human", "value": "angular.module('myApp')\n.directive('googleMaps', [function () {\n return {\n controller: 'MapCtrl',\n\n link: function (scope, elem, attrs, ctrl) {\n var mapOptions,\n latitude...
javascript
chosen
[ { "from": "system", "value": "Add test for xml parsing\n" }, { "from": "human", "value": "var ResponseParser = require('../lib/responseparser'),\n\twinston = require('winston'),\n\tfs = require('fs'),\n\tpath = require('path');\n\ndescribe('responseparser', function() {\n\tvar parser = new Respo...
javascript
chosen
[ { "from": "system", "value": "Change to didUpdateAttrs() from observers\n\nChanged to use didUpdateAttrs instead of observers.\r\nNot only is this the standard ember way now, this also prevent firing update() multiple times if multiple changes occur in a single render cycle.\r\nAlso added a animate property...
javascript
chosen
[ { "from": "system", "value": "Add test for POST request\n" }, { "from": "human", "value": "var chai = require('chai');\nvar chaihttp = require('chai-http');\nchai.use(chaihttp);\nvar expect = chai.expect;\nvar fs = require('fs');\nvar server = require(__dirname + '/../index.js');\n\ndescribe('ou...
javascript
chosen
[ { "from": "system", "value": "Fix A/B test donate button link\n" }, { "from": "human", "value": "(function($) {\n $(function () {\n window.cxVariation = cxApi.chooseVariation();\n if(window.cxVariation === 1){\n var $donate = $('.sidebar__donate-cta');\n var $link = $('.sidebar_...
javascript
chosen
[ { "from": "system", "value": "Fix the memory leak issue on idle timeout\n" }, { "from": "human", "value": "/**\n * Emulates stream.setTimeout() behaviour, but respects outgoing data\n * too.\n *\n * @param {Number} timeout Milliseconds\n */\nexports.attach = function(stream, timeout) {\n var ...
javascript
chosen
[ { "from": "system", "value": ":new: Enable babel 7 in test package\n" }, { "from": "human", "value": "const path = require('path')\nconst presetDefault = require('pundle-preset-default')\n\nmodule.exports = {\n entry: ['./src', './index.html'],\n components: presetDefault({\n transform: {\n...
javascript
chosen
[ { "from": "system", "value": "Make streams work w/ node v0.8.x+\n" }, { "from": "human", "value": "// Copyright 2014 Splunk, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use this file except in compliance with the License. You may obtain\n// a co...
javascript
chosen
[ { "from": "system", "value": "Fix test file after an update to the test cases.\n" }, { "from": "human", "value": "'use strict';\n\nvar lint = require('./_lint');\n\n//////////////////////////////\n// SCSS syntax tests\n//////////////////////////////\ndescribe('no trailing zero - scss', function ...
javascript
chosen
[ { "from": "system", "value": "Update to mini all html\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n htmlmin = require('gulp-htmlmin'),\n config = require('../../config');\n\ngulp.task('mini-html', function() {\n return gulp.src(config.publicDirectory+'/*.html')\n ...
javascript
chosen
[ { "from": "system", "value": "Update agent test with division relationship\n" }, { "from": "human", "value": "import { moduleForModel, test } from 'ember-qunit';\n\nmoduleForModel('agent', 'Unit | Model | agent', {\n // Specify the other units that are required for this test.\n needs: []\n});\...
javascript
chosen
[ { "from": "system", "value": "Change the command name of grunt to build\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.loadNpmTasks('grunt-typescript');\n grunt.loadNpmTasks('grunt-mocha-phantomjs');\n grunt.initConfig({\n typescript: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add watch to grunt defaults\n" }, { "from": "human", "value": "/*jslint node:true */\r\n/*globals module:false */\r\n\r\n\"use strict\";\r\n\r\nmodule.exports = function (grunt) {\r\n\r\n var files = {\r\n allSource: ['Gruntfile.js', 'package.json', 'lib/*...
javascript
chosen
[ { "from": "system", "value": "Add key for elements rendered by map\n" }, { "from": "human", "value": "import { View } from 'react-native';\nimport Button from '../Button';\nimport React, { Component, PropTypes } from 'react';\n\nconst propTypes = {\n actions: PropTypes.array.isRequired,\n ...
javascript
chosen
[ { "from": "system", "value": "Make sure we sort on order\n" }, { "from": "human", "value": "var keystone = require('keystone');\n\nvar index = require('collections-online/lib/controllers/index');\nvar search = require('collections-online/lib/controllers/search');\n\nmodule.exports = function(req...
javascript
chosen
[ { "from": "system", "value": "Print what we're doing, and make executable\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar rimraf = require('rimraf')\nvar fs = require('fs')\nvar childProcess = require('child_process')\nvar walkSync = require('./')\n\nrimraf.sync('benchmark.tmp')\n\...
javascript
chosen
[ { "from": "system", "value": "Put a simple abstraction for the snake's direction\n" }, { "from": "human", "value": "var Game = Game || {};\n\n\nGame.SnakeGame = function(width, height, options) {\n 'use strict';\n this.width = width;\n this.height = height;\n this.grid = [];\n};\n\nGame.Snak...
javascript
chosen
[ { "from": "system", "value": "Add example of using route parameters to fetch data.\n" }, { "from": "human", "value": "import page from 'page'\nimport { connect } from 'react-redux'\nimport React, { PropTypes } from 'react'\n\nimport {\n fetchExample,\n deleteExample,\n...
javascript
chosen
[ { "from": "system", "value": "Add a test for mapPropsOnChange\n" }, { "from": "human", "value": "import test from 'ava'\nimport React from 'react'\nimport { mapPropsOnChange, withState, flattenProp, compose } from '../'\nimport { mount } from 'enzyme'\nimport sinon from 'sinon'\n\ntest('mapProps...
javascript
chosen
[ { "from": "system", "value": "chore: Add missing formatting change to fix linting error.\n" }, { "from": "human", "value": "import test from 'ava';\nimport sinon from 'sinon';\nimport * as actions from '../../../actions';\nimport * as constants from '../../../constants';\nimport { startPlayback ...
javascript
chosen
[ { "from": "system", "value": "Remove weird text shadow under links\n" }, { "from": "human", "value": "import Typography from 'typography';\nimport theme from 'typography-theme-ocean-beach';\n\ntheme.googleFonts.push(\n {\n name: 'M+PLUS+1p',\n styles: ['400'],\n },\n {\n name: 'Noto+...
javascript
chosen
[ { "from": "system", "value": "Reduce log noise in media scanner\n" }, { "from": "human", "value": "const log = require('../lib/logger')('Media:IPC')\nconst Media = require('./Media')\nconst {\n MEDIA_ADD,\n MEDIA_CLEANUP,\n MEDIA_REMOVE,\n MEDIA_UPDATE,\n _SUCCESS,\n _ERROR,\n} = require('...
javascript
chosen
[ { "from": "system", "value": "Fix up some bugs in ecenter_network.\n" }, { "from": "human", "value": "Drupal.behaviors.jqPlot = function(context) {\n if (Drupal.settings.jqPlot) {\n var replace = ['renderer', 'markerRenderer', 'labelRenderer', 'parseX',\n 'parseY', 'scrapeSingle', 'scra...
javascript
chosen
[ { "from": "system", "value": "Remove localhost:3000 from io.connect(), which kills a domain bug\n" }, { "from": "human", "value": "'use strict';\n\n//socket factory that provides the socket service\nangular.module('core').factory('Socket', ['socketFactory',\n function(socketFactory) {\n ...
javascript
chosen
[ { "from": "system", "value": "Disable keystone auto update feature to avoid the \"missing updates folder\" error when starting it.\n" }, { "from": "human", "value": "var config = require('./config.json');\nvar keystone = require('keystone');\n\nkeystone.init({\n\n\t'name': 'anapi',\n\t'brand': '...
javascript
chosen
[ { "from": "system", "value": "Remove homepage settings set for problems with Firefox comunity\n" }, { "from": "human", "value": "'use strict';\n\nvar data = require('sdk/self').data;\n\n{{#if extend_ff_index}}\n{{> extend_ff_index }}\n{{/if}}\n\n{{#if homepage_url}}\nrequire(\"sdk/preferences/se...
javascript
chosen
[ { "from": "system", "value": "Remove dependency install (we don't have any)\n" }, { "from": "human", "value": "'use strict';\nvar util = require('util');\nvar path = require('path');\nvar yeoman = require('yeoman-generator');\n\n\nvar AppengineGenerator = module.exports = function AppengineGener...
javascript
chosen
[ { "from": "system", "value": "[docs] Fix examples for api change.\n" }, { "from": "human", "value": "\nvar prefork = require('../../build/Release/prefork').prefork;\n\nprefork();\n\nvar http = require('http');\n\nhttp.createServer(function (req, res) {\n res.end('I am still running');\n}).liste...
javascript
chosen
[ { "from": "system", "value": "Write test to expect a blueprint to be callable from JsonApiService\n" }, { "from": "human", "value": "/**\n * CategoryController\n *\n * @description :: Server-side logic for managing categories\n * @help :: See http://sailsjs.org/#!/documentation/concepts/C...
javascript
chosen
[ { "from": "system", "value": "Add passthroughAnimatedPropsExplicitValues to modern createAnimatedComponent\n\nSummary:\nCode almost directly copied from the old implementation of [createAnimatedComponent.js](https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libra...
javascript
chosen
[ { "from": "system", "value": "Remove debugger from water grid calendar" }, { "from": "human", "value": "Ext4.namespace('EHR.reports');\n\nEHR.reports.waterGridCalendar = function (panel, tab) {\n var filterArray = panel.getFilterArray(tab);\n debugger;\n var title = panel.getTitleSuffix...
javascript
chosen
[ { "from": "system", "value": "Fix screenshot generation for english rights\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = exports = function(app) {\n\n const gt = app.utility.gettext;\n\n return {\n rights: [\n {\n special: 'annualleav...
javascript
chosen
[ { "from": "system", "value": "Allow Database to receive a connection string.\n" }, { "from": "human", "value": "var util = require('util');\nvar mongoose = require('mongoose');\nvar Grid = require('gridfs-stream')\n\nvar Datastore = function(config) {\n this._config = config;\n this._masters =...
javascript
chosen
[ { "from": "system", "value": "Fix transitions between header menu styles\n" }, { "from": "human", "value": "/**\n * cbpAnimatedHeader.js v1.0.0\n * http://www.codrops.com\n *\n * Licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Copyright 2013, Codrop...
javascript
chosen
[ { "from": "system", "value": "Add limitation to aggregated query results\n" }, { "from": "human", "value": "Meteor.publish('Jobs', (jobId) =>\njobId ? Jobs.find({jobId: jobId}) : Jobs.find()\n)\n\nMeteor.publish('JobsResults', (jobId, limit) =>\nJobsResults.find({jobId:jobId}, {limit: limit, sor...
javascript
chosen
[ { "from": "system", "value": "Remove new lines in if-statement\n" }, { "from": "human", "value": "'use strict';\n\n// VARIABLES //\n\nvar SQRT1OVER8 = 0.35355339059327373; // sqrt( 1.0/8.0 )\n\n\n// MAIN //\n\n/**\n* Returns the standard deviation of an arcsine distribution.\n*\n* @param {number...
javascript
chosen
[ { "from": "system", "value": "Use JSON.stringify instead and fix linter\n" }, { "from": "human", "value": "define([\n '/bower_components/jquery/dist/jquery.min.js',\n '/common/cryptpad-common.js',\n], function (jQuery, Cryptpad) {\n var $ = window.jQuery;\n\n var $body = $('body');\n...
javascript
chosen
[ { "from": "system", "value": "Enable babel plugin in eslint" }, { "from": "human", "value": "// Licensed under the Apache License, Version 2.0 (the “License”); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the License at\n//\n// http://www.apac...
javascript
chosen
[ { "from": "system", "value": "Fix typo in babel presets\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = function (module) {\n return {\n \"module\": false,\n \"port\": 5000,\n \"liveReloadPort\": 35729,\n \"bundleFilename\": \"mai...
javascript
chosen
[ { "from": "system", "value": "Split out an inner loop into a separate function.\n" }, { "from": "human", "value": "var csv = require('ya-csv');\n\nfunction documentsToCsv(writer, handlerName, documents) {\n var csvWriter = new csv.CsvWriter(writer);\n\n (documents || []).forEach(function (...
javascript
chosen
[ { "from": "system", "value": "Split fill and stroke functions\n" }, { "from": "human", "value": "import histSvg from 'static/assets/history-16.svg';\nimport bkmrkSvg from 'static/assets/bookmark.svg';\n\n// Firefox doesnt like # signs in data uris so hex values are a no-go,\n// inline the rgb va...
javascript
chosen
[ { "from": "system", "value": "Switch to function mapping for reducer syntax\n\nIn order to make easier handling of future actions" }, { "from": "human", "value": "import {\n CREATE_GOTO, REMOVE_GOTO, EDIT_GOTO\n} from '../actions/goTo'\nimport {\n LOAD_QUESTIONNAIRE_SUCCESS\n} from '../actions...
javascript
chosen
[ { "from": "system", "value": "Use surface.transaction() in TagEntityPanel to trigger selection update.\n\nFixes substance/archivist#134.\n" }, { "from": "human", "value": "var SelectEntityMixin = require(\"../select_entity_mixin\");\nvar _ = require(\"substance/helpers\");\n\nvar TagEntityPanelM...
javascript
chosen
[ { "from": "human", "value": "Add script to test for memory leaks in watchmen ping\n" }, { "from": "gpt", "value": "var storage_mocked = require ('./../../test/lib/mock/storage_mocked');\nvar debug = require('debug')('data-load');\n\nvar Watchmen = require('../../lib/watchmen.js');\nvar mocked_pi...
javascript
chosen
[ { "from": "system", "value": "Fix scope of socket object\n" }, { "from": "human", "value": "module.exports = function(addressee, correlationId, response) {\n var msg, responseJSON;\n\n response = response || {};\n\n if(String(addressee).length === 0) {\n return new Error(\"No known address...
javascript
chosen
[ { "from": "system", "value": "Add Logs + API Server Key Android notification\n" }, { "from": "human", "value": "var gcm = require('node-gcm');\n\nexports.sendNotification = function(db, title, messageNotif) {\n db.serialize(function() {\n db.all(\"SELECT notification_id from notificati...
javascript
chosen
[ { "from": "system", "value": "Add the local node_modules/.bin to the path\n\nThis happens prior to executing tasks in the\nglueyfile\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nconst Liftoff = require('liftoff');\nconst argv = require('minimist')(process.argv.slice...
javascript
chosen
[ { "from": "system", "value": "Remove unused postal field from form\n" }, { "from": "human", "value": "class Element {\n mount(el) {\n if (typeof el === \"string\") {\n el = document.querySelector(el);\n }\n\n el.innerHTML = `\n <input id=\"stripe-cardnumber\" placeholder=\"ca...
javascript
chosen
[ { "from": "system", "value": "Simplify default equals function based on immutability\n" }, { "from": "human", "value": "import { ReactiveVar } from 'meteor/reactive-var';\nimport { Promise } from 'meteor/promise';\n\nfunction eqls(a, b) {\n return JSON.stringify(a) === JSON.stringify(b);\n}\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix unresolved data with huge result set\n\non some case with many data / many services (mainly due to load activity on client site), $resource query is solved but data are not yet attached and mapped to resolved object. \r\nadding .$promise garanty that the service is done and...
javascript
chosen
[ { "from": "system", "value": "Comment out story that fails in Chromatic\n\n(I will revert this commit soon)\n" }, { "from": "human", "value": "export default {\n title: 'Core|Errors',\n};\n\nexport const exception = () => {\n throw new Error('error');\n};\nexception.title = 'story throws excep...
javascript
chosen
[ { "from": "system", "value": "Fix tree not being drawn after first time\n" }, { "from": "human", "value": "$(function() {\n\n // Pre-populate values from localStorage\n $('#tweet_url').val(localStorage.getItem('tweetUrl') || '');\n $('#usernames').val(localStorage.getItem('usernames') || '');...
javascript
chosen
[ { "from": "system", "value": "Update label for US CT" }, { "from": "human", "value": "const Command = require('../Command');\n\nmodule.exports = Command.extend({\n commandName: 'time',\n commandAliases: ['now'],\n moment: null,\n Discord: null,\n dependencies: {\n 'moment':...
javascript
chosen
[ { "from": "system", "value": "Fix pass error to callback\n" }, { "from": "human", "value": "'use strict';\n\n// module Web.Firebase.Authentication.Eff\n\nexports._onAuth = function (callback, firebase) {\n return function() {\n return firebase.onAuth(callback);\n };\n};\n\nexports._authWith...
javascript
chosen
[ { "from": "system", "value": "Use fragment JSX syntax instead\n" }, { "from": "human", "value": "// @flow strict-local\nimport React, { Fragment } from 'react'\nimport vt323 from './vt323/VT323-Regular.ttf'\nimport { Global, css } from '@emotion/core'\n\nfunction GlobalStyles() {\n return (\n ...
javascript
chosen
[ { "from": "system", "value": "Make bracket regexp a constant\n" }, { "from": "human", "value": "let bracketPattern = /\\[([^\\]]+)\\]/g\nlet inputText = \"To [sleep], [per]chance []to [dream]\"\n\nlet match\nlet startingIndex\nlet matchLength\nlet quillOperations = []\n\nwhile (match = bracketPa...
javascript
chosen
[ { "from": "system", "value": "Use https for load font files\n\nThis will prevent errors from displaying for anyone using the theme behind https" }, { "from": "human", "value": "\n\nvar self = module.exports = {\n __module: {\n provides: {\n \"resources/use_scripts\": {},\n \"resour...
javascript
chosen
[ { "from": "system", "value": "Fix development environment broken after Babel 6 update" }, { "from": "human", "value": "import reactTransform from 'babel-plugin-react-transform'\nimport es2015 from 'babel-preset-es2015'\nimport stage0 from 'babel-preset-stage-0'\nimport react from 'babel-preset-r...
javascript
chosen
[ { "from": "system", "value": "Remove throw when payload is not an Object\n\nAccording to the MQTT Standar, the payload is not always a json Object or json Array. It could be binary data." }, { "from": "human", "value": "/**\n * Created by shellus on 2016-03-16.\n */\nangular.module('ngMQTT', [])...
javascript
chosen
[ { "from": "system", "value": "Set tagName of loading dots to 'span'\n" }, { "from": "human", "value": "import Ember from 'ember'\nimport layout from '../templates/components/sy-loading-dots'\n\nexport default Ember.Component.extend({\n layout,\n\n classNames: [ 'loading-dots' ]\n})\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Swap action and replace action for components\n" }, { "from": "human", "value": "define([\n\n], function () {\n\n function removeElement (node) {\n var parent = node.parentNode;\n while (node.hasChildNodes()) {\n node.removeChild(node.las...
javascript
chosen
[ { "from": "system", "value": "Transform links to clickable links in tweets\n" }, { "from": "human", "value": "let TwitterTimeline = {\n init(socket, tweets_container) {\n // Now that you are connected, you can join channels with a topic:\n this.channel = socket.channel(\"twitter_timeline\...
javascript
chosen
[ { "from": "system", "value": "Add hexo requires for hexo3 compliance\n" }, { "from": "human", "value": "var dot = require('dot');\n\nhexo.extend.renderer.register('dot', 'html', function(data, locals){\n return dot.template(data.text)(locals);\n}, true);" }, { "from": "gpt", "value"...
javascript
chosen
[ { "from": "human", "value": "Index.js: Add sectionShow function to control menu behavior\n" }, { "from": "gpt", "value": "window.onload = function() {\n sectionShow();\n};\n\nfunction sectionShow() {\n document.getElementById('about_btn').addEventListener('click', function(event) {\n event....
javascript
chosen
[ { "from": "system", "value": "Make gulp-mocha comatible with watch\n\nSince mocha uses `require` to load tests - we need either run mocha in\nspawned process or clear requires cache.\n" }, { "from": "human", "value": "'use strict';\nvar es = require('event-stream');\nvar Mocha = require('mocha')...
javascript
chosen
[ { "from": "system", "value": "Extend prototype with non-enumerable property\n\nThis way we don't mess up peoples' code depending on `for..in` or `Object.keys`. Many people rely on Object.prototype having no enumerable properties and do things like:\r\n\r\n```js\r\nfor(key in {a:1, b:2}) foo(key);\r\n```\r\n...
javascript
chosen
[ { "from": "system", "value": "Use `'html'` as output format\n\nPer jstransformers/jstransformer#3.\n" }, { "from": "human", "value": "'use strict';\n\nexports.name = 'verbatim';\nexports.outputFormat = 'xml';\n\nexports.render = function (str) {\n return '\\n' + str + '\\n';\n}\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix: Use custom WeakMap check until es6-weak-map PR is accepted\n" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert');\n\nvar WM = require('es6-weak-map');\nvar hasWeakMap = require('es6-weak-map/is-implemented');\nvar defaultResolution ...
javascript
chosen
[ { "from": "system", "value": "Change indent for print function to 2 spaces.\n" }, { "from": "human", "value": "exports = module.exports = require('./lib/redis');\n\nexports.ReplyError = require('./lib/reply_error');\nexports.Promise = require('bluebird');\nexports.Cluster = require('./lib/cluste...
javascript
chosen
[ { "from": "system", "value": "Add differentiation between GET and POST requests\n" }, { "from": "human", "value": "const url = require('url')\nconst level = require('level')\nconst then = require('then-levelup')\nconst { send, createError, sendError } = require('micro')\n\nconst db = then(level(...
javascript
chosen
[ { "from": "system", "value": "Use l instead of t\n" }, { "from": "human", "value": "'use strict'\n\nmodule.exports = tempest\ntempest.compile = compile\ntempest.render = render\n\nfunction tempest (s) {\n for (var i = 0, t = 0, p = [], e = [], f, l, o = '{{', c = '}}';;) {\n f = s.indexOf(o,...
javascript
chosen
[ { "from": "system", "value": "Change the name template component to view component\n" }, { "from": "human", "value": "'use strict';\nvar createComponent = require('./src/component');\nvar createTemplateComponent = require('./src/template-component');\nvar createAdapter = require('./src/rx/adapte...
javascript
chosen
[ { "from": "system", "value": "Make in-built version args work\n" }, { "from": "human", "value": "/*\n * index.js: Top-level include for flatiron-cli-version\n *\n * (C) 2012, Pavan Kumar Sunkara\n *\n */\n\nvar path = require('path');\n\nvar cliVersion = exports = module.exports;\n\ncliVersion.n...
javascript
chosen
[ { "from": "system", "value": "Fix issue with undefined tree param.\n" }, { "from": "human", "value": "/* eslint-env node */\n'use strict';\n\nvar path = require('path');\nvar Funnel = require('broccoli-funnel');\nvar MergeTrees = require('broccoli-merge-trees');\n\nmodule.exports = {\n name: 'e...
javascript
chosen
[ { "from": "system", "value": "Allow customizing filename field in parts\n" }, { "from": "human", "value": "var uuid = require('node-uuid');\nvar CRLF = '\\r\\n';\n\nfunction generate(tuples, options) {\n options = options || {};\n var boundary = options.boundary || uuid();\n var headers = [\n...
javascript
chosen
[ { "from": "system", "value": "Add write of metric string.\n" }, { "from": "human", "value": "var net = require('net');\nvar util = require('util');\n\nvar MetricClient = function (host, port) {\n this.visorHost = host;\n this.visorPort = port;\n};\n\nMetricClient.prototype.report = functio...
javascript
chosen
[ { "from": "system", "value": "Add access to heroku env port\n" }, { "from": "human", "value": "const express = require('express');\nconst bodyParser = require('body-parser');\n\nconst app = express();\napp.use(express.static((__dirname + '/client/public')));\napp.use(bodyParser.json());\n\napp.g...
javascript
chosen
[ { "from": "system", "value": "Use `charAt` for IE7 support\n\nJust in case anyone ever needs IE7 support.\n" }, { "from": "human", "value": "module.exports = function(value) {\n var length = value.length;\n\n // If `value` is an empty string, then it will have 0 caps and a length of 0,\n // w...
javascript
chosen
[ { "from": "system", "value": "Load the ffi extensions *after* setting module.exports\n" }, { "from": "human", "value": "// Load the node-ffi extensions\nrequire('./ffi-extend')\n\n// The main exports is the casting function\nmodule.exports = $\n$._ = $ // legacy. TODO: remove by 0.1.0\n\n// expo...
javascript
chosen
[ { "from": "system", "value": "Break the build for kicks\n" }, { "from": "human", "value": "import { addError } from './codeship-notifications';\n\ndescribe('codeship-notifications/add-error', () => {\n beforeAll(() => {\n global.atom = {\n notifications: {\n addError: jest.fn(),\...
javascript
chosen
[ { "from": "system", "value": "Fix triggerCheck usage in ctrl\n" }, { "from": "human", "value": "/*\n** Module dependencies\n*/\nvar mongoose = require('mongoose');\n\nvar RemoteResource = mongoose.model('RemoteResource');\nvar ConsolidatedRecord = mongoose.model('ConsolidatedRecord');\n\nconst {...
javascript
chosen
[ { "from": "system", "value": "Allow development server to be accessed from any url\n\nJust needed to set `historyApiFallback` as `true`.\n" }, { "from": "human", "value": "'use strict';\nvar webpack = require('webpack');\nvar WebpackDevServer = require('webpack-dev-server');\n\nvar config = requ...
javascript
chosen
[ { "from": "system", "value": "[FIX] jcapture: Add dependency on auth_token_access (service errors don't seem to appear though, sadly)\n\ngit-svn-id: a7fabbc6a7c54ea5c67cbd16bd322330fd10cc35@42069 b456876b-0849-0410-b77d-98878d47e9d5\n" }, { "from": "human", "value": "// (c) Copyright 2002-2012 b...
javascript
chosen
[ { "from": "system", "value": "Update what plateforms are tested\n" }, { "from": "human", "value": "/**\n * format is {\n * browserName: [versions..]\n * OR\n * browserName: {\n * version: [platforms...]\n * }\n * }\n * for possibilities\n * https://wiki.saucelabs.com/display/DOCS/Pla...
javascript
chosen
[ { "from": "system", "value": "Use a constant for num NPCs.\n" }, { "from": "human", "value": "!function(seine, exports) {\n 'use strict';\n\n var Component = seine.Component,\n Keylogger = demo.Keylogger,\n Player = demo.Player,\n NPC = demo.NPC,\n Tile = demo.Tile;\n\n va...
javascript
chosen
[ { "from": "system", "value": "Add box shadow to movie card component\n" }, { "from": "human", "value": "import React from 'react';\nimport styled from 'styled-components';\nimport PropTypes from 'prop-types';\nimport theme from 'theme';\n\n\nconst StyledContainer = styled.div`\n background: $...
javascript
chosen
[ { "from": "system", "value": "Add comments to tutorial code\n" }, { "from": "human", "value": "window.onload = function() {\n var xScale = new Plottable.LinearScale();\n var yScale = new Plottable.LinearScale();\n\n var xAxis = new Plottable.XAxis(xScale, \"bottom\");\n var yAxis = new Plott...
javascript
chosen
[ { "from": "system", "value": "Replace a query-string parsing utility with URLSearchParams\n" }, { "from": "human", "value": "'use strict';\n\n/** Parse a query string into an object mapping param names to values. */\nfunction parseQuery(query) {\n if (query.charAt(0) === '?') {\n query = que...
javascript
chosen
[ { "from": "system", "value": "Append submit button to form\n" }, { "from": "human", "value": "document.getElementById(\"ayuda\").setAttribute(\"aria-current\", \"page\");\n\nvar aside = document.getElementById(\"complementario\");\n\nvar form = document.createElement(\"FORM\");\nvar p = document...
javascript
chosen
[ { "from": "system", "value": "fix: Add ExportNamedDeclaration to node identifier.\n\nAdding ExportNamedDeclaration covers the case:\n`export { default as Foo } from './Foo.jsx';`\n" }, { "from": "human", "value": "module.exports = function (babel) {\n var t = babel.types\n var regex = new RegE...
javascript
chosen