conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Clean up how timelines respond to tweets\n" }, { "from": "human", "value": "YUI.add(\"model-timeline-base\", function(Y) {\n \"use strict\";\n \n var models = Y.namespace(\"Falco.Models\"),\n \n TimelineBase;\n \n TimelineBase = Y.Ba...
javascript
chosen
[ { "from": "system", "value": "Include new libraries in the project.\n" }, { "from": "human", "value": "'use strict';\n\n/* \n * Angular Seed - v0.1 \n * https://github.com/rachellcarbone/angular-seed/\n * Copyright (c) 2015 Rachel L Carbone; Licensed MIT\n */\n\n// Include modules, and run appli...
javascript
chosen
[ { "from": "system", "value": "Refactor spaceCase to combine \"ltrim/rtrim\" into one regex\n" }, { "from": "human", "value": "const spaceCase = (a) => {\n return a\n .replace(/(_|-|\\.)/g, ' ')\n .replace(/([A-Z])/g, ' $1')\n .replace(/\\s+/g, ' ')\n .replace(/^\\s+/, '')\n .repl...
javascript
chosen
[ { "from": "system", "value": "Use method instead of property\n" }, { "from": "human", "value": "// Include needed files\nvar fluffbot = require('../lib/fluffbot')\nvar discord = require('discord.js')\nvar event = require('../lib/event')\n\n// Instantiate bots\nvar fluffbot = new fluffbot()\ndisc...
javascript
chosen
[ { "from": "system", "value": "Revert \"Fixed the response to any mention of the technical (summary) assessment.\"\n\nThis reverts commit 36ab954db67f20fbb0612d10d2017bb4df893878.\n" }, { "from": "human", "value": "'use strict';\n\nvar exec = require('child_process').exec;\n\nmodule.exports = fun...
javascript
chosen
[ { "from": "system", "value": "Update indentation to 2 spaces\n" }, { "from": "human", "value": "var Series = require('hapi-next'),\n Validator = require('modules/authorization/validator'),\n Controller = require('modules/authorization/controller');\n\nmodule.exports = {\n\t\n\tlogin : {\n\...
javascript
chosen
[ { "from": "system", "value": "Create new API key on launching a new stack\n" }, { "from": "human", "value": "import response from 'cfn-response'\nimport SNS from 'aws/sns'\nimport { Settings } from 'model/settings'\n\nexport async function handle (event, context, callback) {\n if (event.Request...
javascript
chosen
[ { "from": "system", "value": "Use generic Android Emulator, add device-orientation\n" }, { "from": "human", "value": "// Test runner\nvar runTests = require('./affixing-header-specs'),\n browsers = [\n {browserName: 'chrome'},\n {browserName: 'firefox'}\n ];\n\n// var brows...
javascript
chosen
[ { "from": "system", "value": "Update examples to return env from output defined on parent workflow\n" }, { "from": "human", "value": "'use strict';\n\n// workflows/createDeployment\nvar Joi = require('joi');\n\nmodule.exports = {\n schema: Joi.object({\n deployerId: Joi.string().required(),\...
javascript
chosen
[ { "from": "system", "value": "Move selectSpaceshipsData to global reducer\n" }, { "from": "human", "value": "import { createAction, handleActions } from 'redux-actions'\n\nexport const INITIAL_DATA = 'INITIAL_DATA'\n\nexport const initialData = createAction(INITIAL_DATA)\n\nconst spaceshipsDataR...
javascript
chosen
[ { "from": "system", "value": "Check for element before tryign to retrive an attibiute of that element\n" }, { "from": "human", "value": "module.exports = {\n sortChildren (data) {\n data.forEach((el) => {\n if (el.parent) {\n this.findNestedObject(data, el.parent[0].admin.uid).ch...
javascript
chosen
[ { "from": "system", "value": "Remove IdMap from Orbit exports.\n" }, { "from": "human", "value": "import OC from 'orbit-common/main';\nimport Cache from 'orbit-common/cache';\nimport IdMap from 'orbit-common/id-map';\nimport Schema from 'orbit-common/schema';\nimport Serializer from 'orbit-commo...
javascript
chosen
[ { "from": "system", "value": "Add client side script functions to display the checkout form" }, { "from": "human", "value": "define(\n [\n 'Magento_Payment/js/view/payment/cc-form'\n ],\n function (Component) {\n 'use strict';\n return Component.extend({\n ...
javascript
chosen
[ { "from": "system", "value": "Add University associations with User, School\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(sequelize, DataTypes) {\n var University = sequelize.define(\"University\", {\n name: {\n type: DataTypes.STRING,\n ...
javascript
chosen
[ { "from": "system", "value": "Remove firebase config from resp\n" }, { "from": "human", "value": "const functions = require('firebase-functions');\nconst { getPullRequestsForUser } = require('./github.js');\n\nexports.user = functions.https.onRequest(async (request, response) => {\n try {\n ...
javascript
chosen
[ { "from": "system", "value": "Add property to access element of the content header\n" }, { "from": "human", "value": "(function(app) {\n 'use strict';\n\n var jCore = require('jcore');\n var helper = app.helper || require('../helper.js');\n\n var ContentHeader = helper.inherits(function() {\...
javascript
chosen
[ { "from": "system", "value": "Refactor template web sample to use compileTemplateFile\n" }, { "from": "human", "value": "\rvar cobs = require('../..'),\r http = require('http'),\r fs = require('fs');\r\rfunction compileFile(filename) {\r var content = fs.readFileSync(filename).toString(...
javascript
chosen
[ { "from": "system", "value": "Use object destructuring for resident attributes\n" }, { "from": "human", "value": "import newResidentAndResidencySchema from '/both/schemas/newResidentAndResidencySchema';\n\nMeteor.methods({\n addNewResidentAndResidency (document) {\n // set up validation cont...
javascript
chosen
[ { "from": "system", "value": "Use brighter colors in contextual Graphite graphs\n" }, { "from": "human", "value": "// TODO: This is not a real model or controller\nApp.Graphs = Ember.Controller.extend({\n graph: function(emberId, entityName, entityType, numSeries) {\n entityName = entityName...
javascript
chosen
[ { "from": "system", "value": "Add common chunks to dedupe common deps between lazy components.\n" }, { "from": "human", "value": "const path = require('path');\nconst context = path.join(__dirname, 'site');\nconst public = path.join(__dirname, 'public');\n\nmodule.exports = {\n context,\n devS...
javascript
chosen
[ { "from": "system", "value": "Use backend_id instead of Waldur UUID for OpenStack\n" }, { "from": "human", "value": "import template from './appstore-field-select-openstack-tenant.html';\n\nclass AppstoreFieldSelectOpenstackTenantController {\n // @ngInject\n constructor(ncUtilsFlash, openstac...
javascript
chosen
[ { "from": "system", "value": "Change webpack library target to commonjs\n" }, { "from": "human", "value": "module.exports = {\n entry: \"./src/ko-calendar.js\",\n output: {\n filename: \"./ko-calendar.js\",\n libraryTarget: \"commonjs2\"\n }\n}" }, { "from": "gpt",...
javascript
chosen
[ { "from": "system", "value": "Set bamboo generation percent to 0 until water is ready\n" }, { "from": "human", "value": "var biomes = {\n \"riverLand\": {\n probability: 0.8,\n tiles: {\n \"bambooBush\": 0.8,\n \"rockCluster\": 0.2\n }\n },\n \"for...
javascript
chosen
[ { "from": "system", "value": "Fix error \"The provided value ... is not an absolute path!\"\n" }, { "from": "human", "value": "/* eslint-env node */\n/* eslint-disable no-console */\n\nconst webpack = require('webpack');\nconst debug = require('debug')('app:webpack');\n\nconst isDev = process.en...
javascript
chosen
[ { "from": "system", "value": "Exit the process if there is a compile error in a production build\n" }, { "from": "human", "value": "const fs = require('fs');\nconst Encore = require('@symfony/webpack-encore');\n\nconst { paths, js: { entries, vendor } } = JSON.parse(fs.readFileSync('./package.js...
javascript
chosen
[ { "from": "system", "value": "Set default values for slider\n" }, { "from": "human", "value": "import {PluginNotFound} from 'Exception/PluginNotFound';\n\nexport class Slider\n{\n constructor(element)\n {\n if (!$.isFunction($.fn.slider)) {\n throw new PluginNotFound('Slider');\n }\...
javascript
chosen
[ { "from": "system", "value": "Remove import package.json from template\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport logo from './logo.svg';\nimport './App.css';\nimport { version, name } from '../package.json';\n\nclass App extends Component {\n render() ...
javascript
chosen
[ { "from": "system", "value": "Fix typo on output name, add module concat plugin.\n" }, { "from": "human", "value": "const path = require('path')\n\nmodule.exports = {\n context: __dirname,\n entry: './src/index.js',\n devtool: 'source-map',\n\n output: {\n library: 'es2016-starter',\n ...
javascript
chosen
[ { "from": "system", "value": "Revert webpack entry point change\n" }, { "from": "human", "value": "const { resolve } = require('path')\n\nmodule.exports = {\n mode: 'production',\n entry: './dist.browser/index.js',\n module: {\n rules: [\n {\n test: /\\.tsx?$/,\n use: 't...
javascript
chosen
[ { "from": "system", "value": "Remove ember-cli-mocha useLintTree configuration option\n" }, { "from": "human", "value": "/* eslint-env node */\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon')\n\nmodule.exports = function (defaults) {\n const app = new EmberAddon(defaults, {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove inline serving from webpack dev server\n" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\n\nmodule.exports = {\n entry: {\n home: path.join(__dirname, 'app/src/home'),\n },\n\n module: {\n loaders: ...
javascript
chosen
[ { "from": "system", "value": "Add UMD target for use without \"require\"/\"import\"\n" }, { "from": "human", "value": "var CopyWebpackPlugin = require('copy-webpack-plugin');\nvar path = require('path');\n\nmodule.exports = [{\n entry: {\n horizontal: './shim/horizontal.js',\n vertical: '...
javascript
chosen
[ { "from": "system", "value": "Remove webpack plugin for node env production\n\nWebpack 2 sets this automatically with the -p flag\n" }, { "from": "human", "value": "const webpack = require('webpack');\n\nmodule.exports = {\n entry: `${__dirname}/src/index.js`,\n output: {\n path: `${__dirna...
javascript
chosen
[ { "from": "system", "value": "Use platform-specific path separator in log messages.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst path = require('path');\nconst shell = require('shelljs');\nconst argv = require('yargs').argv;\nconst clc = require('cli-color');\n\nfunction packa...
javascript
chosen
[ { "from": "system", "value": "Remove redundant storyshot plugin configuration\n" }, { "from": "human", "value": "module.exports = {\n stories: ['../components/*.stories.js'],\n addons: ['@storybook/addon-actions', '@storybook/addon-links', '@storybook/storyshots'],\n};\n" }, { "from": ...
javascript
chosen
[ { "from": "system", "value": "Revert previous change to changePage() call - it's causing problems.\n" }, { "from": "human", "value": "define(['Twitter', 'TwitterConfirmer', 'TapsModel', 'JQMListView', 'ListPresenter', 'JQMEditView', 'EditPresenter', 'FollowingPresenter', 'SettingsPage'],\nfuncti...
javascript
chosen
[ { "from": "system", "value": "Use BrowserSync 2.0 form of initialization.\n" }, { "from": "human", "value": "var express = require('express');\nvar http = require('http');\nvar routes = require('./routes');\nvar app = express();\n\napp.set('views', __dirname);\napp.set('view engine', 'ejs');\n\n...
javascript
chosen
[ { "from": "system", "value": "Clean up Webpack Dev Server Logs\n" }, { "from": "human", "value": "const path = require('path');\nconst webpack = require('webpack');\n\nconst buildEntryPoint = entryPoint => {\n return [\n 'react-hot-loader/patch',\n 'webpack-dev-server/client?http://localh...
javascript
chosen
[ { "from": "system", "value": "Change global to node compatible\n" }, { "from": "human", "value": "const path = require('path');\nconst UglifyJsPlugin = require('uglifyjs-webpack-plugin');\nconst WebpackAutoInject = require('webpack-auto-inject-version');\n\nmodule.exports = {\n entry: {\n 't...
javascript
chosen
[ { "from": "system", "value": "Include browser file as entry point\n" }, { "from": "human", "value": "module.exports = {\n devtool: 'source-map',\n entry: './src/Home.jsx',\n output: {\n path: './public',\n filename: './js/app.js',\n publicPath: '/'\n },\n devS...
javascript
chosen
[ { "from": "system", "value": "Delete charts in store on logout\n" }, { "from": "human", "value": "import React from 'react';\nimport { connect } from 'react-redux';\n\nclass ProfilePage extends React.Component {\n constructor(props){\n super(props);\n this.logoff = this.logoff.bind(this);...
javascript
chosen
[ { "from": "system", "value": "Fix wrong return type for readHref function\n" }, { "from": "human", "value": "/**\n * @module ol/format/XLink\n */\n\n\n/**\n * @const\n * @type {string}\n */\nconst NAMESPACE_URI = 'http://www.w3.org/1999/xlink';\n\n\n/**\n * @param {Node} node Node.\n * @return {...
javascript
chosen
[ { "from": "system", "value": "Update polyfill url to include default" }, { "from": "human", "value": "/* eslint-disable react/no-danger */\n\nimport Document, { Head, Main, NextScript } from 'next/document'\nimport React from 'react'\n\n// The document (which is SSR-only) needs to be customized ...
javascript
chosen
[ { "from": "system", "value": "Use $cookies to retrive CSRF cookie token value\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular\n .module('<%=angularAppName%>')\n .factory('SocialService', SocialService);\n\n SocialService.$inject = ['$document']...
javascript
chosen
[ { "from": "system", "value": "Enable CORS ignore orgin header\n" }, { "from": "human", "value": "const Hapi = require('@hapi/hapi');\nconst routes = require('./routes');\nconst auth = require('./auth');\n\nmodule.exports = async (elastic, config, cb) => {\n const server = new Hapi.Server({ port...
javascript
chosen
[ { "from": "system", "value": "Support for HTTPS\tin XHR proxy.\n" }, { "from": "human", "value": "// Copyright (c) Microsoft Corporation. All rights reserved.\n\nvar http = require('http'),\n url = require('url');\n\nmodule.exports.attach = function (app) {\n app.all('/xhr_proxy', function...
javascript
chosen
[ { "from": "system", "value": "Change to show error message when browserify failed\n" }, { "from": "human", "value": "var gulp = require(\"gulp\");\nvar browserify = require(\"browserify\");\nvar source = require(\"vinyl-source-stream\");\nvar buffer = require(\"vinyl-buffer\");\nvar reactify = r...
javascript
chosen
[ { "from": "system", "value": "Use push and pop for different rectangles\n" }, { "from": "human", "value": "const WIDTH = 800;\nconst HEIGHT = 600;\n\nvar setup = function() {\n createCanvas(WIDTH, HEIGHT);\n background(0);\n fill(255);\n\n angleMode(DEGREES);\n\n stroke(255);\n strokeWeigh...
javascript
chosen
[ { "from": "system", "value": "Add underline to playing song." }, { "from": "human", "value": "const songs = [...document.querySelectorAll('.songList li')];\nconst currentSong = document.querySelector('#currentSong');\nsongs.map((s) => {\n s.addEventListener('click', () => {\n currentSong.set...
javascript
chosen
[ { "from": "system", "value": "Fix problem with moment conversion\n" }, { "from": "human", "value": "import moment from 'moment';\nimport {has} from 'ramda';\n\nexport default (newProps, momentProps) => {\n const dest = {};\n\n momentProps.forEach(key => {\n const value = newProps[ke...
javascript
chosen
[ { "from": "system", "value": "Add watch task to default\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar gutil = require('gulp-util');\nvar bower = require('bower');\nvar concat = require('gulp-concat');\nvar sh = require('shelljs');\nvar del = require('del');\nvar copyHTML = ...
javascript
chosen
[ { "from": "system", "value": "Disable notification in browser-sync as it caused issues with layout\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar elm = require('gulp-elm');\nvar plumber = require('gulp-plumber');\nvar del = require('del');\nvar browserSync = require('browser...
javascript
chosen
[ { "from": "system", "value": "Use correct load_status path in JS\n" }, { "from": "human", "value": "const checkStatus = () => {\n fetch(\"/load_status\", {\n credentials: \"same-origin\"\n })\n .then(response => {\n return response.text();\n })\n .then(data => {\n documen...
javascript
chosen
[ { "from": "system", "value": "Add gulp release script to generate minified build. " }, { "from": "human", "value": "var gulp = require('gulp')\nvar browserify = require('browserify')\nvar source = require('vinyl-source-stream')\nvar serve = require('gulp-serve')\nvar concat = require('gulp-conca...
javascript
chosen
[ { "from": "system", "value": "Add settings when error occured\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar less = require('gulp-less');\nvar plumber = require(\"gulp-plumber\");\nvar browserSync = require('browser-sync').create();\n\ngulp.task('run', function() {\n browse...
javascript
chosen
[ { "from": "system", "value": "Update Target to accept different types\n" }, { "from": "human", "value": "Target = function(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n this.life = 11;\r\n this.size = 12;\r\n\r\n return this;\r\n}\r\nTarget.prototype.render = function() {\r\n var x = this.x ...
javascript
chosen
[ { "from": "system", "value": "Add comment explaining why it is unnecessary to patch .catch\n" }, { "from": "human", "value": "'use strict';\n\nfunction PromiseWrap() {}\n\nmodule.exports = function patchPromise() {\n const hooks = this._hooks;\n const state = this._state;\n\n const Promise = ...
javascript
chosen
[ { "from": "system", "value": "Fix Model Factory Injections Deprecation\n\nFix ember-metal.model-factory-injections deprecation by removing\ncode that set the MODEL_FACTORY_INJECTIONS flag, which is no longer\nneeded.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Resolver ...
javascript
chosen
[ { "from": "system", "value": "Increase browser disconnect timeout in smoke tests\n" }, { "from": "human", "value": "'use strict';\n\nlet isCI = !!process.env.CI;\nlet smokeTests = !!process.env.SMOKE_TESTS;\n\nlet config = {\n framework: 'qunit',\n test_page: smokeTests ? 'tests/index.html?smo...
javascript
chosen
[ { "from": "system", "value": "Revert \"catch service worker error?\"\n\nThis reverts commit c14cfe8917c1f1c23ccd4bbd25a7b40d6c5d6b2b.\n" }, { "from": "human", "value": "/*jslint browser: true*/\n\nif (navigator.serviceWorker && location.protocol === 'https://') {\n try {\n navigator.se...
javascript
chosen
[ { "from": "system", "value": "Complete numbers tests to pass\n" }, { "from": "human", "value": "\nmodule(\"About Numbers (topics/about_numbers.js)\");\n\ntest(\"types\", function() {\n var typeOfIntegers = typeof(6);\n var typeOfFloats = typeof(3.14159);\n equal(__, typeOfIntegers === t...
javascript
chosen
[ { "from": "system", "value": "Refactor the code to be a pre-processing task.\n" }, { "from": "human", "value": "/*!\n * stylus-initial\n * Copyright (c) 2014 Pierre-Antoine \"Leny\" Delnatte <info@flatland.be>\n * (Un)Licensed\n */\n\n\"use strict\";\n\nvar utils = require( \"stylus\" ).utils,\n...
javascript
chosen
[ { "from": "system", "value": "Fix whitespace in generated CSS\n" }, { "from": "human", "value": "const getTaggedTemplateLiteralContent = require('./tagged-template-literal').getTaggedTemplateLiteralContent\n\nconst getCSS = (node) => `\n.selector {\n ${getTaggedTemplateLiteralContent(node)}\n}\...
javascript
chosen
[ { "from": "system", "value": "Change default remote server to a working one\n" }, { "from": "human", "value": "module.exports = {\n SESSION_TOKEN_KEY: 'SESSION_TOKEN_KEY',\n backend: {\n hapiRemote: true,\n hapiLocal: false,\n parseRemote: false,\n parseLocal: false\n },\n HAPI: ...
javascript
chosen
[ { "from": "system", "value": "Change POST of angular to send values in FormData (for jersey to read)\n\nBy default it sends parameters as Request Payload, and jersey ignores\nthem.\nRead :\nhttp://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/\n" }, { "from": "human",...
javascript
chosen
[ { "from": "system", "value": "Change response to text instead of json\n" }, { "from": "human", "value": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain ...
javascript
chosen
[ { "from": "system", "value": "Include create-react-class in Rollup configuration :newspaper:.\n" }, { "from": "human", "value": "// Rollup plugins.\nimport babel from 'rollup-plugin-babel'\nimport cjs from 'rollup-plugin-commonjs'\nimport globals from 'rollup-plugin-node-globals'\nimport replace...
javascript
chosen
[ { "from": "system", "value": "Set server statusCode on error\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport hoist from 'hoist-non-react-statics'\n\nimport ErrorPage from '../../pages/_error'\n\nexport default Page => {\n const Extended =...
javascript
chosen
[ { "from": "system", "value": "Use @clevercloud/client superagent helper instead of request\n" }, { "from": "human", "value": "'use strict';\n\nconst { addOauthHeader } = require('@clevercloud/client/cjs/oauth.node.js');\nconst { prefixUrl } = require('@clevercloud/client/cjs/prefix-url.js');\nco...
javascript
chosen
[ { "from": "system", "value": "Add newline to end of file\n" }, { "from": "human", "value": "function checkWindowSize(){\n var w = document.documentElement.clientWidth;\n var panel = document.getElementById(\"help-panel\");\n if (w < 978) {\n panel.style.position = \"static\";\n ...
javascript
chosen
[ { "from": "system", "value": "Adjust unit test expected result.\n" }, { "from": "human", "value": "/**\n * Created by rgwozdz on 8/15/15.\n */\n\nvar moduleUnderTest = require(\"../../app/common.js\")\nvar assert = require('chai').assert;\nvar equal = require('deep-equal');\n\ndescribe('common.j...
javascript
chosen
[ { "from": "system", "value": "Fix bug in returning autoUrl for Sandstorm\n" }, { "from": "human", "value": "// # Sandstorm API\n// RESTful API for the Sandstorm resource\nvar capnp = require('capnp'),\n url = require('url'),\n sandstorm;\n\nvar HackSession = capnp.impor...
javascript
chosen
[ { "from": "system", "value": "Use spread operator rather than Object.assign\n" }, { "from": "human", "value": "const idea = (state = [], action) => {\n switch (action.type) {\n case \"SET_IDEAS\":\n return action.ideas\n case \"ADD_IDEA\":\n return [...state, action.idea]\n c...
javascript
chosen
[ { "from": "system", "value": "Comment out sorting function for now\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 url: `http:...
javascript
chosen
[ { "from": "system", "value": "Update with lab app registration\n" }, { "from": "human", "value": "// Config object to be passed to Msal on creation\nconst msalConfig = {\n auth: {\n clientId: \"e760cab2-b9a1-4c0d-86fb-ff7084abd902\",\n authority: \"https://fabrikamb2c.b2clogin.c...
javascript
chosen
[ { "from": "system", "value": "Fix JS error in Safari’s Private Browsing mode\n\nSafari in Private Browsing mode sets a session storage quota of 0 which means that attempts to write to it result in a QuotaExceededError being thrown, breaking JavaScript on the rest of the page.\n\nThe existing code is flawed ...
javascript
chosen
[ { "from": "system", "value": "Remove stray variable breaking defaultUrl calculation.\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nmodule.exports = function(grunt) {\n var module = {};\n\n module.domain = function() {\n return process.env.GRUNT_DRUPAL_DOMAIN || grunt.conf...
javascript
chosen
[ { "from": "system", "value": "Use same .xml MIME type as rgrove/combohandler.\n" }, { "from": "human", "value": "/*!\n * YUI Mocha\n * Copyright 2011 Yahoo! Inc.\n * Licensed under the BSD license.\n */\n\n/**\n * @module mime\n */\n\n/**\n * File extension to MIME type map.\n *\n * Used by `ser...
javascript
chosen
[ { "from": "system", "value": "Check typeof of given value\n" }, { "from": "human", "value": "'use strict';\n/**\n * \n * @param {integer } digit \n * @returns {string} Returns Nepali converted string of given digit or numbers.\n * @example\n * \n * numbers(2090873)\n * // => २०९०८७३\n * \n * num...
javascript
chosen
[ { "from": "system", "value": "Check for undefined localized values\n\nFixes #2.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Retrieve a localized configuration value or the default if the localization\n * is unavailable.\n * \n * @param {String} configuration value\n * @param {Str...
javascript
chosen
[ { "from": "system", "value": "Set logout button to reload state if current state is 'home'\n" }, { "from": "human", "value": "'use strict';\n\nheader.$inject = ['$rootScope', '$state', 'AuthService'];\nfunction header($rootScope, $state, AuthService) {\n return {\n name: 'header',\n ...
javascript
chosen
[ { "from": "system", "value": "Fix a bug in documentation generation\n" }, { "from": "human", "value": "/* task for generating html from sisdocs markdown */\nmodule.exports = function(grunt) {\n 'use strict';\n var marked = require('marked');\n var hljs = require('highlight.js');\n ma...
javascript
chosen
[ { "from": "system", "value": "Fix lint error in JS fixture\n" }, { "from": "human", "value": "export default {\n \"id\": 101,\n \"email\": \"hugo@demo.studentinsights.org\",\n \"admin\": false,\n \"full_name\": \"Teacher, Hugo\",\n \"staff_type\": null,\n \"schoolwide_access\": false,\n \...
javascript
chosen
[ { "from": "system", "value": "Add padding to button item\n" }, { "from": "human", "value": "import { select } from 'd3';\nimport Item from './item';\n\nexport default class ButtonItem extends Item {\n constructor() {\n super();\n\n this._root\n .classed('button', true)\n .styles...
javascript
chosen
[ { "from": "system", "value": "Add username to feedback entries" }, { "from": "human", "value": "window.admin = {};\n\n$(document).ready(function() {\n\t$(\"#admin-feedback\").on(\"tabOpened\", function() {\n\t\twindow.api.get(\"admin/feedback/getList\", function(resp) {\n\t\t\t$(\"#admin-feedbac...
javascript
chosen
[ { "from": "system", "value": "Disable console output in Travis\n" }, { "from": "human", "value": "import Enzyme from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\nimport 'jest-enzyme'; // better matchers\n\nEnzyme.configure({\n adapter: new Adapter(),\n});\n" }, { "from": "...
javascript
chosen
[ { "from": "system", "value": "Send http_x_requested_with header to be able to check for ajax request\n" }, { "from": "human", "value": "/**\n * Fetch module.\n * @module base/utils/fetch\n */\n\nimport fetchJsonP from 'fetch-jsonp'\n\nexport var defaultOptions = {\n credentials: 'same-origin'\n...
javascript
chosen
[ { "from": "system", "value": "Use toString instead of toHexString\n" }, { "from": "human", "value": "var events = require('events');\nvar util = require('util');\n\nmodule.exports = Job;\n\nfunction Job(collection, data) {\n this.collection = collection;\n if(data){\n data.__proto__...
javascript
chosen
[ { "from": "system", "value": "Remove date string from activity\n" }, { "from": "human", "value": "import React, { Component, PropTypes } from 'react';\nimport moment from 'moment';\n\nclass Activity extends Component {\n\n render() {\n const { timestamp, activity, deleteActivity } = this.pro...
javascript
chosen
[ { "from": "system", "value": "Call onSelect event when a game is clicked.\n" }, { "from": "human", "value": "import React from 'react';\nimport '../styles/games.css';\n\nexport default class GameList extends React.Component {\n constructor(props) {\n super(props);\n\n this.state...
javascript
chosen
[ { "from": "system", "value": "Add ability to print to stdout instead of POSTing\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar Formatter = require(\"../formatter\");\nvar client = require('../http_client');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\n...
javascript
chosen
[ { "from": "system", "value": "Add an operator to delay failures\n" }, { "from": "human", "value": "import {Observable, Disposable} from 'rx';\n\nObservable.prototype.subUnsub = function(onSub=null, onUnsub=null) { \n return Observable.create((subj) => {\n if (onSub) onSub();\n let d = thi...
javascript
chosen
[ { "from": "system", "value": "Format YAMLish properly to make it work in Jenkins\n" }, { "from": "human", "value": "/**\n * Results formatter for --format=tap\n *\n * @see http://podwiki.hexten.net/TAP/TAP.html?page=TAP\n * @see https://github.com/isaacs/node-tap\n */\nvar Producer = require('ta...
javascript
chosen
[ { "from": "system", "value": "Fix display artifact that prevented sidebar from showing after login, until page was refreshed\n\n[#LEI-294]\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Controller.extend({\n session: Ember.inject.service(),\n isExpand...
javascript
chosen
[ { "from": "system", "value": "Switch service with factory (it's not a Class called with new)\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n /* Services */\n\n angular.module('myApp.services', [])\n\n // put your services here!\n // .service('serviceName', ['...
javascript
chosen
[ { "from": "system", "value": "Add ability to launch arb url from push\n" }, { "from": "human", "value": "console.log('Started', self);\nself.addEventListener('install', function(event) {\n self.skipWaiting();\n console.log('Installed', event);\n});\nself.addEventListener('activate', function(e...
javascript
chosen
[ { "from": "system", "value": "Set size of fancy box\n" }, { "from": "human", "value": "/**\n * Call the fancybox for displaying organism details in a lightbox\n */\n $(\".fancybox\").fancybox({\n maxWidth: 1000,\n maxHeight: 800\n });" }, { "from": "gpt", "value":...
javascript
chosen
[ { "from": "system", "value": "Update script to add top inset\n" }, { "from": "human", "value": "'use strict';\n\nconst exec = require('child_process').execSync;\nconst ios = require('./contours-ios.json');\nconst web = require('./contours-web.json');\nconst fs = require('fs');\n\nvar offsets = {...
javascript
chosen
[ { "from": "system", "value": "Test of Travis failing build\n" }, { "from": "human", "value": "var buster = require(\"buster\");\n\nvar firestarter = require('../')();\n\nbuster.testCase('Test testing framework', {\n\n\t'Test' : function(){\n\t\t'use strict';\n\t\t\n\t\tassert(firestarter.config....
javascript
chosen
[ { "from": "system", "value": "Unify component name and filename.\n" }, { "from": "human", "value": "import PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport InputContainer from '../Input/InputContainer';\nimport { inputChanged } from './PlatbyActions';\nimport {\n for...
javascript
chosen