conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use var instead of const\n" }, { "from": "human", "value": "'use strict';\n\n/* global env, exec */\n\nvar path = require('path');\nrequire('shelljs/global');\n\nconst PROJECT_DIR = path.join(__dirname, '..');\n\nvar iron = {\n 'token': env.IRON_TOKEN,\n 'project_...
javascript
chosen
[ { "from": "system", "value": "Update node-sass dependency to 9.2" }, { "from": "human", "value": "Package.describe({\n summary: 'Style with attitude.'\n});\n\nPackage._transitional_registerBuildPlugin({\n name: 'meteor-scss',\n use: [],\n sources: [\n 'plugin/compile-scss.js'\n ],\n npm...
javascript
chosen
[ { "from": "system", "value": "Update graphql-tag to 2.3.0 and add required graphql dependency\n" }, { "from": "human", "value": "/* eslint-disable no-var, prefer-arrow-callback */\nvar packages = [\n 'ecmascript',\n 'isobuild:compiler-plugin@1.0.0',\n];\n\nPackage.describe({\n name: 'swydo:gr...
javascript
chosen
[ { "from": "system", "value": "Support for Semantic 2.x, Unpegged \"templating\" pkg version.\n\n* Removed redundant \"semantic:modal\" package (already in semantic-css)\n* Allow both 1.x and 2.x version of Semantic\n* Removed Pegged \"templating\" pkg version\n" }, { "from": "human", "value": "P...
javascript
chosen
[ { "from": "system", "value": "Fix the node v0.12 build.\n" }, { "from": "human", "value": "import babel from 'rollup-plugin-babel';\nimport { readFileSync } from 'fs';\n\nlet babelConfig = JSON.parse(readFileSync('.babelrc', { encoding: 'utf8' }));\nbabelConfig.babelrc = false;\nbabelConfig.pres...
javascript
chosen
[ { "from": "system", "value": "Update to 0.9 with version 0.3.0\n" }, { "from": "human", "value": "Package.describe({\n summary: \"A package that gives you all the inflection methods as Handlebar helpers\"\n});\n\nPackage.on_use(function(api) {\n api.use(['ui'], 'client');\n api.add_files('inf...
javascript
chosen
[ { "from": "system", "value": "Allow Galaxy users to disable `npm rebuild` if they really want to.\n\nPart of #6537..\n" }, { "from": "human", "value": "var path = require(\"path\");\nvar spawn = require(\"child_process\").spawn;\n\ntry {\n // This JSON file gets written in meteor/tools/isobuild...
javascript
chosen
[ { "from": "system", "value": "Replace moment with luxon in test\n" }, { "from": "human", "value": "import { module, test } from 'qunit';\nimport { setupRenderingTest } from 'dummy/tests/helpers';\nimport { setupIntl } from 'ember-intl/test-support';\nimport { render } from '@ember/test-helpers';...
javascript
chosen
[ { "from": "system", "value": "Make options argument to ol.style.Stroke optional\n" }, { "from": "human", "value": "goog.provide('ol.style.Stroke');\n\ngoog.require('ol.color');\n\n\n\n/**\n * @constructor\n * @param {olx.style.StrokeOptions} options Options.\n */\nol.style.Stroke = function(opti...
javascript
chosen
[ { "from": "system", "value": "Fix default docker registry host\n" }, { "from": "human", "value": "import * as _commands from './commands';\nimport { validateRegistry, validateSwarm } from './validate';\n\nexport const description = 'Setup and manage docker';\nexport const commands = _commands;\n...
javascript
chosen
[ { "from": "system", "value": "Use relative index html path\n" }, { "from": "human", "value": "// @flow\n\n/**\n * Main application routes\n */\n\nimport type { $Application, $Request, $Response } from \"express\";\n\nimport Api from \"./api\";\nimport Auth from \"./auth\";\nimport { pageNotFound...
javascript
chosen
[ { "from": "system", "value": "Add notice that to-do list won't be finished" }, { "from": "human", "value": "var todos=[\n \"Create new level editor\",\n \"Add portals\",\n \"Add one-way blocks\",\n \"Add ice blocks\",\n \"Add modding guide to offline version\",\n \"Add levels implementing ...
javascript
chosen
[ { "from": "system", "value": "Add an event handling example to the demo.\n" }, { "from": "human", "value": "'use strict';\n\n/*\n * Tanura demo app.\n *\n * This is the main script of the app demonstrating Tanura's features.\n */\n\n/**\n * Bootstrapping routine.\n */\nwindow.onload = () => {\n ...
javascript
chosen
[ { "from": "system", "value": "Change target to index.js for web build\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar sourcemaps = require('gulp-sourcemaps');\nvar babel = require('gulp-babel');\nvar concat = require('gulp-concat');\nvar uglify = require('gulp-uglify');\nvar ...
javascript
chosen
[ { "from": "system", "value": "Make compatible with Meteor 2.3+" }, { "from": "human", "value": "Package.describe({\n name: 'dburles:two-factor',\n version: '1.3.0',\n summary: 'Two-factor authentication for accounts-password',\n git: 'https://github.com/dburles/meteor-two-factor.git',\n doc...
javascript
chosen
[ { "from": "system", "value": "fix(server): Fix percent URL which create a malformed url exception\n" }, { "from": "human", "value": "'use strict';\n\nlet express = require('express');\n\nlet favicon = require('serve-favicon'),\n bodyParser = require('body-parser'),\n compression = require(...
javascript
chosen
[ { "from": "system", "value": "Return referenceObject regardless of changes by reference or not\n" }, { "from": "human", "value": "const _ = require('lodash');\n\nmodule.exports = function (referenceModificationErrorMessage, nonObjectErrorMessage) {\n\treturn (referencedObject) => {\n\t\tlet refe...
javascript
chosen
[ { "from": "system", "value": "Make decoder.worker a constructor param in Pool\n\nMake worker a constructor param so when using geotiffjs as a webpack dependency, we can use a worker loader externally to initialise decoder worker and pass it to Pool." }, { "from": "human", "value": "import { Pool...
javascript
chosen
[ { "from": "system", "value": "Return promise if callback isn't supplied\n" }, { "from": "human", "value": "'use strict';\nvar _ = require('lodash');\nvar P = require('bluebird');\nvar DeserializerUtils = require('./deserializer-utils');\n\nmodule.exports = function (opts) {\n if (!opts) { opts ...
javascript
chosen
[ { "from": "system", "value": "Fix arguments so they only concatenate once\n" }, { "from": "human", "value": "module.exports = function() {\n self = this;\n\n Object.keys(self.services).forEach(function(k) {\n var args = [\"MDPW02\", self.constants.READY, k];\n\n args = args.concat(args, ...
javascript
chosen
[ { "from": "system", "value": "Add lesson, and link to section.\n" }, { "from": "human", "value": "Template.addLesson.events({\n 'click .add-lesson-button': function (event, template) {\n // Get lesson name\n var lessonName = template.find(\"#lesson-name\").value;\n\n // G...
javascript
chosen
[ { "from": "system", "value": "Change position of sourceIP log\n" }, { "from": "human", "value": "/*jshint esversion: 6 */\nvar AWS = require(\"aws-sdk\");\n\nexports.handler = (event, context, callback) => {\n console.log(event);\n callback(null, 'Hello from Lambda');\n console.log(even...
javascript
chosen
[ { "from": "system", "value": "Add support for JSON values\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Memory store\n*/\nexport class MemoryStore {\n\n constructor() {\n this._store = {};\n }\n\n /**\n * Set a key to a value\n **/\n set(key, value, override = true) {\n ...
javascript
chosen
[ { "from": "system", "value": "Decrease the threshold for lines in unit tests coverage by 1%\n" }, { "from": "human", "value": "const TEST_TYPE = ((argv) => {\n let match = argv[argv.length - 1].match(/npm\\/test-(\\w+).js/);\n\n return match && match[1] || '';\n })(process.argv)...
javascript
chosen
[ { "from": "system", "value": "Change the standard path to mercury to be namespace independent\n" }, { "from": "human", "value": "var config = {\n\t\"version\": \"v1.1.1-SNAPSHOT\",\n\t\"codingDefinitionServiceEndpoint\": \"/codingDefinitionService\",\n\t\"diagramEndpoint\": {\n\t\t//\"service\":...
javascript
chosen
[ { "from": "system", "value": "feat: Add extra default params test\n" }, { "from": "human", "value": "describe(\"About Functions\", function () {\n\n describe(\"Default Parameters\", function () {\n\n it(\"should understand default parameters basic usage\", function () {\n\n function gre...
javascript
chosen
[ { "from": "system", "value": "Change order of parameters\nSeems more common to need a dayModel with items and date with unknown id\n" }, { "from": "human", "value": "import Utils from './utils';\nimport {DateOnly} from './util/time';\nimport TaskModel from './TaskModel';\n\nexport default class ...
javascript
chosen
[ { "from": "system", "value": "Add missing ? to palindrome-parsing\n" }, { "from": "human", "value": "module.exports = function (data) {\n var firstLine = data.split('\\n')[0];\n\n switch (firstLine) {\n case 'ping':\n case 'say-hello':\n case 'fizzbuzz':\n case ...
javascript
chosen
[ { "from": "system", "value": "Fix peice under attack spec\n" }, { "from": "human", "value": "var JSChess = require('../js-chess.js');\nvar _ = require('lodash');\n\ndescribe('Classic Chess', function() {\n it('everything', function() {\n var army1 = new JSChess.Army({ forwardDirection: 'down...
javascript
chosen
[ { "from": "system", "value": "Order and comment\nOrganizar y comentar" }, { "from": "human", "value": "angular.module('wi.bar.mainGridBar', [])\r\n\r\n/**\r\n * Grid Bar Ctrlr | Controlador de la Barra del Grid\r\n */\r\n.controller('GridBarCtrl', ['$scope',\r\nfunction ($scope) {\r\n\t\r\n\t// ...
javascript
chosen
[ { "from": "system", "value": "Use parentElement so we don't try to match document.\n" }, { "from": "human", "value": "module.exports = function closest(el, selector) {\n while (el) {\n if (el.matches(selector)) return el; \n el = el.parentNode;\n }\n};\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Complete Lesson 2 console arguments\n" }, { "from": "human", "value": "console.log(\"HELLO WORLD\");" }, { "from": "gpt", "value": "var result = 0; \nfor (var i = 2; i < process.argv.length; i++) {\n\tresult += Number(process.argv[i]);\n};\n\nconsole.log...
javascript
chosen
[ { "from": "system", "value": "Add template to jsonhelper file\n" }, { "from": "human", "value": "" }, { "from": "gpt", "value": "/*global define*/\n/*jslint devel: true */\n/*jslint browser: true */\ndefine([\n 'knockout',\n 'd3',\n 'd3.colorbrewer'\n], function (\n ko,...
javascript
chosen
[ { "from": "system", "value": "Refactor async code execution in specs\n" }, { "from": "human", "value": "var chai = require('chai');\nvar expect = chai.expect;\nvar db = require('../server/db/config');\nvar models = require('../server/db/models');\nvar q = require('q');\n\ndescribe('scoring', fun...
javascript
chosen
[ { "from": "system", "value": "Fix misleading description in JSDoc\n" }, { "from": "human", "value": "import HorizontalLayout from './layouts/HorizontalLayout';\nimport VerticalLayout from './layouts/VerticalLayout';\nimport SameHeightLayout from './layouts/SameHeightLayout';\nimport SameWidthLay...
javascript
chosen
[ { "from": "system", "value": "Switch from styled(Value) to Value.extend\n" }, { "from": "human", "value": "import React from 'react'\nimport {storiesOf} from '@storybook/react'\nimport styled from 'styled-components'\n\nimport data from './dataMock'\nimport Component from './index'\nimport Value...
javascript
chosen
[ { "from": "system", "value": "Fix click event for random article\n" }, { "from": "human", "value": "---\n---\nvar nav = document.querySelector('.meta .nav');\nvar next = nav.querySelector('[rel=next]');\n\nvar rand = document.createElement('a');\nrand.setAttribute('rel','random');\nrand.setAttri...
javascript
chosen
[ { "from": "system", "value": "Remove steps data from query in list of queries\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport {graphql, gql} from 'react-apollo';\nimport RecipeCard from './card';\n\nclass RecipesIndex extends Component {\n renderRecipes(){...
javascript
chosen
[ { "from": "system", "value": "Change so logout send you to root instead of redirect hell\n" }, { "from": "human", "value": "import React from 'react';\nimport getCSRF from '../../../../shared/util/getcsrf';\nimport Utility from '../../../../shared/util/Utility';\nimport * as Security from '../.....
javascript
chosen
[ { "from": "system", "value": "Make CLI linter messages a bit easier to read\n" }, { "from": "human", "value": "'use strict';\n\nvar configLoader = require('./config-loader');\nvar LessHint = require('./lesshint');\nvar exit = require('exit');\nvar Vow = require('vow');\n\nmodule.exports = functi...
javascript
chosen
[ { "from": "system", "value": "Print welcome message when IRC connects\n" }, { "from": "human", "value": "'use strict';\n\nconst irc = require('irc');\n\nconst server = process.env.IRC_SERVER;\nconst user = process.env.IRC_USER;\nconst channel = process.env.IRC_CHANNEL;\n\nconst client = module.e...
javascript
chosen
[ { "from": "system", "value": "Fix bug when package time is missing.\n\nHas happened in production, some npm package didn’t have a time object.\n" }, { "from": "human", "value": "var npm = require('npm');\nvar asyncMap = require('slide').asyncMap;\n\nexports.getLatestVersions = getLatestVersions;...
javascript
chosen
[ { "from": "system", "value": "Use dirname and path module\n" }, { "from": "human", "value": "import fs from 'fs';\nimport handlebars from 'handlebars';\nimport console from 'node-custom-console';\n\nconst cnsl = console('builder');\n\nexports.build = (eventName, payload) => new Promise((resolve,...
javascript
chosen
[ { "from": "system", "value": "Use glob function instead of `Glob` constructor\n" }, { "from": "human", "value": "import { Glob } from 'glob'\n\nexports = module.exports = function Controllers(app) {\n new Glob(`${__dirname}/*.js`, { ignore: '**/index.js' }, (err, matches) => {\n if (err) { t...
javascript
chosen
[ { "from": "system", "value": "Define the properties as being non-enumerable as per the specification\n\nThe specification for AbortController and AbortSignal defines the objects as interfaces:\nhttps://dom.spec.whatwg.org/#interface-abortcontroller\n```\n[Constructor,\n Exposed=(Window,Worker)]\ninterface A...
javascript
chosen
[ { "from": "system", "value": "Change minified to development jQuery version\n" }, { "from": "human", "value": "/*!\n * Wef\n * Copyright (c) 2011 Pablo Escalada\n * MIT Licensed\n */\n\n/**\n * A private namespace\n */\n(function(global) {\n var wef = {\n VERSION: \"0.0.1\"\n };\n\n...
javascript
chosen
[ { "from": "system", "value": "Make sure navigate is passed to controllers res\n" }, { "from": "human", "value": "'use strict';\n\nimport utils from '../utils'\n\nclass DragonDispatcher {\n\n constructor(options = {}) {\n\n this.uid = utils.uniqueId(this)\n\n this.options = options\n\n ...
javascript
chosen
[ { "from": "system", "value": "Change to ember test to accomodate ember-intl expression of date\n" }, { "from": "human", "value": "import { module, test } from 'qunit';\nimport { setupRenderingTest } from 'ember-qunit';\nimport { render } from '@ember/test-helpers';\nimport hbs from 'htmlbars-inl...
javascript
chosen
[ { "from": "system", "value": "Use local etcd for testing\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nvar defaultConfig = {\n database: {\n backend: 'leveldown',\n file: __dirname + '/data/baixs.db'\n },\n etcd: {\n host: 'racktables.hupu.com',\n port: '4001',\...
javascript
chosen
[ { "from": "system", "value": "Add checking on process variable existance. Change default env to production\n" }, { "from": "human", "value": "module.exports = require('./' + (process.env.FINDIFY_ENV || 'staging'));\n" }, { "from": "gpt", "value": "var findifyEnv = typeof process !== ...
javascript
chosen
[ { "from": "system", "value": "Comment out this console.log which was appearing on the live site yay\n" }, { "from": "human", "value": "import Ember from 'ember';\n\n// This mixin is used to scroll back to (0,0) on transitions\n// To use it, just import the mixin and extend it on the\n// necessar...
javascript
chosen
[ { "from": "system", "value": "Fix react outside of guilds, add checks for custom emojis.\n" }, { "from": "human", "value": "const { Command } = require('discord-akairo');\n\nfunction exec(message, args){\n let emojiSet;\n\n if (!message.guild || !message.guild.emojis.size){\n emojiS...
javascript
chosen
[ { "from": "system", "value": "Send two request to java server for starting srawler and searching text\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc function\n * @name textSummaryApp.controller:MainCtrl\n * @description\n * # MainCtrl\n * Controller of the textSummaryApp\n */...
javascript
chosen
[ { "from": "system", "value": "Fix incorrect file name in doh test\n" }, { "from": "human", "value": "define([\"doh\", \"require\", \"./_StoreMixin\" ], function(doh, require){\n\tdoh.register(\"create-destroy\", require.toUrl(\"./create-destroy.html\"));\n\tdoh.register(\"addCssRule\", require.t...
javascript
chosen
[ { "from": "system", "value": "Add travis Chrome to karma hopefully ?\n" }, { "from": "human", "value": "module.exports = function(config) {\n var detectBrowsers = {\n enabled: false,\n usePhantomJS: false\n };\n\n // On Travis CI, we can only run in Firefox.\n if (process.env.TRAVIS) {...
javascript
chosen
[ { "from": "system", "value": "Fix login test in Travis.\n" }, { "from": "human", "value": "/*jshint quotmark: false */\n\n\"use strict\";\n\nvar rio = require(\"../lib/rio\"),\n vows = require(\"vows\"),\n assert = require(\"assert\");\n\nvar isEnablePlaybackMode = process.env.CI === \"tru...
javascript
chosen
[ { "from": "system", "value": "Use \"load\" event instead of window.onload\n\nOther js files may attempt to listen for the window.onload event, the last function assigned would be the one set.\r\nWe can use addEventListener to listen for the ``load`` event instead which is the same.\r\n\r\nhttps://developer....
javascript
chosen
[ { "from": "system", "value": "Update the test for character count" }, { "from": "human", "value": "import { expect } from './spec_helper'\nimport * as api from '../src/api'\n\ndescribe('api.js', () => {\n it('.communitiesPath', () => {\n expect(api.communitiesPath).to.equal('https://ello-sta...
javascript
chosen
[ { "from": "system", "value": "Test something with the Assets test\n" }, { "from": "human", "value": "'use strict';\n\nconst assert = require('assert');\nconst assets = require('../lib/assets.js');\n\ndescribe('assets', function() {\n it('Returns a valid promise', async function() {\n // This...
javascript
chosen
[ { "from": "system", "value": "Add alpha to interventions block\n\nIn the Profile on the graph #234\n" }, { "from": "human", "value": "(function(root) {\n\n var InterventionPlotBand = function initializeInterventionPlotBand (intervention) {\n this.name = intervention.name;\n this.from = In...
javascript
chosen
[ { "from": "system", "value": "Fix on instead of live\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 separate files in this directory and they'll automatically\n// be included in th...
javascript
chosen
[ { "from": "system", "value": "Add safe require for `babel-polyfill`\n\nRequiring `babel-polyfill` fails if it has already been loaded once, potentially by a parent module. This is a safe method learned from the Feathers.js code" }, { "from": "human", "value": "/**\n * Common code required at all...
javascript
chosen
[ { "from": "system", "value": "Reset seller password when eject\n" }, { "from": "human", "value": "'use strict';\n\n/* global define */\n\ndefine('ejecter', () => {\n let ejecter = {};\n\n ejecter.methods = {\n /**\n * Resets variables when user/seller disconnects\n *...
javascript
chosen
[ { "from": "system", "value": "Disable per user health check\n" }, { "from": "human", "value": "var Step = require('step'),\n _ = require('underscore'),\n fs = require('fs');\n\nfunction HealthCheck(metadataBackend, psqlClass) {\n this.metadataBackend = metadataBackend;\n this.ps...
javascript
chosen
[ { "from": "system", "value": "Add that nifty closing parenthesis\n" }, { "from": "human", "value": "var _ = require('lodash');\n\nif (process.env.NODE_ENV === 'production') {\n \n var twilio = require('twilio')(process.env.TWILIO_ACCOUNT_ID, process.env.TWILIO_AUTH_TOKEN);\n var phoneNumber =...
javascript
chosen
[ { "from": "system", "value": "Send transformed image type and length in response headers.\n" }, { "from": "human", "value": "'use strict'\nconst request = require('request')\nconst sharp = require('sharp')\n\nconst JPEG_QUALITY = 40\n\nmodule.exports = (context, req, res) => {\n const imageUrl ...
javascript
chosen
[ { "from": "system", "value": "Add check for directory with current version of GitHub\n" }, { "from": "human", "value": "var createLink = function(root, path) {\n $(root).parent().append(\"<a class='skipper-link' href='\" + path + \"'>skip -></a>\");\n}\n\nvar grabTree = function(root, current) ...
javascript
chosen
[ { "from": "system", "value": "Remove unused defaultParams from state\n" }, { "from": "human", "value": "import React from 'react';\nimport classnames from 'classnames';\nimport Store from './Store';\nimport ActionCreator from './ActionCreator';\nimport urlUtil from './urlUtil';\n\n\nconst Url = ...
javascript
chosen
[ { "from": "system", "value": "Fix crash on init of ap-npm\n" }, { "from": "human", "value": "import commander from 'commander';\nimport containerInit from './init';\nimport fs from 'fs';\nimport path from 'path';\n\ncommander\n .command('serve')\n .alias('s')\n .description('serve ap-npm')\n ...
javascript
chosen
[ { "from": "system", "value": "Update the cjs files naming\n" }, { "from": "human", "value": "var cooking = require('cooking');\nvar Components = require('../components.json');\nvar config = require('./config');\n\ncooking.set({\n entry: Components,\n dist: './lib',\n clean: false,\n format: ...
javascript
chosen
[ { "from": "system", "value": "Test how much quicker deploys really are\n" }, { "from": "human", "value": "import React from 'react'\nimport { Link } from 'gatsby'\nimport styled from 'styled-components'\nimport Layout from '../components/structure/layout'\n\nconst Section = styled.section`\n h2...
javascript
chosen
[ { "from": "system", "value": "Fix the tokenpass room type not aligning\n" }, { "from": "human", "value": "RocketChat.roomTypes.add('tokenpass', 1, {\n\tcustomTemplate: 'tokenChannelsList',\n\tcondition() {\n\t\tconst user = Meteor.user();\n\t\tconst hasTokenpass = !!(user && user.services && use...
javascript
chosen
[ { "from": "system", "value": "Fix the warning when the immutable reducer is used when immutable.js isn't installed.\n" }, { "from": "human", "value": "\nimport warning from 'warning';\n\nimport createReducer from './utils/createReducer';\nimport {\n SHOW,\n REPLACE,\n DISMISS,\n} from './acti...
javascript
chosen
[ { "from": "system", "value": "Update redux store to include members\n" }, { "from": "human", "value": "import {\n combineReducers, \n applyMiddleware, \n createStore\n} from 'redux'\nimport thunk from 'redux-thunk'\nimport auth from '../modules/Auth/reducer'\nimport households from '../module...
javascript
chosen
[ { "from": "system", "value": "Split read into read/search, by directory\n" }, { "from": "human", "value": "'use strict';\n\n/* eslint no-unused-vars: 0 */\n\nmodule.exports.read = function read( fullPath ) {\n // TODO: Hit w3 bucket and retrieve\n\n return Promise.reject({ code: 501, messa...
javascript
chosen
[ { "from": "system", "value": "Print out current message offset\n" }, { "from": "human", "value": "'use strict';\n\nconst co = require('co');\nconst chassis = require('../../');\nconst Events = chassis.events.Events;\n\nco(function* init() {\n const config = {\n provider: 'kafka',\n groupI...
javascript
chosen
[ { "from": "system", "value": "Prepare it for becoming a kata.\n" }, { "from": "human", "value": "import {\n assertThat, equalTo,\n containsString, throws, returns,\n} from 'hamjest';\n\ndescribe('The core function, `assertThat()`', () => {\n it('is a function', () => {\n const typeOfAssert...
javascript
chosen
[ { "from": "system", "value": "Include site and current url in navigation shape data.\n" }, { "from": "human", "value": "// DecentCMS (c) 2014 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.\n'use strict';\n\nvar async = require('async');\n\nfunction NavigationHandler(scope) {\...
javascript
chosen
[ { "from": "system", "value": "Add test for getAllResponseHeaders after an abort\n" }, { "from": "human", "value": "var sys = require(\"util\")\n ,assert = require(\"assert\")\n ,XMLHttpRequest = require(\"../XMLHttpRequest\").XMLHttpRequest\n ,xhr = new XMLHttpRequest()\n ,http = require(\"h...
javascript
chosen
[ { "from": "system", "value": "Fix bug with template url for surveys\n" }, { "from": "human", "value": "'use strict';\n\n// Setting up route\nangular.module('surveys').config(['$stateProvider', function ($stateProvider) {\n\t// Surveys state routing\n\t$stateProvider\n\t.state('surveys', {\n\t\ta...
javascript
chosen
[ { "from": "system", "value": "Check for existence of config, config.args, and config.args.verbose before using\n" }, { "from": "human", "value": "var gUtil = require('gulp-util');\nvar chalk = require('chalk');\n\nvar prefix = chalk.yellow('[availity]');\n\nvar log = function(color, message) {\n...
javascript
chosen
[ { "from": "system", "value": "Put webhook custom data at root\n" }, { "from": "human", "value": "\"use strict\";\n\nvar jade = require(\"jade\");\nvar i18n = require(\"i18next\");\nvar path = require(\"path\");\nvar configuration = require(\"../server/utils/environment_configuration\");\nvar mai...
javascript
chosen
[ { "from": "system", "value": "Add sanity typecheck to user details registry lookups\n" }, { "from": "human", "value": "\nvar\n\textend = req('/utilities/extend'),\n\tadd = req('/utilities/add');\n\nvar\n\tUserDetails = req('/lib/user-details');\n\n\nclass UserDetailsRegistry {\n\n\tconstructo...
javascript
chosen
[ { "from": "system", "value": "Hide error pages in page link dropdowns\n" }, { "from": "human", "value": "/*\n * Do not display error pages in SiteTree or file selector\n * loaded only when !Permission::check('SITETREE_REORGANISE')\n */\n(function($){\n\t$.entwine('ss', function($){\n\n\t\t/* Hid...
javascript
chosen
[ { "from": "system", "value": "[cli] Add test for executing sub command\n\n- the done is not not triggered when run the test for the first time,\n the file is not saved I guess.\n" }, { "from": "human", "value": "/**\n * Created by at15 on 2016/9/9.\n */\n'use strict';\n\nconst expect = require(...
javascript
chosen
[ { "from": "system", "value": "Print addres, latitude and longitude\n" }, { "from": "human", "value": "const request = require('request');\n\nrequest({\n url: 'https://maps.googleapis.com/maps/api/geocode/json?address=68%20Oktyabrskaya%20street%20Kvasnikovka',\n json: true\n}, (error, response,...
javascript
chosen
[ { "from": "system", "value": "Allow formSelector directive as attribute\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.morph').directive('formSelector', function() {\n return {\n restrict: 'E',\n replace: true,\n controller: function($scope, $element, $a...
javascript
chosen
[ { "from": "system", "value": "Update to work on full view\n" }, { "from": "human", "value": "// ==UserScript==\n// @name FA Cleanup\n// @author Erra Boothale <erra@boothale.net>\n// @namespace http://boothale.net/\n// @description Fixes various annoyances with FA's user interface\n...
javascript
chosen
[ { "from": "system", "value": "Adjust brand title and remove base\n" }, { "from": "human", "value": "import { addons } from '@storybook/addons';\nimport { create } from '@storybook/theming';\nimport { COLOR } from '../src/constants';\nimport pkg from '../package';\n\naddons.setConfig({\n panelPo...
javascript
chosen
[ { "from": "system", "value": "Change the way to handle space followed by $inline$\n" }, { "from": "human", "value": "const latexExtension = (showdown) => {\n const latexInlineRegex = /\\s~D([^~D\\n].*[^~D\\n])~D/g\n const latexDisplayRegex =/~D~D(.*)~D~D/g\n showdown.extension('latex' , () ...
javascript
chosen
[ { "from": "system", "value": "Add a way to get the distance between a point and a box\n" }, { "from": "human", "value": "var Box = function(topLeft, width, height) {\n this.topLeft = topLeft;\n this.width = width;\n this.height = height;\n};\n\nBox.prototype = {\n getLeftX: function(...
javascript
chosen
[ { "from": "system", "value": "Change Entity Revision name separator from . to __\n" }, { "from": "human", "value": "\"use strict\";\n\nconst Table = require('./table');\n\nclass Revision extends Table {\n constructor(engine, relationship, name='revision', alias=null) {\n super(engine, relati...
javascript
chosen
[ { "from": "system", "value": "Move \"Add message\" button to top\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport io from 'socket.io-client';\n\nimport './App.css';\n\nclass App extends Component {\n\n state = {messages: []};\n socket = io('http://localhos...
javascript
chosen
[ { "from": "system", "value": "Set up basic tree traversal function.\n" }, { "from": "human", "value": "// // create a new parser\nvar parser = emmet.require('abbreviationParser');\nvar emmetString = \"ul>li{List Item $}*3>a\";\nvar parsed = parser.parse(emmetString);\n// the parser returns an ob...
javascript
chosen
[ { "from": "system", "value": "Set purged files based on source path\n" }, { "from": "human", "value": "module.exports = {\n plugins: [\n [\"@fullhuman/postcss-purgecss\", { content: [\"src/**/*.{html,ts,tsx}\"] }],\n [\"postcss-preset-env\", {}],\n [\"cssnano\", { preset: \"default\" }...
javascript
chosen
[ { "from": "system", "value": "Change font sizes on form\n" }, { "from": "human", "value": "import React from 'react';\nimport { \n\tView, \n\tTextInput,\n\tText,\n\tStyleSheet \n} from 'react-native';\n\nconst InputField = ({ label, secureTextEntry, placeholder, onChangeText, value, autoCorrect,...
javascript
chosen
[ { "from": "system", "value": "Use Fontawesome 4 for default icon. [rev: matthew.gordon]\n" }, { "from": "human", "value": "define([\n 'js-whatever/js/base-page',\n 'text!about-page/templates/about-page.html',\n 'datatables.net-bs'\n], function(BasePage, template) {\n\n return BasePag...
javascript
chosen
[ { "from": "system", "value": "Remove /v1 from the start of all endpoint names\n" }, { "from": "human", "value": "const express = require('express')\nconst config = require('./config')\nconst allTrendsController = require('./controllers/all-trends')\nconst trendController = require('./controllers...
javascript
chosen
[ { "from": "system", "value": "Add assemble to deploy task.\n" }, { "from": "human", "value": "// Configuration\nmodule.exports = function(grunt) {\n // include time-grunt\n require('time-grunt')(grunt);\n\n // Initialize config\n grunt.initConfig({\n pkg: '<json:package.json>'...
javascript
chosen
[ { "from": "system", "value": "Update: Reduce the installation time of Service Worker\n" }, { "from": "human", "value": "/**\n * sw.js\n */\n\nlet CACHE_NAME = 'yk-blog'\n\nself.oninstall = event => {\n event.waitUntil(\n caches.open(CACHE_NAME).then(cache => cache.addAll([\n '/',\n ...
javascript
chosen