conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make parseInt in JS safer by specifying radix.\n" }, { "from": "human", "value": "$(document).ready(function () {\n $('#share_application_amount').observe_field(0.5, function()\n {\n var newShareApplicationAmount = parseInt(this.value);\n if (isNaN(newShareA...
javascript
chosen
[ { "from": "system", "value": "Validate data in stream test\n" }, { "from": "human", "value": "'use strict'\n\nvar fs = require('../')\nvar rimraf = require('rimraf')\nvar mkdirp = require('mkdirp')\nvar test = require('tap').test\nvar p = require('path').resolve(__dirname, 'files')\n\nprocess.ch...
javascript
chosen
[ { "from": "system", "value": "Fix 'cannot get context of undefined' exception\n" }, { "from": "human", "value": "import AWS from 'aws-sdk';\n\n\nmodule.exports = class Sessions {\n constructor() {\n this.SESSION_TABLE = `${process.env.SERVERLESS_PROJECT}-sessions-${process.env.SERVERLE...
javascript
chosen
[ { "from": "system", "value": "Rename function parameter \"event\" to \"e\"\n" }, { "from": "human", "value": "//==============================================================================\n// Elements which contains the location of the previous and next site\n//===============================...
javascript
chosen
[ { "from": "system", "value": "Add placeholder class to sortable options for dialogue screen grid\n" }, { "from": "human", "value": "// go.campaign.dialogue.diagram\n// ============================\n// Structures for the dialogue diagram (the main view for the dialogue screen).\n\n(function(expor...
javascript
chosen
[ { "from": "system", "value": "Stop auto-showing history in demo\n" }, { "from": "human", "value": "$(function() {\n function show() {\n playbyplayui.show(function(err, run) {\n if (err) {\n alert(err);\n return;\n }\n if (r...
javascript
chosen
[ { "from": "system", "value": "Remove pause from e2e tests\n" }, { "from": "human", "value": "var db = require( '../../db' )\nvar chai = require( 'chai' )\nchai.use( require( 'chai-as-promised' ) )\nvar expect = chai.expect\n\ndescribe( 'making a post', function() {\n it( 'creates an account a...
javascript
chosen
[ { "from": "system", "value": "Remove deprecated usage of addBowerPackageToProject\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n name: 'ember-leaflet-openweathermap-tile-layer',\n description: 'openweathermap tile layer',\n\n normalizeEntityName: function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Raise the time-out a bit after a Travis CI failure\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n var assert = require('assert'),\n Validator = require('../src/validator.js') ;\n\n describe('validator in the wild', function () ...
javascript
chosen
[ { "from": "system", "value": "Replace $ with jQuery for noConflict mode\n\nWhen jQuery is in noConflict mode, the $ operator can be claimed by other frameworks (ProtoType, MooTools). To avoid JS errors, jQuery plugins should not use $ but jQuery instead." }, { "from": "human", "value": "$(docume...
javascript
chosen
[ { "from": "system", "value": "Add version of the package when generating the documentation\n" }, { "from": "human", "value": "'use strict';\n\nvar execSync = require('execSync');\nvar fs = require('fs');\nvar calculatedVersion = require('ember-cli-calculate-version').calculatedVersion();\n...
javascript
chosen
[ { "from": "system", "value": "Add test for scatter chart animation\n" }, { "from": "human", "value": "'use strict';\n\nvar expect = require('chai').expect;\n\ndescribe('ScatterChart', function() {\n it('renders scatterchart', function() {\n var React = require('react/addons');\n var Scatt...
javascript
chosen
[ { "from": "system", "value": "Change variable names for consistency\n" }, { "from": "human", "value": "const clickThroughBaseUrl = 'localhost:8080'; // placeholder\n\nfunction wrapLink(str, trackingId) {\n str = str.replace(/\\{(.+?)\\/(.+?)\\}/g, function(m, label, url) {\n return '<a href...
javascript
chosen
[ { "from": "system", "value": "Return null if 'val' is falsy\n" }, { "from": "human", "value": "'use strict';\n\nvar numberFilter = require('./number');\n\nvar units = {\n ml: 1000,\n cl: 100,\n dl: 10,\n l: 1,\n liter: 1\n};\n\nmodule.exports = function volumeFilter(val) {\n if...
javascript
chosen
[ { "from": "system", "value": "Refactor to avoid using curly-brace-multi-line filter\n" }, { "from": "human", "value": "const idea = (state = [], action) => {\n switch (action.type) {\n case \"SET_IDEAS\":\n return action.ideas\n case \"ADD_IDEA\":\n return [...state, action.idea...
javascript
chosen
[ { "from": "system", "value": "Use localhost by default, not test.mosquitto.org\nMakes development on trains easier\n" }, { "from": "human", "value": "/**\n * Copyright 2014 Nicholas Humfrey\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file ex...
javascript
chosen
[ { "from": "system", "value": "Remove bogus character in jsdoc\n" }, { "from": "human", "value": "'use strict';\n/**\n * Provides a unified interface for some\n * specific IO related tasks provided from\n * different modules.\n *\n * \t@module lib/dir\n */\nconst fs = require('fs-extra');\nconst ...
javascript
chosen
[ { "from": "system", "value": "Refactor server and add simple debug mode" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\nvar server = require('http').createServer(app);\nvar io = require('socket.io')(server);\nvar midi = require('midi');\nvar port = 80;\n...
javascript
chosen
[ { "from": "system", "value": "Add key names for rootReducer\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\nimport fuelSavingsAppState from './fuelSavings';\nimport cmsAppState from './cms.js';\n\nconst rootReducer = combineReducers({\n fuelSavingsAppState,\n cmsAp...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary verification for locales\n" }, { "from": "human", "value": "import path from 'path';\nimport { all, promisifyAll, resolve } from 'bluebird';\nimport osLocale from 'os-locale';\nimport { curry, propOr, replace } from 'ramda';\n\nconst fs = promisif...
javascript
chosen
[ { "from": "system", "value": "Fix an issue where the sort function weren't included in the fkit module.\n" }, { "from": "human", "value": "'use strict';\n\nvar util = require('./util');\n\n/**\n * FKit treats both arrays and strings as *lists*: an array is a list of\n * elements, and a string is...
javascript
chosen
[ { "from": "system", "value": "Add configuration form to an example\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDom from 'react-dom';\nimport {UltimatePagination} from 'react-ultimate-pagination';\n\nReactDom.render(<UltimatePagination currentPage={1} totalPages={10...
javascript
chosen
[ { "from": "system", "value": "Update drag context usage to avoid error about refs\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withProps } from 'recompose';\nimport BandwidthThemeProvider from '../BandwidthThemeProvider';\nimport De...
javascript
chosen
[ { "from": "system", "value": "Disable reload-and-profile button if no renderers support profiling\n" }, { "from": "human", "value": "// @flow\n\nimport React, { useCallback, useContext } from 'react';\nimport Button from '../Button';\nimport ButtonIcon from '../ButtonIcon';\nimport { BridgeConte...
javascript
chosen
[ { "from": "system", "value": "Use _id if id is not set\n" }, { "from": "human", "value": "const models = {\n page: require('../models/page'),\n user: require('../models/user')\n}\n\nconst remove = [\n '_id',\n 'id',\n 'password',\n '__v'\n]\n\nexports.one = function *(type, _id) {\n const...
javascript
chosen
[ { "from": "system", "value": "Add missing function expression name\n" }, { "from": "human", "value": "/* eslint no-console: 0 */\n'use strict';\n\nconst irc = require('irc');\n\nconst server = process.env.IRC_SERVER;\nconst user = process.env.IRC_USER;\nconst channel = process.env.IRC_CHANNEL;\n...
javascript
chosen
[ { "from": "system", "value": "Update liquid-fire version in blueprint\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n description: 'Add LiquidFire to the consumers app',\n\n // So we don't see the entity name error\n normalizeEntityName: function() {},\n\n after...
javascript
chosen
[ { "from": "system", "value": "Add a callback parameter to Tanura's events.\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Tanura main script.\n *\n * This script defines Tanura's high level features.\n */\n\n/*\n * Check if an event exists.\n *\n * When given an event name, this func...
javascript
chosen
[ { "from": "system", "value": "Remove unused dummy functions in NoiseOverlay\n" }, { "from": "human", "value": "/*jslint bitwise: false, evil: true*/\n/*global NoiseOverlay: true, Components: false, dump: false, gBrowser: false, toggleSidebar: true, gFindBar: true*/\nif (!NoiseOverlay) {\n var N...
javascript
chosen
[ { "from": "system", "value": "Add JSCS and JSHint to default task\n" }, { "from": "human", "value": "var gulp = require('gulp');\r\n\r\nvar javascripts = [\r\n 'Gulpfile.js',\r\n 'index.js',\r\n 'lib/**/*.js',\r\n 'test/**/*.js'\r\n];\r\n\r\ngulp.task('jscs', function () {\r\n var jscs = re...
javascript
chosen
[ { "from": "system", "value": "test(cosntant): Test the value param implements\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path');\nvar assert = require('yeoman-assert');\nvar helpers = require('yeoman-test');\n// Var TestHelper = require('./test-helper');\n\ndescribe('T...
javascript
chosen
[ { "from": "system", "value": "Increase timeout in fail-fast interrupt test\n\nHopefully this removes more flakiness from Windows tests.\n" }, { "from": "human", "value": "const test = require('../../../..');\n\ntest.serial('first pass', t => {\n\tt.pass();\n\treturn new Promise(resolve => setTim...
javascript
chosen
[ { "from": "system", "value": "Add purecloud hosts as trusted\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport AjaxService from 'ember-ajax/services/ajax';\n\nconst {\n inject,\n computed\n} = Ember;\n\nexport default AjaxService.extend({\n auth: inject.service(),\n\...
javascript
chosen
[ { "from": "system", "value": "Set up browser/system notifs for pause recording events\n\n- one normal notif when user pauses\n- one notif when pause finishes to indicate history recording, which requires user to close\n- maybe should add option to preferences to disalbe notifs\n" }, { "from": "human...
javascript
chosen
[ { "from": "system", "value": "Add fixture data to the db for a faster set up\n" }, { "from": "human", "value": "var models = require('./models');\n\nmodels.init(function(err) {\n if (err) return console.log(err);\n});\n\n" }, { "from": "gpt", "value": "var models = require('./mode...
javascript
chosen
[ { "from": "system", "value": "[!] Build a basic util.promisify shim for NodeJS 6\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = {\n // location of Sqlite DB file\n Cache: `${process.cwd()}/themeparks.db`,\n // default time to cache any data\n DefaultCacheLengt...
javascript
chosen
[ { "from": "system", "value": "Add support for updating checkbox list values.\n" }, { "from": "human", "value": "import React from 'react'\nimport Input from './input'\n\nexport default class CheckboxList extends Input {\n onChange(value) {\n this.setState({ value: [value] })\n this.onUpda...
javascript
chosen
[ { "from": "system", "value": "Change window size to fit content\n" }, { "from": "human", "value": "const electron = require('electron');\n// Module to control application life.\nconst app = electron.app;\n// Module to create native browser window.\nconst BrowserWindow = electron.BrowserWindow;\n...
javascript
chosen
[ { "from": "system", "value": "Use separate component for TexMath, so model changes lead to a rerender.\n" }, { "from": "human", "value": "import { NodeComponent } from 'substance'\nimport katex from 'katex'\n\nexport default class InlineFormulaComponent extends NodeComponent {\n\n render($$) {\...
javascript
chosen
[ { "from": "system", "value": "Remove stray reference to underscore.string\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\n// description: git status across all repositories\n\nvar async = require('async');\nvar chalk = require('chalk');\nvar gift = require('gift');\nva...
javascript
chosen
[ { "from": "system", "value": "Support async tests in the Jasmine helper\n" }, { "from": "human", "value": "/* global jasmine:true, beforeEach:true, jsc:true */\n/* eslint strict:[2,\"function\"] */\nbeforeEach(function () {\n \"use strict\";\n jasmine.addMatchers({\n // Expects that propert...
javascript
chosen
[ { "from": "system", "value": "ADD harmony for gc in tests\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst mocha = require('gulp-mocha');\nconst tests = require('../test/unit.test');\n\ngulp.task('test', function() {\n return gulp\n .src(tests)\n .pipe(moc...
javascript
chosen
[ { "from": "system", "value": "Access first element of the response first\n\nWe know that there will be at least one because otherwise we take the\nother branch. We know that there will be only one because nicks are\nprimary keys and we're selecting nicks\n" }, { "from": "human", "value": "var ir...
javascript
chosen
[ { "from": "system", "value": "Add Content-Type json to headers\n" }, { "from": "human", "value": "var request = require('request')\n\nvar API_URL = 'https://api.digitalocean.com/v2/'\n\nvar api = {\n call: function (options, callback) {\n options.url = API_URL + options.action\n options.h...
javascript
chosen
[ { "from": "system", "value": "Allow serving from root paths\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict'\n\nconst path = require('path')\nconst flags = require('commander')\n\nconst markserv = require(path.join(__dirname, 'server'))\nconst pkg = require(path.join('..', ...
javascript
chosen
[ { "from": "system", "value": "Fix function nextOpenTime to handle hours before opening.\n" }, { "from": "human", "value": "DateUtilities = {\n\n addDay : function(date, days) {\n date.setHours(date.getHours() + 24*days);\n },\n\n roundToFollowingHalfHour : function(date) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix soname generation on non-Darwin Unix platforms.\n\nChange-Id: Ifc2d7edf883072067b76a51368ea3e89172cff94\nReviewed-by: Christian Kandeler <3aa99dcdd3f0cac61fb81c2a11771c0cc2497607@theqtcompany.com>\n" }, { "from": "human", "value": "var FileInfo = loadExtension(\...
javascript
chosen
[ { "from": "system", "value": "Remove hasBOM from nodes before test\n" }, { "from": "human", "value": "var path = require('path')\n\nfunction clean (node) {\n if (node.source) {\n delete node.source.input.css\n node.source.input.file = path.basename(node.source.input.file)\n }\n\n delete...
javascript
chosen
[ { "from": "system", "value": "Allow removing tags and add actions for add/remove\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from '../templates/components/tag-input';\n\nconst KEY_CODES = {\n BACK_BUTTON: 8,\n COMMA: 188,\n ENTER: 13,\n SPACE: 32\n};\n\nexpor...
javascript
chosen
[ { "from": "system", "value": "Add print out of environment variables, cwd, dirname, and change file write destination to local directory.\n" }, { "from": "human", "value": "var fs = require('fs');\n\nmodule.exports = function (context, req, res) {\n context.log('function triggered');\n con...
javascript
chosen
[ { "from": "system", "value": "Save token to session storage" }, { "from": "human", "value": "/**\r\n * Created by dell on 2015/6/9.\r\n */\r\n(function(){\r\n\r\n \"use strict\";\r\n\r\n var adminServices = angular.module('app.admin.services',[\"app.services\"]);\r\n\r\n adminServices.f...
javascript
chosen
[ { "from": "system", "value": "Move client id to environment variable\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('underscore');\n\nvar settings = {};\n\nsettings.cookieSecret = process.env.COOKIE_SECRET;\n\nsettings.movesClientId = '9uuys57PvQY7G2rFn2uBqPi6uoFabcTT';\nset...
javascript
chosen
[ { "from": "system", "value": "Update compiler test for the new API\n" }, { "from": "human", "value": "'use strict'\n\nvar test = require('tape')\n\nvar Compiler = require('../src/app/compiler')\nvar EventManager = require('../src/lib/eventManager')\n\ntest('compiler.compile smoke', function (t) ...
javascript
chosen
[ { "from": "system", "value": "Add gradient on top of background image\n" }, { "from": "human", "value": "\nvar address = 'https://api.github.com/repos/Coolnesss/lapio-galleria/contents/profiles'\n\n$.get(address, function(data) {\n data.forEach(function(entry) {\n $.getJSON(entry.download_ur...
javascript
chosen
[ { "from": "system", "value": "Trim trailing whitespace, add missing semicolon\n" }, { "from": "human", "value": "function main() {\n $('#tabs').tabs();\n google.load('visualization', '1', {packages: ['geochart']});\n google.setOnLoadCallback(googleReady);\n var commodities_select=[];...
javascript
chosen
[ { "from": "system", "value": "Make capability reading robust for tests.\n" }, { "from": "human", "value": "import plugin_data from 'plugin_data';\n\nexport default {\n launchIntent: plugin_data.appCapabilities.launch_intent,\n};\n" }, { "from": "gpt", "value": "import plugin_data fr...
javascript
chosen
[ { "from": "system", "value": "Fix search problem for /site/:id\n" }, { "from": "human", "value": "module.exports = function($stateParams, $state, $scope, $location, SearchService, DocumentRouteService, DocumentService, MathJaxService, UserService) {\n \n console.log('SITE CONTROLLER')\n ...
javascript
chosen
[ { "from": "system", "value": "Add compitablity with autoform 6" }, { "from": "human", "value": "Package.describe({\n name: 'smaltcreation:autoform-input-addon-icon',\n version: '1.0.0',\n summary: 'Input with bootstrap addon and custom icon for autoform'\n});\n\nPackage.onUse(function(a...
javascript
chosen
[ { "from": "system", "value": "Use require.resolve for more robust path lookup\n" }, { "from": "human", "value": "// Remove the webpack-dev-server grunt task since we do not use it\nvar fs = require('fs');\nvar path = require('path');\n\nvar taskFile = path.join(__dirname, '..', 'node_modules', '...
javascript
chosen
[ { "from": "system", "value": "Fix sources protocol to HTTPS.\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\treturn {\n\t\toptions: {\n\t\t\tseparator: Array(3).join(grunt.util.linefeed),\n\t\t\tsourceRoot: process.env.CI ? 'http://raw.github.com/' + process.env.TRAVIS_...
javascript
chosen
[ { "from": "system", "value": "Add dog conversation to bot\n" }, { "from": "human", "value": "'use strict';\nrequire('dotenv').config();\n\nconst bot = require('./lib/bot.js');\n\nrequire('./src/releases.js')(bot);\nrequire('./src/releaseAndTag.js')(bot);\nrequire('./src/cheese.js')(bot);\nrequir...
javascript
chosen
[ { "from": "system", "value": "Fix @csutter's sloppy code style\n" }, { "from": "human", "value": "define([ \"jquery\", \"lib/utils/viewport_helper\" ], function($, isInViewport) {\n \"use strict\";\n\n var HeroParallax,\n _pageYOffset,\n started = false,\n speed = 15,\n els...
javascript
chosen
[ { "from": "system", "value": "Tweak to CX bookmarklet per Dan Petty.\n" }, { "from": "human", "value": "var content = jQuery('#content');\nvar grafs = content.text().split('\\n\\n');\n\nvar cx_date = new Date();\nvar monthNames = [\"Jan. \",\"Feb. \",\"March \",\"April \",\"May \",\"June \",\"Ju...
javascript
chosen
[ { "from": "system", "value": "Add fix for reactjs shadowdom\n" }, { "from": "human", "value": "chrome.storage.local.get(null, function(items) {\n var aliases = items.aliases\n var aliasKey = items.aliasKey\n $('body').on('keydown', 'input, textarea', function(e) {\n var code = (e.keyCode ?...
javascript
chosen
[ { "from": "system", "value": "Update JS dependency requires to use NPM plugin ids\n" }, { "from": "human", "value": "// Copyright (c) 2015 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nvar h...
javascript
chosen
[ { "from": "system", "value": "Remove UglifyJs warnings from webpack production shortcut (-p)\n\nNot Really a riot problem just an annoyance.\r\n\r\nWebpack/UglifyJs throws this warnings:\r\n\r\nCondition always true [./~/riot/riot.js:1365,0]\r\nDropping unreachable code [./~/riot/riot.js:1368,0]" }, { ...
javascript
chosen
[ { "from": "system", "value": "Build from multiple mapped templates\n" }, { "from": "human", "value": "/*\n \n build.js\n\n Accepts: config - object, the config data\n files - object, the files object generated in schema.js\n\n Creates a set of HTML files based on the j...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous commas for IE\n" }, { "from": "human", "value": "\n//\n// Main entry point.\n//\n\nrequire.config( {\n paths: {\n 'jquery' : \"jquery-1.7.1.min\",\n 'jquery-ui' : \"jquery-ui-1.8.16.custom.min\",\n ...
javascript
chosen
[ { "from": "system", "value": "Update eslint config to disallow semicolons\n" }, { "from": "human", "value": "module.exports = {\n extends: 'eslint:recommended',\n env: {\n node: true,\n es6: true\n },\n rules: {\n 'indent': ['error', 4],\n 'quote-props': [...
javascript
chosen
[ { "from": "system", "value": "Correct reply() error and add neater Boom error handler if\nemployee not found\n" }, { "from": "human", "value": "export default function getEmployee(request, reply) {\n const { employeeID } = request.params;\n request.server.methods.db.getEmployee(employeeID, (er...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous prop declaration for availablePermissions\n\n(This is loaded using stripes-connect, not passed in by the parent\ncomponent.)\n" }, { "from": "human", "value": "// We have to remove node_modules/react to avoid having multiple copies loaded.\n// esli...
javascript
chosen
[ { "from": "system", "value": "Fix the issue with losing pageAction after tab reload\n" }, { "from": "human", "value": "var connections = {};\n\n// Listen to messages sent from the DevTools page\nchrome.runtime.onConnect.addListener(function (port) {\n\n function extensionListener(message) {\n ...
javascript
chosen
[ { "from": "system", "value": "Replace usage of deprecated hook method" }, { "from": "human", "value": "var Sequelize = require('sequelize'),\n _ = require('lodash');\n\nmodule.exports = function(target) {\n if (target instanceof Sequelize.Model) {\n // Model\n createHook(target);\n } ...
javascript
chosen
[ { "from": "system", "value": "Update inline docs for the main function\n" }, { "from": "human", "value": "var Options = require('./options');\nvar Metafile = require('./metafile');\n\nmodule.exports = metafiles;\n\n// Not needed in Node 4.0+\nif (!Object.assign) Object.assign = require('object-a...
javascript
chosen
[ { "from": "system", "value": "Update up to changes in dbjs\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = require('dbjs').Boolean.create('YesNo', {\n\ttrueString: 'Yes',\n\tfalseString: 'No'\n});\n" }, { "from": "gpt", "value": "'use strict';\n\nmodule.exports =...
javascript
chosen
[ { "from": "system", "value": "Add last exercise of 'count-to-6'\n" }, { "from": "human", "value": "console.log(html`<b>${process.argv[2]} says</b>: \"${process.argv[3]}\"`);\n" }, { "from": "gpt", "value": "console.log(html`<b>${process.argv[2]} says</b>: \"${process.argv[3]}\"`);\n\...
javascript
chosen
[ { "from": "system", "value": "Add category mapping for \"festmøte\"\n\nThese were not given a category\n" }, { "from": "human", "value": "module.exports = {\n \"Dagens bedrift\": \"PRESENTATIONS\",\n \"Fest og moro\": \"NIGHTLIFE\",\n \"Konsert\": \"MUSIC\",\n \"Kurs og events\": \"P...
javascript
chosen
[ { "from": "system", "value": "Move confirm call directly in the if statement\n" }, { "from": "human", "value": "import { bind } from 'decko';\nimport React from 'react';\nimport { findDOMNode } from 'react-dom';\n\n/**\n * A modal dialog window.\n */\nclass Dialog extends React.Component {\n co...
javascript
chosen
[ { "from": "system", "value": "Comment out for presentation reasons\n\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\n// import { createStore, combineReducers, applyMiddleware, compose } from 'redux';\nimport { ApolloClient, ApolloProvider, create...
javascript
chosen
[ { "from": "system", "value": "Fix error of blob function not found in whatwg-fetch with Network Inspect enabled\n" }, { "from": "human", "value": "/*\n * See https://github.com/jhen0409/react-native-debugger/issues/209\n *\n * Patch whatwg-fetch code to get `support` var,\n * so we could use it ...
javascript
chosen
[ { "from": "system", "value": "Fix representation of External Classes" }, { "from": "human", "value": "webvowl.nodes.externalclass = (function () {\n\n\tvar o = function () {\n\t\twebvowl.nodes.RoundNode.call(this);\n\n\t\tthis.styleClass(\"external\")\n\t\t\t.textAttribute(\"white\")\n\t\t\t.typ...
javascript
chosen
[ { "from": "system", "value": "Handle hot loading the instance\n" }, { "from": "human", "value": "/**\n * Bootstrap\n * Client entry point\n * @flow\n */\n\n// Polyfills\nimport 'babel/polyfill'\n\n// Modules\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { Router } from 're...
javascript
chosen
[ { "from": "system", "value": "Fix for iframe in Safari\n" }, { "from": "human", "value": "const styles = {\n display: \"grid\",\n gridTemplateRows: \"1fr 1fr 7fr 1fr\",\n};\n\nfunction Resume() {\n return (\n <section className=\"container\" style={styles}>\n <h3>Skills</h3>\n <u...
javascript
chosen
[ { "from": "system", "value": "Revert to old JS, TODO improve performance\n" }, { "from": "human", "value": "$(document).ready(function(){\n /*var box = document.getElementsByTagName('a-box');\n\n var changeColor = function() {\n this.setAttribute('color', 'green');\n };\n var ...
javascript
chosen
[ { "from": "system", "value": "Check if package version is contained in last 10 versions\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconsole.log('Hello World!')\n" }, { "from": "gpt", "value": "#!/usr/bin/env node\n\nconst util = require('util');\nconst packageVersion = ...
javascript
chosen
[ { "from": "system", "value": "Add a unique key to each child in an array\n" }, { "from": "human", "value": "import React from 'react';\n\nconst Main = () => {\n\n\tconst articles = [\n\t\t{\n\t\t\tid: 1,\n\t\t\ttitle: 'Title 1'\n\t\t}, {\n\t\t\tid: 2,\n\t\t\ttitle: 'Title 2'\n\t\t}, {\n\t\t\tid:...
javascript
chosen
[ { "from": "system", "value": "Select search text on click" }, { "from": "human", "value": "'use strict';\n\nimport React from 'react/addons';\n\nimport Icon from './Icon.js';\n\nimport LeftColumnActions from '../actions/LeftColumnActions.js';\nimport SearchActions from '../actions/SearchActions....
javascript
chosen
[ { "from": "system", "value": "Change the max id to GITenberg's max\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n gutenberg: {\n startId: 26158,\n maxId: 50576,\n excludes: [\n 11799,\n ],\n },\n\n paragraphLimit: 1000,\n\n title: 'SEED DISPERSA...
javascript
chosen
[ { "from": "system", "value": "Revert \"Use simpler traverse API for removing config comments.\"\n\nThis reverts commit e9f8e286aaadeda26f898db823cafdf4e6c8dd10.\n\nWe cannot rely on the newer traverse API here, until we do not support\nversions older than Ember 2.1.0.\n" }, { "from": "human", "v...
javascript
chosen
[ { "from": "system", "value": "Add version dropdown to configuration with apply logic\n" }, { "from": "human", "value": "import React from 'react';\n\nimport ConfigurationView from './ConfigurationView';\nimport Service from '../structs/Service';\n\nclass ServiceDetailConfigurationTab extends Rea...
javascript
chosen
[ { "from": "system", "value": "Update to protect against no val().\n" }, { "from": "human", "value": "(function($) {\n $.fn.inputDefaults = function(options) {\n var opts;\n opts = $.extend({}, $.fn.inputDefaults.defaults, options);\n return this.each(function() {\n var $el, defaul...
javascript
chosen
[ { "from": "system", "value": "Improve visibility of nav bar text on page scroll\n\nAlso matches footer now as well.\n" }, { "from": "human", "value": "'use strict';\n/*\n\teffects.js\n\n\tContains the functionality for the scrolling fixed menu\n\tand the popup menu toggle\n\n*/\n$(document).read...
javascript
chosen
[ { "from": "system", "value": "Update couch attachments view for external_blobs" }, { "from": "human", "value": "function (doc) {\n var media = 0, attachments = {}, value;\n\n if (doc.doc_type === \"XFormInstance\") {\n if (doc.xmlns) {\n for (var key in doc._attachments) ...
javascript
chosen
[ { "from": "system", "value": "Add a tool tip to the form.\n" }, { "from": "human", "value": "import React, { PropTypes, Component } from 'react'\nimport moment from 'moment'\n\nimport style from './../../../styles/organisms/ThermostatForm.scss'\n\nclass ThermostatForm extends Component {\n\n ge...
javascript
chosen
[ { "from": "system", "value": "Fix bug on travis CI\n" }, { "from": "human", "value": "import fs from 'fs';\nimport path from 'path';\nimport Sequelize from 'sequelize';\nimport configs from '../config/config';\n\nconst basename = path.basename(module.filename);\nconst env = process.env.NODE_ENV ...
javascript
chosen
[ { "from": "system", "value": "Add closing lite dialog by pressing esc key\n" }, { "from": "human", "value": "import $ from 'jquery';\n\nclass ModalUI {\n constructor($node, options) {\n this.options = $.extend({}, {\n target: options.container || 'body',\n }, options);\n\n this.$m...
javascript
chosen
[ { "from": "system", "value": "Convert mkTmpDirIn to async/await syntax\n" }, { "from": "human", "value": "'use strict';\n\nconst fs = require('fs-extra');\nconst temp = require('temp');\nconst util = require('util');\n\nconst mkdirTemp = util.promisify(temp.mkdir);\n\nfunction mkTmpDirIn(dir) {\...
javascript
chosen
[ { "from": "system", "value": "Use a watch on fold status in sidepanelFolder\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('arethusa.core').directive('sidepanelFolder', [\n 'sidepanel',\n function(sidepanel) {\n return {\n link: function (scope, element, attrs) {\n ...
javascript
chosen
[ { "from": "system", "value": "Update Users API to handle role objects or ids\n\nCloses #3357\n- API method User#edit now handles User objects that have either\n an array of Role ids or objects.\n- Fixed error handler notification on upload modal controller.\n" }, { "from": "human", "value": "\n...
javascript
chosen
[ { "from": "system", "value": "Use redux-starter-kit to set up and configure the redux store\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './components/App';\nimport { applyMiddleware, createStore } from 'redux';\nimport { compo...
javascript
chosen