conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Support import was throwing exceptions\n" }, { "from": "human", "value": "import React from 'react';\nimport {\n View,\n Text,\n} from 'react-native';\n// import { Actions } from 'react-native-router-flux';\nimport { RoomView } from './RoomView';\n\nimport { AppSt...
javascript
chosen
[ { "from": "system", "value": "Fix a bug when using symbols in iOS 8.1\n\nFor some reason, injecting objects with symbols as keys in Vue won’t work in iOS 8.1. To replicate this, simply create a <vue-form> and run it in the on iOS 8.1 or the iOS 8.1 simulator.\n" }, { "from": "human", "value": "i...
javascript
chosen
[ { "from": "system", "value": "Revert \"[WLK-INSTANCE] use locally generated avatars as default instead of cupcake.io\"\n\nThis reverts commit 92c531beca630b1aff75712360a3bae3e158420e.\n" }, { "from": "human", "value": "import cx from 'classnames';\nimport React from 'react';\nimport PropTypes fr...
javascript
chosen
[ { "from": "system", "value": "Add some test card numbers.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { faintBlack, cyan500 } from 'material-ui/styles/colors';\nimport MenuItem from 'material-ui/MenuItem';\nimport IconMenu from 'material-ui/IconMenu';\nim...
javascript
chosen
[ { "from": "system", "value": "Update geo riskfators screen to use the new structure of reported symptoms\n" }, { "from": "human", "value": "/**\n * Created by Tomasz Gabrysiak @ Infermedica on 08/02/2017.\n */\n\nimport View from '../../base/view';\nimport template from './template';\n\nexport d...
javascript
chosen
[ { "from": "system", "value": "Use an arrow function instead\n" }, { "from": "human", "value": "var React = require( \"react\" );\nvar MorningScreen = require( \"./morning-screen\" );\nvar PlayScreen = require( \"./play-screen\" );\n\nmodule.exports = React.createClass({\n\tdisplayName: \"Republi...
javascript
chosen
[ { "from": "system", "value": "Add a TODO for ascii filter\n" }, { "from": "human", "value": "var core = require('../../core');\n\n/**\n * @author Vico @vicocotea\n * original shader : https://www.shadertoy.com/view/lssGDj by @movAX13h\n */\n\n/**\n * An ASCII filter.\n *\n * @class\n * @extends ...
javascript
chosen
[ { "from": "system", "value": "Exit with error if Java home can't be found\n" }, { "from": "human", "value": "require('find-java-home')(function(err, home){\n if(err){\n console.error(\"[node-java] \"+err);\n process.exit(1);\n }\n process.stdout.write(home);\n});\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Remove extra semicolon injection in legacy stylesheet\n" }, { "from": "human", "value": "/* global legacyConvert, module, project */\n\nmodule.exports = function(grunt) {\n\tgrunt.registerTask('convertLegacy', function(task) {\n\t\tvar dest = legacyConvert[task],\n\...
javascript
chosen
[ { "from": "system", "value": "Update ws endpoint to localhost\n" }, { "from": "human", "value": "import {Entity} from 'aframe-react';\nimport React from 'react';\nimport Wsgamepad from './Wsgamepad';\n\nexport default ({\n position=[0, 0, 5],\n id=\"camera\",\n active=\"false\",...
javascript
chosen
[ { "from": "system", "value": "Use `traverse()` instead of the deprecated `Walker` class\n" }, { "from": "human", "value": "'use strict';\n\n/* eslint-env node */\n\nlet TEST_SELECTOR_PREFIX = /data-test-.*/;\n\nfunction isTestSelector(attribute) {\n return TEST_SELECTOR_PREFIX.test(attribute);\...
javascript
chosen
[ { "from": "system", "value": "Add di to allow access to the control's options from its angular controller\n" }, { "from": "human", "value": " 'use strict';\n\n L.Control.Angular = L.Control.extend({\n options: {\n position: 'bottomleft',\n template: ''\n },\n onAdd: f...
javascript
chosen
[ { "from": "system", "value": "Fix bug with array and object data\n" }, { "from": "human", "value": "/**\n * Message for errors when some method is not implemented\n * @type {String}\n * @private\n */\nvar NEED_IMPLEMENT_MESSAGE = \"This method need to implement\";\n\n/**\n * BaseHash class\n * @...
javascript
chosen
[ { "from": "system", "value": "Update deprecated Tailwind config value\n" }, { "from": "human", "value": "module.exports = {\n content: [\n './app/**/*.{html,hbs,js}'\n ],\n darkMode: false, // or 'media' or 'class'\n theme: {\n extend: {}\n },\n plugins: [\n require('@tailwindcss/...
javascript
chosen
[ { "from": "system", "value": "Tidy up whitespace and line-endings\n" }, { "from": "human", "value": "$(function() {\n var $tabs = $('#search-results-tabs'),\n $searchForm = $('.js-search-hash');\n\n if($tabs.length > 0){\n $tabs.tabs({ 'defaultTab' : getDefaultSearchTabIndex(), scrollO...
javascript
chosen
[ { "from": "system", "value": "Add new meaning should have synonyms added too (empty array)\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport EmberValidations from 'ember-validations';\n\nexport default Ember.Component.extend(EmberValidations, {\n classNames: [\"edit-interfac...
javascript
chosen
[ { "from": "system", "value": "Make the drawer behave like a mobile drawer\nClose when you click away. Grey out the background when the menu is up.\n" }, { "from": "human", "value": "import React from 'react'\nimport MuiDrawer from 'material-ui/Drawer'\nimport MenuItem from 'material-ui/MenuItem'...
javascript
chosen
[ { "from": "system", "value": "Check for `icon` in icon path\n" }, { "from": "human", "value": "const cheerio = require('cheerio');\nconst url = require('url');\n\nfunction hrefIsIcon(href) {\n return /\\w\\.(png|jpg|ico)/.test(href);\n}\n\nfunction getIconLinks(rootUrl, dom) {\n var $ = ch...
javascript
chosen
[ { "from": "system", "value": "Add 'use strict' to javascript\n" }, { "from": "human", "value": "$(function() {\n function update() {\n var name = $('#boxes #name').val();\n var id = $('#boxes #id').val();\n if (name || id) {\n if (!name) { name = \"{name}\"; }\...
javascript
chosen
[ { "from": "system", "value": "Allow embedding groups in groups\n" }, { "from": "human", "value": "import { Immutable } from 'nuclear-js';\nimport { getters as entityGetters } from '../entity';\n\nconst DEFAULT_VIEW_ENTITY_ID = 'group.default_view';\n\nexport const currentView = [\n 'currentView...
javascript
chosen
[ { "from": "system", "value": "Add test for number formatter\n" }, { "from": "human", "value": "import columnAccessor from './columnAccessor';\n\ndescribe('Util:columnAccessor', () => {\n it('should run this test', () => {\n const accessor = columnAccessor({ column: 'foo' });\n c...
javascript
chosen
[ { "from": "system", "value": "Load courses in the reducer\n" }, { "from": "human", "value": "import * as types from '../actions/action-types';\n\nexport default (state = [], action) => {\n switch (action.type) {\n case types.CREATE_COURSE:\n return [\n ...state,\n ...
javascript
chosen
[ { "from": "system", "value": "Add a few new Core Editors\n" }, { "from": "human", "value": "[\n {\n \"name\": \"Textstring\",\n \"path\": \"/umbraco/views/propertyeditors/textbox/textbox.html\"\n },\n {\n \"name\": \"Content Picker\",\n \"path\": \"/umbraco/v...
javascript
chosen
[ { "from": "system", "value": "Make script injection more abstract\n" }, { "from": "human", "value": "chrome\n .runtime\n .sendMessage({ msg: 'getStatus' }, function (response) {\n if (response.status) {\n let storage = chrome.storage.local;\n storage.get(['type', 'freq', 'q', 'gai...
javascript
chosen
[ { "from": "system", "value": "Add an alias for bloggify on the client\n" }, { "from": "human", "value": "module.exports = {\n loadPlugins: false\n , cms_methods: true\n , plugins: []\n , pluginConfigs: {}\n , metadata: {\n siteTitle: \"No name\"\n , description: \"Foo\"\n }...
javascript
chosen
[ { "from": "system", "value": "Add css processing to `gulp build`\n" }, { "from": "human", "value": "const babel = require('gulp-babel');\nconst gulp = require('gulp');\nconst pug = require('gulp-pug');\nconst uglify = require('gulp-uglify');\n\ngulp.task('build', () => {\n\tgulp.src('app/src/pug...
javascript
chosen
[ { "from": "system", "value": "Fix changes so it'll start tracking css watches\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n browserSync = require('browser-sync'),\n sass = require('gulp-sass'),\n bower = require('gulp-bower'),\n notify = re...
javascript
chosen
[ { "from": "system", "value": "Add test task to gulp\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar sass = require('gulp-sass');\nvar sassLint = require('gulp-sass-lint');\nvar concat = require('gulp-concat');\nvar sourcemaps = require('gulp-sourcemaps');\nva...
javascript
chosen
[ { "from": "system", "value": "Add the promisification in the service in order to be treated by the view.\n" }, { "from": "human", "value": "/* global Promise */\nvar Reference = require('../models/reference');\nvar reference = new Reference();\n// var References = require('../models/references')...
javascript
chosen
[ { "from": "system", "value": "Update the url for the build-notification-api\n" }, { "from": "human", "value": "const API_URL = 'https://d07a5522.ngrok.io'\n\nexport const saveTokenForPush = subscription =>\n fetch(`${API_URL}/token`, {\n method: 'POST',\n headers: {\n ...
javascript
chosen
[ { "from": "system", "value": "Move the action to the outer question object\n\nThis is a bit more question independant, and more expressive.\n" }, { "from": "human", "value": "\nimportScripts(\"/app/bower_components/videogular-questions/questions-worker.js\");\n\nloadAnnotations({\n\t\"first-ques...
javascript
chosen
[ { "from": "system", "value": "Add site footer to each documentation generator\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tac...
javascript
chosen
[ { "from": "system", "value": "Add Event Listener to window.resize\n" }, { "from": "human", "value": "//Get the begin and end coordinates of selction\r\nfunction getSelectionEnds() {\r\n var success = false, x1 = 0, y1 = 0, x2 = 0, y2 = 0;\r\n var sel = window.getSelection()\r\n if (sel....
javascript
chosen
[ { "from": "system", "value": "Fix multi-line log output in app logs\n" }, { "from": "human", "value": "// TODO: To decide and adopt to some logging utility like winston\nmodule.exports = {\n info: function(message,context) {\n if(context) {\n console.log(message,JSON.stringify(context, ...
javascript
chosen
[ { "from": "system", "value": "Add Base pattern to Component template.\n" }, { "from": "human", "value": "define([\n\n 'lateralus'\n\n ,'./model'\n ,'./view'\n ,'text!./template.mustache'\n\n], function (\n\n Lateralus\n\n ,Model\n ,View\n ,template\n\n) {\n 'use strict';\n\n var {{comp...
javascript
chosen
[ { "from": "system", "value": "Use babel polyfill on frontend\n" }, { "from": "human", "value": "/**\n * Main entry point for budget web app\n */\n\nimport React from 'react';\nimport { AppContainer } from 'react-hot-loader';\nimport { render } from 'react-dom';\nimport { BrowserRouter } from 're...
javascript
chosen
[ { "from": "system", "value": "Allow some tags in whitelist\n" }, { "from": "human", "value": "/**\n * Scroll to element\n * @param element\n */\nfunction scrollTo(element, duration) {\n duration = duration || 500;\n if (!element) return false;\n var elem = $(element).offset();\n if (...
javascript
chosen
[ { "from": "system", "value": "Configure Hot Module Replacement for the reducer logic\n" }, { "from": "human", "value": "import {createStore, applyMiddleware} from \"redux\";\nimport { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';\n\nimport thunk from \"redux-thunk\";\n\n...
javascript
chosen
[ { "from": "system", "value": "Call setTimeout in test case\n" }, { "from": "human", "value": "import { expect } from 'chai';\n\nimport { updateCellSource, executeCell } from '../../../src/notebook/actions';\nimport { liveStore, dispatchQueuePromise, waitForOutputs } from '../../utils';\n\ndescri...
javascript
chosen
[ { "from": "system", "value": "Clarify fetch handler in the api-analytics recipe\n" }, { "from": "human", "value": "// In a real use case, the endpoint could point to another origin.\nvar LOG_ENDPOINT = 'report/logs';\n\n// The code in `oninstall` and `onactive` force the service worker to\n// co...
javascript
chosen
[ { "from": "system", "value": "Add more method and refactor code.\n\nConstructor first argument is a parent text.\n- parent() get paragraph parent which is a text.\n\nAdding lookup methods, they are:\n- findSentenceById() = find a sentence by its id in the sentencesCollection\n- findSentenceByIndex = find a ...
javascript
chosen
[ { "from": "system", "value": "Fix a lie in a comment\n" }, { "from": "human", "value": "/**\n * @file init.js\n * Custom initialization for your app. Use this space to attach any pre/post\n * hooks your setup will need. This is executed after the Router and\n * AutoLoader have been set up, but b...
javascript
chosen
[ { "from": "system", "value": "Add Sync to method name as it's Sync reliant\n" }, { "from": "human", "value": "const spawnSync = require('child_process').spawnSync;\n\nclass Linguist {\n\n /**\n * Returns the languages found in the project. \n * Associate Array of language String to Array of...
javascript
chosen
[ { "from": "system", "value": "Use postcss-sass-extend instead of postcss-extend.\n" }, { "from": "human", "value": "import path from 'path';\r\nimport mixins from 'postcss-mixins';\r\nimport nested from 'postcss-nested';\r\nimport extend from 'postcss-extend';\r\nimport repeat from 'postcss-for'...
javascript
chosen
[ { "from": "system", "value": "Fix button problem introduced in previous commit\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport {\n Text,\n TouchableHighlight\n} from 'react-native';\n\nconst Button = ({theme, disabled}) => {\n const {styles} = theme;\n...
javascript
chosen
[ { "from": "system", "value": "Switch accidentally changed call and dial sounds \n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Module for playing audio, now the Angular way!\n */\n\nangular.module('audiohandler', [])\n.factory('audioFactory', function ($ionicPlatform, $window, $cordo...
javascript
chosen
[ { "from": "system", "value": "Set default zIndex to 10000\n" }, { "from": "human", "value": "/**\n * @name jquery-steamytext\n * @version 1.0.0\n * @description jQuery SteamyText animation plugin\n * @author Maxim Zalysin <max@zalysin.ru>\n */\n(function($){\n $.fn.steamyText = function(data)...
javascript
chosen
[ { "from": "system", "value": "Update overlay positioning to fixed" }, { "from": "human", "value": "(function() {\n \n function onPlayerReady() {\n var overlay = videoPlayer.overlay();\n $(overlay).html('<img id=\"overlaylogo\" src=\"http://cs1.brightcodes.net/ben/img/genericlogo...
javascript
chosen
[ { "from": "system", "value": "Make expand property optional for headerbar\n" }, { "from": "human", "value": "(function() {\n \"use strict\";\n\n angular\n .module('VinculacionApp')\n .directive('tbHeaderbar', tbHeaderbar);\n\n function tbHeaderbar() {\n var directiv...
javascript
chosen
[ { "from": "system", "value": "Handle slug collisions by adding a little salt.\n" }, { "from": "human", "value": "var _ = require('underscore');\nvar getSlug = require('speakingurl');\nvar SLUG_MAP_FILE = \"src/data/slug_map.json\";\n\nmodule.exports = function(grunt) {\n\n fun...
javascript
chosen
[ { "from": "system", "value": "Use the i18n utils setup function in tests\n\n# Conflicts:\n#\tkarma_config/vueLocal.js\n" }, { "from": "human", "value": "/* eslint-disable no-console */\nimport vue from 'vue';\nimport vuex from 'vuex';\nimport router from 'vue-router';\nimport vueintl from 'vue-i...
javascript
chosen
[ { "from": "system", "value": "Improve comment to clarify function's intention\n" }, { "from": "human", "value": "// eg.\n// 3 -> 0.001\n// 2 -> 0.01\n// 1 -> 0.1\nexport default pipSize => {\n const zeros = Array(pipSize).join('0');\n const stepStr = '0.' + zeros + 1;\n return stepStr;\...
javascript
chosen
[ { "from": "system", "value": "fix(router): Add 'history' prop to the archive-list.\n" }, { "from": "human", "value": "import React from 'react';\nimport Archive from '../../component/archive/archive-list-container';\nimport PropTypes from 'prop-types';\n\nconst render = ({ match }) => <Archive n...
javascript
chosen
[ { "from": "system", "value": "Sort addresses on home-screen by name and value.\n" }, { "from": "human", "value": "import './AddressList.less';\nimport AddrLine from './AddrLine.react';\nimport React, { PropTypes } from 'react';\nimport Component from 'react-pure-render/component';\nimport { conn...
javascript
chosen
[ { "from": "system", "value": "Fix test for travis ci\n" }, { "from": "human", "value": "const sum = require('./sum');\n\ntest('adds 1 + 2 to equal 3', () => {\n expect(sum(1, 2)).toBe(4);\n});" }, { "from": "gpt", "value": "const sum = require('./sum');\n\ntest('adds 1 + 2 to equal ...
javascript
chosen
[ { "from": "system", "value": "Print error on clients that do not support printing on unhandledRejections\n" }, { "from": "human", "value": "import preInit from '../common/pre-init';\n\npreInit().then(() => {\n require('./init-render'); // eslint-disable-line global-require\n});\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Set default duration for events to 1 hour.\n\nSigned-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@stormz.me>\n" }, { "from": "human", "value": "var icalendar = require('icalendar');\nvar _ = require('underscore');\n\nexports.generateIcal = func...
javascript
chosen
[ { "from": "system", "value": "Reset search state on reset action\n" }, { "from": "human", "value": "import { SET_COMPLETION, SET_BODY, SET_PAGE, SET_RESULTS_PER_PAGE } from '../actions/Search'\n\nconst initialState = {\n completion: '',\n body: '',\n page: 1,\n resultsPerPage: 10\n}\n\nfunct...
javascript
chosen
[ { "from": "system", "value": "Comment out unused import to silence eslint\n" }, { "from": "human", "value": "import BaseApp from '../../lib/javascripts/base_app';\n\n// remove these if not needed\nimport Base64 from 'base64';\nimport helpers from 'helpers';\n\nvar App = {\n\n defaultState: 'loa...
javascript
chosen
[ { "from": "system", "value": "Add missing job run status\n" }, { "from": "human", "value": "const JobStates = {\n active: {\n stateTypes: ['active'],\n displayName: 'Running'\n },\n failed: {\n stateTypes: ['completed', 'failure'],\n displayName: 'Failed'\n },\n success: {\n ...
javascript
chosen
[ { "from": "system", "value": "Add a selector star - no behaviour yet\n" }, { "from": "human", "value": "define(['react'], function (React) {\n 'use strict';\n\n var ul = React.DOM.ul\n , li = React.DOM.li\n , span = React.DOM.span\n , a = React.DOM.a;\n\n var Pager = React.createCla...
javascript
chosen
[ { "from": "system", "value": "Set post state to published upon save\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';\n\nexport default Ember.Route.extend(AuthenticatedRouteMixin, {\n session:...
javascript
chosen
[ { "from": "system", "value": "Add services to user schema\n\nLogin was failing without it.\n\nWe still blackbox and omit them from forms.\n\nre #1\n" }, { "from": "human", "value": "Schema = {};\n\nSchema.UserProfile = new SimpleSchema({\n name: {\n type: String,\n optional: true\n },\n ...
javascript
chosen
[ { "from": "system", "value": "Add skeleton for CRUD REST services for raw data feed\n" }, { "from": "human", "value": "var rawFeedService = require('../database/raw_feed.js');\n\nthis.load = function(app, io, gcm, logger) {\n\tapp.get('/rawfeed/?', function(req, res){\n\t\tif(logger.DO_LOG){\n\t...
javascript
chosen
[ { "from": "system", "value": "Make modulePrefix default a little more generic.\n" }, { "from": "human", "value": "\nmodule.exports = {\n options: {\n 'v': {\n type: 'boolean',\n description: 'Verbose logging',\n alias: 'verbose'\n },\n 'd'...
javascript
chosen
[ { "from": "system", "value": "Work around not being able to set res.body\n\nFor #268\n" }, { "from": "human", "value": "var CONTENT_TYPE = 'Content-Type';\nvar JSON_CONTENT_TYPE = 'application/json';\nvar _ = require('../../../../utils/mindash');\n\nmodule.exports = {\n id: 'parseJSON',\n afte...
javascript
chosen
[ { "from": "system", "value": "Remove One Off option on page load for recurring tasks.\n" }, { "from": "human", "value": "$('document').ready(function () {\n showOrHideRecurrenceFields();\n});\n\n$('#IsRecurring').on('click', function () {\n addOrRemoveOneOffOption();\n showOrHideRecurr...
javascript
chosen
[ { "from": "system", "value": "Modify recipe service to only perform one call to API" }, { "from": "human", "value": "var RecipeService = function() {\n\n this.initialize = function() {\n // No Initialization required\n var deferred = $.Deferred();\n deferred.resolve();\n ...
javascript
chosen
[ { "from": "system", "value": "Add initial tests for Registry.check\n" }, { "from": "human", "value": "import test from 'ava';\n\ntest.todo('Write test for Registry.check');\n" }, { "from": "gpt", "value": "import test from 'ava';\nimport Registry from '../src/registry';\n\nwindow.inn...
javascript
chosen
[ { "from": "system", "value": "Fix paste event for IE\n" }, { "from": "human", "value": "import lists from '../core/lists';\n\nexport default class Clipboard {\n constructor(context) {\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n }\n\n initialize() {\n t...
javascript
chosen
[ { "from": "system", "value": "Fix runtime JavaScript errors in chrome://options.\n\nWith chrome built with CHROMEOS=1, the following error occurs\nin in chrome://options as sync-button and dummy-button don't exist.\nRemove the binding code to fix the error.\n\n[28843:28843:611993994873:INFO:CONSOLE(0)] \"Un...
javascript
chosen
[ { "from": "system", "value": "Fix issue with redux-logger upgrade\n\n" }, { "from": "human", "value": "import { createStore, applyMiddleware, compose } from 'redux'\nimport thunkMiddleware from 'redux-thunk'\nimport createLogger from 'redux-logger'\n\nconst loggerMiddleware = createLogger()\n\ne...
javascript
chosen
[ { "from": "system", "value": "Allow Heroku to specify a port\n" }, { "from": "human", "value": "'use strict';\n\nconst server = require('./app/server');\n\nserver.listen(80, () => {\n console.info('Server listening on port 80');\n});\n" }, { "from": "gpt", "value": "'use strict';\n\...
javascript
chosen
[ { "from": "system", "value": "Exclude iOS Chrome as mobile safari\n" }, { "from": "human", "value": "(function(window, Models) {\n\n function Browser() {\n var self = this;\n\n self._isMobileSafariStandalone = function() {\n return self.isMobileSafari && window.navigator.standalone;\...
javascript
chosen
[ { "from": "system", "value": "Disable specific JSCS rules where necessary\n" }, { "from": "human", "value": "'use strict';\nvar walk = require('walk'),\n path = require('path'),\n fs = require('fs');\n\nclass FileSystemSourceRepository {\n // Awaiting resolution of https://github.com/js...
javascript
chosen
[ { "from": "system", "value": "Change button text depending on view\n" }, { "from": "human", "value": "import React, { Component } from 'react';\n\nimport Summary from './sections/Summary';\nimport Table from './sections/Table';\n\nimport { processLicense } from './licenseProcessor';\n\nexport cl...
javascript
chosen
[ { "from": "system", "value": "Use last_build_result instead of last_build_status\n" }, { "from": "human", "value": "define(\n [\n 'jquery',\n 'backbone',\n 'underscore',\n 'moment'\n ],\n function ($, Backbone, _, moment) {\n \"use strict\";\n\n ...
javascript
chosen
[ { "from": "system", "value": "Use history push instead of replace\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from \"react\"\nimport styles from \"./index.css\"\nimport { Treebeard } from \"react-treebeard\"\nimport treeStyle from \"./treeStyle\"\nimport decorators ...
javascript
chosen
[ { "from": "system", "value": "Drop if Contents post duplicates.\n" }, { "from": "human", "value": "'use strict';\n\nvar mongoose = require('mongoose');\n\nvar db = require('../config/db');\nvar helper = require('../lib/helper');\n\nvar ContentsScheme = new mongoose.Schema({\n\turl_id: String,\n\...
javascript
chosen
[ { "from": "system", "value": "Add handler for non-json requests\n" }, { "from": "human", "value": "let express = require('express');\nlet bodyParser = require('body-parser');\n\nlet index = require('./routes/index');\n\nlet app = express();\n\napp.use(bodyParser.json());\napp.use(bodyParser.urle...
javascript
chosen
[ { "from": "human", "value": "Add code for the smooth scroll on page\n" }, { "from": "gpt", "value": "$('a[href^=\"#\"]').on('click', function(event) {\n\tvar target = $(this.getAttribute('href'));\n\tif (target.length) {\n\t\tevent.preventDefault();\n\t\t$('html, body').stop().animate( {\n\t\t\t...
javascript
chosen
[ { "from": "system", "value": "Add url encoding/decoding and handle slack characters\n" }, { "from": "human", "value": "const logger = require('../logger')\r\n\r\nmodule.exports = (controller) => {\r\n\r\n controller.hears([/encode base64 (.*)$/i,], ['direct_message','direct_mention'], (bot, mes...
javascript
chosen
[ { "from": "system", "value": "Add explanation to spreadsheet title input\n" }, { "from": "human", "value": "import React from 'react';\nimport './Options.css';\n\nexport default class Options extends React.Component {\n\n constructor() {\n super();\n\n this.state = {\n filename: ''\n...
javascript
chosen
[ { "from": "system", "value": "Make the service worker get the payload from the server if the push message didn't contain any\n" }, { "from": "human", "value": "importScripts('localforage.min.js');\n\nself.addEventListener('push', function(event) {\n var data = event.data ? event.data.json() : n...
javascript
chosen
[ { "from": "system", "value": "Remove superfluous code from netflix example\n" }, { "from": "human", "value": "(function ( views ) {\n\n views.AppView = Backbone.View.extend({\n el : '#content',\n\n initialize : function () {\n\n var tags = this.collection;\n\n tags.on('add', thi...
javascript
chosen
[ { "from": "system", "value": "Revert \"move isCorrectUrl outside of findCorrectUrls\"\n\nThis reverts commit 6d3cc349eaba6ac2fa4671fd4a67111911c2ec48.\n" }, { "from": "human", "value": "const fetch = require('node-fetch');\nconst composeDictionaryEntry = require('./utils/composeDictionaryEntry.j...
javascript
chosen
[ { "from": "system", "value": "Fix amd part of umd to return r function correctly.\n" }, { "from": "human", "value": "function r() {\n\tvar strings = arguments[0];\t\t\t\t\t\t\t\t\t// template strings\n\tvar values = Array.prototype.slice.call(arguments, 1);\t// interpolation values \n\t\n\t// co...
javascript
chosen
[ { "from": "system", "value": "Add tests for onPress methods on add idea cell\n" }, { "from": "human", "value": "'use strict';\n\njest.disableAutomock();\n\nimport React, { View } from 'react-native';\nimport TestUtils from 'react-addons-test-utils';\nimport expect from 'expect';\n\nimport { Idea...
javascript
chosen
[ { "from": "system", "value": "Add store tags to settings\n" }, { "from": "human", "value": "import { AsyncStorage } from 'react-native';\n\nexport { MobileAppSettings } from './MobileAppSettings';\n\nexport const SETTINGS_KEYS = {\n APP_VERSION: 'AppVersion',\n CURRENT_LANGUAGE: 'CurrentLangua...
javascript
chosen
[ { "from": "system", "value": "Add ability to click on listing cards\n" }, { "from": "human", "value": "import React from 'react';\nimport { Card, Image, Icon } from 'semantic-ui-react';\nimport ListingDeleteModal from './ListingDeleteModal';\n\nconst getIconString = str => (\n str === 'home imp...
javascript
chosen
[ { "from": "system", "value": "Throw an error instead of killing the process\n" }, { "from": "human", "value": "var fs = require ('fs');\n\nvar logger = {\n\t_logFile: undefined,\n\tinitLog: function (logfile_, version_) {\n\t\tlogger._logFile = logfile_;\n\n\t\t// Clear the log\n\t\tfs.writeFile...
javascript
chosen
[ { "from": "system", "value": "Set reactive variable with chart data\n" }, { "from": "human", "value": "Template.homeReport.onCreated(function () {\n // get a reference to template instance\n const templateInstance = this;\n\n // set reactive variable to hold chart data (attached to template i...
javascript
chosen
[ { "from": "system", "value": "Fix last value disappearing when it coincides with completion\n" }, { "from": "human", "value": "import { Observable } from 'rxjs/Observable'\nimport { merge } from 'rxjs/observable/merge'\nimport { takeUntil } from 'rxjs/operator/takeUntil'\nimport { share } from '...
javascript
chosen
[ { "from": "system", "value": "Remove obsolete functions from NavigatorCtrl\n" }, { "from": "human", "value": "'use strict';\nangular.module('arethusa.core').controller('NavigatorCtrl', [\n '$scope',\n 'navigator',\n function ($scope, navigator) {\n $scope.next = function () {\n naviga...
javascript
chosen
[ { "from": "system", "value": "Make Google implicit grant redirect to the local Ember app\n" }, { "from": "human", "value": "/**\n * This class implements authentication against google\n * using the client-side OAuth2 authorization flow in a popup window.\n */\n\nimport Oauth2Bearer from 'torii/p...
javascript
chosen
[ { "from": "system", "value": "Change to reflect client service." }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(app) {\n\tvar users = require('../../app/controllers/users.server.controller');\n\tvar mal = require('../../app/controllers/mal.server.controller');\n\n\t//...
javascript
chosen
[ { "from": "system", "value": "Remove absolute path of source locations" }, { "from": "human", "value": "var path = require('path');\nvar jade = require('jade');\nvar normalize = require('./normalize');\n\n/**\n * A Metalsmith plugin to create HTTP redirections.\n *\n * @param {Object} files\n * ...
javascript
chosen
[ { "from": "system", "value": "Append settings hash to URL\n" }, { "from": "human", "value": "(function(Pebble, window) {\n var settings = {};\n\n Pebble.addEventListener(\"ready\", function(e) {\n settings = window.localStorage.getItem(\"settings\");\n if(settings !== '') {\n var op...
javascript
chosen
[ { "from": "system", "value": "Add mongoose settings for mongodb\n\nTo get rid of the deprication warnings in the logs and ensuring everything is still working as expected\n\nOHM-1058\n" }, { "from": "human", "value": "'use strict'\n\nimport mongoose from 'mongoose'\nimport uriFormat from 'mongod...
javascript
chosen
[ { "from": "system", "value": "Use lodash dependency in utility functions\n" }, { "from": "human", "value": "// --------------------\n// Sequelize hierarchy\n// Utility functions\n// --------------------\n\n// exports\n\nmodule.exports = function(Sequelize) {\n\tvar Utils = Sequelize.Utils,\n\t\t...
javascript
chosen