conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix unit tests after change in optimize API 💀" }, { "from": "human", "value": "import { expect } from 'chai'\nimport { optimize } from 'webpack'\nimport preset from './optimize'\nimport buildTargets from '../../build-targets'\n\ndescribe('optimize webpack preset', ...
javascript
chosen
[ { "from": "system", "value": "Make 'delete' default to `no_output` true\n" }, { "from": "human", "value": "'use strict';\n\n\nconst { EngineError } = require('../../../error');\n\n\n// Sets modifiers.noOutput, by using args.no_output\n// It only flags that part of the response is to be removed,\...
javascript
chosen
[ { "from": "system", "value": "Support for IconField in tabular/stacked inlines in Django admin\n" }, { "from": "human", "value": "if (!$) {\n var $ = jQuery = django.jQuery;\n}\n\n\n$(function() {\n\n var prefix = $('select.fontawesome-select').data('fontawesome-prefix');\n\n function f...
javascript
chosen
[ { "from": "system", "value": "feat: Add in a number of dummy prompts\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar program = require('commander');\nvar prompt = require('inquirer');\nvar path = require('path');\nvar chalk = require('chalk');\n\nvar pkg = require(path.resolve(__di...
javascript
chosen
[ { "from": "system", "value": "Improve API to return error if user doesn't exist\n" }, { "from": "human", "value": "'use strict';\n\nvar connect = require( 'connect' );\nvar app = connect();\nvar PORT = 3000;\n\nvar connectRoute = require( 'connect-route' );\nvar bodyParser = require( 'body-parse...
javascript
chosen
[ { "from": "system", "value": "Migrate to @angular:2.0.0-rc.1. - partial test support\n" }, { "from": "human", "value": "'use strict';\n\nError.stackTraceLimit = Infinity;\nrequire('es6-shim');\nrequire('angular2/bundles/angular2-polyfills.js');\nrequire('angular2/testing');\n\n/*\n Ok, this is k...
javascript
chosen
[ { "from": "system", "value": "Remove \"<hr>\" elements from homepage\n" }, { "from": "human", "value": "import React from 'react'\n\nimport Page from '../../components/page'\nimport Header from './header'\nimport PreviousEpisodeSection from './sections/previous-episodes'\nimport EpisodesSection ...
javascript
chosen
[ { "from": "system", "value": "Add readme screenshot to screenshot config.\n" }, { "from": "human", "value": "const puppeteer = require('puppeteer')\nconst path = require('path')\n\nconst HOST =\n process.env.TRAVIS == true\n ? 'http://localhost:8080/'\n : 'https://jsonnull.com/'\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Check for an empty result\n" }, { "from": "human", "value": "(function (env) {\n \"use strict\";\n env.ddg_spice_thumbtack = function(api_result){\n\n // Don't show anything if we weren't able to return 2 or more services.\n // In future iteratio...
javascript
chosen
[ { "from": "system", "value": "Refactor to avoid export expression assignment\n" }, { "from": "human", "value": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in c...
javascript
chosen
[ { "from": "system", "value": "Remove useless '.js' in require\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar encryption = require('../../../server/utils/encryption.js');\n\nmodule.exports = function() {\n describe('Utils: encryption', function() {\n describe('#c...
javascript
chosen
[ { "from": "system", "value": "Check if not hasOwnProperty when copying Java prototype to Vue object\n" }, { "from": "human", "value": "/**\n * This object provides methods to integrate Java in Vue.JS world\n * @author Adrien Baron\n */\nwindow.vueGwt = {\n\tcreateVueInstance: function (vueCompon...
javascript
chosen
[ { "from": "system", "value": "Comment out custom de-/serializeUser code for now\n" }, { "from": "human", "value": "'use strict';\n\nconst p = require('path');\n\nconst _ = require('lodash');\nconst passport = require('passport');\n\n// const User = require('../services/users/model');\n\nconst co...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary async in migration function\n\n" }, { "from": "human", "value": "export function up(knex) {\n return knex.schema\n .table('users', (table) => table.boolean('is_protected').defaultTo(false).notNullable())\n .raw('update users set is_protecte...
javascript
chosen
[ { "from": "system", "value": "Set organization and user groups to UserModel\n" }, { "from": "human", "value": "import Vue from 'vue';\n\n// Backbone Models\nimport ConfigModel from 'dashboard/data/config-model';\nimport UserModel from 'dashboard/data/user-model';\nimport BackgroundPollingModel f...
javascript
chosen
[ { "from": "system", "value": "Add heroku password to heroku test\n" }, { "from": "human", "value": "var helper = require(__dirname + '/../test-helper');\nvar pg = helper.pg;\n\nvar host = 'ec2-107-20-224-218.compute-1.amazonaws.com';\nvar database = 'db6kfntl5qhp2';\nvar user = 'kwdzdnqpdiilfs';...
javascript
chosen
[ { "from": "system", "value": "Change a fastmap to a map\n" }, { "from": "human", "value": "var _ = require('_'),\n\n _regex = require('../../regex'),\n _cache = require('../../cache'),\n\n _isCache = _cache(),\n\n Selector = require('./Selector'),\n\n _isMatch = require('./match')...
javascript
chosen
[ { "from": "system", "value": "Remove the google oauth entry in the config file.\n" }, { "from": "human", "value": "// define google account settings\n\n'use strict';\n\nvar google = {};\n\ngoogle.CLIENT_ID = '';\ngoogle.CLIENT_SECRET = '';\ngoogle.SCOPE = ['https://www.googleapis.com/auth/plus.l...
javascript
chosen
[ { "from": "system", "value": "Fix relation from feed to user\n" }, { "from": "human", "value": "\"use strict\";\n\nvar\n uuid = require('node-uuid');\n\nmodule.exports = function(sequelize, DataTypes) {\n var UserFeed = sequelize.define(\"UserFeed\", {\n name : {\n type : DataTy...
javascript
chosen
[ { "from": "system", "value": "Add semi-colon at end of return statement" }, { "from": "human", "value": "import * as React from \"react\";\n\n/**\n * Main Navigation Component\n */\nexport const Header = () => {\n return (\n <header>\n LLVM Build View\n </header>\n ...
javascript
chosen
[ { "from": "system", "value": "Add URL base for image URL endpoints.\n" }, { "from": "human", "value": "module.exports = {\n contacts : '2.0/contacts/',\n favorites : '2.0/favorites/',\n folders : '2.0/folders/',\n groups : '2.0/groups/',\n home ...
javascript
chosen
[ { "from": "system", "value": "Use .default since regenerator-transform doesn't set module.exports.\n" }, { "from": "human", "value": "module.exports = {\n plugins: [\n require(\"babel-plugin-syntax-async-functions\"),\n require(\"babel-plugin-syntax-async-generators\"),\n require(\"bab...
javascript
chosen
[ { "from": "system", "value": "Fix validation errors not showing in the admin UI\n" }, { "from": "human", "value": "var keystone = require('../../../../');\n\nmodule.exports = function (req, res) {\n\tif (!keystone.security.csrf.validate(req)) {\n\t\treturn res.apiError(403, 'invalid csrf');\n\t}...
javascript
chosen
[ { "from": "system", "value": "Change color of test button to match app\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport {\n StyleSheet,\n Text,\n View,\n Button,\n TouchableHighlight\n} from 'react-native';\n\nimport {dispatch} from 'ringa';\nimport {atta...
javascript
chosen
[ { "from": "system", "value": "Add default values for homepage\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport {Link} from 'react-router-dom';\nimport Header from './components/header/Header';\n\n\nclass Home extends Component {\n render() {\n return (\n ...
javascript
chosen
[ { "from": "system", "value": "Set Meteor.isModern to false in Cordova environments.\n" }, { "from": "human", "value": "/**\n * @summary Boolean variable. True if running in a Cordova mobile environment.\n * @type {Boolean}\n * @static\n * @locus Anywhere\n */\nMeteor.isCordova = true;\n\nMeteor...
javascript
chosen
[ { "from": "system", "value": "Remove use of eval in dev\n\nThis violates Codesandbox' CSP which does not permit unsafe-eval.\nInstead, just use window to get the current global.\n\nFixes #6611\n" }, { "from": "human", "value": "if (__DEV__) {\n const global = (1, eval)(\"this\");\n const key =...
javascript
chosen
[ { "from": "system", "value": "Add URI handler for Firefox\n" }, { "from": "human", "value": "'use strict';\n\nvar UriHandler = function() {};\n\nUriHandler.prototype.register = function() {\n var base = window.location.origin + '/';\n var url = base + '#!/uri-payment/%s';\n\n var isFirefox = ...
javascript
chosen
[ { "from": "system", "value": "Adjust search expander so that it closes when no child elements are focused\n" }, { "from": "human", "value": "// JavaScript Document\n\n// Scripts written by __gulp_init_author_name__ @ __gulp_init_author_company__\n\nconst SEARCH_TOGGLE = document.querySelector(\"...
javascript
chosen
[ { "from": "system", "value": "[SWIK-675_remaking_user_profile_page] Delete user context and doing refresh of page after user was deleted\n" }, { "from": "human", "value": "import { userSignOut } from '../userSignOut.js';\nimport { navigateAction } from 'fluxible-router';\nimport UserProfileStore...
javascript
chosen
[ { "from": "system", "value": "Remove __nav prefix due to conflicts with combineReducers function\n" }, { "from": "human", "value": "const {PUSH, POP, REPLACE} = require('../constants/navigation');\n\nmodule.exports = function navigate(state, {type, payload}) {\n if (!state) {\n return {__nav...
javascript
chosen
[ { "from": "system", "value": "Fix to preprocessor for postdata\n" }, { "from": "human", "value": "var mQuerystring = require('querystring');\n\nmodule.exports = function(aRequest, aResponse, aArgs, aCallback) {\n 'use strict';\n\n if (aRequest.headers['content-type'] && aRequest.headers['c...
javascript
chosen
[ { "from": "system", "value": "Remove trailing whitespace, add missing semicolon." }, { "from": "human", "value": "module.exports = function(grunt) {\n\n \"use strict\";\n\n grunt.initConfig({ \n \n libFiles: [\n \"src/**/*.purs\",\n \"bower_components/purescript-*/src/**/*.purs\"...
javascript
chosen
[ { "from": "system", "value": "Set correct headings for file responses\n" }, { "from": "human", "value": "const express = require('express'),\n router = express.Router(),\n fs = require('fs'),\n path = require('path'),\n grid = require('gridfs-stream');\n\nconst db = require('...
javascript
chosen
[ { "from": "system", "value": "Remove whitespace caused by template string\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport convertReactToHTMLStyle from '../utils/convertReactToHTMLStyle';\n\nexport default class NoScriptImg extends Component {\n render() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add defaults for HTTP 500 error\n" }, { "from": "human", "value": "exports.respond = function (res, success, code, message, data, err) {\n\tif (err)\n\t\tconsole.log(err);\n\tres\n\t\t.status(code)\n\t\t.type('application/json')\n\t\t.send(JSON.stringify({\n\t\t\t's...
javascript
chosen
[ { "from": "system", "value": "Define promote method in Shogi.Piece\n" }, { "from": "human", "value": "import Shogi from '../shogi';\n\nShogi.Piece = class Piece {\n constructor(type, x, y) {\n this.type = type;\n this.x = x;\n this.y = y;\n }\n};\n" }, { "from": "gpt", "va...
javascript
chosen
[ { "from": "system", "value": "Add timer and remove confirm buttonk, overall cleanup for better ux\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n $(\"#new-timeslot-form\").submit(function(event){\n event.preventDefault();\n var data = createDate();\n $(\"#modal_new...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect test for timezone `Pacific/Apia`\n" }, { "from": "human", "value": "var assert = require('power-assert')\nvar isThisWeek = require('../is_this_week')\n\ndescribe('isThisWeek', function() {\n beforeEach(function() {\n this.clock = sinon.useFakeTimer...
javascript
chosen
[ { "from": "system", "value": "Add support for locks in canToggleDomain\n" }, { "from": "human", "value": "export default function canToggleDomain(domain, servicesMap) {\n const serviceDomain = servicesMap.get(domain);\n return !!serviceDomain && serviceDomain.services.has('turn_on');\n}\n" }...
javascript
chosen
[ { "from": "system", "value": "Add basic encryption for database\n" }, { "from": "human", "value": "var parse = require('./js/parse');\nvar Datastore = require('nedb');\nvar db = new Datastore({\n filename: `${__dirname}/tasks.db`,\n autoload: true\n});\n\n/**\n * Get a query, parse it and add ...
javascript
chosen
[ { "from": "system", "value": "Add TODO notes for NavigationController\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n /* ngInject */\n function NavigateController(\n $scope,\n Navigation, Directions, Map, MapStyle, NavbarConfig, MapControl\n ) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix data erasure API test to use POST method\n\n(was previously done via GET request)\n" }, { "from": "human", "value": "const frisby = require('frisby')\n\nconst jsonHeader = { 'content-type': 'application/json' }\nconst REST_URL = 'http://localhost:3000/rest'\n\nd...
javascript
chosen
[ { "from": "system", "value": "Update mocha specs to account for new markup heirarchy\n" }, { "from": "human", "value": "import React from \"react\"\nimport { shallow } from \"enzyme\"\nimport { expect } from \"chai\"\n\nimport UserList from \"../../web/static/js/components/user_list\"\n\ndescrib...
javascript
chosen
[ { "from": "system", "value": "Fix scope watch of angular flotchart integration\n" }, { "from": "human", "value": "/**\n * Created with IntelliJ IDEA.\n * User: issa\n * Date: 2/10/14\n * Time: 1:18 AM\n */\n\n\napp.directive('aFloat', function() {\n function link(scope, element, attrs){\n ...
javascript
chosen
[ { "from": "system", "value": "Use ES6 properties import for Component.\n" }, { "from": "human", "value": "import React from 'react';\n\nclass SearchBar extends React.Component {\n render() {\n return <input />;\n }\n}\n\nexport default SearchBar;\n" }, { "from": "gpt", "value": ...
javascript
chosen
[ { "from": "system", "value": "Mark login as Index route\n" }, { "from": "human", "value": "import React from 'react';\nimport { Route } from 'react-router';\nimport Login from './features/login';\nimport CategoryTileListContainer from './features/categories/components/CategoryTileListContainer';...
javascript
chosen
[ { "from": "system", "value": "Update number of repo stars\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport { List, ListItem } from 'material-ui/List';\nimport Divider from 'material-ui/Divider';\n\nimport './About.css';\n\nclass About extends Component {\n ...
javascript
chosen
[ { "from": "system", "value": "Change team key to use only new [side]_team_key, add extra checks\n" }, { "from": "human", "value": "import React from 'react'\n\nimport GameCard from './GameCard'\nimport { simpleFilter } from '../../lib/filter'\nimport { searchByAll } from '../../lib/search'\n\nex...
javascript
chosen
[ { "from": "system", "value": "Add subset of missing react-autosuggest props as optional properties\n" }, { "from": "human", "value": "import React from 'react'\nimport Autosuggest from 'react-autosuggest'\n\nimport style from './bpk-autosuggest.scss'\n\nconst defaultTheme = {\n container: ...
javascript
chosen
[ { "from": "system", "value": "Add unit tests to ecmaVersion 7 and 8\n" }, { "from": "human", "value": "'use strict'\nvar parsers = [\n {\n name: 'acorn',\n options: {\n locations: true,\n onComment: []\n },\n parser: require('acorn')\n },\n {\n name: 'espree',\n op...
javascript
chosen
[ { "from": "system", "value": "Remove error where \"moment\" is not found\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Controller.extend({\n formattedDate: function() {\n var date = this.get(\"model.createdAt\");\n return moment(date).format(\"LL\")...
javascript
chosen
[ { "from": "system", "value": "Fix time formatting (time zones were getting in the way)\n" }, { "from": "human", "value": "export function formatTime(timestamp) {\n let d = new Date(timestamp)\n return [\n d.getHours(),\n d.getMinutes(),\n d.getSeconds()\n ].map(t => t < 10 ? `0${t}` ...
javascript
chosen
[ { "from": "system", "value": "Use real message and address\n" }, { "from": "human", "value": "/**\n * text-message\n * Service to send text message to summoners notifying\n * them to do something more useful with their free time.\n *\n */\n\n// Twilio API creds\nvar API_KEY;\nvar AUTH_TOKEN;\n...
javascript
chosen
[ { "from": "system", "value": "Change assignees grid to tree\n" }, { "from": "human", "value": "Ext.define('TM.view.plan.SelectAssignables', {\n extend: 'Ext.panel.Panel',\n xtype: 'plan_selectassignables',\n \n requires: [\n 'TM.view.plan.SelectAssignablesGrid',\n ],\n\n items: [{\n ...
javascript
chosen
[ { "from": "system", "value": "Fix button color for confirm dialogue.\n" }, { "from": "human", "value": "$(function() {\n $('#btnAddPermission').click(function() {\n $(this).parent().append(JST[\"assets/templates/rights/permissioninput.html\"]);\n });\n\n $('#deleteGroup').click(f...
javascript
chosen
[ { "from": "system", "value": "Add Loading screen to wait for authentication\n" }, { "from": "human", "value": "import React, { useState, useEffect } from 'react';\nimport app from '../Firebase';\n\nconst AuthContext = React.createContext();\n\n/**\n * AuthProvider component that keeps track of t...
javascript
chosen
[ { "from": "system", "value": "Add distanceBetween function, event listener for 'faceLocation' on Tomato\n" }, { "from": "human", "value": "const util = require('util');\nconst EventEmitter = require('events');\n\nfunction Tomato(context, center, direction, speed) {\n EventEmitter.call(this);\n ...
javascript
chosen
[ { "from": "system", "value": "Tidy up hashchange a bit\n" }, { "from": "human", "value": "(function (global) {\n\tvar\n\thash = global.location.hash,\n\tfunc = function () {\n\t\tif (hash !== global.location.hash) {\n\t\t\thash = global.location.hash;\n\n\t\t\tglobal.dispatchEvent(new Event('has...
javascript
chosen
[ { "from": "system", "value": "Reduce cordova demo on windows\n\nIt can later be investigated how to improve windows support for cordova\nplug-ins, but for now include only the two that acually work.\n\nChange-Id: I1839ab1604d8191d5ed67e76d7e2f3398a1d8bbb\n" }, { "from": "human", "value": "const ...
javascript
chosen
[ { "from": "system", "value": "Allow resource templates from self\n" }, { "from": "human", "value": "(function() {\n\t'use strict';\n\tangular.module('pagespeedApp', []).config(function($sceDelegateProvider) {\n\t\t$sceDelegateProvider.resourceUrlWhitelist([\n\t\t\t'https://www.googleapis.com/pag...
javascript
chosen
[ { "from": "system", "value": ":wrench: Tweak error handler to prevent undefined in URL\n" }, { "from": "human", "value": "const fourOhFourHandler = require('./fourOhFourHandler');\n\n/**\n * Handles compilation errors\n * like when a template or page does not exist\n * @param {object} req - Requ...
javascript
chosen
[ { "from": "system", "value": "Fix gradient on thanks page\n" }, { "from": "human", "value": "$(document).ready(function(){\n if (geo_position_js.init()){\n geo_position_js.getCurrentPosition(function(p){\n $('.geoPosition').val(p.coords.latitude + \"|\" + p.coords.longitude);\n }, fu...
javascript
chosen
[ { "from": "system", "value": "Fix JS test missing $scope.dsAddForm.$setPristine\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('middlewareAddDatasourceController', function() {\n var rootScope;\n var $scope;\n var $controller;\n var $httpBackend;\n var miqService;\n\n beforeE...
javascript
chosen
[ { "from": "system", "value": "[DDW-611] Implement new Network status dialog design - final fixes\n" }, { "from": "human", "value": "// @flow\nexport type Environment = {\n network: string,\n apiVersion: string,\n mobxDevTools: boolean | string,\n current: string,\n isDev: boolean,\n isTest...
javascript
chosen
[ { "from": "system", "value": "Remove buttons added in the wrong step.\n" }, { "from": "human", "value": "define(function (require, exports, module) {\n\n var definition = ['todoList'];\n\n var getTemplate = function () {\n var template = '';\n template += '<ul>';\n tem...
javascript
chosen
[ { "from": "system", "value": "Improve sorting algorithm by using sortBy from lodash\n" }, { "from": "human", "value": "// Reorder a file by running (from the scripts folder)\n\nimport fs from 'fs';\nimport {range} from 'lodash';\nimport {parse} from 'date-fns';\nimport {TOPICS} from '../src/comp...
javascript
chosen
[ { "from": "system", "value": "Support use `remotedev` npm package field\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\nconst argv = require('minimist')(process.argv.slice(2), {\n boolean: ['secure', 'runserver', 'injectserver', 'injectdebugger', 'desktop', 'revert'],\n default: {\n...
javascript
chosen
[ { "from": "system", "value": "Add ajax call for sending signup links\n" }, { "from": "human", "value": "/**\r\n * Created by nkmathew on 23/06/2016.\r\n */\r\n\r\n$(document).ready(function () {\r\n var source = $(\"#email-list-template\").html();\r\n var template = Handlebars.compile(so...
javascript
chosen
[ { "from": "system", "value": "Add ModuleConcatenationPlugin to webpack compile plugins\n" }, { "from": "human", "value": "/* eslint-disable import/no-extraneous-dependencies */\nimport path from 'path'\nimport webpack from 'webpack'\nimport packageConfig from './package.json'\n\nconst banner = `...
javascript
chosen
[ { "from": "system", "value": "Fix the ‘Unexpected token’ error.\n" }, { "from": "human", "value": "import lodash from 'lodash';\nimport merge from 'lodash/merge';\nimport keys from 'lodash/keys';\nimport each from 'lodash/each';\n\nimport clientWebpackConfig from './client';\n\nconst packageJson...
javascript
chosen
[ { "from": "system", "value": "test: Change test to reflect that arrayOf needs a validator\n" }, { "from": "human", "value": "// @flow\n/* eslint-env jest */\nimport arrayOf from '../arrayOf';\n\ndescribe('rules.arrayOf', () => {\n it('should return array of validation errors', () => {\n expe...
javascript
chosen
[ { "from": "system", "value": "Change back from localhost to 127.0.0.1\n" }, { "from": "human", "value": "module.exports = {\n host: process.env.HOST || \"http://localhost\",\n port: process.env.PORT || 3000,\n persona_uri: process.env.PERSONA_URI || \"http://127.0.0.1:10002\",\n persona_veri...
javascript
chosen
[ { "from": "system", "value": "Implement new format using dashboard as this reference\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('edge.app.controllers').controller('DashboardController', function (edgePage) {\n this.intro = 'Now build something cool.';\n});\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Add existence check for firestore before invoking.\n" }, { "from": "human", "value": "import { merge } from 'lodash/fp';\nimport { firestoreActions } from './actions';\nimport { mapWithFirebaseAndDispatch } from './utils/actions';\nimport { defaultConfig } from './c...
javascript
chosen
[ { "from": "system", "value": "Add a space to prodbuild task.\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar browserify = require('./browserify');\nvar vendor = require('./vendor');\nvar less = require('./less');\nvar images = require('./images');\nvar copy = require('./copy'...
javascript
chosen
[ { "from": "system", "value": "Fix red highlighting in GitHub diff\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { action } from '@kadira/storybook';\nimport { DraftJSEditor, Renderer, defaultBlocks } from '../../src';\n\nconst draftRenderer = new Renderer(d...
javascript
chosen
[ { "from": "system", "value": "Enable usage with multiple jspsych timeline_variables\n" }, { "from": "human", "value": "jsPsych.plugins['conditional-run'] = (function () {\r\n\tvar plugin = {};\r\n\r\n\tplugin.info = {\r\n\t\tname: 'conditional-run',\r\n\t\tdescription: 'Only run the specified pl...
javascript
chosen
[ { "from": "system", "value": "Fix for phantom support of Float64Array.\n" }, { "from": "human", "value": "/*jslint node: true, continue: true, eqeq: true, forin: true, nomen: true, plusplus: true, todo: true, vars: true, white: true */\n'use strict';\n\nYUI.add(\"macaroon\", function(Y) {\n var...
javascript
chosen
[ { "from": "system", "value": "Include includeSubData parameter true, so we show the loading indicator if petriNetData or agreementData is loading as well\n" }, { "from": "human", "value": "/**\n * Created by quasarchimaere on 21.01.2019.\n */\nimport { get } from \"../utils.js\";\nimport {\n is...
javascript
chosen
[ { "from": "system", "value": "Add ID for video in story" }, { "from": "human", "value": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\n\nimport YouTube from 'shared/components/youtubeVideo/youtubeVideo';\n\nstoriesOf('shared/components/youtubeVideo', module)\n .add(...
javascript
chosen
[ { "from": "system", "value": "Use toString for SVG text\n" }, { "from": "human", "value": "load('classpath:META-INF/resources/webjars/viz.js/1.5.1/viz.js');\n\nvar svg = Viz(dotSrc, {\n format: \"svg\",\n engine: \"dot\"\n});\n\nvar writer = new java.io.FileWriter(outFile);\nwriter.write(s...
javascript
chosen
[ { "from": "system", "value": "Add example two: remove information leaking response headers\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n\n one: function (req, res) {\n/* vcl:\nvcl 4.0; backend default { .host = \"www.vclfiddle.net\"; .port = \"80\"; }\n\...
javascript
chosen
[ { "from": "system", "value": "Add firefox to wct tests\n" }, { "from": "human", "value": "module.exports = {\n 'plugins': {\n 'local': {\n 'browsers': [ 'chrome' ]\n }\n }\n}" }, { "from": "gpt", "value": "module.exports = {\n 'plugins': {\n 'local': {\n 'browse...
javascript
chosen
[ { "from": "system", "value": "Tweak commuting activity POST endpoint.\n" }, { "from": "human", "value": "import rp from 'request-promise'\nimport { Observable } from 'rx'\n\nconst sendActivityToCoreService = (activities$, requestLib=rp) => {\n return activities$\n .flatMap(activity => {\n c...
javascript
chosen
[ { "from": "system", "value": "Remove reference to calendar reducer.js.\n" }, { "from": "human", "value": "import { createStore, combineReducers, applyMiddleware, compose } from 'redux';\nimport thunk from 'redux-thunk';\nimport root from './reducer';\nimport schedule from './schedule/reducer';\n...
javascript
chosen
[ { "from": "system", "value": "Fix sending of empty string\n" }, { "from": "human", "value": "'use strict';\n\nconst debug = require('debug')('sockjs:connection');\nconst stream = require('stream');\nconst uuid = require('uuid/v4');\n\nclass SockJSConnection extends stream.Duplex {\n constructor...
javascript
chosen
[ { "from": "system", "value": "Fix matching stop name and destination (api)\n" }, { "from": "human", "value": "const _ = require('lodash');\n\nconst db = require('../../db.js');\n\nmodule.exports = async () => {\n\tconst stops = await db.query(`\n\t\tSELECT\n\t\t\tstop_id AS id,\n\t\t\tGROUP_CONC...
javascript
chosen
[ { "from": "system", "value": "Remove required onClick from Ripple Button\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react'\nimport { Ripple } from './ripple'\n\nclass RippleButton extends Component {\n\n static propTypes = {\n children: PropTypes.oneOfTyp...
javascript
chosen
[ { "from": "system", "value": "Set creation date for videos\n" }, { "from": "human", "value": "const photos = Application('photos');\nconst albums = photos.albums();\n\nalbums.forEach(album => {\n const name = album.name();\n const items = album.mediaItems();\n const path = Path('./export/' + ...
javascript
chosen
[ { "from": "system", "value": "Add Explanatory comment for onHistoryStateUpdated\n" }, { "from": "human", "value": "/** Executes the main.js file in the context of the user's current webpage. */\nfunction injectAmaranth() {\n chrome.tabs.executeScript(null, {\n file: 'src/main.js',\n });\n}\...
javascript
chosen
[ { "from": "system", "value": "Add mp3 to cache list\n" }, { "from": "human", "value": "import path from 'path';\nimport cachifyStatic, { cachify } from 'connect-cachify-static';\n\nexport const PUBLIC_DIR = path.resolve(__dirname, '..', 'public');\n\nconst middleware = cachifyStatic(PUBLIC_DIR);...
javascript
chosen
[ { "from": "system", "value": "Use new stripe token parameter name\n" }, { "from": "human", "value": "DP.PaymentForm = function() {\n this.setup();\n};\n\nDP.PaymentForm.prototype = {\n setup: function() {\n $(\"#payment-form\").submit(_.bind(function(event) {\n // disable the submit bu...
javascript
chosen
[ { "from": "system", "value": "Reset state on book added\n" }, { "from": "human", "value": "import { fromJS } from 'immutable';\nimport {\n SEARCH_REQUEST,\n SEARCH_SUCCESS,\n SEARCH_ERROR,\n SELECT_BOOK,\n UNSELECT_BOOK,\n} from './constants';\n\nconst initialState = fromJS({\n searching: ...
javascript
chosen
[ { "from": "system", "value": "Check that RootCtrl sets the default sort order\n" }, { "from": "human", "value": "'use strict';\n\n/* jasmine specs for controllers go here */\n\ndescribe('RootCtrl', function(){\n beforeEach(module('swiftBrowser.controllers'));\n\n it('should list containers...
javascript
chosen
[ { "from": "system", "value": "Allow `@tailwind screens` directive inside an at-rule\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport postcss from 'postcss'\nimport cloneNodes from '../util/cloneNodes'\nimport buildMediaQuery from '../util/buildMediaQuery'\n\nexport default funct...
javascript
chosen
[ { "from": "system", "value": "Use the Spring Cloud Context version from jhipster-dependencies" }, { "from": "human", "value": "/**\n * Copyright 2013-2018 the original author or authors from the JHipster project.\n *\n * This file is part of the JHipster project, see http://www.jhipster.tech/\n ...
javascript
chosen
[ { "from": "system", "value": "Add a loading indicator on the auth page\n" }, { "from": "human", "value": "const React = require('react');\n\nconst Utils = require('../utils');\n\nconst AuthentificationPage = React.createClass({\n getInitialState() { return { loading: false }; },\n openAuthWind...
javascript
chosen
[ { "from": "system", "value": "Rename clean folder to test/tmp\n" }, { "from": "human", "value": "/*\n * generator-init\n * https://github.com/use-init/generator-init\n *\n */\n\n'use strict';\n\nmodule.exports = function (grunt) {\n // Load all grunt tasks matching the `grunt-*` pattern.\n req...
javascript
chosen
[ { "from": "system", "value": "Clean plugin is not used\n" }, { "from": "human", "value": "*\n * grunt-cdndeps\n * https://github.com/cambridge-healthcare/grunt-cdndeps\n *\n * Copyright (c) 2014 Cambridge Healthcare\n * Licensed under the MIT license.\n */\n\n\"use strict\";\n\nmodule.exports = ...
javascript
chosen