conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use require all the way\n\nBabel seems to move `import` statements up the tree, which feels strange to me. For now I decided to just keep using require in this file.\n" }, { "from": "human", "value": "import fs from \"fs\";\nimport path from \"path\";\nconst jscodes...
javascript
chosen
[ { "from": "system", "value": "Add tests for init method\n" }, { "from": "human", "value": "describe('traffic', function() {\n beforeEach(function() {\n window.matrix.settings = {\n profileId: ''\n };\n subject = window.matrix.content;\n sandbox = sinon.sandbox.create();\n s...
javascript
chosen
[ { "from": "system", "value": "Add test for gatherOptions in JquiWidgetMixin\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport JquiWidgetMixin from 'ember-cli-jquery-ui/mixins/jqui-widget';\n\nmodule('JquiWidgetMixin');\n\n// Replace this with your real tests.\ntest('it works'...
javascript
chosen
[ { "from": "system", "value": "Remove needless `.type = 'text/javascript'`\n\nSee <https://mathiasbynens.be/notes/async-analytics-snippet#type>." }, { "from": "human", "value": "document.addEventListener('DOMContentLoaded', function(){\n var str = \"var st = document.createElement('script'); st....
javascript
chosen
[ { "from": "system", "value": "Make token name more descriptive and unique\n" }, { "from": "human", "value": "/**\n * A Bot for Slack that tracks Mario Kart results and calculates rankings.\n */\n\n \n // TOKEN is required for connecting to Slack\nif (!process.env.TOKEN) {\n\tconsole.log('Error: ...
javascript
chosen
[ { "from": "system", "value": "Fix navbar transparent on page load\n" }, { "from": "human", "value": "import \"phoenix_html\"\n\n// Import local files\n//\n// Local files can be imported directly using relative\n// paths \"./socket\" or full ones \"web/static/js/socket\".\n\n// import socket from...
javascript
chosen
[ { "from": "system", "value": "Select hashed tab on select\n" }, { "from": "human", "value": "require(['bootstrap', 'jquery'], function() {\n $('.nav-tabs a').click(function(e) {\n e.preventDefault();\n $(this).tab('show');\n });\n});\n" }, { "from": "gpt", "value"...
javascript
chosen
[ { "from": "system", "value": "Fix MIME type for whitelist\n" }, { "from": "human", "value": "// 允许上传的MIME类型\nconst mimeWhiteList = [\n {\n mime: 'application/msword',\n ext: 'doc'\n },\n {\n mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n ext: 'd...
javascript
chosen
[ { "from": "system", "value": "Move combine assets step before uglify step\n\nThis ensures that uglify will catch these changes." }, { "from": "human", "value": "import { ConcatSource } from 'webpack-sources'\n\n// This plugin combines a set of assets into a single asset\n// This should be only u...
javascript
chosen
[ { "from": "system", "value": "Order keys consistently for enhanced readability\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst { Controller, inject, computed, getOwner } = Ember;\n\nexport default Controller.extend({\n token: inject.service(),\n\n tokenRecord: null,\n s...
javascript
chosen
[ { "from": "system", "value": "Add prompt to guide user toward certificate or sso config.\n" }, { "from": "human", "value": "const fs = require('fs');\nconst csv = require(\"fast-csv\");\nconst jsforce = require('jsforce');\nconst sfdc = require(\"./salesforce\");\nconst prompt = require('prompt'...
javascript
chosen
[ { "from": "system", "value": "Work around npm cmd shim's cwd resolution\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict'\n\nvar spawn = require('child_process').spawn,\n path = require('path');\n\n// add --harmony flag + pass-through args to main runner.js\nvar args = ['--...
javascript
chosen
[ { "from": "system", "value": "Comment on why we're disabling lint rules\n" }, { "from": "human", "value": "module.exports = {\n root: false,\n plugins: ['markdown'],\n globals: {\n expect: true // One of the snippets overwrites the global\n },\n rules: {\n 'no-unused-vars': 0,\n 'n...
javascript
chosen
[ { "from": "system", "value": "Add import pipeline for standalone page content.\n" }, { "from": "human", "value": "import React from 'react'\nimport styled from 'styled-components'\nimport Wrapper from '../../../components/Wrapper'\nimport Section from '../../../components/Section'\nimport Conten...
javascript
chosen
[ { "from": "system", "value": "Use the correct userId when displaying who redacted a message\n" }, { "from": "human", "value": "/*\nCopyright 2015, 2016 OpenMarket Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the Lic...
javascript
chosen
[ { "from": "system", "value": "Add function bind for iOS\n" }, { "from": "human", "value": "(function() {\n window.PointerEventShim = {\n clone: function(inSink, inSource) {\n var p$ = [].slice.call(arguments, 1);\n for (var i=0, p; p=p$[i]; i++) {\n if (p) {\n var g...
javascript
chosen
[ { "from": "system", "value": "Write out badFingerprints file for top 500\n" }, { "from": "human", "value": "import {init, getAdInfo, exit} from 'ad-info';\nimport top500 from './top500';\nvar path = require('path');\nlet fs = require('fs');\nlet perSiteInfo = {};\n\nlet sequence = init('./node_m...
javascript
chosen
[ { "from": "system", "value": "Remove code to generate .gitattributes\n" }, { "from": "human", "value": "import fse from 'fs-extra';\nimport path from 'path';\nimport R from 'ramda';\nimport { core } from './commands/lfsCommands';\n\nconst createGitattributes = (workdir) => {\n const gitattrpath...
javascript
chosen
[ { "from": "system", "value": "Use the `ember-data` initializer as a target instead of the soon to be deprecated `store` initializer" }, { "from": "human", "value": "// Import the full module to ensure monkey-patchs are applied before any store\n// instances are created. Sad face for side-effects...
javascript
chosen
[ { "from": "system", "value": "Handle error when getting initial URL\n" }, { "from": "human", "value": "/* @flow */\n\nimport ReactNative from 'react-native';\nimport { bus } from '../../core-client';\n\nconst {\n\tLinking\n} = ReactNative;\n\nbus.on('state:init', async () => {\n\tconst initialUR...
javascript
chosen
[ { "from": "system", "value": "Set protractor page timeout to 30s\n" }, { "from": "human", "value": "var exec = require(\"sync-exec\");\n\nexports.config = {\n suites: {\n core: \"../src/adhocracy_frontend/adhocracy_frontend/tests/acceptance/*Spec.js\",\n mercator: \"../src/merca...
javascript
chosen
[ { "from": "system", "value": "Update validation to match server error.\n\nWhen a using the forgottenRoute if you enter an incorrectly formatted\nemail address you would see the error message 'Invalid Email', however\nif you entered an email address that was correctly formatted but missing\nthe error message...
javascript
chosen
[ { "from": "system", "value": "Move account error messages below submit button\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport Header from 'components/Header'\nimport AccountForm from '../containers/AccountForm'\nimport classes from './AccountView.css'\n\nclass...
javascript
chosen
[ { "from": "system", "value": "US2086: Clear RSA key area when showing/hiding. Improve indentation.\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n $(\"#addKeyBtn\").unbind(\"click\");\n $(\"#addKeyBtn\").click(function() {\n $(\"#rsaKeyField\").toggle(250);\n $(\"#r...
javascript
chosen
[ { "from": "system", "value": "Send invite email to each address individually\n" }, { "from": "human", "value": "Meteor.methods({\n \"nearest-past-games\": function (location) {\n this.unblock();\n check(location, GeoJSONPoint);\n return Games.find({\n 'startsAt': {$lt: new Date()}...
javascript
chosen
[ { "from": "system", "value": "Fix host snapshot to use new Twitch API endpoint.\n" }, { "from": "human", "value": "var nazgul = require('./nazgul'),\n _ = require('lodash'),\n async = nazgul.async,\n await = nazgul.await,\n Config = nazgul.Config,\n Log = nazgul.Log,\n sprintf ...
javascript
chosen
[ { "from": "system", "value": "Fix double closing script tag\n\n" }, { "from": "human", "value": "\n\"use strict\";\n\nmodule.exports = require(\"./change-buffer\")(function (data, file, debug) {\n var fs = require(\"fs\");\n var path = require(\"path\");\n var base = path.dirname(file.p...
javascript
chosen
[ { "from": "system", "value": "Fix windows phone API calls" }, { "from": "human", "value": "// cordova-plugin-spinnerdialog\n// Copyright © 2015 filfat Studios AB\n// Repo: https://github.com/filfat-Studios-AB/cordova-plugin-spinnerdialog\n/* global Windows, cordova */\nvar progressIndicator;\...
javascript
chosen
[ { "from": "system", "value": "Set prompting info for tests\n" }, { "from": "human", "value": "'use strict';\nvar path = require('path');\nvar assert = require('yeoman-assert');\nvar helpers = require('yeoman-generator').test;\n\ndescribe('generator-ocaml:app', function () {\n before(function (d...
javascript
chosen
[ { "from": "system", "value": "Add https status on error\n" }, { "from": "human", "value": "/**\n * Seed controller for fill your db of fake data\n */\n\nimport HTTPStatus from 'http-status';\n\nimport User from '../models/user.model';\nimport { userSeed, deleteUserSeed } from '../seeds/user.seed...
javascript
chosen
[ { "from": "system", "value": "Switch date formatting for digital takeup number view\n" }, { "from": "human", "value": "define([\n 'extensions/views/single-stat'\n],\nfunction (SingleStatView) {\n var DigitalTakeupNumberView = SingleStatView.extend({\n\n changeOnSelected: true,\n\n getVal...
javascript
chosen
[ { "from": "system", "value": "Update the Prettier config in the blueprints\n\nThis updates the `.prettierrc.js` file so that it only applies the singleQuote config to `.js` (and `.ts`) files. This has the benefit that other file types will still use the default Prettier settings and apps no longer have to a...
javascript
chosen
[ { "from": "system", "value": "Remove console.log from tags script\n" }, { "from": "human", "value": "Skull.Tabs = {\n selectTab: function($tab, $tabContent){\n $tab.siblings('.selected').removeClass('selected');\n $tab.addClass('selected');\n $tabContent.siblings(':visible').hide();\n ...
javascript
chosen
[ { "from": "system", "value": "Use a more pleasant color for LineChart\n" }, { "from": "human", "value": "import VisualizationComponent from './../resplendent';\nimport vcharts from 'vcharts';\n\nexport default class LineChart extends VisualizationComponent {\n constructor (el, data) {\n supe...
javascript
chosen
[ { "from": "system", "value": "Change modules images file name\n" }, { "from": "human", "value": "import gulp from \"gulp\";\nimport plumber from \"gulp-plumber\";\nimport changed from \"gulp-changed\";\nimport imagemin from \"gulp-imagemin\";\nimport rename from \"gulp-rename\";\nimport gulpIf f...
javascript
chosen
[ { "from": "system", "value": "Fix date format datepickers when multiple datepickers are on the page\n" }, { "from": "human", "value": "$(function () {\n var $date_option = $('.date-time-picker').data('date-option');\n if ($date_option == \"mm\") {\n $('.date-time-picker').datepicker...
javascript
chosen
[ { "from": "system", "value": "Update up to changes in es6-iterator package\n" }, { "from": "human", "value": "'use strict';\n\nvar toArray = require('es6-iterator/to-array')\n , Database = require('dbjs');\n\nmodule.exports = function (t, a) {\n\tvar db = new Database(), Type = t(db);\n\ta.dee...
javascript
chosen
[ { "from": "system", "value": "Update to new helper API\n\nEmber.HTMLBars.makeBoundHelper is deprecated in favor of\nEmber.Helper.helper\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport moment from 'moment';\n\nexport function formattedDate(params, hash = {}) {\n let output;...
javascript
chosen
[ { "from": "system", "value": "Add watch task to gulp\n" }, { "from": "human", "value": "'use strict';\n\nconst gulp = require('gulp');\nconst babel = require('gulp-babel');\nconst uglify = require('gulp-uglify');\nconst browserify = require('browserify');\nconst source = require('vinyl-source-st...
javascript
chosen
[ { "from": "system", "value": "Use hash based location type for now to support IE9 / ember bug\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n l...
javascript
chosen
[ { "from": "system", "value": "Use a networkFirst strategy for Picasa\n" }, { "from": "human", "value": "/**\n * Copyright 2015 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the Li...
javascript
chosen
[ { "from": "system", "value": "Add folder content count to label, navigate to folder on click.\n" }, { "from": "human", "value": "// Auto-magically referenced. Yay.\n\n$(document).ready(function() {\n var rubyFolders = gon.folders;\n var folders = {};\n \n var currentId = gon.currentFolder.id...
javascript
chosen
[ { "from": "system", "value": "Update: Refactor Javascript Factory to match best practices\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('<%= scriptAppName %>')\n .factory('<%= cameledName %>', function () {\n // Service logic\n // ...\n\n var meaningOfLife = 42;\n\...
javascript
chosen
[ { "from": "system", "value": "fix(Storage): Use promises correctly, fixes storage clearing error display\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc function\n * @name MatchCalendarApp.controller:SettingsCtrl\n * @description\n * # SettingsCtrl\n * Controller of the MatchC...
javascript
chosen
[ { "from": "system", "value": "Add trailing path delimeter onto OUT_DIR\n" }, { "from": "human", "value": "var gulp = require('gulp')\nvar source = require('vinyl-source-stream')\nvar browserify = require('browserify')\nvar babel = require('babelify')\nvar glob = require('glob')\nvar path = requi...
javascript
chosen
[ { "from": "system", "value": "Use the new clean file\n" }, { "from": "human", "value": "var gulp = require('gulp');\nvar del = require('del');\n\ngulp.task('clean', function (done) {\n\tvar dir = './source';\n\tvar jsFiles = '/**/*.js';\n\tvar mapFiles = '/**/*.js.map';\n\tvar typingFiles = '/**...
javascript
chosen
[ { "from": "system", "value": "Make expanding notification bar much less verbose.\n\n--HG--\nextra : convert_revision : 3f96e638dc43a8cd6d58ae2ffdca6d120e8c7ec8\n" }, { "from": "human", "value": "forClass(\"com.android.internal.policy.impl.LockScreen\", {\n onViewFocused: function() {\n retur...
javascript
chosen
[ { "from": "system", "value": "Fix link click handling - some regular links were erroneously caught\n" }, { "from": "human", "value": "debug_log(\"Creating click handler\");\n$(\"body\").on(\"click\", \"a\", function(event) {\n\tdebug_log(\"Click handler activated.\")\n\tvar url = $(this).prop(\"...
javascript
chosen
[ { "from": "system", "value": "[INTERNAL] CardExplorer: Use correct path in Custom Actions sample\n\nChange-Id: I73b3f8aadd7b375267435e0b43cc1376c0d3447f\nBCP: 2080456866\n" }, { "from": "human", "value": "sap.ui.define([\"sap/ui/integration/Extension\", \"sap/ui/integration/ActionDefinition\"], ...
javascript
chosen
[ { "from": "system", "value": "Add some template selectorin LoginModel\n" }, { "from": "human", "value": "\n// ----------------------------------------------------------------\n// Login Class\n\nclass LoginModel extends SwitchModel {\n constructor({\n name,\n lsKeyView,\n triggerSelecto...
javascript
chosen
[ { "from": "system", "value": "Add trailing semicolon to js file\n" }, { "from": "human", "value": "/* global $, document */\n$(function() {\n $(document).on('click', '#add_membership', function(e) {\n e.preventDefault();\n $.ajax({\n url: this,\n success: function(data) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix issue with isotope and define method\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\t'use strict';\n\treturn {\n\t\tisotope: {\n\t\t\toptions: {\n\t\t\t\tpatcher: function(text) {\n\t\t\t\t\tvar re = grunt.config('env.name') === 'develop...
javascript
chosen
[ { "from": "system", "value": "Test ad component call to display an ad.\n" }, { "from": "human", "value": "/* eslint-env jest */\n\nimport React from 'react'\nimport {shallow} from 'enzyme'\nimport Ad from '../Ad'\n\njest.mock('ads/AdClient')\njest.mock('ads/activeAdClient')\n\ndescribe('Ad compo...
javascript
chosen
[ { "from": "system", "value": "Improve method name for search input change\n" }, { "from": "human", "value": "import { updateQuery, fetchQuery, addSearch, isSearching } from '../actions';\nimport { search } from '../actions/SearchAPI';\nimport Icon from './Icon';\n\nexport default class SearchFor...
javascript
chosen
[ { "from": "system", "value": "Remove debugger statement from Footer.js\n" }, { "from": "human", "value": "(function(){\n\n angular\n .module('openeApp')\n .controller('FooterController', FooterController);\n\n FooterController.$inject = ['$scope', 'authService', 'serverVersio...
javascript
chosen
[ { "from": "system", "value": "Add fetch by url api in reducer.\n" }, { "from": "human", "value": "import localDB from './localDb';\n\nconsole.log(localDB.getItemById(2323));\n\n// ACTIONS\nconst FILTER = 'FILTER';\n\n\n// REDUCER\nconst initialState = {\n};\n\nconst dashboard = (state = initialS...
javascript
chosen
[ { "from": "system", "value": "Set initialLine of found file\n" }, { "from": "human", "value": "'use babel'\n\nimport * as util from './util'\nimport { Range } from 'atom'\n\nexport default {\n wordRegExp: /([\\w\\.\\-_]+)/,\n providerName: \"moie-modelica\",\n setClient(client) {\n this.cl...
javascript
chosen
[ { "from": "system", "value": "Correct bower rx-ember tag in addon blueprint\n" }, { "from": "human", "value": "/* globals module */\nmodule.exports = {\n normalizeEntityName: function() {},\n\n afterInstall: function() {\n return this.addBowerPackagesToProject([\n { name: 'd3', target:...
javascript
chosen
[ { "from": "system", "value": "Add console.log for return value in example\n" }, { "from": "human", "value": "/*\n * <%= props.name %>\n * <%= props.homepage %>\n *\n * Copyright (c) <%= currentYear %><% if (props.authorName) { %> <%= props.authorName %><% } %>\n * Licensed under the <%= props.li...
javascript
chosen
[ { "from": "system", "value": "Use native video controls in Claro video\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Claro Video - No mouse hijacking\n// @namespace http://federicojm.com/\n// @version 0.1\n// @description Disable mouse hijacking by Claro Video\n...
javascript
chosen
[ { "from": "system", "value": "Add questions having access to results\n" }, { "from": "human", "value": "\nimportScripts(\"/app/bower_components/videogular-questions/questions-worker.js\");\n\nloadAnnotations({\n\t\"first-question\": {\n\t\ttime: 8,\n\t\tquestions: [\n\t\t\t{\n\t\t\t\tid: \"first...
javascript
chosen
[ { "from": "system", "value": "Update the way the main JavaScript file is organized.\n\nUsing the module.exports approach.\n" }, { "from": "human", "value": "/*\n * simple-sudoku-check\n * https://github.com/jbranchaud/simple-sudoku-check\n *\n * Copyright (c) 2014 Josh Branchaud\n * Licensed und...
javascript
chosen
[ { "from": "system", "value": "Use hash_maps for student.studies and student.schedules\n" }, { "from": "human", "value": "var Fluxy = require('fluxy')\nvar Promise = require('bluebird')\nvar uuid = require('node-uuid')\nvar _ = require('lodash')\nvar mori = require('mori')\n\nvar StudyStore = req...
javascript
chosen
[ { "from": "system", "value": "Add possibility to add custom plugin prefix\n\nSummary: The problem with a fixed prefix is that babel 7 uses a scoped packages and every (standard) plugin is now part of that scope so the prefix is no longer `babel-plugin-` but instead `babel/plugin-`. There are more changes. T...
javascript
chosen
[ { "from": "system", "value": "Update to latest i18n API\n" }, { "from": "human", "value": "\nimport Vue from 'vue';\nimport vuexI18n from 'vuex-i18n';\n\nimport store from '../store';\nimport locales from './locales';\n\nimport fallback from '../assets/i18n/en.json';\n\nVue.use(vuexI18n.plugin, ...
javascript
chosen
[ { "from": "system", "value": "Update admin js for admin ux redesign\n" }, { "from": "human", "value": "import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PermissionGrid from 'flarum/components/PermissionGrid';\n\napp.initializers.add('flarum-sticky', () => {\n extend...
javascript
chosen
[ { "from": "system", "value": "Set page title via route property.\n" }, { "from": "human", "value": "angular.module('moped.widgets', [\n 'moped.util'\n])\n.directive('mopedTrack', function(util) {\n return {\n restrict: 'EA',\n scope: {\n trackNo: '=',\n track: '='\n },\n ...
javascript
chosen
[ { "from": "system", "value": "Add text window data fields" }, { "from": "human", "value": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(item) {\n return item.getBytes().then(function(bytes) {\n var text = macintoshRoman(bytes, 0, bytes.length...
javascript
chosen
[ { "from": "system", "value": "fix: Remove js that disables links to prepare for using button instead\n" }, { "from": "human", "value": "import {\n define,\n props,\n withComponent,\n css,\n hasNativeShadowDomSupport,\n BoltComponent,\n sanitizeBoltClasses,\n} from '@bolt/core';\n\nimport ...
javascript
chosen
[ { "from": "system", "value": "Add content to About Us page.\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport Box from 'grommet/components/Box';\nimport { SectionHeader } from 'components';\n\nexport default class AboutUsPage extends Component {\n static fetch...
javascript
chosen
[ { "from": "system", "value": "Load default.js if it exists.\n" }, { "from": "human", "value": "var pageMod = require('page-mod'),\n data = require('self').data,\n file = require('file'),\n url = require('url');\n\npageMod.PageMod({\n include: \"*\",\n contentScriptWhen: 'ready',\n...
javascript
chosen
[ { "from": "system", "value": "Refactor translation downloads according to downloadFile service\n" }, { "from": "human", "value": "import Controller from '@ember/controller';\n\nexport default Controller.extend({\n isLoading: false,\n\n actions: {\n translationsDownload() {\n this.set('...
javascript
chosen
[ { "from": "system", "value": "fix(seedData): Order of seedData now places the main schema json after all other modules plus refactoring\n" }, { "from": "human", "value": "var path = require( 'path' )\n , fs = require( 'fs' )\n , fileNames = [ 'seedData' ]\n , packageJson = r...
javascript
chosen
[ { "from": "system", "value": "Apply bindings for new change password VM\n" }, { "from": "human", "value": "'use strict';\n\nvar $ = require('jquery');\nvar $osf = require('js/osfHelpers.js');\nvar accountSettings = require('js/accountSettings.js');\n\n$(function() {\n var viewModel = new acco...
javascript
chosen
[ { "from": "system", "value": "Change order of PostCSS plugins\n" }, { "from": "human", "value": "module.exports = {\n plugins: {\n 'autoprefixer': {},\n 'postcss-import': {},\n 'postcss-nested': {},\n 'cssnano': {}\n },\n 'local-plugins': true,\n}\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Tweak poster size a bit.\n" }, { "from": "human", "value": "$('form').submit(function(event) {\n\tevent.preventDefault();\n\n\tvar movie = $('#movie'),\n\t\tid = $('#search-id').val();\n\n\tmovie.html('<img src=\"/static/img/loading.gif\">');\n\n\tvar request = $.ge...
javascript
chosen
[ { "from": "system", "value": "Implement .destroy method in MemoryCookieStorage.\n" }, { "from": "human", "value": "var util = require(\"util\");\nvar MemoryCookieStore = require('tough-cookie/lib/memstore.js').MemoryCookieStore;\nvar CookieStorage = require('./cookie-storage');\n\n\nfunction Coo...
javascript
chosen
[ { "from": "system", "value": "Update to avoid copyright problem\n" }, { "from": "human", "value": "'use strict'\n\nlet pokemons = ['Pikachu','Magikarp','Balbasaur'];\n\n// ES 5\n// pokemons.forEach(function(mon){\n// console.log(mon);\n// });\n\n\n// ES 6" }, { "from": "gpt", "va...
javascript
chosen
[ { "from": "system", "value": "Add a task to the Grunt file for just running the tests.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (grunt) {\n // Show elapsed time at the end\n require('time-grunt')(grunt);\n // Load all grunt tasks\n require('load-grunt-tas...
javascript
chosen
[ { "from": "system", "value": "[sgc] Revert \"enablenpmpublish off for common branch\"\n\nThis reverts commit 9afd156a148071bf05bb764e6dc9e987e2fcb1ce.\n" }, { "from": "human", "value": "'use strict';\n\n/* istanbul ignore next */\nmodule.exports = function( grunt ) {\n\trequire( './' )( __dirnam...
javascript
chosen
[ { "from": "system", "value": "Remove local information from test settings\n" }, { "from": "human", "value": "/*\n * grunt-restful\n * https://github.com/DaneStuckel/grunt-restful\n *\n * Copyright (c) 2013 Dane Stuckel\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.exports =...
javascript
chosen
[ { "from": "system", "value": "Update demo server version response\n" }, { "from": "human", "value": "const EventEmitter = require(\"events\");\nclass DemoClient extends EventEmitter {}\n\nconst Client = new DemoClient();\nexports.client = Client;\n\nClient.connect = () => {\n Client.emit(\"read...
javascript
chosen
[ { "from": "system", "value": "Send middlware output, challenge setup\n" }, { "from": "human", "value": "'use strict';\n\nvar authHeader = require('auth-header');\nvar tokenUtils = require('./token');\n\nmodule.exports = function (options) {\n return function (req, res, next) {\n var auth = a...
javascript
chosen
[ { "from": "system", "value": "Delete this util function since we're not using it anymore\n" }, { "from": "human", "value": "import { DateUtils } from 'react-day-picker/lib/src/index';\n\nexport const convertModifiersToClassnames = (modifiers, theme) => {\n if (!modifiers) {\n return {};\n }...
javascript
chosen
[ { "from": "system", "value": "Fix typo in scenarios test\n" }, { "from": "human", "value": "import { API } from 'api';\nimport Scenarios from 'api/scenarios';\n\ndescribe('scenrios', () => {\n\n beforeEach(() => {\n API.clearStorage();\n });\n\n it('should get 0 scenarios', () => {\n ex...
javascript
chosen
[ { "from": "system", "value": "Update react template to reflect latest player changes\n" }, { "from": "human", "value": "/*\n\nCurrent state of affairs:\n\n - Gadget must be exported to window object, modules are not supported\n Proper support for modules will come later.\n Currently playe...
javascript
chosen
[ { "from": "system", "value": "Fix error in testing template\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar expect = require('chai').expect;\nvar bitmapReader = require('../lib/bitmapReader');\n\ndescribe('bitmapReader', function() {\n before(function() {\n /...
javascript
chosen
[ { "from": "system", "value": "Test for spoiler list with single spoiler\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\nvar test = require('nodeunit');\nvar Media = require('../../app/models/media');\n\nvar db;\n\ndb = mongoose.connect('mongodb://localhost/test');\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Reading: Fix images of Phoneme Segmentation Fluency materials\"\n" }, { "from": "human", "value": "import React from 'react';\nimport expandedViewPropTypes from './expandedViewPropTypes';\nimport {DIBELS_PSF} from '../reading/thresholds';\nimport {PHONOLOGICAL_AWARE...
javascript
chosen
[ { "from": "system", "value": "Add raw string tests to validation tests\n" }, { "from": "human", "value": "var test = require('tape');\nvar validate = require('../candidate');\n\nvar validCandidates = [\n { mid: 'data', candidate: 'a=candidate:2441410931 1 udp 2121670399 172.17.42.1 40992 typ ho...
javascript
chosen
[ { "from": "system", "value": "Fix order of static and router to let static to handle static files first\n" }, { "from": "human", "value": "\n/**\n * Module dependencies.\n */\n\nvar express = require('express')\n , routes = require('./routes')\n , http = require('http')\n , mongoose = require...
javascript
chosen
[ { "from": "system", "value": "Add trace logs for response duration\n" }, { "from": "human", "value": "'use strict';\n\nvar http = require('http');\n\nvar config = require('./lib/configLoader');\nvar urlUtils = require('./lib/urlUtils');\nvar api = require('./lib/api');\n\nvar logger = config.log...
javascript
chosen
[ { "from": "system", "value": "Update the driving time periodically\n" }, { "from": "human", "value": "(function(N) {\n N.Map = function(opts) {\n\n self = this;\n self.directionsService = new google.maps.DirectionsService();\n self.directionsDisplay = new google.maps.Dire...
javascript
chosen
[ { "from": "system", "value": "Add include for geocens-core JS\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 directory, lib/assets/javascripts...
javascript
chosen
[ { "from": "system", "value": "Fix 404 issues on reload during demo\n" }, { "from": "human", "value": "var SERVERDIR = __dirname + '/../server/src';\n\nvar express = require('express');\nvar config = require(SERVERDIR + '/config');\nvar app = express();\n\napp.use(express.static('../dashboard'))...
javascript
chosen
[ { "from": "system", "value": "Build infrastrucutre: eslint config adaption\n" }, { "from": "human", "value": "module.exports = {\n extends: [\"eslint:recommended\", \"prettier\"],\n root: true,\n env: {\n es6: \"true\",\n browser: true,\n node: true,\n },\n ig...
javascript
chosen
[ { "from": "system", "value": "Use vue/recommended and add no-trailing-spaces\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n env: {\n browser: true,\n node: true,\n mocha: true\n },\n extends: ['eslint:recommended', 'plugin:vue/essential', 'prettier'],\n parse...
javascript
chosen
[ { "from": "system", "value": "Add page_url parameter to the init_folder_list function\n" }, { "from": "human", "value": "/*\r\n * awa-storages -- Storages and folders\r\n * Copyright (C) 2012 Stephane Carrez\r\n * Written by Stephane Carrez (Stephane.Carrez@gmail.com)\r\n *\r\n * Licensed un...
javascript
chosen
[ { "from": "system", "value": "Change the way of exports MainSidebar Component\n\nFor: https://github.com/falmar/react-adm-lte/issues/3\n" }, { "from": "human", "value": "import MainSidebar from './MainSidebar'\nimport UserPanel from './UserPanel'\nimport SearchForm from './SearchForm'\nimport Me...
javascript
chosen
[ { "from": "system", "value": "Update: Change Datepicker to use react-testing-library\n" }, { "from": "human", "value": "/* eslint-env jest */\n\nimport React from 'react';\nimport { mountWithTheme } from 'styled-enzyme';\n\nimport DatePicker from './DatePicker';\n\ndescribe('DatePicker component...
javascript
chosen