conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Increase archive record limit to 10000 for demo to allow reduction information to be seen\n" }, { "from": "human", "value": "const knex = require('../../../knex').archive\n\nmodule.exports = function () {\n var selectColumns = [\n 'unique_identifier AS uniqueIde...
javascript
chosen
[ { "from": "system", "value": "Change In Badge Code Js\n\nChange In Badge Code Js" }, { "from": "human", "value": "/********************************************************************************/\r\n/********************************************************************************/\r\n/*Functio...
javascript
chosen
[ { "from": "system", "value": "Make width a non-obligatory parameter" }, { "from": "human", "value": "(function() {\n var Inkscape, async, fs;\n\n fs = require('fs');\n\n async = require('async');\n\n Inkscape = require('inkscape');\n\n module.exports = function(grunt) {\n return grunt.re...
javascript
chosen
[ { "from": "system", "value": "Add Edge to the targets list\n\nPart of https://github.com/vector-im/element-web/issues/9175\n" }, { "from": "human", "value": "module.exports = {\n \"sourceMaps\": \"inline\",\n \"presets\": [\n [\"@babel/preset-env\", {\n \"targets\": [\n ...
javascript
chosen
[ { "from": "system", "value": "Hide action buttons if the company is archived\n\nThis prevents bad data being added when a company\nhas been archived\n" }, { "from": "human", "value": "const { getCompanyInvestmentProjects } = require('../../investment-projects/repos')\nconst { transformInvestment...
javascript
chosen
[ { "from": "system", "value": "Enable IA button only if cookie iabutton exists implemented\n" }, { "from": "human", "value": "/* global menuJson:false */\nwindow.addEventListener('WebComponentsReady', function() {\n\n //original document\n var firstElement = document.body.children[0];\n\n // i...
javascript
chosen
[ { "from": "system", "value": "Read from the 'package.json' property\n\nIn this segment the 'Gruntfile' containing the 'grunt',\nmodule can read from the 'package.json' property,\nin order to initialize settings described within this,\n'package.json' property.\n" }, { "from": "human", "value": "m...
javascript
chosen
[ { "from": "system", "value": "Update websocket url to use dynamic host rather than fixed\n" }, { "from": "human", "value": "import { browserHistory } from 'react-router';\n\nconst instanceID = Math.floor(Math.random() * 10000) + 1;\n\nexport const eventTypes = {\n shownNotification: \"SHOWN_N...
javascript
chosen
[ { "from": "system", "value": "Add GA and Convert domains to Sentry JS allowURLs list\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at h...
javascript
chosen
[ { "from": "system", "value": "Change version checking to only halt on yarn error\n" }, { "from": "human", "value": "import { spawn } from 'cross-spawn';\nimport hasYarn from './has_yarn';\n\nconst packageManager = hasYarn() ? 'yarn' : 'npm';\n\nexport default function latestVersion(packageName) ...
javascript
chosen
[ { "from": "system", "value": "Remove the require statement for signupValidtion.js\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport thunk from 'redux-thunk';\nimport { createStore, applyMiddleware } f...
javascript
chosen
[ { "from": "system", "value": "Correct the documentation for supported VNC modes\n" }, { "from": "human", "value": "export const INIT_CONSOLE = 'INIT_CONSOLE'\nexport const DOWNLOAD_CONSOLE = 'DOWNLOAD_CONSOLE'\nexport const DISCONNECTED_CONSOLE = 'DISCONNECTED_CONSOLE'\n\nexport const OPEN_CONSO...
javascript
chosen
[ { "from": "system", "value": "Remove notify from box fangorn [skip ci]\n" }, { "from": "human", "value": "'use strict';\n\nvar m = require('mithril');\nvar Fangorn = require('js/fangorn');\n\nfunction _fangornLazyLoadError (item) {\n item.notify.update('Box couldn\\'t load, please try again l...
javascript
chosen
[ { "from": "system", "value": "Handle errors in response helper\n" }, { "from": "human", "value": "const TYPE = 'Content-Type'\nconst OSTREAM = 'application/octet-stream'\n\nconst sendResponse = (res, arg1, arg2) => {\n let code = typeof arg1 === 'number' ? arg1 : 200\n let data = (typeof arg1 ...
javascript
chosen
[ { "from": "system", "value": "Reset pagination size for small screen\n\n为移动端调整导航条大小\n" }, { "from": "human", "value": "// 为相对时间添加 title 属性\n$(document).ready(function() {\n $(\".post-date, .comment-date span\").each(function() {\n var ts = $(this).attr('data-timestamp');\n var t...
javascript
chosen
[ { "from": "system", "value": "Remove flow statement to catch handling all of action types\n" }, { "from": "human", "value": "// @flow\n\nimport {\n FETCHING_DATA,\n FETCHING_DATA_FAILURE,\n FETCHING_DATA_SUCCESS\n} from './types'\n\nimport type { Neo } from './types'\nimport type { Actions } ...
javascript
chosen
[ { "from": "system", "value": "Change done-based mocha tests to use returned promises\n" }, { "from": "human", "value": "var mockMbaasServiceProxy = require('./stub/mbaas-service-proxy');\nvar mediator = require('fh-wfm-mediator/lib/mediator');\nvar express = require('express');\nvar proxyquire =...
javascript
chosen
[ { "from": "system", "value": "Save frequently used jQuery elements to variables for caching purposes\n" }, { "from": "human", "value": "$(document).ready(function () {\n var socket = io.connect();\n var messageTemplate = _.template($('#message-template').html());\n\n socket.on('message reciev...
javascript
chosen
[ { "from": "system", "value": "Add experimental server-side renderer for Torus/JDOM\n" }, { "from": "human", "value": "const stringRenderJDOM = (node, previous, next) => {\n return '';\n}\n\nmodule.exports = stringRenderJDOM;\n\n" }, { "from": "gpt", "value": "// These bits are fro...
javascript
chosen
[ { "from": "system", "value": "Add Slash Command help text\n" }, { "from": "human", "value": "module.exports = {\n add: function(req, res) {\n YouTubeService.getYouTubeVideo(req.body.key, req.body.user).then(SyncService.addVideo).then(SyncService.sendAddMessages).then(function(video) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add Card styling to landing page\n" }, { "from": "human", "value": "import React, { PropTypes, Component } from 'react';\nimport d3 from 'd3';\n//import * as parcoords from './lib/d3.parcoords.js';\nimport Parallel from './Parallel.js'; \n\n\n\nexport default class ...
javascript
chosen
[ { "from": "system", "value": "Fix called create API when show API success\n" }, { "from": "human", "value": "import { createAction } from 'redux-actions'\nimport { createEvent as createAPI, showEvent as showAPI } from '../api/Event'\nimport Actions from '../constants/Actions'\nimport errorUrls f...
javascript
chosen
[ { "from": "system", "value": "Convert functional component to class extending PureComponent\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst WeekDay = ({ weekday, className, localeUtils, locale, size }) => {\n const weekdayName = locale...
javascript
chosen
[ { "from": "system", "value": "Use same layout for now\n" }, { "from": "human", "value": "import PropTypes from 'prop-types'\nimport React from 'react'\n\nimport App from 'components/App'\n\nimport './base.scss'\n\nconst Alternate = ({ children, location }) => (\n <App location={location}>\n ...
javascript
chosen
[ { "from": "system", "value": "Add ref to table element\n" }, { "from": "human", "value": "var React = require('react');\nvar data = require('./data.full.js');\nvar options = {\n rowHeight: 40\n};\n\nvar ReactDataTable = React.createClass({\n getInitialState: function() {\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Change @include to match manifest\n" }, { "from": "human", "value": "// ==UserScript==\n// @name TwitchEmote4Facebook\n// @description adds the Twitch emotes to the facebook chat\n// @homepage https://github.com/Kiniamaro/TwitchEmote4Facebook\n// @versi...
javascript
chosen
[ { "from": "system", "value": "GH-35: Update for rename of default branch to main\n" }, { "from": "human", "value": "/*\n\n A handlebars helper to allow us to safely output object content from within a template. See the docs for details:\n\n https://github.com/fluid-project/fluid-handlebar...
javascript
chosen
[ { "from": "system", "value": "[LIB-387] Change param name in APNS device model\n" }, { "from": "human", "value": "import stampit from 'stampit';\nimport {Meta, Model} from './base';\n\nconst APNSDeviceMeta = Meta({\n name: 'apnsdevice',\n pluralName: 'apnsdevices',\n endpoints: {\n 'detail...
javascript
chosen
[ { "from": "system", "value": "Add mode to fix error\n" }, { "from": "human", "value": "var sys = require('sys');\nvar fs = require('fs');\n\nvar cache = {}\nfunction now() { return (new Date).getTime(); }\n\nexports.put = function(key, value, time) {\n fs.stat('cache', function (err, stats) {\n...
javascript
chosen
[ { "from": "system", "value": "Set clear flag on render pass to false\n\nThe clear flag needs to be flase to allow transparent render passes on\ntop of eachother. It was originally set to false in nin, but updating\nthree.js resets it to true, since that's the default in the official\nthree.js version.\n" ...
javascript
chosen
[ { "from": "system", "value": "Fix IE tests firing too many connections\n" }, { "from": "human", "value": "\nvar expect = require('expect.js');\nvar eio = require('../');\n\ndescribe('engine.io-client', function () {\n\n it('should expose protocol number', function () {\n expect(eio.protocol)...
javascript
chosen
[ { "from": "system", "value": "Add functionality to sign up new users.\n\nThis does not include agents and there is still an error\nthat will not allow users to be created for a mysterious\nreason.\n" }, { "from": "human", "value": "// SignupController\n// ================\n// Handles routing for...
javascript
chosen
[ { "from": "system", "value": "Make the test actually function\n" }, { "from": "human", "value": "const test = require('tape')\nconst BorrowState = require('borrow-state')\n\ntest(`read-only-safety`, (t) => {\n t.plan(4)\n let myState = new BorrowState()\n myState.block().then((state) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove non-working debug output to console\n" }, { "from": "human", "value": "/*\n Author: mythern\n \n Copyright (C) 2014, MIT License\n http://www.opensource.org/licenses/mit-license.php\n\n Adressaway is provided free of charge, to any person obtai...
javascript
chosen
[ { "from": "system", "value": "Verify that circular namespaces work.\n" }, { "from": "human", "value": "test(\"Can declare namespace without usings\", function() {\n\n var ns = namespace(\"My.Namespace.One\", function() {\n this.message = 'Hello world';\n });\n\n equal('Hello worl...
javascript
chosen
[ { "from": "system", "value": "Remove clone, _ check is not needed\n" }, { "from": "human", "value": "var es = require('event-stream')\n , clone = require('clone')\n , sass = require('node-sass')\n , path = require('path')\n , gutil = require('gulp-util')\n , ext = gutil.replaceExtens...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix path, remove undocumented value\n" }, { "from": "human", "value": "/*jslint node:true, browser:true */\n\n'use strict';\n\nexports.Reader = require('./lib/parser/reader').Reader;\nexports.Writer = require('./lib/parser/writer').Writer;\n\nexports.connect =...
javascript
chosen
[ { "from": "system", "value": "Revert \"use argument passed instead of this.app\"\n\nThis reverts commit 6353e4b2acbe5be66f67de00c5bea473ce4d2a22.\n" }, { "from": "human", "value": "/* jshint node: true */\nmodule.exports = {\n name: 'ember-cli-dotenv',\n config: function(env, appConfig){\n ...
javascript
chosen
[ { "from": "system", "value": "Add angular service for VariableCategory\n" }, { "from": "human", "value": "angular.module('dplaceServices', ['ngResource'])\n .factory('LanguageClass', function ($resource) {\n return $resource(\n '/api/v1/language_classes/:id',\n {p...
javascript
chosen
[ { "from": "system", "value": "Fix a minor formatting issue\n" }, { "from": "human", "value": "// Chance.js 0.1\n// http://chancejs.com\n// (c) 2013 Victor Quinn\n// Chance may be freely distributed or modified under the MIT license.\n\n(function() {\n\n var chance = {\n VERSION: 0....
javascript
chosen
[ { "from": "system", "value": "Return rejected promise instead of throwing if an error occurs in Request\n" }, { "from": "human", "value": "import { request as baseRequest, sanitize } from 'js-utility-belt/es6';\n\nimport ApiUrls from '../constants/api_urls';\n\n\nconst DEFAULT_REQUEST_CONFIG = {...
javascript
chosen
[ { "from": "system", "value": "Add MONGOHQ_URL env var to db secret\n" }, { "from": "human", "value": "module.exports = {\n db: process.env.MONGODB || 'mongodb://localhost:27017/gamekeller',\n sessionSecret: process.env.SESSION_SECRET || 'gkdevel',\n}" }, { "from": "gpt", "value": "...
javascript
chosen
[ { "from": "system", "value": "Remove deprecation warning by using require.resolve to look up dompurify location" }, { "from": "human", "value": "/* eslint-env node */\n'use strict';\nvar path = require('path');\nvar Funnel = require('broccoli-funnel');\nvar mergeTrees = require('broccoli-merge-t...
javascript
chosen
[ { "from": "system", "value": "Use the new pref name for the remote server URL" }, { "from": "human", "value": "// Stalling server\n// https://bugzilla.mozilla.org/show_bug.cgi?id=1165816\n//\n// To use:\n//\n// 1. start the server using `node ./index.js`\n// 2. set browser.safebrowsing.appRepURL...
javascript
chosen
[ { "from": "system", "value": "Add rsync to appCmd taskcat" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar _ = require('lodash');\n\nvar PLUGIN_NAME = 'kalabox-plugin-rsync';\n\nmodule.exports = function(kbox) {\n\n var events = kbox.core.events;\n var engine ...
javascript
chosen
[ { "from": "system", "value": "Remove `os.EOL` and just use `'\\n'`\n" }, { "from": "human", "value": "'use strict';\n\nconst os = require('os');\nconst debug = require('debug')('asset-resolver');\nconst resolver = require('./lib/resolver');\n\nfunction any(promises) {\n return Promise.all(\n ...
javascript
chosen
[ { "from": "system", "value": "Fix code style and ES6ify\n" }, { "from": "human", "value": "export function download(filename, data) {\n // yanked from here\n // https://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server\n var blob = new Blob([d...
javascript
chosen
[ { "from": "system", "value": "Allow only future dates for date picker\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport { DatePickerIOS, StyleSheet } from 'react-native';\n\nconst styles = StyleSheet.create({\n picker: {\n backgroundColor: '#fff'...
javascript
chosen
[ { "from": "system", "value": "Refactor patch to build pins array and add function to make pins array\n" }, { "from": "human", "value": "'use strict';\n\nvar Map = require('../models/map');\n\nmodule.exports = function (app) {\n app.route('/api/maps')\n .get(function(req, res){\n Map.fin...
javascript
chosen
[ { "from": "system", "value": "Fix missing SignUp page screen add workaround for createNativeStackNavigator safe area view\n" }, { "from": "human", "value": "import React from 'react';\nimport { createNativeStackNavigator } from 'react-native-screens/native-stack';\nimport { useTheme } from 'reac...
javascript
chosen
[ { "from": "system", "value": "Fix removed jQuery function from 3.0\n\nThe .load API was removed in jQuery 3.0 [1] and it is recommended to use\n`.on(\"load\")` instead.\n" }, { "from": "human", "value": "// Happen as soon as the DOM is loaded and before assets are downloaded\njQuery(function ($)...
javascript
chosen
[ { "from": "system", "value": "Add show/hide functions to ChannelInfo component\n" }, { "from": "human", "value": "ChannelInfo = BlazeComponent.extendComponent({\n onCreated: function () {\n },\n\n onRendered: function () {\n var self = this,\n $channelInfo = self.$('.channel-info'),...
javascript
chosen
[ { "from": "system", "value": "Change css to root argument name to be more clear\n" }, { "from": "human", "value": "var postcss = require('postcss');\n\nmodule.exports = postcss.plugin('PLUGIN_NAME', function (opts) {\n opts = opts || {};\n\n // Work with options here\n\n return function...
javascript
chosen
[ { "from": "system", "value": "Use \"exports\" instead of \"module.exports\".\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * CRUD middlewares to access bookshelf models\n */\n\nmodule.exports = {\n create: require('./lib/create'),\n destroy: require('./lib/destroy'),\n search: req...
javascript
chosen
[ { "from": "system", "value": "Add the mandatory semicolon after class property" }, { "from": "human", "value": "import React from 'react';\n\nexport default class Line extends React.Component {\n\n static propTypes = {\n from: React.PropTypes.shape({\n x: React.PropTypes.number.isRequir...
javascript
chosen
[ { "from": "system", "value": "Throw Error when type is missing\n" }, { "from": "human", "value": "module.exports.encode = function encode() {\n return new Buffer(1);\n};\n" }, { "from": "gpt", "value": "module.exports.encode = function encode(type) {\n if(type == null) {\n throw...
javascript
chosen
[ { "from": "system", "value": "Add support for multilingual gitbooks\n" }, { "from": "human", "value": "module.exports = {\n hooks: {\n // After html generation\n \"page:after\": function(page) {\n var config = this.options.pluginsConfig[\"edit-link\"] || {};\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add route and button for new post\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { fetchPosts } from '../actions/index';\n\nclass PostIndex extends Component {\n componentWillMount() {\n ...
javascript
chosen
[ { "from": "system", "value": "Throw instead of returning an error\n" }, { "from": "human", "value": "'use strict';\n\nvar getos = require('getos');\nvar execFile = require('child_process').execFile;\n\n/**\n * Get the current Linux distro\n *\n * @param {Function} cb\n * @api public\n */\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Improve with simple performance wins\n" }, { "from": "human", "value": "var crypto = require('crypto')\n\n// Crockford's Base32\n// https://en.wikipedia.org/wiki/Base32\nvar ENCODING = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"\n\nfunction strongRandomNumber() {\n return...
javascript
chosen
[ { "from": "system", "value": "Set the filename jade option in order to make logs more consistent\n" }, { "from": "human", "value": "'use strict';\nvar Filter = require('broccoli-filter');\nvar jade = require('jade');\n\nfunction JadeFilter(inputTree, options) {\n\tif (!(this instanceof JadeFilte...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fix for blank page on Safari reload\"\n" }, { "from": "human", "value": "\n/**\n * Expose `fresh()`.\n */\n\nmodule.exports = fresh;\n\n/**\n * Check freshness of `req` and `res` headers.\n *\n * When the cache is \"fresh\" __true__ is returned,\n * otherwi...
javascript
chosen
[ { "from": "system", "value": "Check if Google Maps API has already been loaded\n\nIn case the function is called twice (e.g. by another module), return existing instance immediately." }, { "from": "human", "value": "var CALLBACK_NAME = '__googleMapsApiOnLoadCallback'\n\nvar OPTIONS_KEYS = ['chan...
javascript
chosen
[ { "from": "system", "value": "Refactor the way that the property name is replaced in preparation for start and end types\n" }, { "from": "human", "value": "var postcss = require('postcss');\n\nmodule.exports = postcss.plugin('postcss-logical-props', function (opts) {\n\n var DIR_LTR = 'ltr';\...
javascript
chosen
[ { "from": "system", "value": "Fix a bug where Assertion's stack is always true even when set to false\n" }, { "from": "human", "value": "/**\n * External dependencies.\n */\n\nvar chai = global.chai || require('chai');\n\n/**\n * Chai.js plugin.\n *\n * Options:\n *\n * - styles: array/string...
javascript
chosen
[ { "from": "system", "value": "Fix regression error in file path.\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path'),\n childProcess = require('child_process'),\n phantomjs = require('phantomjs'),\n binPath = phantomjs.path;\n\nmodule.exports = function (filep...
javascript
chosen
[ { "from": "system", "value": "Fix typo in Alg00 that prevents CIEUtils from loading\n" }, { "from": "human", "value": "\n'use strict';\n\nvar CIEStrategy = require('./cie_strategy.js').CIEStrategy;\nvar CIEUtils = require('./cie_utils.js').CIEUtils;\nvar cieUtils = new CIEUtil();\n\nvar Alg00 = ...
javascript
chosen
[ { "from": "system", "value": "Allow setting thumbnail width & height.\n" }, { "from": "human", "value": "var gm = require('gm'),\n fs = require('fs'),\n common = require('./common'),\n root = process.argv[2];\n\nvar TEASER_IMAGE_PATTERN = '.+-teaser';\nvar TEASER_FILE_NAME = '-teaser.jp...
javascript
chosen
[ { "from": "system", "value": "Add method override to http requests\n" }, { "from": "human", "value": "import Vue from 'vue/dist/vue.esm';\nimport AxiosConfig from 'axios';\nimport VueAxios from 'vue-axios';\n\nconst csrf_el = document.querySelector('meta[name=csrf-token]'),\n headers = csrf...
javascript
chosen
[ { "from": "system", "value": "Add opacity support for colorscale interpolation\n" }, { "from": "human", "value": "/**\n* Copyright 2012-2016, Plotly, Inc.\n* All rights reserved.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this s...
javascript
chosen
[ { "from": "system", "value": "Replace reserved keywords in Node: config, module.\n" }, { "from": "human", "value": "/* \n Copyright 2011 Google Inc\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n ...
javascript
chosen
[ { "from": "system", "value": "Fix addRouteObject when primary is already an object\n" }, { "from": "human", "value": "import fp from 'mostly-func';\n\nconst defaultOptions = {\n field: 'primary',\n select: '*'\n};\n\n/**\n * Add route service object to hook.params\n */\nexport default function...
javascript
chosen
[ { "from": "system", "value": "Remove the reference to table\n" }, { "from": "human", "value": "import * as Boundless from './exports.js';\nimport * as _ from 'lodash';\nimport fs from 'fs';\n\n_.mixin({'pascalCase': _.flow(_.camelCase, _.upperFirst)});\n\ndescribe('exports', () => {\n it('doe...
javascript
chosen
[ { "from": "system", "value": "Add sensor contact update and remove routes\n" }, { "from": "human", "value": "var shipSystems = require('../shipSystems.js');\nvar sensors = shipSystems.getSystemById('sensors');\n\nexports.registerRoutes = function (app, config) {\n app.post('/api/systems/sensors...
javascript
chosen
[ { "from": "system", "value": "Make adjacenttab true in default\n\nClick with Ctrl key opens a tab adjacently.\n" }, { "from": "human", "value": "// describe types of a propety as:\n// mystr: 'string',\n// mynum: 'number',\n// mybool: 'boolean',\nconst types = {\n hintchars: 'string',\n...
javascript
chosen
[ { "from": "system", "value": "Make sure payments table fills out when loaded\n" }, { "from": "human", "value": "import React from 'react'\nimport { connect } from 'react-redux'\nimport { pick } from 'ramda'\n\nconst PaymentsTable = require('../../shared/components/payments_table')\n\nconst Membe...
javascript
chosen
[ { "from": "system", "value": "Switch out map in code\n" }, { "from": "human", "value": "var battleState = {\r\n\r\n\tmap: null,\r\n\tbattle: null,\r\n\r\n\tcreate: function() {\r\n\t\t//TODO: anything needed on battle start add here\r\n // tilemap(key, tileWidth, tileHeight, width, height) → ...
javascript
chosen
[ { "from": "system", "value": "Add step parameter to range helper\n" }, { "from": "human", "value": "export const range = (start, end) => {\n const result = [];\n for (let index = start; index < end; index++) {\n result.push(index);\n }\n return result;\n};\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Throw on component action error, until fluxible releases a fix\n" }, { "from": "human", "value": "var RouterPlugin = require('./utils/plugins/router'),\n FetchPlugin = require('./utils/plugins/fetch'),\n fetch = require('isomorphic-fetch'),\n Fluxible = require('...
javascript
chosen
[ { "from": "system", "value": "Add appbase link in poweredby\n" }, { "from": "human", "value": "import {default as React, Component} from 'react';\n\nexport class PoweredBy extends Component {\n\tconstructor(props, context) {\n\t\tsuper(props);\n\t}\n\n\t// render\n\trender() {\n\t\treturn (\n\t\...
javascript
chosen
[ { "from": "system", "value": "Write to file at every 1000 block\n" }, { "from": "human", "value": "/*\n We extract real data from Ethereum canonical blockchain header. \n*/\n\nvar Web3 = require('web3');\nvar fs = require('fs');\nvar async = require('async');\n\n//var resultFileName = 'te...
javascript
chosen
[ { "from": "system", "value": "WatLobby: Fix for hiding text field based on model type.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file e...
javascript
chosen
[ { "from": "system", "value": "Change confusing variable name in e2e test\n" }, { "from": "human", "value": "describe('the Basic example page', function () {\n var basicExamplePage = require('./page.js');\n\n beforeEach(function () {\n basicExamplePage.get();\n });\n\n describe('rendering ...
javascript
chosen
[ { "from": "system", "value": "(docs): Fix Angular 2.0 tutorial diffBox\n" }, { "from": "human", "value": "DiffBox.registerTutorial(\"angular-meteor\", {\n gitHubRepoName: \"Urigo/meteor-angular-socially\",\n patchFilename: \"client/content/patches/angular-meteor.multi.patch\"\n});\n\nDiffbox.r...
javascript
chosen
[ { "from": "system", "value": "Fix Promise polyfill not working in IE11\n\nIt was just a wrong import path.\n" }, { "from": "human", "value": "if (!global.Promise) global.Promise = require('promise-polyfill');\nif (!global.fetch) global.fetch = require('isomorphic-unfetch');\n" }, { "from...
javascript
chosen
[ { "from": "system", "value": "Remove possible jquery-prototype conflict when using both libs\n" }, { "from": "human", "value": "/*\n * Smart event highlighting\n * Handles when events span rows, or don't have a background color\n */\n$(document).ready(function() {\n var highlight_color = \"#2EA...
javascript
chosen
[ { "from": "system", "value": "Test page for webpush notifications\n" }, { "from": "human", "value": "import React, {Component} from 'react'\n\nimport RoleSwitch from '../RoleSwitch'\n\nexport default class AdminPage extends Component {\n render () {\n return (\n <div style={{margin: 16}...
javascript
chosen
[ { "from": "system", "value": "Change tab size to 2\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport CodeMirror from 'react-codemirror'\nimport 'codemirror/lib/codemirror.css'\nimport 'codemirror/theme/monokai.css'\n\nrequire('codemirror/mode/jsx/jsx')\n\nclass ...
javascript
chosen
[ { "from": "system", "value": "Add detail to search bar\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nexport default class SearchBar extends Component {\n\n\trender() {\n\t\treturn (\n\t\t\t<form className=\"input-group\">\n\t\t\t\t<input />\n\t\t\t\t<span classN...
javascript
chosen
[ { "from": "system", "value": "Add viewEventSchedules function to read all schedules for an event.\n" }, { "from": "human", "value": "var base = require('./base.js');\n\nexports.assemble = {\n addSchedule: \n function (parameters, response) {\n var userEventEntry = { \n ...
javascript
chosen
[ { "from": "system", "value": "Remove irrelevant comment (was copy-pasted)\n" }, { "from": "human", "value": "const SUPPORTED_BROWSER_LANGUAGES = {\n en: 'en',\n da: 'da',\n 'zh-CN': 'zh-Hans',\n 'zh-TW': 'zh-Hant',\n 'zh-Hans': 'zh-Hans',\n 'zh-Hant': 'zh-Hant',\n hr: 'hr',\n nl: 'nl',\n...
javascript
chosen
[ { "from": "system", "value": "[Android] Move the shadow onto the tab bar for Android\n\nOn Android everything is `overflow: hidden` so we need to render the shadow within the bounds of the TabBar. We could add a transparent wrapper view around the tab bar so the shadow appears to sit outside of it, but I do...
javascript
chosen
[ { "from": "system", "value": "Add nextzy cnx address info\n" }, { "from": "human", "value": "const office = {\n bangkok: {\n lat: 13.7456,\n lng: 100.5623,\n key: 'Asoke Tower',\n address:\n 'Nextzy Technologies Co., Ltd.219 / 22 Asoke Towers 7th\\nSoi Sukhumvit 21 Rd., Klongto...
javascript
chosen
[ { "from": "system", "value": "Fix gateway response formatter for falsy data\n\nSometimes the data response from the API is falsy. For example when\nasking for a count, the count could be 0. This makes sure the data\nis still formatted properly\n" }, { "from": "human", "value": "export const erro...
javascript
chosen
[ { "from": "system", "value": "Revert commit 68ba4fd7 - it breaks local file access...\n" }, { "from": "human", "value": "// Replaces internal \"qrc:/*.png\" and \"file:\" image URIs with web-friendly URIs\n// Replaces \"file:\" links\nfunction replaceqrc()\n{\n var imgs = document.images;\n ...
javascript
chosen
[ { "from": "system", "value": "Implement activity api:admin report: activity logs\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst { Route } = Ember;\n\nexport default Route.extend({\n titleToken() {\n return this.l10n.t('Activity Logs');\n },\n\n model() {\n return...
javascript
chosen
[ { "from": "system", "value": "Fix timing issue with map test.\n" }, { "from": "human", "value": "var EC = protractor.ExpectedConditions;\n\ndescribe('con10t pages', function() {\n\n\n function click() {\n element.all(by.css('.ar-map-zoomcontrol-box')).get(0).getText(); // hack to slow ...
javascript
chosen
[ { "from": "system", "value": "Comment unused imports so eslint doesn't complain\n" }, { "from": "human", "value": "import BaseApp from 'base_app';\n\n// remove these if not needed\nimport Base64 from 'base64';\nimport helpers from 'helpers';\n\nvar App = {\n\n defaultState: 'loading',\n\n requ...
javascript
chosen
[ { "from": "system", "value": "Update handling of elements with no class attribute to skip checks\n" }, { "from": "human", "value": "( function( QUnit ) {\n\tfunction check( element, classes, stateVal, message ) {\n\t\tvar result,\n\t\t\tclassArray = classes.split( \" \" ),\n\t\t\tmissing = [],\n...
javascript
chosen
[ { "from": "system", "value": "Add comments for getting vk token\n" }, { "from": "human", "value": "/**\n * Created by Андрей on 29.11.2015.\n */\nvar config = {};\n\nconfig.vk = {};\nconfig.mail = {};\nconfig.mail.strings = {};\n\nconfig.vk.appId = 5167405;\nconfig.vk.appSecret = process.env.VK_...
javascript
chosen