conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix loading of select2 lib\n\nSigned-off-by: Christoph Wurst <7abde52c298496fa169fb750f91f213a282142af@winzerhof-wurst.at>\n" }, { "from": "human", "value": "import $ from 'jquery'\nimport '@babel/polyfill'\nimport {init} from '@sentry/browser';\nimport 'bootstrap'\...
javascript
chosen
[ { "from": "system", "value": "Clean up events bound on window, otherwise this will induce a memory leak.\n" }, { "from": "human", "value": "var spyCallbacks = [];\nvar spySetState = [];\n\nvar currentPositionY = function() {\n var supportPageOffset = window.pageXOffset !== undefined;\n var isC...
javascript
chosen
[ { "from": "system", "value": "Make CLI output help if there's not enough args\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst jsdotmd = require('../lib')\nconst program = require('commander')\nconst path = require('path')\n\nprogram\n .usage('[options] <source> <destination>')\n...
javascript
chosen
[ { "from": "system", "value": "Fix flow errors for Relay export\n\nReviewed By: yuzhi\n\nDifferential Revision: D4728271\n\nfbshipit-source-id: a95d2d60de466738961c770dfad34fc049ea8683\n" }, { "from": "human", "value": "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n...
javascript
chosen
[ { "from": "system", "value": "Check against dir when copying assets\n\nNow a declaration like\n\n```javascript\n{\n from: './extra',\n to: '.'\n}\n```\n\nwill work as expected. Previously `from` expected to find a file in this\ncase and failed as a result. This can be possibly cleaned up further.\n" }, ...
javascript
chosen
[ { "from": "system", "value": "typing: Use `getUsersById` for fast user search.\n\npart of #3339.\n" }, { "from": "human", "value": "/* @flow strict-local */\nimport { createSelector } from 'reselect';\n\nimport type { Narrow, Selector, User } from '../types';\nimport { getTyping, getUsers } from...
javascript
chosen
[ { "from": "system", "value": "Add negative test for user validation\n" }, { "from": "human", "value": "/*jslint node: true, expr: true */\n/* global before, describe, it */\n\"use strict\";\nvar assert = require(\"assert\");\nvar expect = require(\"chai\").expect;\nvar fs = require('fs');\nvar m...
javascript
chosen
[ { "from": "system", "value": "Add functions to be filled later\n" }, { "from": "human", "value": "'use strict';\r\n\r\nfunction init() {\r\n // Disable drag + drop event for document.\r\n document.addEventListener('dragover', function(event) {\r\n event.preventDefault();\r\n return false...
javascript
chosen
[ { "from": "system", "value": "Fix year in license block.\n" }, { "from": "human", "value": "/*\n * @license MIT License\n *\n * Copyright (c) 2014 Tetsuharu OHZEKI <saneyuki.snyk@gmail.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software ...
javascript
chosen
[ { "from": "system", "value": "Fix 'home' link in the header\n" }, { "from": "human", "value": "import View from '../View';\nimport HeaderAnalysesView from './HeaderAnalysesView';\nimport HeaderUserView from './HeaderUserView';\nimport HeaderImageView from './HeaderImageView';\nimport router from...
javascript
chosen
[ { "from": "system", "value": "Switch to counting seconds since the beginning of the week.\n" }, { "from": "human", "value": "import DS from 'ember-data';\n\nexport default DS.Model.extend({\n temp: DS.attr('number'),\n day: DS.attr('number'),\n time: DS.attr('number'),\n});\n" }, { "...
javascript
chosen
[ { "from": "system", "value": "Add logging of received JSON from websocket\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nexport default class App extends Component {\n render() {\n return (\n <h1>Hello, world.</h1>\n );\n }\n}\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Add routes to login with Passport\n" }, { "from": "human", "value": "'use strict';\n\n//var FileUpload = require(process.cwd() + '/app/controllers/fileUpload.server.js');\n\nmodule.exports = function (app) {\n \n //var fileUpload = new FileUpload();\n \n app.rou...
javascript
chosen
[ { "from": "system", "value": "Make form creation more generic\n" }, { "from": "human", "value": "// TODO: Add more fields\nfunction Event() {\n this.name = null;\n this.description = null;\n}\n\n$( \"#sel-thing\" ).change(function() {\n // Remove precreated input fields\n $(\".input-...
javascript
chosen
[ { "from": "system", "value": "Test if the file should be chmod'ed\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar writeDir = require('./writeDir');\nvar writeStream = require('./writeStream');\nvar writeBuffer = require('./writeBuffer');\n\nfunction writeContents...
javascript
chosen
[ { "from": "system", "value": "Fix element tree for inspector\n\nSummary: Problem was in calling unimpelmented post method on Http class.\n\nReviewed By: migchez\n\nDifferential Revision: D3449793\n\nfbshipit-source-id: 4f61c88dc1a67b090054f21c7b08d5b6c707e69a\n" }, { "from": "human", "value": "/...
javascript
chosen
[ { "from": "system", "value": "Remove leading slash from page filenames\n" }, { "from": "human", "value": "'use strict';\n\nconst ArchivePlugin = require('webpack-archive-plugin');\nconst DashboardPlugin = require('webpack-dashboard/plugin');\nconst HtmlWebpackPlugin = require('html-webpack-plugi...
javascript
chosen
[ { "from": "system", "value": "Correct the status code of close reason\n" }, { "from": "human", "value": "#!/usr/bin/env node\r\n\r\nvar ws = require('../lib/websocket');\r\n\r\nvar client = ws.connect('ws://localhost:8000', function (session) {\r\n\tsession.setEncoding('utf8');\r\n\tsession.send...
javascript
chosen
[ { "from": "system", "value": "Fix typo: avaiableLanguages -> availableLanguages\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar cli = require('cli'),\n hljs = require('highlight.js'),\n avaiableLanguages = hljs.listLanguages(),\n cheerio = require('cheerio'),\n Entities...
javascript
chosen
[ { "from": "system", "value": "Add missing method to Promise\n" }, { "from": "human", "value": "'use strict';\n\nconst crypto = require('crypto');\nconst Network = require('./network');\nconst Witness = require('./witness');\nconst MAX_MEMORY = Math.pow(2, 21) + (64 * 1000);\n\nclass EncryptedPro...
javascript
chosen
[ { "from": "system", "value": "Disable screenshots in wdio runner\n\nI don't understand when the screenshots are taken so I'm disabling them.\n" }, { "from": "human", "value": "exports.config = {\n host: 'selenium',\n\n specs: [\n './tests/acceptance/specs/**/*.spec.js'\n ],\n\n maxInstanc...
javascript
chosen
[ { "from": "system", "value": "Use empty object as a context instead of request object\n" }, { "from": "human", "value": "var timer = require('contimer'),\n TIMER_LABEL = '__response_timer_label__';\n\nmodule.exports = function requestTimeMiddleware(cb) {\n return function(req, res, next) {...
javascript
chosen
[ { "from": "system", "value": "Add Critical and Dist tasks\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (gulp) {\n //////////////////////////////\n // Sass Tasks\n //////////////////////////////\n require('./tasks/sass')(gulp);\n\n\n /////////////////////////...
javascript
chosen
[ { "from": "system", "value": "Use fs.existsSync, is not deprecated" }, { "from": "human", "value": "'use strict'\n\nvar fs = require('fs')\nvar promise = require('cb2promise')\n\nfunction isString (str) {\n return typeof str === 'string'\n}\n\nfunction existeFile (filepath, cb) {\n if (!isStri...
javascript
chosen
[ { "from": "system", "value": "Use new snarl plugin feature instead of emulating / waiting.\n" }, { "from": "human", "value": "module.exports = {\n '{USER}': function(user, cb) {\n var self = this;\n if (!self.config || !self.config.welcome) return;\n\n // simulate a real user delay\n ...
javascript
chosen
[ { "from": "system", "value": "Use new with gutil plugin error.\n" }, { "from": "human", "value": "/* jshint node:true */\n\n'use strict';\n\nvar csso = require('csso'),\n gutil = require('gulp-util'),\n transform = require('stream').Transform,\n bufferstreams ...
javascript
chosen
[ { "from": "system", "value": "Add code to open database\n" }, { "from": "human", "value": "var express = require('express');\nvar app = require('express')();\nvar http =require('http').Server(app);\nvar io = require('socket.io')(http);\n\nio.on('connection',function(client){\n\tconsole.log(\"use...
javascript
chosen
[ { "from": "system", "value": "Use Math.min instead of sorting\n\nCloses #1\n" }, { "from": "human", "value": "'use strict'\n\nvar toArray = require('to-array')\n\nmodule.exports = function smallest (values) {\n if (!Array.isArray(values)) {\n values = toArray(arguments)\n }\n return values...
javascript
chosen
[ { "from": "system", "value": "Use _super.methodName instead of bare super. \n\nOlder versions of ember-cli do not support invoking _super as an argument (yet all versions that I am aware of support this syntax)." }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nvar path ...
javascript
chosen
[ { "from": "system", "value": "Add redirect to /login page.\n" }, { "from": "human", "value": "var ejs = require('ejs');\nvar path = require('path');\nvar conf = require('./conf');\nvar express = require('express');\nvar favicon = require('serve-favicon');\nvar bodyParser = require('body-parser')...
javascript
chosen
[ { "from": "system", "value": "Test fix, remove invalid owner\n" }, { "from": "human", "value": "/*\n * Copyright (C) 2013 salesforce.com, 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 * You ma...
javascript
chosen
[ { "from": "system", "value": "fix(Build): Exclude JS files in tools directory from symlinking.\n" }, { "from": "human", "value": "'use strict';\n(() => {\n module.exports = (gulp, plugins, config) => {\n return () => {\n return plugins.vinylFs.src([config.patternsPath + '/**/*.js',\n ...
javascript
chosen
[ { "from": "system", "value": "Add tests for findItemInArray function\n" }, { "from": "human", "value": "(function() {\n\n describe('SearchService', function() {\n var SearchService;\n beforeEach(function() {\n module('awesome-app.search');\n\n inject(functi...
javascript
chosen
[ { "from": "system", "value": "Fix issue with 'who' lagging behind user typing\n" }, { "from": "human", "value": "\"use strict\"\n\nimport React from \"react\"\nimport StatusMessage from \"./status-message\"\nimport PollTable from \"./poll-table\"\nimport PollReport from \"./poll-report\"\nimport...
javascript
chosen
[ { "from": "system", "value": "Fix try to load generators allowing raw object\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nfunction tryToLoadGenerator(nameOrObject, lookupTable, thingKind) {\n var parsed = parseNameOrObject(nameOrObject);\n if (!parsed) {\n return nameOrO...
javascript
chosen
[ { "from": "system", "value": "Use Halo 5 KDA calculation\n" }, { "from": "human", "value": "import { Session } from 'meteor/session';\nimport { Template } from 'meteor/templating';\n\nTemplate.registerHelper('accuracy', (fired, landed) => {\n let accuracy = 0;\n if (fired !== undefined && land...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary code since the introduction of the router\n\n" }, { "from": "human", "value": "import React from 'react'\nimport { switchViewClassificationDetails } from '../actions/app-state'\nimport { sparqlConnect } from '../sparql/configure-sparql'\nimport { ...
javascript
chosen
[ { "from": "system", "value": "Add more sprites faster, and with mouse\n" }, { "from": "human", "value": "\"use strict\";\n\nvar add = require(\"../../addSprite\");// eslint-disable-line no-unused-vars\n\n//var camera = 10;\nmodule.exports = function(ecs, game) { // eslint-disable-line no-unused-...
javascript
chosen
[ { "from": "system", "value": "Add search links to tag cloud terms\n" }, { "from": "human", "value": "angular.module('chronontology.components')\n .component('periodTypeTagCloud',{\n templateUrl: '../../partials/period/type-tag-cloud.html',\n controller: function ($http, chronont...
javascript
chosen
[ { "from": "system", "value": "Make default elasticsearch config to point to logstash demo instance.\n" }, { "from": "human", "value": "GlobalProperties = {\n\t'elasticSearchServer': 'http://localhost:9200',\n 'elasticSearchTimeout': 30000,\n 'pageSize': 100\n}" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Add global style and update layout style." }, { "from": "human", "value": "import styled from 'styled-components';\n\nconst Layout = styled.div`\n font-family: Arial, Verdana, Tahoma;\n font-size: 16px;\n box-sizing: border-box;\n\n *, *:before, *:after {\n b...
javascript
chosen
[ { "from": "system", "value": "Revert \"Revert \"Remove babel-compiler dependency in minifier-js\"\"\n\nThis reverts commit 1bc5beeeac1948b913905e36ed9466a8641caec7.\n" }, { "from": "human", "value": "Package.describe({\n summary: \"JavaScript minifier\",\n version: \"2.6.1\"\n});\n\nNpm.depend...
javascript
chosen
[ { "from": "system", "value": "Verify in a layout test that replacing a notification closes the old one.\n\nWe do this by listening to the \"close\" event on the old notification as\nwell. This test passes with or without the Chrome-sided fix because it's\nproperly implemented in the LayoutTestNotificationMa...
javascript
chosen
[ { "from": "system", "value": "Handle greasemonkey matching differently than ext\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Bring Stars Back (Netflix)\n// @namespace theinternetftw.com\n// @include https://www.netflix.com/\n// @include https://www.netflix.com/...
javascript
chosen
[ { "from": "system", "value": "Update browser-sync task to use the view directory\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar bs = require('browser-sync').create();\nvar nodemon = require('gulp-nodemon');\n\n// TODO\n// Set up a seperate server for the view layer and have ...
javascript
chosen
[ { "from": "system", "value": "Use tests from spec (extended for nested example)\n" }, { "from": "human", "value": "'use strict'\n\nconst jsonPointer = require('../lib')\nconst expect = require('chai').expect\n\nit('dereferences root document', function () {\n const doc = {\n name: {\n f...
javascript
chosen
[ { "from": "system", "value": "Update reference to now categorize.js" }, { "from": "human", "value": "\n// Prep step before autotune.js can run; pulls in meal (carb) data and calls total.js \n\nvar tz = require('timezone');\nvar find_meals = require('oref0/lib/meal/history');\nvar sum = require('...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Enable admin to access user routes.\n" }, { "from": "human", "value": "BasicStrategy = require('passport-http').BasicStrategy;\nvar gateway = require(__dirname + '/../../');\nvar passport = require('passport');\n\nvar passportAuth = {};\n\npassportAuth.adm...
javascript
chosen
[ { "from": "system", "value": "Fix channel type rendering in setup panel\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport capitalize from 'lodash/capitalize'\n\nimport {ListItem, CHECKED, UNCHECKED} from '@opentrons/components'\n\nInstrument...
javascript
chosen
[ { "from": "system", "value": "Remove slash from asset paths.\n" }, { "from": "human", "value": "var ready = function(fn) {\n if (document.readyState != 'loading') {\n fn();\n } else if (document.addEventListener) {\n document.addEventListener('DOMContentLoaded', fn);\n } e...
javascript
chosen
[ { "from": "system", "value": "Modify filter to show new computational sample templates.\n" }, { "from": "human", "value": "class MCWorkflowProcessTemplatesComponentController {\n /*@ngInit*/\n constructor(templates) {\n this.templates = templates.get();\n this.templateTypes =...
javascript
chosen
[ { "from": "system", "value": "Fix issue about unknown identifier\n" }, { "from": "human", "value": "/**\n * Created by chengfulin on 2015/4/24.\n */\nrequire('core-js/es6/weak-map');\nmodule.exports = Namespace;\n\nvar map = new WeakMap();\nfunction Namespace() {\n return function (obj) {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove init because import does the init already and init function isn't exposed\n" }, { "from": "human", "value": "import stencilUtils from 'bigcommerce/stencil-utils'\nimport account from './theme/account';\nimport auth from './theme/auth';\nimport blog from './th...
javascript
chosen
[ { "from": "system", "value": "Allow layout and theme opt-out\n" }, { "from": "human", "value": "import React from 'react'\n\nimport styles from './PreviewTools.styl'\n\nexport default ({ href, layout, theme, onLayoutChanged, onThemeChanged }) =>\n <div className={styles.container}>\n <div>\n...
javascript
chosen
[ { "from": "system", "value": "Fix URL of question link\n" }, { "from": "human", "value": "\"use strict\";\n\nvar QAService = require(\"../services/QAService\");\nvar notFound = require(\"../notFound\");\n\nmodule.exports = [{\n method: \"GET\",\n path: \"/{qaid}\",\n handler: function hander(...
javascript
chosen
[ { "from": "system", "value": ":guitar: Set signup/login to email only\n" }, { "from": "human", "value": "/*\nLet's import all our files here. \n*/\n\n// general business logic of this customization\nimport \"./callbacks.js\";\nimport \"./emails.js\";\nimport \"./custom_fields.js\";\nimport \"./i...
javascript
chosen
[ { "from": "system", "value": "Correct issue where readline bombs out if there's no existing history file.\n" }, { "from": "human", "value": "// IMPORTANT: choose one\nvar RL_LIB = \"libreadline\"; // NOTE: libreadline is GPL\n//var RL_LIB = \"libedit\";\n\nvar HISTORY_FILE = require('path').joi...
javascript
chosen
[ { "from": "system", "value": "Check for hasBlock on super if it exist, otherwise use template.\n" }, { "from": "human", "value": "import Ember from 'ember';\n\n/**\n * This mixin add support for hasBlock for Ember < 1.13.0\n *\n * @todo Remove in Ember 2.0\n * See also https://github.com/emberjs...
javascript
chosen
[ { "from": "system", "value": "Add random names using behindthename.com API\n" }, { "from": "human", "value": "console.log('The bot is starting');\n\nvar Twit = require('twit');\nvar config = require('./config.js');\nvar T = new Twit(config);\n" }, { "from": "gpt", "value": "console.l...
javascript
chosen
[ { "from": "system", "value": "Set sensible default for the pagination parameter\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/data-table';\n\nexport default Ember.Component.extend({\n layout: layout,\n noDataMessage: 'No data',\n pa...
javascript
chosen
[ { "from": "system", "value": "Switch to Space.getenv for default envs\n" }, { "from": "human", "value": "\nlet createExampleOrg = function() {\n let byEmail = { 'emails.address': process.env.EXAMPLE_ORG_EMAIL };\n if (Meteor.users.find(byEmail).count() === 0) {\n\n Donations.app.send(new Do...
javascript
chosen
[ { "from": "system", "value": "Change build directory to `dist`\n" }, { "from": "human", "value": "const path = require('path');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\n\nmodule.exports = {\n mode: 'development',\n entry: './src/index.js',\n output: {\n filename: 'bundle...
javascript
chosen
[ { "from": "system", "value": "Update references to fix Language selection\n" }, { "from": "human", "value": "class Cookie {\n\t\n\tstatic initialize(prefix) {\n\t\tthis._prefix = prefix;\n\t}\n\t\n\t/*\n\tstatic set prefix(prefix) {\n\t\tthis._prefix = prefix;\n\t}\n\t\n\tstatic get prefix( ) {\...
javascript
chosen
[ { "from": "system", "value": "Fix import of interactive renderer App\n" }, { "from": "human", "value": "const React = require('react');\nconst importJsx = require('import-jsx');\nconst { render } = require('ink');\n\nconst App = importJsx('./app');\n\nconst renderInteractive = taskRunner => {\n ...
javascript
chosen
[ { "from": "system", "value": "Add playlist folder and playlist index in title if there is one\n" }, { "from": "human", "value": "import { getBaseDestination } from '../storage/storage';\n\nconst youtubedl = require('youtube-dl');\nconst path = require('path');\nconst fs = require('fs');\nconst {...
javascript
chosen
[ { "from": "system", "value": "Add check to see if post exists\n" }, { "from": "human", "value": "import React from 'react';\nimport connect from 'react-redux';\nimport { fetchPost } from '../actions';\n\nclass PostsShow extends React.Component {\n componentDidMount() {\n const { id } = this....
javascript
chosen
[ { "from": "system", "value": "Remove console logging and make email required\n" }, { "from": "human", "value": "'use strict';\n\nconst Joi = require('joi');\nconst Boom = require('boom');\n\nexports.addTicket = {\n description: 'Add new support ticket',\n validate: {\n payload: {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove rankBy parameter in request\n" }, { "from": "human", "value": "let service;\nlet map;\n\nconst MTV = new google.maps.LatLng(37.4220, 122.0841);\n\nfunction findNearbyPlaces() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: ...
javascript
chosen
[ { "from": "system", "value": "Update 'Packages' sidebar label to 'Universe'\n" }, { "from": "human", "value": "import React from 'react';\n\nimport Icon from '../components/Icon';\n\nclass UniversePage extends React.Component {\n render() {\n return this.props.children;\n }\n}\n\nUniversePa...
javascript
chosen
[ { "from": "system", "value": "Copy binary.css from binary-style node_module\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst del = require('del');\nconst paths = require('vinyl-paths');\nconst rev = require('gulp-rev');\nconst through = require('through2');\nconst sass = r...
javascript
chosen
[ { "from": "system", "value": "Send emails to non @uprise.org accounts in production settings.\n" }, { "from": "human", "value": "const path = require('path');\n\nmodule.exports = {\n sessionOptions: {\n secret: process.env.SESSION_SECRET_KEY, \n saveUninitialized: true, // save new sessio...
javascript
chosen
[ { "from": "system", "value": "Set ISO date as the Sentry release tag\n" }, { "from": "human", "value": "// @flow\nimport Raven from 'raven-js';\n\nfunction addUserData(data) {\n if (!window.champaign) return;\n if (!window.champaign.personalization) return;\n const { location, member } = wind...
javascript
chosen
[ { "from": "system", "value": "Add update method, remove getters..\nThis makes the osmNote work a bit more like other osm objects in iD.\n\n- When working with the osm objects, we'll treat them as immutable.\n So all modifications will be through the update method:\n\n e.g. can do this in a repl, like chro...
javascript
chosen
[ { "from": "system", "value": "Rename deleteRule variable to currentRule\n" }, { "from": "human", "value": "'use strict';\n\nvar FormManager = require('./formmanager');\nvar Rules = require('./rules');\nvar TableController = require('./table');\nvar translate = require('./translate');\n\nvar rule...
javascript
chosen
[ { "from": "system", "value": "Use event instead of e" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { fetchWeather } from '../actions/index';\n\nclass SearchBar extends Compon...
javascript
chosen
[ { "from": "system", "value": "Remove path config of not used dependencies\n" }, { "from": "human", "value": "require.config({\n baseUrl: window.baseSiteUrl + 'Scripts/post-mortem/',\n paths: {\n 'underscore': 'libs/underscore/underscore-debug',\n 'backbone': 'libs/backbone/backbone-debu...
javascript
chosen
[ { "from": "system", "value": "Check for new version on load. We should probably do this even earlier and force reload immediately.\n" }, { "from": "human", "value": "// We don't want everyone to be synchronized, so add a random amount to the interval\nconst NEW_VERSION_INTERVAL = (10 + Math.rand...
javascript
chosen
[ { "from": "system", "value": "Fix the issue that switch project doesn't update the metrics\n" }, { "from": "human", "value": "import Component from '@ember/component';\nimport Metrics from 'shared/mixins/metrics';\nimport layout from './template';\n\nexport default Component.extend(Metrics, {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug in focus effect accessing null prop\n" }, { "from": "human", "value": "const justFocus = (_, { id, ...props }) =>\n document.getElementById(props.id).focus(props)\n\nconst justBlur = (_, id) => document.getElementById(id).blur()\n\nexport const focus = (id,...
javascript
chosen
[ { "from": "system", "value": "Add comment to link list shortcode\n" }, { "from": "human", "value": "module.exports = function linkListShortCode (data) {\n return `\n${data.host == undefined ? '' : `<h2>${data.host}</h2>`}\n<ol reversed>\n${data.list.map(entry => \n `<li>\n ${entry.r...
javascript
chosen
[ { "from": "system", "value": "Fix string interpolation in dashboard.\n" }, { "from": "human", "value": "import * as types from '../constants/actionTypes';\nimport * as dashboardActions from '../actions/dashboardActions';\nimport { takeEvery, takeLatest } from 'redux-saga';\nimport { take, put, c...
javascript
chosen
[ { "from": "system", "value": "Remove configurable Base Path for js callout proxy" }, { "from": "human", "value": "/**\n * Copyright 2020 Google LLC\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 * Y...
javascript
chosen
[ { "from": "system", "value": "Add tests for board body and footer\n" }, { "from": "human", "value": "'use strict';\n\nimport chai from 'chai';\nimport chaiAsPromised from 'chai-as-promised';\n\nchai.use(chaiAsPromised);\nlet expect = chai.expect;\n\ndescribe('Board page (desktop)', () => {\n\n ...
javascript
chosen
[ { "from": "system", "value": "Improve default HTML block node converter.\n" }, { "from": "human", "value": "import { HTMLExporter, DefaultDOMElement } from 'substance'\n\nexport default class ArticleHTMLExporter extends HTMLExporter {\n constructor (articleConfig) {\n super({\n converte...
javascript
chosen
[ { "from": "system", "value": "Change comment counter in CommentsContainer\n" }, { "from": "human", "value": "'use strict';\n\nimport React, {PropTypes} from 'react';\nimport Comment from './Comment.component.js';\nimport {isEmpty, take} from 'lodash';\n\nclass CommentsContainerComponent extends ...
javascript
chosen
[ { "from": "system", "value": "Replace state connection by store injection and observer decorator\n" }, { "from": "human", "value": "import React from 'react'\nimport {\n Image,\n Text,\n View,\n} from 'react-native'\nimport { connect } from 'react-redux'\n\nclass ProfileScreen extends React.C...
javascript
chosen
[ { "from": "system", "value": "Add channel as a separate sync-able object model" }, { "from": "human", "value": "var Joi = require('joi');\n\nvar VALID_MODELS = ['room', 'thing', 'device'];\n\nexports.ObjectId = Joi.string().regex(/^[a-zA-Z0-9\\-_]+$/);\nexports.UserRecord = Joi.object().keys({id...
javascript
chosen
[ { "from": "system", "value": "Revert project attributes delimiter to dot\n" }, { "from": "human", "value": "export const PROJECT_INFO_INITIAL_STATE = {};\nexport const PROJECT_PREFERENCES_INITIAL_STATE = {\n filters: [],\n};\nexport const PROJECT_ATTRIBUTES_DELIMITER = '$';\n\nexport const FETC...
javascript
chosen
[ { "from": "system", "value": "Check if token is an error\n" }, { "from": "human", "value": "const Boom = require('boom');\nconst bookshelf = require('../lib/bookshelf');\n\nexports.register = function (server, pluginOptions, next) {\n server.auth.scheme('email_token', (server, schemeOptions) =>...
javascript
chosen
[ { "from": "system", "value": "Add error field to reveal fetch error\n" }, { "from": "human", "value": "import { GraphQLObjectType, GraphQLString } from 'graphql';\n\nfunction resolveUrl(field) {\n return async function({ url }, args, { loaders }) {\n const urlEntry = await loaders.urlLoader....
javascript
chosen
[ { "from": "system", "value": "Save previously used dev tools dock config\n" }, { "from": "human", "value": "'use strict';\n\n// Conditionally load development services if run from CLI\nif (\n process.defaultApp\n && process.env.NODE_ENV !== 'production'\n && process.env.NODE_ENV !== 'test'\n)...
javascript
chosen
[ { "from": "system", "value": "Remove remnants of Foundation gem from Application.js\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, ...
javascript
chosen
[ { "from": "system", "value": "Load treebank data through $http\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa').service('treebankRetriever', function($http) {\n // tokens should always be loaded synchronous - the app should\n // not start anything without knowin...
javascript
chosen
[ { "from": "system", "value": "[LEADERBOARD/USERDATA] Add storage for \"level passed\" info\n" }, { "from": "human", "value": "const LEADERBOARD_SIZE = 10;\n\nclass leaderboard {\n\n constructor () {\n this.db = fbApp.database();\n }\n\n refresh (callback) {\n this.db.ref('...
javascript
chosen
[ { "from": "system", "value": "Remove extra character from whitespace replacement\n" }, { "from": "human", "value": "'use strict';\n\n/* Filters */\n\nangular.module('myApp.filters', []).\n filter('interpolate', ['version', function(version) {\n return function(text) {\n return String(te...
javascript
chosen
[ { "from": "system", "value": "Fix React import for Jest\n" }, { "from": "human", "value": "import React from 'react';\n\n// From https://gist.github.com/turadg/9bcf08a7279e82a030a645250639fe6e\n// Also needed for TypeScript, not just Flow\n\n/**\n * Since React v15.5, there's a warning printed i...
javascript
chosen
[ { "from": "system", "value": "Create and set model association objects in the initialize method,\n\ninstead of in the parse method.\n" }, { "from": "human", "value": "define([\n 'underscore',\n 'backbone',\n 'models/profile',\n 'models/address',\n 'collections/item'\n], function (_, Backbon...
javascript
chosen
[ { "from": "system", "value": "Use a link tag instead of style, to get sourcemaps to work\n" }, { "from": "human", "value": "var ConcatSource = require(\"webpack/node_modules/webpack-core/lib/ConcatSource\");\n\nfunction ChunkWithStyleTagTemplate(chunkTemplate) {\n\tthis.chunkTemplate = chunkTemp...
javascript
chosen
[ { "from": "system", "value": "Make sure the presentation listen on the right port\n" }, { "from": "human", "value": "var express = require('express');\nvar ejs = require('ejs');\nvar app = express();\n\napp.configure(function() {\n app.use(express.bodyParser());\n app.set('dirname', __dirname)...
javascript
chosen
[ { "from": "system", "value": "Fix typo in code comment: propogation errata changed to propagation.\n" }, { "from": "human", "value": "// # Ghost bootloader\n// Orchestrates the loading of Ghost\n// When run from command line.\n\nvar when = require('when'),\n bootstrap = require('./bootst...
javascript
chosen