conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix downloaded file has invisible characters issue\n" }, { "from": "human", "value": "/**\n * Created by liuxizi.xu on 2/2/17.\n */\n'use strict';\n/*global angular:false */\n\nangular.module('argus.services.downloadHelper', [])\n.service('DownloadHelper', function ...
javascript
chosen
[ { "from": "system", "value": "Remove TODO that was completed.\n" }, { "from": "human", "value": "/**\n * Flint\n * By: Ivan Montiel\n *\n * TODO support reference checks\n * TODO support cancelling by using `new Flint();`\n */\n(function () {\n /**\n * Wait for globals to be defined by other ...
javascript
chosen
[ { "from": "system", "value": "Fix: Add debug logging for Acorn parsing errors\n" }, { "from": "human", "value": "// @flow\nimport { Parser, type AcornNode } from 'acorn';\n\nexport const ACORN_OPTIONS = {\n\tecmaVersion: 2019,\n\tsourceType: 'module',\n};\n\n/**\n * Parse source code with Acorn ...
javascript
chosen
[ { "from": "system", "value": "Divide test into single-it tests\n" }, { "from": "human", "value": "'use strict';\n\ndescribe('SimulationService', function () {\n describe('sortDroits', function() {\n var DROITS_DESCRIPTION = { acs: { id: 'acs' }, apl: { id: 'apl' }};\n var servic...
javascript
chosen
[ { "from": "system", "value": "Join error path from Joi\n\n* Breaking change after update to 11.0.0 - https://github.com/hapijs/joi/issues/1302\n" }, { "from": "human", "value": "import HttpStatus from 'http-status-codes';\n\n/**\n * Build error response for validation errors.\n *\n * @param {er...
javascript
chosen
[ { "from": "system", "value": "Refactor router lookup in tests\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport { module, test } from 'qunit';\nimport startApp from '../helpers/start-app';\n\nvar application;\n\nmodule('Acceptance: DocumentTitle', {\n beforeEach: function() ...
javascript
chosen
[ { "from": "system", "value": "Set up email templates for the accounts package only if email delivery is enabled\n" }, { "from": "human", "value": "import { Accounts } from 'meteor/accounts-base';\nimport {GlobalSettings} from './GlobalSettings';\n\nAccounts.emailTemplates.siteName = GlobalSettin...
javascript
chosen
[ { "from": "system", "value": "Remove i18n of the JS daterange filter\n" }, { "from": "human", "value": "import moment from 'moment';\nimport granularities from 'models/geogranularities';\nimport frequencies from 'models/frequencies';\nimport resource_types from 'models/resource_types';\n\nexport...
javascript
chosen
[ { "from": "system", "value": "Add search for a user to later modify a profile\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\n\nvar User = require('../models/user');\n\nmodule.exports = function(app, mountPoint) {\n router.get('/', function(...
javascript
chosen
[ { "from": "system", "value": "Remove root store from datapoint store\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport Reflux from 'reflux'\nimport StateMixin from'reflux-state-mixin'\nimport DatapointActions from 'actions/DatapointActions'\n\nvar DatapointStore = Reflux.createSt...
javascript
chosen
[ { "from": "system", "value": "Make sure that pressing Escape doesn't close the pop-up when there is a cancel button - at least in Chrome\n" }, { "from": "human", "value": "/*\n * This Source Code is subject to the terms of the Mozilla Public License\n * version 2.0 (the \"License\"). You can obt...
javascript
chosen
[ { "from": "system", "value": "Fix the vote buttons which weren't appearing when signed in\n\nThis fixes a bug whereby the vote buttons were not appearing on proposal pages even if you were signed in.\n" }, { "from": "human", "value": "import Ember from \"ember\";\nimport ENV from '../../config/e...
javascript
chosen
[ { "from": "system", "value": "Fix ERROR in Path must be a string. Received undefined\n\nthis error happens when user omits pattern.to property\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport path from 'path';\n\nexport default (pattern) => {\n const filename = pattern.to;\n...
javascript
chosen
[ { "from": "system", "value": "Update publications for the home page\n" }, { "from": "human", "value": "// Publication who send back everything, use it carrefully\nMeteor.publish('games', function() {\n\treturn Games.find();\n});\n\n// Publication who send back the last 3 live games\nMeteor.publi...
javascript
chosen
[ { "from": "system", "value": "Move modernizr to front of js\n" }, { "from": "human", "value": "---\n---\n\n{% include bower_components/moment/min/moment.min.js %}\n{% include bower_components/fullcalendar/dist/fullcalendar.min.js %}\n{% include js/jquery.jqgoogleforms.min.js %}\n{% include bower...
javascript
chosen
[ { "from": "system", "value": "Include relationship on forwards index\n" }, { "from": "human", "value": "function(doc) {\n if(doc.doc_type == \"CommCareCase\") {\n if (doc.indices) {\n for (var i = 0; i < doc.indices.length; i++) {\n emit([doc.domain, doc._id, ...
javascript
chosen
[ { "from": "system", "value": "Update gallery ctrl with responsive service\n" }, { "from": "human", "value": "angular.module('controllers', [])\n\n.controller('NavCtrl', function ($scope, $state) {\n\n $scope.state = $state.current.name\n\n})\n\n.controller('GalleryCtrl', function ($scope, json,...
javascript
chosen
[ { "from": "system", "value": "Add is_admin property to user migration.\n" }, { "from": "human", "value": "\nexports.up = knex =>\n knex.schema.createTable('user', (table) => {\n table.increments('id');\n table.string('username').unique().notNullable();\n table.string('name');\n tabl...
javascript
chosen
[ { "from": "system", "value": "Fix bug with input int and float not letting user enter nothing\n" }, { "from": "human", "value": "import React from 'react';\nimport {Router} from 'react-router'\nimport routes from '../shared/routes/Routes';\nimport configureStore from '../shared/redux/store/Store...
javascript
chosen
[ { "from": "system", "value": "Update simple demo to use center, not pos" }, { "from": "human", "value": ";(function(exports) {\n var Game = function(autoFocus) {\n var coq = new Coquette(this, \"canvas\", 500, 150, \"#000\", autoFocus);\n\n coq.entities.create(Person, { pos:{ x:250, y:40 ...
javascript
chosen
[ { "from": "system", "value": "Clear form scope on success\n" }, { "from": "human", "value": "/* global angular */\n(function () {\n \"use strict\";\n angular\n .module(\"helloApp.controllers\", [])\n .controller(\"signUpCtrl\", signUpController);\n\n signUpController.$inj...
javascript
chosen
[ { "from": "system", "value": "Modify redux tool loading to work w/Jest\n" }, { "from": "human", "value": "import thunkMiddleware from 'redux-thunk'\nimport { createStore, applyMiddleware, compose } from 'redux'\nimport rootReducer from './reducers'\n\n// import { createLogger } from 'redux-logge...
javascript
chosen
[ { "from": "system", "value": "Check in Chai assertions that they have been given TestMongo\n" }, { "from": "human", "value": "import isEqual from 'lodash/isEqual'\n\nimport { collectionAttachedSchema } from '../schemaHelper'\n\n\nconst collectionLabel = collection =>\n collection._name ? `colle...
javascript
chosen
[ { "from": "system", "value": "Fix bug when the input field can't access value\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n tagName: 'input',\n\n setupBootstrapDatepicker: function() {\n var self = this,\n element = this.$(...
javascript
chosen
[ { "from": "system", "value": "Fix checking if array contains a string\n" }, { "from": "human", "value": "import queryString from 'query-string';\n\nexport const getFromQuery = (key, defaultValue = null) => {\n let value = queryString.parse(location.search)[key];\n return value || defaultValue;...
javascript
chosen
[ { "from": "system", "value": "Include the app icon in the osx build\n" }, { "from": "human", "value": "module.exports = {\n\toptions\t\t\t: {\n\t\tbuildDir\t\t: \"build/releases\",\n\t\tcacheDir\t\t: \"build/cache\",\n\t\tversion\t\t\t: \"<%= package.config['node-webkit-version'] %>\"\n\t},\n\tw...
javascript
chosen
[ { "from": "system", "value": "Fix test by allowing empty index\n" }, { "from": "human", "value": "import _ from 'underscore'\nimport search from 'api/lib/elasticsearch.coffee'\nimport { matchAll } from 'api/apps/search/queries'\nconst { NODE_ENV } = process.env\n\n// GET /api/search\nexport cons...
javascript
chosen
[ { "from": "system", "value": "Enable tests, disabled in prev commit\n" }, { "from": "human", "value": "'use strict';\n\n\ndescribe.only('babelmark responder app', function () {\n var app;\n\n var PORT = 5005;\n var request = require('supertest')('http://127.0.0.1:' + PORT);\n\n\n before(f...
javascript
chosen
[ { "from": "system", "value": "Fix banning to insert to correct table\n" }, { "from": "human", "value": "exports.name = 'banuser';\nexports.hidden = true;\nexports.enabled = true;\nexports.matchStart = true;\nexports.handler = function(data) {\n //my room is idiots\n //if (config.database.u...
javascript
chosen
[ { "from": "system", "value": "Disable sinon in browser tests.\n" }, { "from": "human", "value": "if (typeof global === \"object\") {\n global.expect = require(\"chai\").expect\n require(\"chai\").use(require(\"sinon-chai\"))\n global.sinon = require(\"sinon\")\n} else if (typeof window ...
javascript
chosen
[ { "from": "system", "value": "Make sure modals are correctly positioned\n" }, { "from": "human", "value": "var Backbone = require('backbone');\n\n\nvar ModalContainerView = Backbone.View.extend({\n events: {\n 'mousedown': 'closeOnOutsideClick'\n },\n\n initialize: function() {\n\n },\n\n...
javascript
chosen
[ { "from": "system", "value": "Mark the UMD module as an ES module.\n" }, { "from": "human", "value": "import config from './rollup.config';\n\nconfig.dest = 'dist/coffee-lex.umd.js';\nconfig.format = 'umd';\nconfig.moduleName = 'coffeelex';\n\nexport default config;\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Add semicolons and blocks to mock Writable Stream.\n" }, { "from": "human", "value": "/*!\n * YUI Onyx\n * Copyright 2011 Yahoo! Inc.\n * Licensed under the BSD license.\n */\n\n/**\n * Returns a Vows topic function, which will return\n * a MockWritableStream, a fak...
javascript
chosen
[ { "from": "system", "value": "Refactor transformHead test to use custom functions\n" }, { "from": "human", "value": "import {assert} from 'chai';\nimport R from 'ramda';\nimport transformHead from '../../src/util/transform-head.js';\n\ndescribe('#transformHead', () => {\n it('should transform t...
javascript
chosen
[ { "from": "system", "value": "fix: Update axe.source to work with Firefox webdriver\n" }, { "from": "human", "value": "/*exported axe, commons */\n/*global axeFunction, module, define */\n// exported namespace for aXe\nvar axe = axe || {};\naxe.version = '<%= pkg.version %>';\n\nif (typeof defin...
javascript
chosen
[ { "from": "system", "value": "Enable proxy settings if a user logs in.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n// daab login\n\nvar program = require('commander');\nvar auth = require('./auth');\nvar direct = require(\"direct-js\").DirectAPI.getInstance();\n\nprogram\n .allowUnk...
javascript
chosen
[ { "from": "system", "value": "Check if language is valid\n" }, { "from": "human", "value": "const r = require('../../../db.js');\nconst i18n = require('i18n');\n\nmodule.exports.info = {\n\taliases: [\n\t\t'locale',\n\t\t'lang'\n\t]\n};\n\nmodule.exports.command = (message) => {\n\tif (message.i...
javascript
chosen
[ { "from": "system", "value": "Make sourcemap directory is synchronously created\n" }, { "from": "human", "value": "/* global config, fs, module, project */\n\nmodule.exports = function(grunt) {\n\tgrunt.registerTask('cleanup', function() {\n\t\tvar remFiles = function(dir) {\n\t\t\tfs.readdirSyn...
javascript
chosen
[ { "from": "system", "value": "Load CSS correctly in tests\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n entry: './test/build/index.js',\n output: {\n path: __dirname + \"/build\",\n filename: \"bundle.js\",\n publicPath: \"./bui...
javascript
chosen
[ { "from": "system", "value": "Include credentials with Apollo request\n" }, { "from": "human", "value": "import ApolloClient, { createNetworkInterface } from 'apollo-client';\n\nconst client = new ApolloClient({\n networkInterface: createNetworkInterface({\n uri: '/graphql',\n }),\n queryD...
javascript
chosen
[ { "from": "system", "value": "Add CORS wildcard host to lambda endpoint\n\n- from https://serverless.com/framework/docs/providers/aws/events/apigateway/\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports.ajax1 = (event, context, callback) => {\n setTimeout(() => {\n callbac...
javascript
chosen
[ { "from": "system", "value": "Reset the contact form validation between transitions.\n\nFixes #69\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Route.extend({\n model() {\n return this.store.createRecord('support-ticket');\n }\n});\n" }, { "fr...
javascript
chosen
[ { "from": "system", "value": "Add iroki ary spec to everything wrapper\n" }, { "from": "human", "value": "//= require spec_helper\n//= require spec_helper_functions\n//= require fn.lalolib_spec\n//= require fn.parsed_biom_spec\n//= require fn.project_spec\n//= require functions_spec\n//= require...
javascript
chosen
[ { "from": "system", "value": "Tag a changed for p.\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport logo_calzaweb_mini from '../../img/logo-calzaweb-mini.png'\n\nclass Footer extends Component {\n\trender() {\n\t return(\n\t\t\t<div className=\"App-textalign-ce...
javascript
chosen
[ { "from": "system", "value": "Add cart title class to cart item view.\n" }, { "from": "human", "value": "module.exports = function(Backbone, _, SearchShop) {\n return Backbone.View.extend({\n tagName: 'div',\n className: 'row',\n template: '<div class=\"col-md-12\"><%= title %></div>',...
javascript
chosen
[ { "from": "system", "value": "Fix sticky with find as you type\n\nIt was losing its position because filtering the list of templates with\nfind as you type was causing the height of the page to change.\n" }, { "from": "human", "value": "(function(Modules) {\n \"use strict\";\n\n let normalize ...
javascript
chosen
[ { "from": "system", "value": "fix: Make event emitter from blank object\n\n- If a function is passed to jQuery, it calls it 🤷🏻‍♂️\n- In hindsight, it is not needed to pass the object to jQuery\n- This fixes a weird bug explained here\nhttps://github.com/frappe/frappe/pull/6791\n" }, { "from": "hum...
javascript
chosen
[ { "from": "system", "value": "Fix typeof check for allowed globals\n\n" }, { "from": "human", "value": "var allowedGlobals = require('./allowed-globals'),\n UNDEF = 'undefined',\n cache;\n\n/**\n * Get global object based on what is available\n * @private\n */\nmodule.exports = function ()...
javascript
chosen
[ { "from": "system", "value": "Send UserAgent header, when using GitHub api\n\nhttp://developer.github.com/v3/#user-agent-required\n" }, { "from": "human", "value": "var Strategy = require('passport-github').Strategy,\n Promise = require('mongoose').Promise,\n https = require('https'),\...
javascript
chosen
[ { "from": "system", "value": "Fix test related to chartjs\n" }, { "from": "human", "value": "import { test, moduleForComponent } from 'ember-qunit';\n\nmoduleForComponent('file-overview', 'Integration | Component | file overview', {\n unit: true\n});\n\ntest('tapping button fires an external ac...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error where function is not closed properly\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular.module('app', [\n 'Core',\n 'Directives'\n ])\n .config(function($stateProvider, $urlRouterP...
javascript
chosen
[ { "from": "system", "value": "Create anchor tag for logout\n" }, { "from": "human", "value": "import React from 'react'\n\nclass LessonData extends React.Component {\n constructor(props){\n super(props);\n \n this.state = {\n lessonId: this.props.params.lessonId,\n className:...
javascript
chosen
[ { "from": "system", "value": "Change databse name to 'notelis'\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc service\n * @name applicationApp.pouchdb\n * @description\n * # pouchdb\n * Service in the applicationApp.\n */\nangular.module('applicationApp')\n .factory('pouchdb...
javascript
chosen
[ { "from": "system", "value": "Fix color function to support rgba on IE9 and up\n" }, { "from": "human", "value": "/*\n===============================================================================================\n\n Unify Project\n\n Homepage: unify-project.org\n License: MIT + Apache...
javascript
chosen
[ { "from": "system", "value": "Add some image mime types.\n" }, { "from": "human", "value": "const removeLeadingSlash = path => (path[0] === '/' ? path.substring(1) : path);\n\nconst generateFileNameSuffix = fileName => `${Date.now()}-${fileName}`;\n\nconst returnFileType = fileName => ({\n\tdocx...
javascript
chosen
[ { "from": "system", "value": "Remove stack breaking recursive test case\n" }, { "from": "human", "value": "import { assert } from 'chai';\nimport isEven from '../../src/2-Functions/2-RecursiveEven';\n\ndescribe('2-Functions/2-RecursiveEven', () => {\n it('should return 0 even', () => {\n ass...
javascript
chosen
[ { "from": "system", "value": "Move the invocation into the parens that contain the function\n" }, { "from": "human", "value": "(function(){\n 'use strict';\n\n /*\n This file contains tests for the labels that get rendered next to each bar\n */\n\n describe('BarLabelGroup', function(){\n\n...
javascript
chosen
[ { "from": "system", "value": "Fix related box going over footer" }, { "from": "human", "value": "$(function(){\n function checkOverflow(){\n var $related = $(\".related-positioning\");\n if($related.length !== 0 && $related.css('position') == 'fixed') {\n var viewPort = $(window).hei...
javascript
chosen
[ { "from": "system", "value": "fix(PointSet): Update vtkPointSet to use vtkPoints instead of vtkDataArray directly\n" }, { "from": "human", "value": "import * as macro from '../../../macro';\nimport vtkDataSet from '../DataSet';\nimport vtkDataArray from '../../Core/DataArray';\n\n// --------...
javascript
chosen
[ { "from": "system", "value": "Fix export for video detail, have a check for video existing, build the video embed url, add data for the video.\n" }, { "from": "human", "value": "import React from 'react';\n\nconst VideoDetail = (props) => {\n\treturn (\n\t\t<div className=\"video-detail col-md-8...
javascript
chosen
[ { "from": "system", "value": "Remove loaders from file displayed\n" }, { "from": "human", "value": "'use strict';\n\nconst concat = require('../utils').concat;\nconst formatTitle = require('../utils/colors').formatTitle;\n\nfunction displayError(severity, error) {\n const baseError = formatTitl...
javascript
chosen
[ { "from": "system", "value": "Change group function to string\n" }, { "from": "human", "value": "var ipc = window.require('ipc');\nvar _ = require('underscore');\n\nvar Reflux = require('reflux');\nvar Actions = require('../actions/actions');\nvar AuthStore = require('../stores/auth');\nvar apiR...
javascript
chosen
[ { "from": "system", "value": "Use \"Walker\" class instead of traverse()\n\nfor Ember 1.13 compat\n" }, { "from": "human", "value": "/* eslint-env node */\nvar TEST_SELECTOR_PREFIX = /data-test-.*/;\n\nfunction TransformTestSelectorParamsToHashPairs() {\n this.syntax = null;\n}\n\nfunction isTe...
javascript
chosen
[ { "from": "system", "value": "Return the state object if the key is not specified\n" }, { "from": "human", "value": "import _ from 'lodash';\nimport events from 'events';\n\nclass ImmutableStore extends events.EventEmitter {\n state = {};\n\n constructor(state = {}) {\n super();\n\n...
javascript
chosen
[ { "from": "system", "value": "Improve the GAPI mocks for local development." }, { "from": "human", "value": "// GAPI Hangouts Mocks\nvar gapi = function(gapi){\n\n // Create the Hangout API\n gapi.hangout = function(hangout){\n\n hangout.localParticipant = {\n id: '123456',\n disp...
javascript
chosen
[ { "from": "system", "value": "Remove duplicate menu item People\n" }, { "from": "human", "value": "'use strict';\n\n// Setting up route\nangular.module('core').config(['$stateProvider', '$urlRouterProvider',\n\tfunction($stateProvider, $urlRouterProvider) {\n\t\t// Redirect to home view when rou...
javascript
chosen
[ { "from": "system", "value": "Add changes property before saving document to pouchdb\n" }, { "from": "human", "value": "import { getDocument, updateDocument } from '../services/pouchdbService';\nimport { isEqual } from 'lodash';\n\nimport {\n NEW_POUCHDB,\n LOAD_EBUDGIE,\n INITIAL_LOAD,\n} fr...
javascript
chosen
[ { "from": "system", "value": "Add more properties to the SpritePlugin\n\nA sprite should have a width, height and in case\nit isn't an image, it should have a fill_style.\n" }, { "from": "human", "value": "function SpritePlugin() {\n\n this.settings = {\n 'x': {\n 'value': 0...
javascript
chosen
[ { "from": "system", "value": "Disable react-hmre from production config\n" }, { "from": "human", "value": "import path from 'path';\nimport webpack from 'webpack';\nimport copyWebpackPlugin from 'copy-webpack-plugin';\nimport ExtractTextPlugin from 'extract-text-webpack-plugin';\n\nconst mainPat...
javascript
chosen
[ { "from": "system", "value": "[IMP][10.0] Add UI notification for AJAX request status\n" }, { "from": "human", "value": "'use strict';\nodoo.define('proxy_action.proxy_view', function (require) {\n var ActionManager = require('web.ActionManager');\n\n ActionManager.include({\n ir_ac...
javascript
chosen
[ { "from": "system", "value": "Fix browser window instance invalidation\n" }, { "from": "human", "value": "let windows = {};\n\nmodule.exports = {\n registerWindow: function (windowId, createFunction) {\n if (!windows[windowId]) {\n windows[windowId] = {\n crea...
javascript
chosen
[ { "from": "system", "value": "Replace ngGAPI settings with angular-googleapi\n\nsettings. #6\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular\n .module('annualTimeBlock')\n .value('GoogleApp', {\n apiKey: 'AIzaSyCcgg8cp_fEA3nXRfTtM1E6wRwKkSsMLio',\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor auth middleware to be more readable\n" }, { "from": "human", "value": "import express from 'express'\nimport bodyParser from 'body-parser'\nimport auth from './lib/auth.js'\n\nconst PORT = process.env.PORT || 8080\nconst API_KEY = process.env.API_KEY || 'ab...
javascript
chosen
[ { "from": "system", "value": "Create first draft of standard questions\n" }, { "from": "human", "value": "import { touch } from 'shelljs'\nimport inquirer from 'inquirer'\n\nconst chain = [\n {\n type: 'input', name: 'title', message: 'title: ', validate: (val) => val.constructor === String?...
javascript
chosen
[ { "from": "system", "value": "Use $document instead of document for on fn\n\nSigned-off-by: gconsidine <79e2475f81a6317276bf7cbb3958b20d289b78df@gregconsidine.com>\n" }, { "from": "human", "value": "const templateUrl = require('~components/layout/side-nav.partial.html');\n\nfunction atSideNavLin...
javascript
chosen
[ { "from": "system", "value": "Add interims link and reword narratives\n" }, { "from": "human", "value": "/*jslint browser: true, undef: true *//*global Ext*/\nExt.define('SlateAdmin.view.progress.NavPanel', {\n extend: 'SlateAdmin.view.LinksNavPanel',\n xtype: 'progress-navpanel',\n //TODO...
javascript
chosen
[ { "from": "system", "value": "Enable switches if it's function is to switch on/off lights.\n" }, { "from": "human", "value": "import R from 'ramda';\nimport React, {PropTypes} from 'react';\nimport {Switch} from 'react-mdl/lib';\n\nimport Component from 'react-pure-render/component';\n\nexport d...
javascript
chosen
[ { "from": "system", "value": "Return empty row, fixes bug when there are no skins\n" }, { "from": "human", "value": "(function() {\n\t\n\texports.getEmptyRow = function() {\n\t\tvar row = Ti.UI.createTableViewRow({\n\t\t\teditable: false,\n\t\t\tisPlaceholder: true,\n\t\t\tselectionStyle: Ti.UI....
javascript
chosen
[ { "from": "system", "value": "Add workaround for Node v0.10 where REPLServer does not have a close method\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar tape = require( 'tape' );\nvar repl = require( './../lib' );\n\n\n// TESTS //\n\ntape( 'main export is a function', f...
javascript
chosen
[ { "from": "system", "value": "Add calls to domains delete functionality\n" }, { "from": "human", "value": "var digio_api = require('../digio-api')\n, config = require('./config')\n\n\nvar api = new digio_api(config.token)\n\n// api.droplets.list_droplets(function (err, data) {\n// console.log(...
javascript
chosen
[ { "from": "system", "value": "Simplify API to target basic callback usage" }, { "from": "human", "value": "var Promise = require('bluebird');\nvar mapValues = require('lodash.mapvalues');\nvar assign = require('lodash.assign');\nvar curry = require('lodash.curry');\n\nfunction FileWebpackPlugin(...
javascript
chosen
[ { "from": "system", "value": "Change way of passing token to API\n" }, { "from": "human", "value": "var digio_api = require('../digio-api')\n, config = require('./config')\n\n\nvar api = new digio_api(config.token)\n\n// api.droplets.list_droplets(function (err, data) {\n// console.log(data);\...
javascript
chosen
[ { "from": "system", "value": "Use Error class instead of the unreferenced class Exception\n" }, { "from": "human", "value": "var P = require('./build/Release/perl.node');\nP.InitPerl();\nP.Perl.prototype.use = function (name) {\n if (!name.match(/^[A-Za-z0-9_:]+$/)) {\n throw new Excep...
javascript
chosen
[ { "from": "system", "value": "Add targetExtension class property for chaining\n" }, { "from": "human", "value": "'use strict';\n\nvar peg = require('pegjs');\n\nclass PegJsPlugin {\n\n constructor(config) {\n this.config = config.plugins.pegjs;\n // The output of the below peg.generate() ...
javascript
chosen
[ { "from": "system", "value": "Fix the condition to return string\n" }, { "from": "human", "value": "export default class EasyInput {\n constructor() {\n this.keys = []\n }\n\n handleKeyDown(event) {\n if (event.ctrlKey) {\n this.keys.push(this.ignoreDupKey('Ctrl+'))\n }\n if...
javascript
chosen
[ { "from": "system", "value": "Remove imgur api and path\n" }, { "from": "human", "value": "//Import modules\nvar AWS = require('aws-sdk');\nvar util = require('util');\nvar imgur = require('imgur-node-api');\nvar path = require('path');\n\n//Create S3 client\n\nvar s3 = new AWS.S3();\n\n//Create...
javascript
chosen
[ { "from": "system", "value": "Clarify variable naming for below\n" }, { "from": "human", "value": "'use strict'\n\nvar EventEmitter = require('events').EventEmitter\nvar dot = require('dot-prop')\nvar Symbol = require('es6-symbol')\nvar traverse = require('traverse')\n\nmodule.exports = EventsTr...
javascript
chosen
[ { "from": "system", "value": "Update so it works right via browserify\n" }, { "from": "human", "value": "require('coffee-script/register')\nmodule.exports= require('./src/ogre')" }, { "from": "gpt", "value": "// require('coffee-script/register')\n// module.exports= require('./src/ogr...
javascript
chosen
[ { "from": "system", "value": "Add party name to race\n" }, { "from": "human", "value": "var fs = require('fs');\nvar chalk = require('chalk');\n\nmodule.exports = function splitResults(json, directory) {\n\n\tvar electionDate = json.electionDate;\n\n\t// save each json.races item as a separate f...
javascript
chosen
[ { "from": "system", "value": "Add hapi support. Fix regex for url rewriting\n" }, { "from": "human", "value": "function fromConnect (connectFn) {\n return function (context, req, res) {\n req.url = req.url.replace('/api/run/', '/');\n req.webtaskContext = context;\n \n ...
javascript
chosen
[ { "from": "system", "value": "Update lead adviser success message\n" }, { "from": "human", "value": "const { find, get } = require('lodash')\n\nconst { Order } = require('../../../models')\n\nasync function editLeadAssignee (req, res, next) {\n const adviserId = req.body.adviserId\n const orde...
javascript
chosen
[ { "from": "system", "value": "Add \"e.code\" as possible status\n" }, { "from": "human", "value": "module.exports = handler => async (req, res, next) => {\n try {\n await handler(req, res, next);\n } catch (e) {\n if (!res.headersSent) {\n const status = e.status || e.statusCode || ...
javascript
chosen
[ { "from": "system", "value": "Update user with new lists of projects on create\n" }, { "from": "human", "value": "App.ProjectsController = Ember.ArrayController.extend({\n actions: {\n createProject: function () {\n var project = this.store.createRecord('project');\n\n project.save...
javascript
chosen
[ { "from": "system", "value": "internal-test-helpers: Convert `ContainersAssert` to ES6 class\n" }, { "from": "human", "value": "import { Container } from '@ember/-internals/container';\n\nfunction ContainersAssert(env) {\n this.env = env;\n}\n\nconst { _leakTracking: containerLeakTracking } = C...
javascript
chosen
[ { "from": "system", "value": "Update service worker to use cache and update strategy\n" }, { "from": "human", "value": "var CACHE_NAME = 'static';\n\nfunction _addToCache(method, resource, url) {\n if (method === 'addAll') {\n return caches.open(CACHE_NAME).then(cache => {\n ...
javascript
chosen
[ { "from": "system", "value": "Add console log for original error from http request\n" }, { "from": "human", "value": "apiCall = function (method, apiUrl, options) {\n try {\n var response = HTTP.call(method, apiUrl, options).data;\n return response;\n } catch (error) {\n var errorCode...
javascript
chosen
[ { "from": "system", "value": "Declare and use normalOffset variable as value of original offset from top.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(app) {\n app.controller('NavController', ['$rootScope', 'AuthService', function($rs, AuthService) {\n this.s...
javascript
chosen
[ { "from": "system", "value": "Fix schema misstep in SQL code\n" }, { "from": "human", "value": "(function () {\n var cogClass = function () {};\n cogClass.prototype.exec = function (params, request, response) {\n var oops = this.utils.apiError;\n var sys = this.sys;\n ...
javascript
chosen
[ { "from": "system", "value": "Deploy ember app to dist\n\nFor fastboot-app-server\n" }, { "from": "human", "value": "module.exports = function(deployTarget) {\n var ENV = {\n build: {}\n // include other plugin configuration that applies to all deploy targets here\n };\n\n if (deployTar...
javascript
chosen
[ { "from": "system", "value": "Add javascript to pull video elements off page and pass to native iOS\n" }, { "from": "human", "value": "var exec = require('cordova/exec');\n\nexports.call = function (options) {\n exec(\n function (data) {\n if (data.type === '__answered' && options.answe...
javascript
chosen