conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add a warning if breakpoints are still define in app.js\n" }, { "from": "human", "value": "import Media from 'ember-responsive/media';\n\n/**\n * An initializer that sets up `ember-responsive`.\n *\n * Refer to {{#crossLink \"Ember.Application.responsive\"}}{{/cross...
javascript
chosen
[ { "from": "system", "value": "Add cache-control max age to static content\n" }, { "from": "human", "value": "import path from 'path';\nimport renderApp from './renderApp.js';\nimport express from 'express';\nimport compression from 'compression';\nconst server = express();\nconst port = process....
javascript
chosen
[ { "from": "system", "value": "Add height and width defaults for mfr renderer\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport layout from './template';\nimport config from 'ember-get-config';\n\nexport default Ember.Component.extend({\n layout,\n download: null,\n m...
javascript
chosen
[ { "from": "system", "value": "[Rules] Hide Google search top ads\n" }, { "from": "human", "value": "var advertisingCSSRules = [{\n \"trigger\": {\n \"url-filter\": \".*\"\n },\n \"action\": {\n \"type\": \"css-display-none\",\n \"selector\":\n \".ad-promotions-container,\\\n ...
javascript
chosen
[ { "from": "system", "value": "Return type to working one\n" }, { "from": "human", "value": "FileBrowserHelper = {\n markItUp: false,\n\n show: function(markItUp, type) {\n this.markItUp = markItUp\n var textarea_id = $(markItUp.textarea).attr('id');\n FileBrowser.show(...
javascript
chosen
[ { "from": "system", "value": "Add test for single addIvar call. For some reason this fixes the segfault from before... WTF...\n" }, { "from": "human", "value": "var $ = require('../')\n , assert = require('assert')\n\n$.import('Foundation')\n$.NSAutoreleasePool('alloc')('init')\n\n// Subclass '...
javascript
chosen
[ { "from": "system", "value": "BB-4210: Add validation functionality to RuleEditorComponent\n- extended typeahead plugin;\n- changed autocomplete init script;\n- added typeahead behavior ащк empty value;\n" }, { "from": "human", "value": "define(function(require) {\n 'use strict';\n\n var $...
javascript
chosen
[ { "from": "system", "value": "Fix ember test and remove bind syntax\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nvar SubRowArray = Ember.ArrayController.extend({\n init: function() {\n this._super();\n var oldObject = this.get('oldObject');\n if (oldObject) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing semicolon for ES7" }, { "from": "human", "value": "'use strict';\n\nimport React, {\n Platform,\n StyleSheet,\n View,\n} from 'react-native';\n\nimport Layout from './Layout';\n\nexport default class TabBar extends React.Component {\n static propType...
javascript
chosen
[ { "from": "system", "value": "Test that __proto__ is indexed across two serializations\n\nI found while using lunr that __proto__ can slip through the\nserialization process if you're serializing an index that was\nitself loaded from a serialized index - it might not be a bad idea\nto make sure that seriali...
javascript
chosen
[ { "from": "system", "value": "Add working redirection for Java SE documentation\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Redirect to up to date documentation\n// @namespace sieradzki.it\n// @description Detects if currently viewed online documentation page is the m...
javascript
chosen
[ { "from": "system", "value": "Update image upload button styling\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport actions from '../actions/index.js';\nimport { fetchFPKey } from '../utils/utils';\nconst filepicker = requ...
javascript
chosen
[ { "from": "system", "value": "Fix coverage to cover all files\n" }, { "from": "human", "value": "module.exports = function (config) {\n config.set({\n basePath: '../..',\n frameworks: ['jasmine'],\n files: [\n // Angular libraries\n 'lib/angular.js',...
javascript
chosen
[ { "from": "system", "value": "Make it not expect json\n" }, { "from": "human", "value": "$( document ).ready( function() {\n function showUploadedImage( source ) {\n $( \"#userImage\" ).attr( \"src\", source );\n }\n $( \"#image-form\" ).submit( function() {\n var image = ...
javascript
chosen
[ { "from": "system", "value": "Patch hot fix to work on mobile\n" }, { "from": "human", "value": "/**\n * Created by tom on 08/07/16.\n */\n\nlet location = window.location;\nlet isWebsite = location.protocol.indexOf('http') !== -1 && location.host.indexOf('localhost') === -1;\n\nif(!isWebsite) {...
javascript
chosen
[ { "from": "system", "value": "Switch to example to localhost uppy-server\n" }, { "from": "human", "value": "import { Core,\n Dummy,\n Dashboard,\n GoogleDrive,\n Webcam,\n Tus10,\n MetaData,\n Informer } from '../src/index.js'\n\n// import ...
javascript
chosen
[ { "from": "system", "value": "Hide user deletion for non-admins.\n" }, { "from": "human", "value": "// Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0.\n\n$(document).ready(function () {\n 'use strict';\n\n var hideDownloadsForAnon = function () {\n if (js...
javascript
chosen
[ { "from": "system", "value": "Clean up and remove stub\n" }, { "from": "human", "value": "(function(bitcoinWorker, Models) {\n\n function KeyPair() {\n self = this;\n\n self.isGenerated = false;\n\n // self.bitcoin_worker = new Worker('/js/workers/bitcoin_worker.js');\n // self.bitc...
javascript
chosen
[ { "from": "system", "value": "Correct the order of css loaders.\n" }, { "from": "human", "value": "const path = require(\"path\");\n\nmodule.exports = {\n entry: \"./src/index.js\",\n output: {\n filename: \"bundle.js\",\n path: path.resolve(__dirname, \"dist\")\n },\n module: {\n r...
javascript
chosen
[ { "from": "system", "value": "Fix import to update widget action\n" }, { "from": "human", "value": "import { connect } from 'react-redux'\nimport { asyncUpdateWidget as update } from '../action-creators'\nimport Widget from './widget'\n\nconst mapStateToProps = (state, props) => ({\n saving: sta...
javascript
chosen
[ { "from": "system", "value": "Change to prevent livereload from dying on certain file changes.\n" }, { "from": "human", "value": "/**\r\n * Run predefined tasks whenever watched file patterns are added, changed or deleted.\r\n *\r\n * -------------------------------------------------------------...
javascript
chosen
[ { "from": "system", "value": "Fix new route after new ember-data\n" }, { "from": "human", "value": "(function() {\n \"use strict\";\n \n App.PostsNewRoute = Ember.Route.extend({\n actions: {\n willTransition: function(transition) {\n var record = this.get('controller.content');...
javascript
chosen
[ { "from": "system", "value": "Add control-panel asset & initial specs\n" }, { "from": "human", "value": "/*global window*/\n/*global angular*/\n/*global ___socket___*/\n(function (window, socket) {\n \"use strict\";\n\n var app = angular.module(\"BrowserSync\", []);\n\n /**\n * Sock...
javascript
chosen
[ { "from": "system", "value": "Add CSS for moving cards down a little\n" }, { "from": "human", "value": "'use strict';\n\nconsole.log('\\'Allo \\'Allo! Content script');\n\n// https://gist.github.com/dkniffin/b6f5dd4e1bde716e7b32#gistcomment-1980578\nfunction toggle_visibility(data_id) {\n var...
javascript
chosen
[ { "from": "system", "value": "Reset prefs that are not explicitly passed into setPrefs\n\ngit-svn-id: 6772fbf0389af6646c0263f7120f2a1d688953ed@5182 e969d3be-0e28-0410-a27f-dd5c76401a8b\n" }, { "from": "human", "value": "/* See license.txt for terms of usage */\nvar Format = {};\nComponents.utils...
javascript
chosen
[ { "from": "system", "value": "Enforce order of tests when running all.\n" }, { "from": "human", "value": "module.exports = {\n\toptions: { reporter: 'spec' },\n\tall: { src: 'test/*-test.js' },\n\tapp: { src: 'test/app-test.js' },\n\tnode: { src: 'test/node-test.js' },\n\tnodeServer: { src: 'te...
javascript
chosen
[ { "from": "system", "value": "Move content scripts to own dir\n" }, { "from": "human", "value": "const path = require('path')\nconst CopyWebpackPlugin = require('copy-webpack-plugin')\n\nconst BUILD_DIR = path.resolve(__dirname, 'build')\n\nmodule.exports = {\n entry: {\n 'content_script/das...
javascript
chosen
[ { "from": "system", "value": "Allow build with no env file" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp');\nvar env = require('node-env-file');\nenv(\".env\");\n\nvar paths = gulp.paths;\n\nvar $ = require('gulp-load-plugins')();\n\ngulp.task('scripts', function () ...
javascript
chosen
[ { "from": "system", "value": "Handle ajax errors, don't show 'no content'\n" }, { "from": "human", "value": "var dataSource = function () {\n var module = {};\n\n module.load = function (url, callback) {\n d3.json(url, function (_, data) {\n callback(data);\n });\n...
javascript
chosen
[ { "from": "system", "value": "Add condition for one bottle\n\nIt will now print -\r\n\"2 bottles of beer on the wall, 2 bottles of beer.\r\nTake one down and pass it around, 1 bottle of beer on the wall.\r\n1 bottle of beer on the wall, 1 bottle of beer.\"\r\ninstead of -\r\n\"2 bottles of beer on the wall,...
javascript
chosen
[ { "from": "system", "value": "Add timer and remove confirm buttonk, overall cleanup for better ux\n" }, { "from": "human", "value": "var deleteOpenSession = function(timeslot_id){\n event.preventDefault();\n $(\"#modal_remote\").modal('hide');\n swal({\n title: \"Are you sure you wish to...
javascript
chosen
[ { "from": "system", "value": "Add default case for switch (web)\n" }, { "from": "human", "value": "import i18n from 'i18next';\n\nconst $app = document.getElementById('app');\n\nclass StoreSettings {\n\t\n\tdata = {}\n\t\n\tdefaultData = {\n\t\tlang: i18n.languages[0] || 'en',\n\t\ttheme: 'light...
javascript
chosen
[ { "from": "system", "value": "Add \"X-Molotov-Agent\" header on authentication token refresh requests.\n" }, { "from": "human", "value": "chrome.webRequest.onBeforeSendHeaders.addListener(\n function(details) {\n details.requestHeaders.push({\n name: \"X-Molotov-Agent\",\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the deserializer when no relationships is present.\n" }, { "from": "human", "value": "'use strict';\nvar _ = require('lodash');\nvar P = require('bluebird');\nvar humps = require('humps');\nvar Schemas = require('../generators/schemas');\n\nfunction ResourceDese...
javascript
chosen
[ { "from": "system", "value": "Change initial default showResult value to 'NO DATA' message\n" }, { "from": "human", "value": "import React from 'react';\nimport GithubAPI from '../../api/githubAPI';\n\nclass HomePage extends React.Component {\n constructor(props, context) {\n super(props, co...
javascript
chosen
[ { "from": "system", "value": "Enable external component e2e on Android\n" }, { "from": "human", "value": "const Utils = require('./Utils');\nconst testIDs = require('../playground/src/testIDs');\n\nconst { elementByLabel, elementById } = Utils;\n\ndescribe('complex layout', () => {\n beforeEach...
javascript
chosen
[ { "from": "system", "value": "Use proper page sizes again\n" }, { "from": "human", "value": "// @flow\n\nexport const PIPELINES_INITIAL_PAGE_SIZE = 2;\nexport const PIPELINES_PAGE_SIZE = 2;\n" }, { "from": "gpt", "value": "// @flow\n\nexport const PIPELINES_INITIAL_PAGE_SIZE = 30;\ne...
javascript
chosen
[ { "from": "system", "value": "Test work of API communication\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular\n .module('scrum_retroboard')\n .controller('UserController', ['$scope', '$http', 'sessionService', 'userService', UserController]);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix handler only checking https protocol\n" }, { "from": "human", "value": "chrome.tabs.onUpdated.addListener(\n function(tabId, changeInfo, tab) {\n var url = tab.url;\n if (url.indexOf('https://www.bing.com/maps/default.aspx') == 0 && changeInfo.s...
javascript
chosen
[ { "from": "system", "value": "Use string interpolation in toString functions" }, { "from": "human", "value": "'use strict';\n\nclass Character {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n this.health_ = 100;\n }\n damage() {\n this.health_ -= 10;\n }\n getHealth() {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug in ticket revoke controller.\n" }, { "from": "human", "value": "angular.module('billett.admin').controller('AdminTicketRevokeController', function ($http, $modalInstance, order, ticket) {\n var ctrl = this;\n ctrl.order = order;\n ctrl.ticket = tick...
javascript
chosen
[ { "from": "system", "value": "Improve login page when wrong password is entered\n" }, { "from": "human", "value": "//\n// Copyright 2014 Ilkka Oksanen <iao@iki.fi>\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance w...
javascript
chosen
[ { "from": "system", "value": "Enable cache for 'get' API call to /cards\n" }, { "from": "human", "value": "export default class BaseApiService {\n\tconstructor($http, $log, appConfig, path) {\n\t\t'ngInject';\n\n\t\tthis.$http = $http;\n\t\tthis.$log = $log;\n\n\t\tthis._ = _;\n\n\t\tthis.host =...
javascript
chosen
[ { "from": "system", "value": "Make swift DAOProperties be of type (DAO & FObject)\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2017 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.CLASS({\n refines: 'foam.dao.AbstractDAO',\...
javascript
chosen
[ { "from": "system", "value": "Remove ] from connection string.\n" }, { "from": "human", "value": "var pg = require(\"pg\");\nvar Config = require(\"./config\");\nvar Util = require(\"util\");\n\nvar conString = Util.format(\"postgres://%s:%s@%s:%s/%s]\", Config.postgres.username, Config.postgres...
javascript
chosen
[ { "from": "system", "value": "Fix settings for username and email\n" }, { "from": "human", "value": "// Configure Accounts UI for our specific user schema\nimport { Accounts } from 'meteor/accounts-base';\n\nAccounts.ui.config({\n requestPermissions: {},\n extraSignupFields: [{\n fi...
javascript
chosen
[ { "from": "system", "value": "Remove use of deprecated getWithDefault" }, { "from": "human", "value": "import { getWithDefault } from '@ember/object';\nimport IntercomService from 'ember-intercom-io/services/intercom';\nimport cfg from '../config/environment';\n\nexport default IntercomService.e...
javascript
chosen
[ { "from": "system", "value": "Add dirty-flag extension for knockout\n" }, { "from": "human", "value": "define([\n 'knockout',\n 'knockout-mapping',\n 'knockout-arraytransforms',\n 'knockout-validation'\n], function(ko) {\n return ko;\n})" }, { "from": "gpt", "value": "...
javascript
chosen
[ { "from": "system", "value": "Add layers animation and fadeIn\n" }, { "from": "human", "value": "function createMenuItem(parentSelector,menuData){\n var menuListItem=document.createElement('li');\n $(menuListItem).addClass(menuData.class).appendTo(parentSelector);\n var menuLink=documen...
javascript
chosen
[ { "from": "system", "value": "Save off the access token in our property\n" }, { "from": "human", "value": "'use babel';\n\nimport {component} from './polymer-es6';\nimport _ from 'lodash';\n\nconsole.log(\"AT LOGIN\");\n\n@component('at-login')\nexport class AtomTwitchLogin {\n static propertie...
javascript
chosen
[ { "from": "system", "value": "Add more keycodes used in cms\n\nSRFCMSAL-2597\n" }, { "from": "human", "value": "export const KEYCODES = {\n 'enter': 13,\n 'tab': 9,\n 'space': 32,\n 'escape': 27,\n 'up': 38,\n 'down': 40\n};\n" }, { "from": "gpt", "value": "export c...
javascript
chosen
[ { "from": "system", "value": "Remove 1000ms wait for page load\n" }, { "from": "human", "value": "/* eslint-env phantomjs */\n\nvar system = require('system');\nvar webpage = require('webpage');\n\nvar page = webpage.create();\nvar ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) ' +\n ...
javascript
chosen
[ { "from": "system", "value": "Set up skeleton and style css\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDom from 'react-dom';\nimport { Route, Router, browserHistory } from 'react-router';\n\nimport \"./vendor/css/skeleton_css/normalize.css\"\nimport \"./vendor/css...
javascript
chosen
[ { "from": "system", "value": "Disable browser history for static site\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport Root from 'components/Root';\nimport configureStore from './stores';\nimport createBrowserHistory from 'history/lib/creat...
javascript
chosen
[ { "from": "system", "value": "Set user's name as anonymous if no name is specified\n" }, { "from": "human", "value": "/**\n * 24.05.2017\n * TCP Chat using NodeJS\n * https://github.com/PatrikValkovic/TCPChat\n * Created by patri\n */\n'use strict'\n\nconst net = require('net')\nconst log = requ...
javascript
chosen
[ { "from": "system", "value": "Add source map for SASS\n" }, { "from": "human", "value": "'use strict'\n\nimport { defaults } from 'lodash'\nimport { extractStyles, styleLoader } from './helpers'\n\nexport default function ({ isClient }) {\n let babelOptions = JSON.stringify(defaults(this.option...
javascript
chosen
[ { "from": "system", "value": "Support for Redux DevTools Extension\n" }, { "from": "human", "value": "import {\n applyMiddleware,\n combineReducers,\n compose,\n createStore as createReduxStore\n} from 'redux'\n\nconst makeRootReducer = (reducers, asyncReducers) => {\n // Redux + ...
javascript
chosen
[ { "from": "system", "value": "FIX bug on stylesheets without href\n" }, { "from": "human", "value": "module.exports = {\n\t// Tools for client side\n\taddStyleSheet: function(url) {\n\t\tif (document) {\n\t\t\tvar link = document.createElement(\"link\");\n\t\t\tlink.type = \"text/css\";\n\t\t\tl...
javascript
chosen
[ { "from": "system", "value": "Add a trailing slash to the URL.\n" }, { "from": "human", "value": "var shell = require('shelljs');\nvar parseGitUrl = require('git-url-parse');\n\nmodule.exports.exec = function exec(command) {\n console.log(\" executing: \" + command);\n const options = { sile...
javascript
chosen
[ { "from": "system", "value": "Add a 'context' parameter to util functions, so we don't rely on a global 'document'.\n" }, { "from": "human", "value": "import VNode from 'snabbdom/vnode';\n\nexport function createTextVNode(text) {\n return VNode(undefined, undefined, undefined, unescape(text))...
javascript
chosen
[ { "from": "system", "value": "Integrate UI Datepicker into VisualSearch.js\n" }, { "from": "human", "value": "$(function () {\n VS.init({\n remainder : null,\n container : $('.visual_search'),\n query : '',\n unquotable: ['day', 'date'],\n callbacks : {\n facetMatches: f...
javascript
chosen
[ { "from": "system", "value": "Use then instead of success on promise.\n" }, { "from": "human", "value": "(function() {\n angular.module('marvelousnote.notes')\n .service('NotesService', NotesService);\n\n NotesService.$inject = ['$http'];\n function NotesService($http) {\n var service =...
javascript
chosen
[ { "from": "system", "value": "Make timeline view a global for debugging.\n" }, { "from": "human", "value": "// Copyright (c) 2011 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(function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add a profile link which allow users to control the redirection\n" }, { "from": "human", "value": "require('dotenv').config()\n\nimport {version} from '../package.json'\nimport path from 'path'\n\nimport Koa from 'koa'\nimport Route from 'koa-route'\nimport Serve fr...
javascript
chosen
[ { "from": "system", "value": "Fix for opacity issues on browsers\n" }, { "from": "human", "value": "HTMLWidgets.widget({\n\n name: \"sigma\",\n \n type: \"output\",\n \n initialize: function(el, width, height) {\n \n // create our sigma object and bind it to the element\n var sig = ...
javascript
chosen
[ { "from": "system", "value": "Remove publish-event from course serializer\n" }, { "from": "human", "value": "import { moduleForModel, test } from 'ember-qunit';\nimport {a as testgroup} from 'ilios/tests/helpers/test-groups';\n\nmoduleForModel('course', 'Unit | Serializer | course ' + testgroup,...
javascript
chosen
[ { "from": "system", "value": "Add chapter 7, exercise 2\n" }, { "from": "human", "value": "function getTurnCount(state, robot, memory) {\n for (let turn = 0;; turn++) {\n if (state.parcels.length == 0 || turn > 50) {\n return turn;\n }\n let action = robot(stat...
javascript
chosen
[ { "from": "system", "value": "Fix a mistake about cron jobs\n" }, { "from": "human", "value": "'use strict'\n\nconst AV = require('leancloud-storage')\nconst schedule = require('node-schedule')\n\nconst APP_ID = 'yzbpXQpXf1rWVRfAAM8Durgh-gzGzoHsz'\nconst APP_KEY = '020bjTvbiVinVQ21YtWAJ9t8'\ncon...
javascript
chosen
[ { "from": "system", "value": "Optimize formatting of main file\n" }, { "from": "human", "value": "/*global\n define,\n require,\n window,\n console,\n _\n*/\n/*jslint devel:true,\n white: true\n */\ndefine([\n 'jquery',\...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error which causes redeclaration of a variable.\n" }, { "from": "human", "value": "'use strict';\n\nvar expect = require('chai').expect,\n config = require('../../../config/config');\n\ndescribe('config', function () {\n\n describe('getConfig', func...
javascript
chosen
[ { "from": "system", "value": "Create real channel object in tests\n" }, { "from": "human", "value": "var EventEmitter = require(\"events\").EventEmitter;\nvar util = require(\"util\");\nvar _ = require(\"lodash\");\nvar express = require(\"express\");\nvar Network = require(\"../src/models/netwo...
javascript
chosen
[ { "from": "system", "value": "Send response while database is still updating\n" }, { "from": "human", "value": "const slaveService = require('../services/slave');\nconst versionService = require('../services/version');\n\nconst version = {\n currentVersion(req, res) {\n const {slaveUID...
javascript
chosen
[ { "from": "system", "value": "Add query strings to the anchor\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Language switcher for Microsoft Docs\n// @namespace curipha\n// @description Add language menu\n// @include https://docs.microsoft.com/*\n// @vers...
javascript
chosen
[ { "from": "system", "value": "no_right_click: Add JSDoc and use addEventListener\n" }, { "from": "human", "value": "\nwindow.oncontextmenu = function() {return false;};\n\n" }, { "from": "gpt", "value": "/**\n * Disables context menus, including those initiated by a right click.\n */...
javascript
chosen
[ { "from": "system", "value": "Add high level getter/setter for executionOn attr\n" }, { "from": "human", "value": "define([\n 'app/models/base',\n 'app/validations/trade'\n ], function (BaseModel, validation) {\n return BaseModel.extend({\n defaults: {\n 'executionOn': null,\n ...
javascript
chosen
[ { "from": "system", "value": "feat/webview: Mark safe as a secure protocol\n\nChrom(e|ium) exposes many newer DOM APIs and HTML5 features (like User Media or Geolocation)\nonly over secure connections – primarily https – in order to prevent the user from\naccidentially exposing themselves to third parties. ...
javascript
chosen
[ { "from": "system", "value": "Remove return value from sample, it's not doing anything" }, { "from": "human", "value": "import { props, shadow, withUpdate } from 'skatejs';\n\nclass WithUpdate extends withUpdate() {\n static get props() {\n return {\n name: props.string\n };\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Rename on to bind, add unbind\n" }, { "from": "human", "value": "/**\n * Event\n *\n * @author Rakume Hayashi<i@fake.moe>\n */\n\nFaiash.ise.extend({\n on: function() {\n if (typeof arguments[0] === 'string') {\n for (var i = 0; i < this.length;...
javascript
chosen
[ { "from": "system", "value": "Break dep cycle, allow most to use mostjs/multicast\n" }, { "from": "human", "value": "import {Stream} from 'most'\nimport MulticastSource from './MulticastSource'\n\nfunction multicast (stream) {\n const source = stream.source\n return source instanceof Multicast...
javascript
chosen
[ { "from": "system", "value": "Bring back `render` to module\n" }, { "from": "human", "value": "// Configuration\nexport {default as configure} from './configure';\nexport {default as configureRoutes} from './configureRoutes';\n\n// Components\nexport {default as Card} from './components/Card/Car...
javascript
chosen
[ { "from": "system", "value": "Fix style loading in production.\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport {Router, browserHistory} from 'react-router'\nimport configureStore from './store'\nimport {Provider} from 'react-redux'\nimport {...
javascript
chosen
[ { "from": "system", "value": "Fix import path after file move.\n" }, { "from": "human", "value": "import Component from './src/component';\nimport PureComponent from './src/pureComponent';\n\nexport default {\n\tComponent,\n\tPureComponent,\n};\n" }, { "from": "gpt", "value": "import...
javascript
chosen
[ { "from": "system", "value": "Add tests for error handling\n" }, { "from": "human", "value": "\"use strict\";\n\nvar assert = require('assert');\nvar CryptoApi = require('../lib/crypto-api');\nvar hex = require('../lib/enc.hex');\nvar md2 = require('../lib/hasher.md2');\nvar md4 = require('../li...
javascript
chosen
[ { "from": "system", "value": "refactor(database): Add device info to beacon\n\nAdd device info to beacon\n" }, { "from": "human", "value": "const Sequelize = require('sequelize');\nconst db = require('../db.js');\n\nconst beacon = db.define('beacon', {\n currentLocation: {\n type: Sequelize....
javascript
chosen
[ { "from": "system", "value": "Allow passing more params to trackPageView\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Mixin.create({\n init: function() {\n this._super();\n if(!this.hasAnalytics()) {\n Ember.Logger.warn('Segment.io is not load...
javascript
chosen
[ { "from": "system", "value": "Update documentation for Route53 service\n" }, { "from": "human", "value": "/**\n * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You\n * may not use this file e...
javascript
chosen
[ { "from": "system", "value": "[leap] Add method to determine if hand is mocked\n" }, { "from": "human", "value": "'use strict'\n\nconst path = require('path')\nconst { config } = require(path.join(__dirname, '..', '..', 'main.config.js'))\n\nmodule.exports = class MockHand {\n constructor (norm...
javascript
chosen
[ { "from": "system", "value": "Use modified time instead of creation time when copying folders\n" }, { "from": "human", "value": "var fs = require('fs-extra');\n\nexports.newer = function(src, dest) {\n var srcTime = 0;\n try {\n var srcTime = fs.statSync(src).ctime.getTime();\n } catch ...
javascript
chosen
[ { "from": "system", "value": "Fix loading of socket.io.js when in development mode\n" }, { "from": "human", "value": "var fs = require('fs'),\n _ = require('lodash'),\n yaml = require('js-yaml'),\n bundles = yaml.safeLoad(fs.readFileSync('bundles.yml', 'utf8')),\n settings = require(...
javascript
chosen
[ { "from": "system", "value": "Fix linting issues and duplicate check for components and sections\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { setComponentsNames, globalizeComponents, promoteInlineExamples, flattenChildren } from './ut...
javascript
chosen
[ { "from": "system", "value": "Move try-catch into the parsing logic, and display errors into the\noutput.\n" }, { "from": "human", "value": "import functionalText from \"functional-text\";\n\nwindow.addEventListener(\"DOMContentLoaded\", function () {\n let inputNode = document.querySelector(...
javascript
chosen
[ { "from": "system", "value": "Update React app entry point:\nAdd middleware to the project\nUse redux-thunk lib\nApplies middleware and use it as store\n" }, { "from": "human", "value": "import React from 'react';\nimport { render } from 'react-dom';\nimport { createStore } from 'redux';\nimport...
javascript
chosen
[ { "from": "system", "value": "Update App rendering to comply with React 0.14\n" }, { "from": "human", "value": "import React from 'react';\nimport App from './app/App';\n\nReact.render(<App />, document.body);\n" }, { "from": "gpt", "value": "import React from 'react';\nimport ReactD...
javascript
chosen
[ { "from": "system", "value": "Allow loading of local and global plugins\n" }, { "from": "human", "value": "import glob from 'glob'\nimport path from 'path'\nimport Dns from './dns'\nimport { name as packageName } from '../package.json'\n\nexport default () => {\n const dns = new Dns()\n\n // L...
javascript
chosen
[ { "from": "system", "value": "Add support to old module.exports (webpack has issue with it)\n" }, { "from": "human", "value": "import R from 'ramda';\nimport And from './and';\nimport Or from './or';\nimport Conjunction from './conjunction';\n\n/**\n * Check if the given object is an object-like...
javascript
chosen
[ { "from": "system", "value": "Fix test to pass model not nothing\n\nWe were passing a value that doesn't exist and we need to pass the model\ninto administeredSchools.\n" }, { "from": "human", "value": "import { currentURL, visit } from '@ember/test-helpers';\nimport { module, test } from 'qunit...
javascript
chosen
[ { "from": "system", "value": "Fix bug with Board not realizing it's in a thread view\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Router, Route, browserHistory } from 'react-router';\nimport App from './App';\nimport Board from './Boa...
javascript
chosen
[ { "from": "system", "value": "Set log level to info only in production\n" }, { "from": "human", "value": "export default {\n name: 'Apollo Starter Kit',\n logging: {\n level: 'info',\n debugSQL: false,\n apolloLogging: ['production'].indexOf(process.env.NODE_ENV) < 0\n },\n // Check...
javascript
chosen
[ { "from": "system", "value": "Add token and client reference to box-view mock\n" }, { "from": "human", "value": "var extend = require('extend')\n\nvar bv, createClient\n\nmodule.exports.mock = function (mocks) {\n var boxview = 'box-view'\n bv = require(boxview)\n createClient = bv.createClie...
javascript
chosen
[ { "from": "system", "value": "Add check for root variable in Trie\n" }, { "from": "human", "value": "var Trie = require('../app/trie');\n\ndescribe('Trie', function() {\n var trie;\n\n beforeEach(function() {\n trie = new Trie();\n });\n\n it('should be an object', function() {\n expec...
javascript
chosen