conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Enable button if the app is neither devel nor system\n" }, { "from": "human", "value": "/*jshint browser: true */\n/*jshint strict: false, unused: false */\n/*global Backbone, $, window, arangoHelper, templateEngine, Joi, _*/\n\nwindow.ApplicationDetailView = Backbo...
javascript
chosen
[ { "from": "system", "value": "Add proper output in gh-pages build script\n" }, { "from": "human", "value": "var ghpages = require('gh-pages');\nvar path = require('path');\n\nghpages.publish(path.join(__dirname, 'build'), function(err) { console.log('Built, yo') });\n" }, { "from": "gpt"...
javascript
chosen
[ { "from": "system", "value": "Store expires token on the config cache\n\nThis will help prevent errors where the token changes and not all resources are updated to reflect the change." }, { "from": "human", "value": "var exec = require('child_process').exec,\n lumbar = require('lumbar');\n\nm...
javascript
chosen
[ { "from": "system", "value": "Fix typo for gt char\n" }, { "from": "human", "value": "var fs = require('fs');\nvar path = require('path');\nvar md = require('cli-md');\n\nmodule.exports = function (filepath) {\n return md(fs.readFileSync(filepath, 'utf8'))\n .replace(/'/g, \"'\")\n .r...
javascript
chosen
[ { "from": "system", "value": "Change colour of command executed\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n\"use strict\";\n\nconst moment = require(\"moment\");\nconst sugar = require(\"sugar\");\nconst chalk = require(\"chalk\");\nconst exec = require(\"child_process\").exec;\n\...
javascript
chosen
[ { "from": "system", "value": "Change default gulp task to watch.\n" }, { "from": "human", "value": "var gulp = require('gulp');\n\nvar uglify = require('gulp-uglify');\nvar concat = require('gulp-concat');\n\nvar paths = {\n scripts: [\n 'src/**/*.module.js',\n 'src/**/!(main)*.js',\n ...
javascript
chosen
[ { "from": "system", "value": "Clean up. Comments for running in prod and dev\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport { LeaderBoard } from './components/LeaderBoard';\n// import registerServiceWorker from './r...
javascript
chosen
[ { "from": "system", "value": "Fix creating the first address.\n" }, { "from": "human", "value": "/**\n * @fileOverview PocketCreateCtrl angular controller\n */\n'use strict';\n\ndefine(['./module', 'darkwallet'], function (controllers, DarkWallet) {\n controllers.controller('PocketCreateCtrl', ...
javascript
chosen
[ { "from": "system", "value": "Adjust for reformat and add init\n\nOptions can now be reinitialized if settings change during the run\n" }, { "from": "human", "value": "// Includes\nvar request = require('request-promise');\nvar settings = require('../settings.json');\n\nvar session_only = settin...
javascript
chosen
[ { "from": "system", "value": "Fix removal of \"Add new\" page\n" }, { "from": "human", "value": "/*\n* Do not display ability to add pages or Settings tab\n* loaded only when !Permission::check('SITETREE_REORGANISE')\n*/\n(function($){\n\t$.entwine('ss', function($){\n\n\t\t/* Hide Add Page butt...
javascript
chosen
[ { "from": "system", "value": "Insert or update anonymous when no klubmaster are specify\n" }, { "from": "human", "value": "Template.ksEdit.helpers({\n ks: function () {\n var ks = this;\n ks.books = Books.find();\n return ks;\n }\n});\n\nTemplate.ksEdit.events({\n 'submit form': func...
javascript
chosen
[ { "from": "system", "value": "Add a few more needed time zones to clock widget\n" }, { "from": "human", "value": "var timeZoneData = {\n \"UTC/UTC\": 0,\n \"Europe/London\": 0,\n \"Europe/Amsterdam\": 1,\n \"America/Los_Angeles\":-8,\n \"America/Minneapolis\":-6,\n \"America/New_York\":-5,...
javascript
chosen
[ { "from": "system", "value": "Fix to allow for null buffers to be passed in." }, { "from": "human", "value": "(function () {\n \"use strict\";\n\n function concat(bufs) {\n var buffer, length = 0, index = 0;\n\n if (!Array.isArray(bufs)) {\n bufs = Array.prototype.slice.call(argumen...
javascript
chosen
[ { "from": "system", "value": "registration[points]: Add Hungarian minima subtraction step.\n" }, { "from": "human", "value": "/*exported Hungarian*/\nvar Hungarian = (function() {\n 'use strict';\n\n /**\n * Array minima mutation functions.\n */\n function subtractRowMinima( row ) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix bug in GoogleTokenVerifier causing it never to work.\n\nApparently, I was horribly misusing constants. Comprehensive tests would have uncovered this. I'm not convinced that I'm doing the right thing by injecting services inside the verification function, and this particul...
javascript
chosen
[ { "from": "system", "value": ":art: Fix mixins-before-declaration rule to work with latest gonzales\n" }, { "from": "human", "value": "'use strict';\n\nvar helpers = require('../helpers');\n\nmodule.exports = {\n 'name': 'mixins-before-declarations',\n 'defaults': {\n 'exclude': [\n 'b...
javascript
chosen
[ { "from": "system", "value": "Revert \"Set error message using constructor\"\n\nThis reverts commit 931fa47355cb7f5d5bce4d77affb7313211ac043.\n" }, { "from": "human", "value": "var util = require('util');\n\nmodule.exports = function (name, defaultMessage, status) {\n\n util.inherits(Constructo...
javascript
chosen
[ { "from": "system", "value": "Fix Pasting text into a card is adding a line before and after\n(and multiplies by pasting more) by disabling WYSIWYG comment editor\nfor everyone.\n\nCloses #2890\n" }, { "from": "human", "value": "Meteor.startup(() => {\n const RCCE = process.env.RICHER_CARD_COMM...
javascript
chosen
[ { "from": "system", "value": "Add basic unit test for notification model\n\nReviewers: asteinlein\n\nReviewed By: asteinlein\n\nDifferential Revision: http://dev.e5r.no/D3847\n" }, { "from": "human", "value": "import { moduleForModel, test } from 'ember-qunit';\n\nmoduleForModel('notification', ...
javascript
chosen
[ { "from": "system", "value": "Make CourseList accept dropped Courses\nLogs the clbid of the dropped course\n" }, { "from": "human", "value": "'use strict';\n\nimport * as _ from 'lodash'\nimport * as React from 'react'\n\nimport Course from './course'\n\nvar CourseList = React.createClass({\n\tr...
javascript
chosen
[ { "from": "system", "value": "Add overlay style to widget overlay\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\n\nconst WidgetOverlay = ({ children, widget, onClick, onMouseOver, onMouseOut, hasMouseOver }) => (\n <div\n className='relative'\n style={{ curso...
javascript
chosen
[ { "from": "system", "value": "Increase search result page size\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('chronontology.controllers')\n\n.controller(\"SearchController\", function($scope, $location, searchService, chronontologySettings) {\n\n $scope.query = $location....
javascript
chosen
[ { "from": "system", "value": "Exclude vtk.js from lean bundle\n" }, { "from": "human", "value": "// The lean build does not include any of the third-party runtime dependencies, rather\n// it assumes they are in the global namespace at runtime.\nvar config = require('./webpack.base.config');\nvar...
javascript
chosen
[ { "from": "system", "value": "Fix NEVER:TASK for images + Fix CLEAN:TASK for images & JS (Fix missed vendor JS)\n" }, { "from": "human", "value": "module.exports = {\n options: { force: true },\n all: [\n \"../assets/\"\n ]\n};\n" }, { "from": "gpt", "value": "module....
javascript
chosen
[ { "from": "system", "value": "Change the toggle button icon according to sidebar-toggle-type\n" }, { "from": "human", "value": "(function(app) {\n 'use strict';\n\n var jCore = require('jcore');\n var helper = app.helper || require('../helper.js');\n var dom = app.dom || require('../dom.js')...
javascript
chosen
[ { "from": "system", "value": "Remove importing of emit() as it's not needed.\n" }, { "from": "human", "value": "import apiEmit from '../api/emit';\nimport globals from './vars';\nimport hasOwn from '../util/has-own';\nimport typeElement from '../type/element';\n\nvar definitions = {};\nvar map =...
javascript
chosen
[ { "from": "system", "value": "Add back the \"crashed\" icon when an AI stopped responding\n" }, { "from": "human", "value": "/** @jsx React.DOM */\nvar React = require(\"react\");\nvar GameModel = require(\"../../GameModel\");\n\nvar HeroStats = React.createClass({\n propTypes: {\n game: Rea...
javascript
chosen
[ { "from": "system", "value": "Fix frontpage webhook to deploy from main\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/* eslint-disable no-console */\n\nconst fetch = require('node-fetch');\nconst { execSync } = require('child_process');\n\nconst { FRONTPAGE_WEBHOOK, FRONTPAGE_WEBHOOK_...
javascript
chosen
[ { "from": "system", "value": "Fix : exclude api from whitelist\n" }, { "from": "human", "value": "module.exports = {\n staticFileGlobs: [\n 'manifest.json',\n 'bower_components/webcomponentsjs/*.js',\n 'images/*'\n ],\n runtimeCaching: [\n {\n urlPattern: /\\/data\\/images\\/...
javascript
chosen
[ { "from": "system", "value": "Use Azavea's mapbox account for real this time\n" }, { "from": "human", "value": "define([], function(){\n var maps = [\n L.mapbox.map('map-1', 'azavea.i8f6m5el'),\n L.mapbox.map('map-2', 'azavea.i8f6m5el'),\n L.mapbox.map('map-3', 'azavea.i8f6m5el')\n ];...
javascript
chosen
[ { "from": "system", "value": "Align header nav button left\n" }, { "from": "human", "value": "import styled from 'styled-components';\n\nexport default styled.div`\n text-align: center;\n`;\n" }, { "from": "gpt", "value": "import styled from 'styled-components';\n\nexport default st...
javascript
chosen
[ { "from": "system", "value": "Add the path definition for quiting group API.\n" }, { "from": "human", "value": "module.exports = {};\n\nfunction define( key, value ) {\n\tmodule.exports[key] = value;\n}\n\ndefine( 'token', { 'get' : '/user/getToken' } );\ndefine( 'message', { 'publish' : '/messa...
javascript
chosen
[ { "from": "system", "value": "Remove experimental fluff from GroupsView\n" }, { "from": "human", "value": "var GroupsView = Em.View.extend({\n classNameBindings: ['groups', 'animateMe:yoyo:yaya'],\n init: function () {\n this._super();\n this.one('click', this, function (e) { console.log...
javascript
chosen
[ { "from": "system", "value": "Change default zoom level to 8.\n" }, { "from": "human", "value": "var app = angular.module('am');\n\napp.directive('googleMap', ['$timeout', function($timeout) {\n return {\n scope: {\n 'center': '='\n },\n\n controller: function() {\n this.map ...
javascript
chosen
[ { "from": "system", "value": "Revert \"Update testing to better fit\"\n\nThis reverts commit 04569aeb14186564ff0c080c4ccbdc64b56cf2e8.\n" }, { "from": "human", "value": "/*\n#\n# i2mx.js - v0.1-Alpha\n# Apache v2 License\n#\n*/\n\n// Create img2musicXML (abbreviated as i2mx) namespace\nvar i2mx ...
javascript
chosen
[ { "from": "system", "value": "Add favicon and static folder\n" }, { "from": "human", "value": "module.exports = {\n siteMetadata: {\n title: `Gatsby Default Starter`,\n description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the ...
javascript
chosen
[ { "from": "system", "value": "Add hours for each task list item per day\n" }, { "from": "human", "value": "/*global require, module*/\n/** @jsx React.DOM */\nvar React = require('react'),\nrandomMC = require('random-material-color');\n\nvar WeeklyViewDay = React.createClass({\n \n render: ...
javascript
chosen
[ { "from": "system", "value": "Change `twitter-oauth` => to `weibo-oauth`\n\nSeemingly copy-paste residue in the PR, but this is the Weibo package\nit should be Weibo, not Twitter.\n" }, { "from": "human", "value": "Package.describe({\n summary: \"Login service for Sina Weibo accounts\",\n vers...
javascript
chosen
[ { "from": "system", "value": "Allow internal `nextTick` utility to use microtasks when possible.\n" }, { "from": "human", "value": "import { Promise } from 'rsvp';\n\nexport const nextTick = setTimeout;\nexport const futureTick = setTimeout;\n\n/**\n @private\n @returns {Promise<void>} promise w...
javascript
chosen
[ { "from": "system", "value": "Handle child process errors gracefully\n" }, { "from": "human", "value": "/**\n * Runs \"make generator\" using a child process.\n *\n * @package generator\n * @author Andrew Sliwinski <andrew@diy.org>\n */\n\n/**\n * Dependencies\n */\nvar child = require('child_pr...
javascript
chosen
[ { "from": "system", "value": "Check if is secured url\n" }, { "from": "human", "value": "\n\nmodule.exports.isValidUrl = function(_url) {\n if (_url && typeof _url === 'string' && _url.indexOf('amqp://') === 0) {\n return true;\n }\n\n return false;\n};\n\nmodule.exports.parseMsg = functi...
javascript
chosen
[ { "from": "system", "value": "Use elastic ip for austin OBA instance\n" }, { "from": "human", "value": "import fetch from 'isomorphic-fetch';\nimport queryString from 'query-string';\n\n\nexport default function request(endpoint, query = {}) {\n // const url = `http://localhost:8080/api/where/$...
javascript
chosen
[ { "from": "system", "value": "EventPage.js: Fix storage call from local to sync\n" }, { "from": "human", "value": "chrome.runtime.onMessage.addListener(\n function(echo, sender, sendResponse) {\n var promise = new Promise(function(resolve, reject) {\n chrome.identity.getProfileUserInfo(...
javascript
chosen
[ { "from": "system", "value": "test(store): Reset jest modules and NODE_ENV after store tests\n" }, { "from": "human", "value": "/* globals describe, expect, it, jest */\n\ndescribe('store', () => {\n it('should create a development redux store with the reducers passed', () => {\n jest.resetM...
javascript
chosen
[ { "from": "system", "value": "Apply touchactive for mouse and touch\n" }, { "from": "human", "value": "(function ($) {\n $.event.special.touchclick = {\n setup: function () {\n if (typeof window.ontouchstart !== \"undefined\") {\n $(this).on('touchstart', $.ev...
javascript
chosen
[ { "from": "system", "value": "Fix webpack hot module reload\n" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n entry: {\n app: ['./static/js/src/app.js'],\n },\n\n output: {\n path: 'static/js/build',\n pathInfo: ...
javascript
chosen
[ { "from": "system", "value": "Fix the bug of summernote dependency mismatch between the blueprint and the package.js thanks to @billdami.\nIt causes the error while running the blueprint\n" }, { "from": "human", "value": "module.exports = {\n normalizeEntityName: function() {},\n\n afterInstal...
javascript
chosen
[ { "from": "system", "value": "Set status code for now found\n" }, { "from": "human", "value": "var path = require('path');\nvar deliver = require('deliver');\nvar mime = require('mime');\nvar url = require('url');\n\nmodule.exports = function (fileStore) {\n return function (req, res, next) {\n...
javascript
chosen
[ { "from": "system", "value": "Update `git status` to use machine output -z.\n" }, { "from": "human", "value": "/*jshint node: true */\n\nvar _ = require('underscore');\nvar _s = require('underscore.string');\nvar exec = require('shelljs').exec;\nvar fs = require('fs');\n\nvar cachedFileList;\n\n...
javascript
chosen
[ { "from": "system", "value": "style(badge): Change badge style on sidebar notification count\n" }, { "from": "human", "value": "import classNames from \"classnames\";\nimport React from \"react\";\nimport { Link } from \"react-router\";\n\nimport NotificationStore from \"../stores/NotificationSt...
javascript
chosen
[ { "from": "system", "value": "Remove www from footer links" }, { "from": "human", "value": "import React from 'react'\nimport './style.scss'\n\nconst Footer = () => {\n return (\n <div className=\"footer container\">\n <hr/>\n <div className=\"grid\">\n <p className=\"left\"...
javascript
chosen
[ { "from": "system", "value": "Move task dependencies to the top\n" }, { "from": "human", "value": "/*\n * Copyright 2013, All Rights Reserved.\n *\n * Code licensed under the BSD License:\n * https://github.com/node-gh/gh/blob/master/LICENSE.md\n *\n * @author Zeno Rocha <zno.rocha@gmail.com>\n ...
javascript
chosen
[ { "from": "system", "value": "Check if sorting exists when returning response\n" }, { "from": "human", "value": "'use strict'\n\nconst { createError } = require('micro')\n\nconst referrers = require('../database/referrers')\n\nconst {\n\tREFERRERS_SORTING_TOP,\n\tREFERRERS_SORTING_RECENT\n} = re...
javascript
chosen
[ { "from": "system", "value": "Add default url for loading gif\n" }, { "from": "human", "value": "(function($) {\n\t$(document).ready(function() { \t\t \n\t\tvar ad_galleries = $('.ad-gallery').adGallery();\n\t});\n})(jQuery)\n" }, { "from": "gpt", "value": "(function($) {\n\t$(docume...
javascript
chosen
[ { "from": "system", "value": "Improve the comments on the filter.\n" }, { "from": "human", "value": "(function (angular, _) {\n 'use strict';\n\n var drf = angular.module('drf-display-name-filter', []);\n\n // A filter to return a display name.\n drf.filter('drfDisplayName', function...
javascript
chosen
[ { "from": "system", "value": "Add extra UI cleanup for reset\n\nSigned-off-by: Kaustav Das Modak <ba1ce5b1e09413a89404909d8d270942c5dadd14@yahoo.co.in>\n" }, { "from": "human", "value": "(function () {\n\n // Add behaviour for option buttons\n app(function (api) {\n\n var resetbtn =...
javascript
chosen
[ { "from": "system", "value": "Change versionup to write package.json using 2 space indentation. Add some doco.\n" }, { "from": "human", "value": "var _ = require('underscore'),\n fs = require('fs'),\n Toolbelt = require('./toolbelt').Toolbelt,\n toolbelt = new Toolbelt();\n\nfunction Ch...
javascript
chosen
[ { "from": "system", "value": "Add callback for homepage javascript light POST request.\n" }, { "from": "human", "value": "\"use strict\";\n\n$(document).ready(function(){\n\n var $btnLight = $(\"#btnLight\");\n\n var lightText = $btnLight.text();\n var lightOn;\n if (lightText = \"Light On\"...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary call to collapse the accordion\n\nbootstrap does that for us\n" }, { "from": "human", "value": "// Javascript specific to guide admin\n$(function() {\n // collapse the parts using the bootstrap accordion\n $(\".collapse\").collapse();\n\n var s...
javascript
chosen
[ { "from": "system", "value": "Remove leftover references to reducer\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\nimport baseData from './base-data';\nimport projects from './projects';\nimport locations from './locations';\nimport location from './location';\nimpo...
javascript
chosen
[ { "from": "system", "value": "Change baseurl from angular to admissions-project.codingcamp.us\n" }, { "from": "human", "value": "var app = angular.module(\"AdmissionsApp\");\n\napp.service(\"PasswordCheckService\", [\"$http\", function ($http) {\n var submitBaseUrl = \"http://localhost:8001/p...
javascript
chosen
[ { "from": "system", "value": "Increase the e2e duration for study view\n\n\nFormer-commit-id: 678c0d33a3e3e88b257028655a80fc36b8175d03" }, { "from": "human", "value": "var assert = require('assert');\nvar expect = require('chai').expect;\nvar waitForOncoprint = require('./specUtils').waitForOnco...
javascript
chosen
[ { "from": "system", "value": "feat: Add support for configuration through env variables\n\nFixes #23\n" }, { "from": "human", "value": "// @flow\nimport _ from 'lodash'\nimport program from 'commander'\n\nimport info from '../package.json'\n\nexport type Options = {\n command: ?string,\n files...
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": "Fix mongodb usage in tests\n" }, { "from": "human", "value": "/* jslint node:true */\n\n'use strict';\n\nexports = module.exports = {\n db: null,\n\n databaseUrl: process.env.CLOUDRON_MONGODB_URL || 'mongodb://127.0.0.1:27017/meemo',\n _clearDatabase: clear...
javascript
chosen
[ { "from": "system", "value": "Add basic menu to app\n\nWill refine later on.\n" }, { "from": "human", "value": "var app = require('app')\nvar BrowserWindow = require('browser-window')\nvar crashReporter = require('crash-reporter')\n\ncrashReporter.start()\n\nvar mainWindow = null\n\napp.on('wind...
javascript
chosen
[ { "from": "system", "value": "Create remove2if4 method to fix bug with sixteenths and eights\n" }, { "from": "human", "value": "createSubdivisionsArray = function(){\n var subdivisions = [];\n var possibleNoteValues = [\"#eighths\", \"#triplets\", \"#sixteenths\", \"#quintuplets\"];\n var pos...
javascript
chosen
[ { "from": "system", "value": "Remove special handling of `lib` folder\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path')\n , findRoot = require('next/lib/module/find-package-root')\n\n , resolve = path.resolve, sep = path.sep;\n\nmodule.exports = function (tpath...
javascript
chosen
[ { "from": "system", "value": "Comment out console statement that will be needed later.\n" }, { "from": "human", "value": "Application.Controllers.controller('projectsProject',\n [\"$scope\", \"$stateParams\", \"actionStatus\", \"provStep\",\n ...
javascript
chosen
[ { "from": "system", "value": "Add ability to disable logging\n" }, { "from": "human", "value": "const logLevels = ['DEBUG', 'INFO', 'WARN', 'ERROR']\r\nlet currentLevel = 1\r\n\r\nmodule.exports = {\r\n setLogLevel: (newLevel) => {\r\n currentLevel = logLevels.indexOf(newLevel)\r\n if (cu...
javascript
chosen
[ { "from": "system", "value": "[Glitch] Fix limited account hint referencing \"your\" server when logged out\n\nPort 139ea4c981f563e51d80ec3ec407d6265e29cb70 to glitch-soc\n\nSigned-off-by: Claire <82b964c50e9d1d222e48cf5046e6484a966a7b07@sitedethib.com>\n" }, { "from": "human", "value": "import ...
javascript
chosen
[ { "from": "system", "value": "Fix typo resulting in build issue\n" }, { "from": "human", "value": "envimport * as MuConstants from '../exports/MuConstants'\n\nconst service = MuConstants.STORIES_SERVICE_URL\n\nfunction handleErrors(response) {\n if (!response.ok) {\n throw Error(response.sta...
javascript
chosen
[ { "from": "system", "value": "3559: Remove components= prefix from FP string\n\nAfter discussion we decided to remove the components= prefix from the\nquery params of the fp.gif resource requested by the JS fingerprinting\ncode, because it's not required and will probably make the string harder\nto parse.\n...
javascript
chosen
[ { "from": "system", "value": "Initialize input for proper behavior\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport fetch from 'ember-network/fetch';\n\nexport default Ember.Service.extend({\n prompt(){\n return new Promise((resolve, reject) => {\n const input = doc...
javascript
chosen
[ { "from": "system", "value": "Improve module definition generation script\n\nThe script no longer produces unnecessary module declarations.\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar mkdirp = require('mkdirp');\nvar path = require('path');\n\nvar banner = re...
javascript
chosen
[ { "from": "system", "value": "Add news footer to media tile\n" }, { "from": "human", "value": "(function(env) {\n \"use strict\";\n\n env.ddg_spice_dogo_news = function(api_result) {\n if (!api_result || !api_result.results || !api_result.results.length) {\n return Spice....
javascript
chosen
[ { "from": "system", "value": "Hide dogs without avatars on homepage slider, randomize dogs on homepage slider\n" }, { "from": "human", "value": "var fs = require('fs');\nvar _ = require('underscore');\nvar Backbone = require('backbone');\nvar Flickity = require('flickity-imagesloaded');\nvar Ind...
javascript
chosen
[ { "from": "system", "value": "Add fetchStats function in FetchFileFactory\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('fileBrowserApp').factory('FetchFileFactory', ['$http',\n function($http) {\n var _factory = {};\n\n _factory.fetchFile = function(file) {\n re...
javascript
chosen
[ { "from": "system", "value": "Include detail in \"The listed user cannot be searched\" message" }, { "from": "human", "value": "let index = 0;\nconst logEntries = [];\nfor (let i = 0; i < 500; i++) {\n logEntries.push(null);\n}\n\nexport function getLog() {\n return logEntries;\n}\nexport func...
javascript
chosen
[ { "from": "system", "value": "Add adding new social record\n" }, { "from": "human", "value": "import React from 'react';\nimport update from 'immutability-helper';\nimport * as firebase from 'firebase';\nimport { Field } from '../Field';\nimport { notifications } from '../../service/notification...
javascript
chosen
[ { "from": "system", "value": "Remove finish screen from empty default story\n" }, { "from": "human", "value": "/*global document, alert*/\n'use strict';\n\nvar editStory = require('./edit-story');\n\nfunction emptyStory() {\n return {\n locations: {\n start: {}\n },\n screens: {\n...
javascript
chosen
[ { "from": "system", "value": "Add client to lib wrap\n" }, { "from": "human", "value": "'use strict';\nmodule.exports = {\n 'decode': require('./decode'),\n 'encode': require('./encode'),\n 'Server': require('./server'),\n};\n" }, { "from": "gpt", "value": "'use strict';\nmodule.e...
javascript
chosen
[ { "from": "system", "value": "Put generated controller file into api/controllers\n" }, { "from": "human", "value": "/**\n * sails-generate-controller\n *\n * Usage:\n * `sails generate controller`\n *\n * @type {Object}\n */\n\nmodule.exports = {\n\n\ttemplatesDirectory: require('path').resolve(...
javascript
chosen
[ { "from": "system", "value": "Clean up Firebase middleware code.\n" }, { "from": "human", "value": "import {\n LOAD_MESSAGES,\n LOGIN,\n LOGOUT,\n SAVE_PREFERENCES,\n SEND_MESSAGE,\n UPDATE_USER\n} from '../../actions'\n\nconst firebaseMiddleware = firebase => store => next => action => {\...
javascript
chosen
[ { "from": "system", "value": "Add pressure readings to sensor simulator" }, { "from": "human", "value": "var Bacon = require('baconjs')\nvar _ = require('lodash')\n\nvar simulatorStream = Bacon.interval(2000)\n .map(() => ({\n tag: 't',\n instance: _.random(1, 3),\n temperature: _.rand...
javascript
chosen
[ { "from": "system", "value": "Add name and id to success action\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport { take, put, spawn, call, select } from 'redux-saga/effects'\n\nimport {\n TASK__START,\n TASK__PROGRESS,\n TASK__SUCCESS,\n TASK__ERROR,\n TASK__CLEAR,\n} from ...
javascript
chosen
[ { "from": "system", "value": "Support CDN prefix for production builds\n\nSigned-off-by: Rohan Jain <f3a935f2cb7c3d75d1446a19169b923809d6e623@gmail.com>\n" }, { "from": "human", "value": "/* global require, module */\nvar EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nmodule.exports ...
javascript
chosen
[ { "from": "system", "value": "Clone object before processing JSON\n" }, { "from": "human", "value": "\n/**\n *\n *\n * @param {object} object The output from Alpaca\n * @return {object} A corrected version of the output. This should be a\n * valid Swagger spec.\n ...
javascript
chosen
[ { "from": "system", "value": "Simplify _getHostURL using Ternary operator\n" }, { "from": "human", "value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozil...
javascript
chosen
[ { "from": "system", "value": "Use external window for tumlr share\n" }, { "from": "human", "value": "((window, document) => {\n const encode = window.encodeURIComponent;\n const $ = document.querySelector.bind(document);\n const $$ = document.querySelectorAll.bind(document);\n const url = ((...
javascript
chosen
[ { "from": "system", "value": "Add two string dot joiner method\n" }, { "from": "human", "value": "module.exports = {\n arraysAreEqual : function(a, b) {\n for(var i = 0; i < a.length; i++){\n if(a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n};\n" }, ...
javascript
chosen
[ { "from": "system", "value": "Make example work with refactored code.\n" }, { "from": "human", "value": "require.paths.unshift('../lib')\nvar xmpp = require('node-xmpp');\nvar inflect = require('inflect');\n\nvar options = {\n type: 'client',\n jid: 'user@example.com',\n password: 'secret',\n...
javascript
chosen
[ { "from": "system", "value": "Remove use of arrow function\n" }, { "from": "human", "value": "/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2016, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| T...
javascript
chosen
[ { "from": "system", "value": "Handle flags and options with minimist\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar elementorServer = require('../lib/server');\n\nelementorServer.start();\n" }, { "from": "gpt", "value": "#!/usr/bin/env node\n\nvar minimist = require('m...
javascript
chosen
[ { "from": "system", "value": "Add test for Groovy findById() function\n" }, { "from": "human", "value": "var should = require('should');\nvar mogwai = require('../');\n\n\nvar UserSchema = new mogwai.Schema({\n name: String\n});\n\nUser = mogwai.model('User', UserSchema);\n\nvar user;\n\ndescri...
javascript
chosen
[ { "from": "system", "value": "Fix to use object rest spread syntax\n" }, { "from": "human", "value": "import rendererMixin from './mixins/renderer'\nimport incrementalizedRules from './mixins/rules'\n\nconst mixinTo = (base, mixin) =>\n (Object.assign(Object.create(Object.getPrototypeOf(base)),...
javascript
chosen
[ { "from": "system", "value": "Fix fatal error on pages with nested nodes in header\n" }, { "from": "human", "value": "import React, {PureComponent, PropTypes, createElement} from 'react'\nimport {Link} from 'react-scroll'\n\nimport {Link as LinkIcon} from '../icons'\nimport {scrollDuration} from...
javascript
chosen
[ { "from": "system", "value": "Add article-identifier to article in HTML\n" }, { "from": "human", "value": "'use strict';\n\nvar ArticleLoader = new Class({\n feed: 12,\n page: 0,\n\n initialize: function (feed) {\n this.feed = feed;\n\n this.getArticles();\n },\n\n g...
javascript
chosen
[ { "from": "system", "value": "Update channel mapping ot use process.cwd()\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar fs = require('fs');\nvar path = require('path');\nvar errors = require('./errors');\n\nfunction getChannelMapping() {\n var mapping = process.env.CHANNEL_...
javascript
chosen
[ { "from": "system", "value": "Exclude all except staging and production\n" }, { "from": "human", "value": "const Client = require('../binary/base/client').Client;\nconst getLanguage = require('../binary/base/language').getLanguage;\nconst url_for_static = require('../binary/base/url')...
javascript
chosen