conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Comment backdrop attribute of modal" }, { "from": "human", "value": "export default {\n stylePrefix: 'mdl-',\n\n title: '',\n\n content: '',\n\n backdrop: true,\n\n // Avoid rendering the default modal.\n custom: false,\n\n /**\n * Extend ModalView object (...
javascript
chosen
[ { "from": "system", "value": "Fix teardown of routeless engines mounted from Route.\n\nSpecify `ViewClass` instead of instantiating `view` to ensure that\n`ownerView` will be set properly." }, { "from": "human", "value": "import Ember from 'ember';\n\nconst {\n Route,\n getOwner,\n run\n} = E...
javascript
chosen
[ { "from": "system", "value": "Change init event to service:running\n\nservice:running is the best one to ensure BrowserSync has fully loaded.\r\n\r\nIt is triggered after any initialization function and DNS lookup." }, { "from": "human", "value": "/*\n * grunt-browser-sync\n * https://github.com...
javascript
chosen
[ { "from": "system", "value": "Remove resume iframe jQuery. Iframe doesn't bubble up and remove easily with jQuery.\n" }, { "from": "human", "value": "// $(document).ready(function(){\n// // On click of resume link\n// $(\".navLinkContainer__resumeLink\").on (\"click\", function(){\n// v...
javascript
chosen
[ { "from": "system", "value": "Handle 500 error and removed old unused code\n" }, { "from": "human", "value": "var logEvents = angular.module('logEvents', []);\n\nfunction mainController($scope, $http) {\n\t$scope.formData = {};\n\n\t// when landing on the page, get all events and show them\n\t$h...
javascript
chosen
[ { "from": "system", "value": "Convert to Symbol and getter\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = class Plugin {\n \n constructor(name) {\n this._name = name;\n }\n \n /**\n * Add this plugin to the configuration object.\n */\n conf...
javascript
chosen
[ { "from": "system", "value": "Add function that displays prices\n" }, { "from": "human", "value": "import 'whatwg-fetch';\n\nvar helpers = {\n checkStatus,\n parseJSON,\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n};\n\nfunction checkStatus(res...
javascript
chosen
[ { "from": "system", "value": "Remove an annoying log and remove introduction of oceanic fauna namespace, where there is no need for an additional namespace.\n" }, { "from": "human", "value": "/**\n *\n * Copyright (c) 2020 Silicon Labs\n *\n * Licensed under the Apache License, Version 2.0...
javascript
chosen
[ { "from": "system", "value": "Update ajax callback action param\n" }, { "from": "human", "value": "(function ( $ ) {\n\t\"use strict\";\n\n\t$(function () {\n\n\t\t// catch the upvote/downvote action\n\t\t$( 'div.comment-weight-container' ).on( 'click', 'span > a', function( e ){\n\t\t\te.preven...
javascript
chosen
[ { "from": "system", "value": "Remove paragraph trimming in the Medium Editor validator to stop it from trimming paragraphs that contain only images.\n" }, { "from": "human", "value": "'use strict';\n\nvar sanitizeHTML = require('sanitize-html');\n\nfunction decodeHtml(html) {\n var txt = docume...
javascript
chosen
[ { "from": "system", "value": "Fix class name in test event\n" }, { "from": "human", "value": "const EventEmitter = require('events').EventEmitter;\n\n/**\n * A very classy class with lots of class\n * @extends EventEmitter\n */\nclass ClassyClass extends EventEmitter {\n\t/**\n\t * Constructs a ...
javascript
chosen
[ { "from": "system", "value": "Send receiving user with api/users/:id/messages\n" }, { "from": "human", "value": "const models = require('../../../database/schemas.js');\n\nmodule.exports = {\n getAllForUser: (req, res) => {\n models.User.findOne({\n where: {\n id: req.params.id,\...
javascript
chosen
[ { "from": "system", "value": "Maintain the current context `this` context when giving the module its own scope\n" }, { "from": "human", "value": "(function() {\n function multifn() {\n var types = [];\n var fallback = noop;\n\n function _multifn_() {\n var i = -1;\n var n = t...
javascript
chosen
[ { "from": "system", "value": "Update to latest ds update\n" }, { "from": "human", "value": "var config;\n\nconfig = {\n // Source and build directory\n src: \"src\",\n build: \"build\",\n // Client and server directory\n client: \"client\",\n server: \"server\",\n // Less directory and en...
javascript
chosen
[ { "from": "system", "value": "Remove function for tax/vat implementing UIU-577 and UIU-578\n" }, { "from": "human", "value": "export function getTotal(amount, taxvat) {\n if (!amount) return parseFloat(0).toFixed(2);\n // eslint-disable-next-line no-restricted-globals\n if (isNaN(amount)) ret...
javascript
chosen
[ { "from": "system", "value": "[DASH-2398] Remove pause from move to element command\n" }, { "from": "human", "value": "// Command that will wait for a given element to be visible, then\n// will move to it, click and pause for 1sec. Mostly used for buttons or any\n// other clickable parts of UI.\...
javascript
chosen
[ { "from": "system", "value": "Remove custom get, post and session data setup\n" }, { "from": "human", "value": "module.exports = function(router, users){\n router.use(function(req, res, next){\n Object.assign(res.locals,{\n postData: (req.body ? req.body : false)\n });\n\n Object....
javascript
chosen
[ { "from": "system", "value": "MOve the login concern to the user model\n" }, { "from": "human", "value": "const bcrypt = require('bcryptjs')\nconst knex = require('../database')\n\nmodule.exports.findOne = (username) => new Promise((resolve, reject) => {\n knex('users').select().where({username...
javascript
chosen
[ { "from": "system", "value": "Use Stripes object from context, not from prop\n\nPart of STRIPES-395.\n" }, { "from": "human", "value": "import _ from 'lodash';\n\nconst IfPermission = props =>\n (props.stripes.hasPerm(props.perm) ? props.children : null);\n\nexport default IfPermission;\n" },...
javascript
chosen
[ { "from": "system", "value": "Remove old todo already done\n" }, { "from": "human", "value": "Ext.namespace('ui','ui.component');\n\n// TODO: Extract the URI specific at php's project into the config file to allow use of others projects\n// ViewVCDiff\n// config - {prefix, fid, fpath, fname, rev...
javascript
chosen
[ { "from": "system", "value": "Update settings and add tasks\n" }, { "from": "human", "value": "'use strict';\n\n// Load requirements\nconst path = require('path'),\n fs = require('fs');\n\n// Helper to avoid a lot of directory traversing\nglobal.__base = path.resolve(__dirname + '/../') + '...
javascript
chosen
[ { "from": "system", "value": "Fix reading values of username and password from the basic authwntication form\n\nWrong selectors were used.\n" }, { "from": "human", "value": "'use strict';\n\nSwaggerUi.Views.BasicAuthButton = Backbone.View.extend({\n\n\n initialize: function (opts) {\n this.o...
javascript
chosen
[ { "from": "system", "value": "Switch sort direction of index in order to improve performance\n" }, { "from": "human", "value": "exports.index = function (collection) {\n collection.getIndexes(function(err, indexes) {\n if (err) {\n if (err.code === 26) { \n //...
javascript
chosen
[ { "from": "system", "value": "Make legacy modules non-strict, as in Meteor versions < 1.3.3.\n" }, { "from": "human", "value": "exports.getDefaults = function getDefaults(features) {\n var options = {\n compact: false,\n sourceMap: \"inline\",\n ast: false,\n babelrc: false,\n //...
javascript
chosen
[ { "from": "system", "value": "Remove old parts of executor_simple" }, { "from": "human", "value": "/* Hypermedia workflow. \r\n ** Amqp task executor which submits commands as amqp messages.\r\n ** This executor is based on executor_simple made by Bartosz Balis\r\n ** Author: Maciej Palwik\r\n *...
javascript
chosen
[ { "from": "system", "value": "Add new config for github deploy\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'eapp',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n EmberE...
javascript
chosen
[ { "from": "system", "value": "Add missing import of tipsy\n" }, { "from": "human", "value": "$(document).on('turbolinks:load', function() {\n\n $('.open-other-statements').click(function(e) {\n e.preventDefault();\n $('.other-statements').toggle();\n });\n\n $('#people-filter li').click...
javascript
chosen
[ { "from": "system", "value": "Fix scope for correlation object\n" }, { "from": "human", "value": "var uniqueID = require('../unique-id');\n promise = require('../promise'),\n commandTimeout = 1000;\n\nmodule.exports = function(serviceType, serviceInstance, command, params){\n var correla...
javascript
chosen
[ { "from": "system", "value": "Fix redirect during jasmine tests\n\nChange https://review.openstack.org/#/c/200725/ added a new test\nthat causes browsers to redirect to the login page while running\nJasmine tests. This changes the test to inject a mock $window\nobject so that the code under test doesn't use...
javascript
chosen
[ { "from": "system", "value": "Fix time synchonization endpoint URL\n" }, { "from": "human", "value": "import { API_URL } from './constants';\n\nexport const getCurrentUserURL = () => `${API_URL}currentUser`;\nexport const getCurrentTimeURL = () => `${API_URL}getTime`;\n\nexport const getContests...
javascript
chosen
[ { "from": "system", "value": "Enable nested sortable field sets\n" }, { "from": "human", "value": "// Sortable fields\n\n$(document).on('turbolinks:load app:block-slot-after-insert', function() {\n var $fieldSets = $('.sortable-field-set');\n\n $fieldSets.each(function() {\n var $fieldSet =...
javascript
chosen
[ { "from": "system", "value": "Fix event parameter. Send 500 when file not found\n" }, { "from": "human", "value": "const fs = require('fs')\nconst path = require('path')\nconst mime = require('mime-types')\n\nconst { getElapsedTime } = require('../dates')\n\nmodule.exports = (req, res, next, {co...
javascript
chosen
[ { "from": "system", "value": "Normalize check email step errors\n" }, { "from": "human", "value": "'use strict';\n\nconst AccountManager = require('../account-manager');\nconst {handleResponseData} = require('../utils');\n\nmodule.exports = class CheckEmail {\n constructor({name, retryStep} = {...
javascript
chosen
[ { "from": "system", "value": "Fix cave combat to reflect new battle sizes. 9x9\n" }, { "from": "human", "value": "eburp.registerMap(\"caveCombat\",{\n name: \"Cave Combat\",\n width: 9,\n height: 8,\n map: \"\\\nC'''''''C\\\nC'''''''C\\\nC'''''''C\\\nC'''''''C\\\nC'''''''C\\\nC'''''''C\...
javascript
chosen
[ { "from": "system", "value": "Move table JS outside of scrolling\n" }, { "from": "human", "value": "$(document).ready(function () {\n var sections = $('div.section');\n var activeLink = null;\n var bottomHeightThreshold = $(document).height() - 30;\n\n $(window).scroll(function (event) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use Array.isArray() instead of lodash.\n" }, { "from": "human", "value": "import * as _ from \"lodash\";\nimport sinon from \"sinon\";\nimport jQueryObject from \"./jQueryObject\";\n\nconst arrayEach = ( a, c ) => {\n\tfor ( let i = 0; i < a.length; i++ ) {\n\t\tc( ...
javascript
chosen
[ { "from": "system", "value": "Add full browser height page layout.\n" }, { "from": "human", "value": "/* @flow */\nimport React, { Component, PropTypes } from 'react';\nimport GrommetApp from 'grommet/components/App';\nimport { AppContainer as ReactHotLoader } from 'react-hot-loader';\nimport { ...
javascript
chosen
[ { "from": "system", "value": "Switch runId to use md5.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @module computation-service\n */\nconst common = require('coinstac-common');\nconst Computation = common.models.computation.Computation;\nconst ModelService = require('../model-serv...
javascript
chosen
[ { "from": "system", "value": "Use https instead of s3:// for benchm-ml\n" }, { "from": "human", "value": "// This file is part of MLDB. Copyright 2015 Datacratic. All rights reserved.\n\nfunction assertEqual(expr, val, msg)\n{\n if (expr == val)\n return;\n if (JSON.stringify(expr) ...
javascript
chosen
[ { "from": "system", "value": "Fix nearby stops not loading\n" }, { "from": "human", "value": "import { observable, action, reaction } from 'mobx';\n\nimport storeCoords from 'stores/coords.js';\n\nexport default new class StoreSearch {\n\t\n\tdispose = 0\n\t\n\t@observable\n\tquery = ''\n\t\n\t@...
javascript
chosen
[ { "from": "system", "value": "Add React Dev Tools integration\n" }, { "from": "human", "value": "import { h, render } from 'preact';\n\n// this holds our rendered root element so we can re-render in response to HMR updates\nlet root;\n\n// Making our app's initialization a function means it's re...
javascript
chosen
[ { "from": "system", "value": "Add hiking icon for view activities (temporary solution for now).\n" }, { "from": "human", "value": "import { library } from '@fortawesome/fontawesome-svg-core';\n\nimport { faMapMarkerAlt, faCalendarAlt, faBook, faUserFriends,\n faTrash, faEdit } from '@fo...
javascript
chosen
[ { "from": "system", "value": ":eyes: Return better default avatars when 'gravatar' images are not defined\n" }, { "from": "human", "value": "import gravatar from 'gravatar';\n\n// Resolve gravatar url\nexport const getAvatarFromEmail = email => gravatar.url(email, { s: '200' });\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Add wildcard to end of query for partial word search\n" }, { "from": "human", "value": "console.log(\"=================================\");\nconsole.log(\"Creating search index...\");\nconsole.log(\"=================================\");\n\n// Scan through all conten...
javascript
chosen
[ { "from": "system", "value": "Return url of asset on save. Implemented get by id functionality.\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction save(request, response){\n\tresponse.status(201).end();\n}\n\nfunction getById(request, response){\n\tresponse.end(\"<h1>Not Found</h1>\"...
javascript
chosen
[ { "from": "system", "value": "Delete all jobs on cleanup\n" }, { "from": "human", "value": "var express = require('express');\nvar kue = require('kue');\nvar Bot = require('../models/bot');\n\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/', function(req, res, next) {\n r...
javascript
chosen
[ { "from": "system", "value": "Add a protected route /secret\n" }, { "from": "human", "value": "\n'use strict'\n\nconst router = require('express').Router()\n\nrouter.get('/', (req, res) => {\n\tres.json({message: 'success'})\n})\n\nmodule.exports = router" }, { "from": "gpt", "value"...
javascript
chosen
[ { "from": "system", "value": "Allow only one simultaneous command.\n" }, { "from": "human", "value": "$(document).ready(function () {\n $.each($(\".lightcontrol-btn\"), function() {\n $(this).data(\"original-color\", $(this).css(\"background-color\"));\n $(this).on(\"click\", function () ...
javascript
chosen
[ { "from": "system", "value": "Update content for order states in collection filters\n\nThis corrects the text used for order states in the collection filter.\n" }, { "from": "human", "value": "const ORDER_STATES = [\n {\n value: 'draft',\n label: 'Draft',\n },\n {\n value: 'quote_awa...
javascript
chosen
[ { "from": "system", "value": "Change github oauth app's perms to READONLY.\n" }, { "from": "human", "value": "/*\nOn window resize, call updateHeight() to resize the height of the page\ncomponents so that there's no global scroll for the page.\n*/\n$(window).resize(updateHeight);\n\n/* Routers *...
javascript
chosen
[ { "from": "system", "value": "Make sure down_panel wrapper has flex-basis of 'auto'\n" }, { "from": "human", "value": "import { baseFonts } from '@storybook/components';\n\nexport default {\n empty: {\n flex: 1,\n display: 'flex',\n ...baseFonts,\n fontSize: 11,\n letterSpacing: ...
javascript
chosen
[ { "from": "system", "value": "Remove stray Git conflict markers\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: 'singleLinePerSelector',\n nodeTypes: ['ruleset'],\n message: 'Each selector should be on its own line.',\n\n lint: function singleLinePerSel...
javascript
chosen
[ { "from": "system", "value": "Revert \"After login, goto mood page\"\n\nThis reverts commit 6ef109dd17c8fadcc5b635292b91ba6b81e0eab3.\n" }, { "from": "human", "value": "/**\n * GET /\n * Home page.\n */\nexports.index = (req, res) => {\n return res.redirect('/mood');\n};\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Remove strict mode from hc-scripts\nSome of the scripts don't work with it enabled.\n" }, { "from": "human", "value": "const yargs = require('yargs');\n\nprocess.on('unhandledRejection', (reason, promise) => {\n console.error('Unhandled rejection at: Promise', prom...
javascript
chosen
[ { "from": "system", "value": "Add css class for mobile modal canvas.\n" }, { "from": "human", "value": "import { Component, $$, domHelpers } from '../dom'\n\nexport default class ModalCanvas extends Component {\n getActionHandlers () {\n return {\n cancel: this._cancel,\n confirm: ...
javascript
chosen
[ { "from": "system", "value": "Return a comma-separated string of all ips in the X-Forwarded-For header.\n\nThis mimics the behavior of the sample app https://cryptic-ridge-9197.herokuapp.com/api/whoami/ when the user supplies its own\nheader.\n" }, { "from": "human", "value": "'use strict';\n\nc...
javascript
chosen
[ { "from": "system", "value": "Use engine’s controller + view when rendering from Route." }, { "from": "human", "value": "import Ember from 'ember';\n\nconst {\n Route,\n getOwner,\n run\n} = Ember;\n\nRoute.reopen({\n mount(engine, options) {\n console.log('mount', options);\n\n let ow...
javascript
chosen
[ { "from": "system", "value": "Issue-7: Add support for git@github.com remotes\n\nCloses #7\nenhancement\nSemVer:Minor\n" }, { "from": "human", "value": "\"use strict\";\n\n// Node\nconst url = require(\"url\");\n\n// Third Party\nconst compact = require(\"lodash/fp/compact\");\nconst flow = requ...
javascript
chosen
[ { "from": "system", "value": "Fix script filenames for @cassette/hooks.\n" }, { "from": "human", "value": "var getPackageWebpackConfig = require('../../getPackageWebpackConfig');\n\nmodule.exports = getPackageWebpackConfig({\n packageName: '@cassette/core',\n hasStyles: false,\n entrySrc: './...
javascript
chosen
[ { "from": "system", "value": "Update webpack babel-loader to es2017\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n entry: './src/index.js',\n output: {\n path: __dirname + '/dist',\n filename: 'bundle.js',\n publicPath: '/dist/'\n },\n\n resol...
javascript
chosen
[ { "from": "system", "value": "Remove autopopulation from User model\n" }, { "from": "human", "value": "var modelProperties, mongoose, passportLocalMongoose, Rat, Schema, UserSchema;\n\nmongoose = require( 'mongoose' );\npassportLocalMongoose = require( 'passport-local-mongoose' );\nRat = require...
javascript
chosen
[ { "from": "system", "value": "[TASK] Set a more generic url bust scheme for requireJS modules\n" }, { "from": "human", "value": "/**\n * RequireJS configuration\n * @description Pass in options for RequireJS like paths, shims or the baseUrl\n */\nrequire.config({\n\tpaths: {\n\t\t\"mainModule\" ...
javascript
chosen
[ { "from": "system", "value": "Add get all github activities route\n" }, { "from": "human", "value": "import Job from './handlers/job'\nimport Home from './handlers/home'\nimport Ping from './handlers/ping'\n\nexport default [\n { method: 'GET', path: '/', config: { auth: false, handler: Home } ...
javascript
chosen
[ { "from": "system", "value": "Use initial value from api\n" }, { "from": "human", "value": "import {div, header, footer, button, p, hJSX} from '@cycle/dom'\nimport isolate from '@cycle/isolate'\nimport AceEditor from 'cyclejs-ace-editor'\n\nlet {Observable} = require('rx')\n\nfunction intent({DO...
javascript
chosen
[ { "from": "system", "value": "Use players instead of todos\n" }, { "from": "human", "value": "// The types of actions that you can dispatch to modify the state of the store\nexport const types = {\n ADD: 'ADD',\n REMOVE: 'REMOVE',\n}\n\n// Helper functions to dispatch actions, optionally with ...
javascript
chosen
[ { "from": "system", "value": "Remove lingering require on lodash\n" }, { "from": "human", "value": "/* jshint node: true */\n\n'use strict';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n\nvar _ = requ...
javascript
chosen
[ { "from": "system", "value": "Remove redundant properties inherited from parent class.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file e...
javascript
chosen
[ { "from": "system", "value": "Add function for placing footnotes\n" }, { "from": "human", "value": "/**\n * Main JS file for Casper behaviours\n */\n\n/* globals jQuery, document */\n(function ($, undefined) {\n \"use strict\";\n\n var $document = $(document);\n\n $document.ready(functi...
javascript
chosen
[ { "from": "system", "value": "Write tests for the module\n" }, { "from": "human", "value": "import {expect} from 'chai';\nimport {composeAll} from '../';\nconst {describe, it} = global;\n\ndescribe('Module', () => {\n describe('createApp', async () => {\n it('should create app with provided ...
javascript
chosen
[ { "from": "system", "value": "Make the 405 response more valid, and also JSON.\n" }, { "from": "human", "value": "exports.AllowedMethods = function (app, methods) {\n return function (env) {\n if (methods.indexOf(env.REQUEST_METHOD) === -1) return {\n status : 405,\n ...
javascript
chosen
[ { "from": "system", "value": "Modify camera to allow zooming and better rendering\n" }, { "from": "human", "value": "function Camera() {\n\n function _print() {\n console.log(x, y);\n }\n\n function _move(_x, _y) {\n x += _x;\n y += _y;\n }\n\n function getWid...
javascript
chosen
[ { "from": "system", "value": "Tweak search distance in article (should probably minimize article size too).\n" }, { "from": "human", "value": "import Fuse from \"fuse.js\";\n\n\nconst options = {\n include: [\"matches\"],\n shouldSort: true,\n tokenize: true,\n threshold: 0.3,\n location: 0...
javascript
chosen
[ { "from": "system", "value": "Change location of test database\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n\n unittest: {\n client: 'sqlite3',\n connection: {\n filename: './test/data/test.sqlite3'\n //filename: ':memory:'\n ...
javascript
chosen
[ { "from": "system", "value": "Convert background image example screen to using scroll view.\n" }, { "from": "human", "value": "W.ImageBackground = function() {\n var win = UI.Win({\n title:'Background Images',\n layout:'vertical'\n });\n \n var label = Ti.UI.createLabel({\n text:'It...
javascript
chosen
[ { "from": "system", "value": "Remove window param from self-exec main function\n" }, { "from": "human", "value": "(function (window, $) {\n 'use strict';\n var partner = 'YW5kcm9pZC12M3M',\n build_url = function (url, params) {\n return url + '?' + $.param(params);\n ...
javascript
chosen
[ { "from": "system", "value": "Add list requirement and fix commander settings\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\nvar program = require('commander');\n\n/**\n * Init.\n */\nvar version = \"0.1.0\"\n\n/**\n * Config.\n */\nprogram\n .versi...
javascript
chosen
[ { "from": "system", "value": "Use jsonfile helper to create package.json fixture.\n" }, { "from": "human", "value": "/**\n * Dependencies\n */\nvar TemplateManifest = require('./fixtures/TemplateManifest');\nvar FileHeap = require('./fixtures/FileHeap');\n\n\nbefore(function (cb) {\n\tvar self =...
javascript
chosen
[ { "from": "system", "value": "Add code to draw the graph.\n" }, { "from": "human", "value": "$(document).ready(function() {\n});\n" }, { "from": "gpt", "value": "var options = {\n chart: {\n renderTo: 'chart'\n },\n legend: {\n enabled: false\n },\n title:...
javascript
chosen
[ { "from": "system", "value": "Integrate logger middleware with redux\n" }, { "from": "human", "value": "import { createStore, applyMiddleware } from 'redux'\nimport rootReducer from '../reducers/index'\n\nconst createStoreWithMiddleware = applyMiddleware()(createStore)\n\nexport default function...
javascript
chosen
[ { "from": "system", "value": "Add return type to darken\n" }, { "from": "human", "value": "// @flow\nimport Color from 'color'\n\nexport const darkText = '#2b2b2b'\nexport const primary = '#685eb2'\n\n// Modifier Functions\nexport function darken(colour: string, level: number = 0.2) {\n return ...
javascript
chosen
[ { "from": "system", "value": "Add logging to server PUT\n" }, { "from": "human", "value": "'use strict';\n\nvar env = require('./env.json');\n\nfunction httpPost(req, cb) {\n var https = req.deps.https;\n console.log('env:', env);\n\n var postData = JSON.stringify({\n metadata: req.data.s3...
javascript
chosen
[ { "from": "system", "value": "Fix shell-on-build-end-webpack plugin run flag being set globally" }, { "from": "human", "value": "const { exec } = require(\"child_process\");\n\nlet ran = false;\n\n/**\n * @typedef {Object} Options\n * @property {string} command - The command to run\n * @property...
javascript
chosen
[ { "from": "system", "value": "Add 'build' gulp task and make the 'default' task clean, build and generate sw\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar oghliner = require('oghliner');\nvar fse = require('fs-extra');\n\ngulp.task('default', function() {\n fse.removeSync(...
javascript
chosen
[ { "from": "system", "value": "Watch on test files to automatically run tests task\n" }, { "from": "human", "value": "var gulp = require(\"gulp\");\nvar uglify = require(\"gulp-uglify\");\nvar rename = require(\"gulp-rename\");\nvar mocha = require(\"gulp-mocha\");\nvar istanbul = require(\"gulp-...
javascript
chosen
[ { "from": "system", "value": "Remove lint task from prod\n" }, { "from": "human", "value": "/* eslint-disable */\nconst gulp = require('gulp');\nconst tasks = require('strt-gulptasks')({\n source: 'src',\n output: 'public/dist',\n scripts: {\n publicPath: '/dist/scripts',\n },\n serve: {...
javascript
chosen
[ { "from": "system", "value": "Build ebooks as part of CI tasks\n" }, { "from": "human", "value": "const gulp = require('gulp'); \nconst del = require('del');\nconst gulpGitbook = require('gulp-gitbook'); \nconst shell = require('gulp-shell');\nconst gulpLoadPlugins = require('gulp-load-plugins...
javascript
chosen
[ { "from": "system", "value": "Add thermostat control to REST example\n" }, { "from": "human", "value": "var Insteon = require('home-controller').Insteon;\nvar hub = new Insteon();\nvar route = require('koa-route');\nvar koa = require('koa');\nvar app = koa();\n\napp.use(function *(next){\n try ...
javascript
chosen
[ { "from": "system", "value": "Simplify Airbrake Singleton, thread environment" }, { "from": "human", "value": "var Client = require(\"../client\"),\n Processor = require(\"../processors/browser_processor\"),\n\n// This error-to-array-of-strings implementation can be swapped out\nvar printStac...
javascript
chosen
[ { "from": "system", "value": "Add karma serve path for MutationObservers and WeakMap\n" }, { "from": "human", "value": "module.exports = function(karma) {\n var common = require('../../tools/test/karma-common.conf.js');\n\n karma.set(common.mixin_common_opts(karma, {\n // base path, that wi...
javascript
chosen
[ { "from": "system", "value": "SAR-9536: Fix 'return' link on save page\n" }, { "from": "human", "value": "var backLinks = document.querySelectorAll('a[href=\"#\"][class=\"govuk-back-link\"]')\n\nif (backLinks.length > 0) {\n backLinks.forEach(element => element.addEventListener('click', funct...
javascript
chosen
[ { "from": "system", "value": "Change name of Viggle back button\n" }, { "from": "human", "value": "(function() {\n\tfunction onBridgeIsReady () {\n\t\tVAPP.setTitleBarTitle(function(message) {}, 'Who am I?');\n\t\t\n\t\tVAPP.getCurrentShow(function (message) {\n\t\t\tvar showInfo = JSON.parse(me...
javascript
chosen
[ { "from": "system", "value": "FIX : adresse du lien en paramètre \n\n" }, { "from": "human", "value": "\nimport React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport messages from './messages';\n\nimport ButtonStyle from './ButtonStyle';\n\n\nfunction LinkButton() {\n retu...
javascript
chosen
[ { "from": "system", "value": "Fix api server crashing when response isn't an array\n" }, { "from": "human", "value": "import request from 'request';\nimport { parseString } from 'xml2js';\n\nexport default function loadFromBGG(req) {\n return new Promise((resolve, reject) => {\n request({\n ...
javascript
chosen
[ { "from": "system", "value": "Sort tracks and albums by popularity in artist model\n" }, { "from": "human", "value": "\"use strict\";\n\nangular\n .module('app')\n .factory('ArtistModel', [\n function () {\n function ArtistModel(data) {\n angular.forEach(data, function(value, ke...
javascript
chosen
[ { "from": "system", "value": "Remove \"Woah, scary\" confirm dialogue\n\nNowhere in publisher was using this confirm message.\n" }, { "from": "human", "value": "//= require select2\n//= require moment\n//= require jquery-ui.custom.min\n//= require_directory .\n//= require_directory ./modules\n//...
javascript
chosen
[ { "from": "system", "value": "Remove redundant call to Foundation framework javascripts\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directo...
javascript
chosen
[ { "from": "system", "value": "Revert \"Add google analytics code.\"\n\nThis reverts commit 2a7e971ac7ea804d5d4b1547d5bbc904d6f52e37.\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into including all the files listed below.\n// Add new JavaScript/Coffee code in ...
javascript
chosen
[ { "from": "system", "value": "Move off of deprecated API\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport reopenRoute from 'ember-redirect/utils/reopen-route';\n\nexport default {\n name: 'redirect',\n\n initialize: function(instance) {\n var router = instance.conta...
javascript
chosen
[ { "from": "system", "value": "Fix: Add custom focus outline for <summary> element\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport Styled from 'rsg-components/Styled';\n\nconst styles = ({ space, color, fontSize, fontFamily }) => ({\n\tsu...
javascript
chosen
[ { "from": "system", "value": "Fix error when npmName return false\n" }, { "from": "human", "value": "'use strict';\nvar _ = require('lodash');\nvar path = require('path');\nvar npmName = require('npm-name');\n\nmodule.exports = function askName(prompt, generator, cb) {\n var prompts = [prompt, ...
javascript
chosen