conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Include moment as a global external instead of bundling it with the tests.\n"
},
{
"from": "human",
"value": "// Karma default configuration\n\nvar webpackJsonLoader = require('./webpack.json-loader');\n\nmodule.exports = function (karma, karmaSettings) {\n\tvar kar... | javascript | chosen |
[
{
"from": "system",
"value": "Change window title in dev mode\n"
},
{
"from": "human",
"value": "'use strict';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport Ansel from './../dist/components/ansel';\n\nReactDOM.render(React.createElement(Ansel), document.getElementByI... | javascript | chosen |
[
{
"from": "system",
"value": "Update user-content URL for the Bookmarklet, too\n"
},
{
"from": "human",
"value": "javascript:{if (!('console' in window)){window.console={log:function(){},warn:function(){},error:function(){}}};if (!('obis' in window)){window.obis={loadScript:function _loadScript(... | javascript | chosen |
[
{
"from": "system",
"value": "Use user specified columns for data transform\n"
},
{
"from": "human",
"value": "export default function onInit(){\n this.raw_data.forEach(function(d){\n d.FormField = d.Form + \": \"+d.Field\n })\n};"
},
{
"from": "gpt",
"value": "export default fun... | javascript | chosen |
[
{
"from": "system",
"value": "Throw an exception if callback is defined in $e.\n\nUse .then part as callback when the defer approach is used.\nThe check is better before creating the promise.\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nexports.evaluateDefer = evaluateDefer;\n\nvar eval... | javascript | chosen |
[
{
"from": "system",
"value": "Fix deprecation of `new Buffer()`\n"
},
{
"from": "human",
"value": "import { Transform } from 'stream';\nimport util from 'util';\n\nimport tipograph from './tipograph';\n\nutil.inherits(TipographStream, Transform);\nfunction TipographStream(options, callback) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": ":children_crossing: Set app infos from environments automatically (for JS SDK 4)\n"
},
{
"from": "human",
"value": "'use strict';\nvar AV = require('leancloud-storage/live-query');\n\nAV._config.disableCurrentUser = true;\n\nif (process.env.LEANCLOUD_REGION) {\n AV... | javascript | chosen |
[
{
"from": "system",
"value": "Add meta data to team model\n\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst mongoose = require('mongoose');\nconst Schema = mongoose.Schema;\n\nconst TeamModel = new Schema({\n project: {\n type: Schema.Types.ObjectId,\n required: false,\n ref:... | javascript | chosen |
[
{
"from": "system",
"value": "Add tests for Array/PickIn & Array/reindex\n"
},
{
"from": "human",
"value": "\"use strict\";\n\n/* global it describe */\n\nconst expect = require('expect.js');\n\n//const pickIn = require('../array/pickIn');\n//const reindex = require('../array/reindex');\nconst ... | javascript | chosen |
[
{
"from": "system",
"value": "Use if/else and direct function calls over try/catch + bind\n"
},
{
"from": "human",
"value": "import CoreObject from './metal/core-object';\n\nfunction wrapConsole(logCommand) {\n let logMethod;\n\n /* eslint-disable no-console */\n try {\n logMethod = Functi... | javascript | chosen |
[
{
"from": "system",
"value": "Create createPost action creator function\n"
},
{
"from": "human",
"value": "import axios from 'axios';\n\nexport const FETCH_POSTS = 'fetch_posts';\n\nconst ROOT_URL ='https://reduxblog.herokuapp.com/api';\nconst API_KEY = '?key=unhommequidort';\n\nexport function ... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"select2Options.width = \"element\" as default\"\n"
},
{
"from": "human",
"value": "Template[\"afSelect2_bootstrap3\"].helpers({\n optionAtts: function afSelectOptionAtts() {\n var item = this\n var atts = {\n value: item.value\n };\n if (i... | javascript | chosen |
[
{
"from": "system",
"value": "Change the way to report bugs\n"
},
{
"from": "human",
"value": "//\n// script.js\n//\n\n'use strict';\n\nchrome.runtime.onInstalled.addListener(() => {\n chrome.contextMenus.create({\n contexts: ['page', 'frame', 'selection', 'link', 'editable', 'image',... | javascript | chosen |
[
{
"from": "system",
"value": "Add prop test to Foo\n"
},
{
"from": "human",
"value": "import React from \"react\";\nimport toJson from \"enzyme-to-json\";\nimport { shallow, mount, render } from \"enzyme\";\n\nimport Foo from \"../Foo\";\n\ndescribe(\"A suite\", function() {\n it(\"should rende... | javascript | chosen |
[
{
"from": "system",
"value": "Fix error.data.compress being undefined when compress is a string\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst { DEFAULT_COMPRESS } = require('./merger');\n\n// Normalize `compress` name\nconst normalizeCompress = function ({\n compressResponse: { name... | javascript | chosen |
[
{
"from": "system",
"value": "Move most of device handling to the frameworks\n"
},
{
"from": "human",
"value": "/**\n * a class that is used to store each test device so we can send data back to them\n */\n\n'use strict';\n\nfunction TestDevice(deviceSocket,name,platform,testType,bluetoothAddres... | javascript | chosen |
[
{
"from": "system",
"value": "Add Travis CI build number to Sauce Labs jobs\n"
},
{
"from": "human",
"value": "module.exports = function(config) {\n var commonConfig = (require(\"./karma-common.conf\"))(config);\n var customLaunchers = {\n sl_chrome: {\n base: \"SauceLabs... | javascript | chosen |
[
{
"from": "system",
"value": "Determine status code in constant linear time\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport GetController from 'ember-cli-mirage/controllers/get';\nimport PostController from 'ember-cli-mirage/controllers/post';\nimport PutController from 'em... | javascript | chosen |
[
{
"from": "system",
"value": "Make mocha run not only once, seems something has changed."
},
{
"from": "human",
"value": "var expect = require('referee/lib/expect');\nvar should = require('should');\nvar assert = require('assert');\n\nfunction consumeMessage(messageData) {\n var sender = messag... | javascript | chosen |
[
{
"from": "system",
"value": "Watch element files in Vulcanize watch task\n"
},
{
"from": "human",
"value": "'use strict';\n\nimport gulp from 'gulp';\nimport size from 'gulp-size';\nimport vulcanize from 'gulp-vulcanize';\n\nimport {config, browserSync} from './_config.babel.js';\n\nlet sourceF... | javascript | chosen |
[
{
"from": "system",
"value": "Set tests to run w/ memoryadapter by default just to prevent slowdowns (the on-disk implementation is excruciatingly slow-- this is only for development/testing)\n"
},
{
"from": "human",
"value": "var _ = require('underscore');\n\nvar dirtyAdapter = require('waterli... | javascript | chosen |
[
{
"from": "system",
"value": "Fix cross linking to EG problem in compara trees\n"
},
{
"from": "human",
"value": "Ensembl.Panel.ZMenu.prototype.populateAjax = function(url, expand) {\n\tvar timeout = this.timeout;\n\turl = url || this.href;\n if(url && url.match('www.wormbase.org')) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Make departures a plain array\n\nThe ArrayProxy was a remnant of the previous departureFetcher\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport DepartureFetcher from 'bus-detective/utils/departure-fetcher';\nlet { run, computed } = Ember;\nconst... | javascript | chosen |
[
{
"from": "system",
"value": "Include credentials when entity search request is sent\n"
},
{
"from": "human",
"value": "import fetch from 'isomorphic-fetch'\n\nexport const REQUEST_ENTITIES = 'REQUEST_ENTITIES'\nexport const RECEIVE_ENTITIES = 'RECEIVE_ENTITIES'\n\nfunction requestEntities() {\n... | javascript | chosen |
[
{
"from": "system",
"value": "Normalize the data read from the sensors.\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nconst EventEmitter = require('events');\nconst evts = new EventEmitter();\n\nconst env = require('../../env');\nlet dht;\nif (env.inDevMode) {\n\tdht = require('gpio-peri... | javascript | chosen |
[
{
"from": "system",
"value": "Fix props usage for function vs class\n"
},
{
"from": "human",
"value": "// import node packages\nimport React from 'react';\n\nfunction Flashcard(props) {\n return (\n <li>\n Question: <span>{this.props.question}</span><br />\n Answer: <span>{this.pro... | javascript | chosen |
[
{
"from": "system",
"value": "Reset user data when signed out.\n"
},
{
"from": "human",
"value": "import {\n createUser,\n updateUser\n} from '../../../api/db/user'\nimport userMutations from './mutations'\nimport authMutations from '../auth/mutations'\nimport { getCurrentUserObject } from... | javascript | chosen |
[
{
"from": "system",
"value": "Add routing for list and single protocol views\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar mainApp = angular.module('mainApp', ['ngResource']);\nvar indexApp = angular.module('indexApp', ['ngResource']);\n"
},
{
"from": "gpt",
"value": "'use ... | javascript | chosen |
[
{
"from": "system",
"value": "Allow env override of autoLocation parameters and increase max distance to 100km\n"
},
{
"from": "human",
"value": "exports.default = {\n app: {\n orphanRecordsAdopter: process.env.ORPHAN_OWNER,\n latKilometersPerDegree: 111.195,\n lonKilometersPerDegree: ... | javascript | chosen |
[
{
"from": "system",
"value": "Read the file content and send it to client\n"
},
{
"from": "human",
"value": "/**\n *\n * form-serializer#loadForm\n *\n * This is the server operation that reads the content of\n * the HTML file that must be loaded and sends it back to the\n * client.\n *\n */... | javascript | chosen |
[
{
"from": "system",
"value": "Replace this.props.visibleUnits with const visibleUnits.\n"
},
{
"from": "human",
"value": "import React, { Component, PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux'\nimport UnitList from '../components/... | javascript | chosen |
[
{
"from": "system",
"value": "Check mergeImages returns a Promise\n"
},
{
"from": "human",
"value": "import test from 'ava';\nimport mergeImages from '../';\n\ntest('mergeImages is a function', t => {\n\tt.is(typeof mergeImages, 'function');\n});\n"
},
{
"from": "gpt",
"value": "impo... | javascript | chosen |
[
{
"from": "system",
"value": "Use Ember.run.later instead of setTimeout\n"
},
{
"from": "human",
"value": "App.flashQueueController = Ember.ArrayController.extend({\n // 15s\n destroyTimeout: 15 * 1e3,\n flash: function(type, message){\n var flash = App.FlashMessage.create({\n type: t... | javascript | chosen |
[
{
"from": "system",
"value": "Add function to fetch size and location of selection\n"
},
{
"from": "human",
"value": "/*---------------------------------------------------------------------------/\n *\n * textselect.js\n *\n * Author: Declan de Wet <declandewet@me.com>\n *\n * This script wil... | javascript | chosen |
[
{
"from": "system",
"value": "Update skill model unit tests\n"
},
{
"from": "human",
"value": "import { moduleForModel, test } from 'ember-qunit';\n\nmoduleForModel('skill', 'Unit | Model | skill', {\n // Specify the other units that are required for this test.\n needs: []\n});\n\ntest('it exi... | javascript | chosen |
[
{
"from": "system",
"value": "Add named anchor to benchmark text explainer\n"
},
{
"from": "human",
"value": "//general ContactManager app code (defining regions, the start handler, etc.):\nvar HospitalCheckup = new Marionette.Application();\n\nHospitalCheckup.navigate = function(route, options)... | javascript | chosen |
[
{
"from": "system",
"value": "Add return requests reducer in root reducer\n"
},
{
"from": "human",
"value": "import { combineReducers } from 'redux';\nimport { routerReducer } from 'react-router-redux';\nimport { reducer as formReducer } from 'redux-form';\nimport auth from './userSignUp';\nimpo... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"Added module path to require lookup tree.\"\n\nThis reverts commit a32fa1402ca903d66e9626146ebcf0001660ff4d.\n"
},
{
"from": "human",
"value": "(function() {\n\n\tvar modules = {}, cache = {};\n\n\tif (typeof __fhtagn__ == \"undefined\") {\n\t\twindow.__fht... | javascript | chosen |
[
{
"from": "system",
"value": "Add missing key in Homepage quicklinks\n"
},
{
"from": "human",
"value": "\nimport React from 'react';\nimport './HomePage.css';\nimport {connect} from 'react-redux';\nimport logo from './svg/manny_wave.svg';\nimport {getQuicklinks} from './selectors';\nimport Card ... | javascript | chosen |
[
{
"from": "system",
"value": "Include a __typename in the pull request result fixture\n"
},
{
"from": "human",
"value": "function createCommitResult(attrs = {}) {\n return {\n commit: {\n status: {\n contexts: [ {state: 'PASSED'} ]\n }\n }\n };\n}\n\nexport function crea... | javascript | chosen |
[
{
"from": "system",
"value": "Remove unused function. [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 BasePage.extend({\n... | javascript | chosen |
[
{
"from": "system",
"value": "chore: Tidy up the eslint excludes\n\n"
},
{
"from": "human",
"value": "const RESPONSE_PUBLIC = 'in_channel';\nconst RESPONSE_PRIVATE = 'ephemeral';\n\n// Required names for slack\n/*eslint-disable camelcase */\nconst baseResponse = {\n\tparse: 'full',\n\tt... | javascript | chosen |
[
{
"from": "system",
"value": "Fix issue with undefined strings\n"
},
{
"from": "human",
"value": "import React from 'react';\n\nexport const tidyString = string => (\n\t<span>{string.split(/\\n/).map(s => <p>{s}</p>)}</span>\n);\n"
},
{
"from": "gpt",
"value": "import React from 'rea... | javascript | chosen |
[
{
"from": "system",
"value": "Set a smarter default for the aspectRatio setting\n"
},
{
"from": "human",
"value": "Template.videobackground.onRendered(function () {\n renderVideo(this.firstNode, _.extend(\n {\n loop: 1,\n type: 'vimeo',\n volume: 0,\n aspectRatio: 1.8,\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the version test spec\n"
},
{
"from": "human",
"value": "/*\n * Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documen... | javascript | chosen |
[
{
"from": "system",
"value": "Set the background color of the body element\n"
},
{
"from": "human",
"value": "import { injectGlobal } from 'styled-components';\n\ninjectGlobal`\n html {\n box-sizing: border-box;\n }\n\n *,\n *::before,\n *::after {\n box-sizing: inherit;\n }\n\n bod... | javascript | chosen |
[
{
"from": "system",
"value": "Fix deprecation in tests regarding resources\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport config from './config/environment';\n\nvar Router = Ember.Router.extend({\n location: config.locationType\n});\n\nRouter.map(function() {\n this.reso... | javascript | chosen |
[
{
"from": "system",
"value": "Create PUT and PATCH requests to handle updating a book\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar routes = function(Book) {\n var bookRouter = express.Router();\n bookRouter.route('/')\n .post(function(req, res) {\n var book... | javascript | chosen |
[
{
"from": "system",
"value": "Make get compatible with @glimmer/component\n"
},
{
"from": "human",
"value": "import { makeArray } from '@ember/array';\nimport { computed } from '@ember/object';\nimport filterByQuery from 'ember-cli-filter-by-query/util/filter';\n\nvar computedFilterByQuery = fun... | javascript | chosen |
[
{
"from": "system",
"value": "Add section 2.3 code to get tag totals\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar router = express.Router();\nvar JsonDB = require('node-json-db');\n\n// Tags listing\nrouter.get('/', function (req, res, next) {\n var db = new JsonDB(... | javascript | chosen |
[
{
"from": "system",
"value": "Add a newline for readability\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst path = require('path');\n\n// Allows for environment variables to be set using a .env file\nrequire('dotenv').config({\n silent: true,\n path: path.join(__dirname, '.env')\n});... | javascript | chosen |
[
{
"from": "system",
"value": "Use lazy connection for mysql\n"
},
{
"from": "human",
"value": "'use strict'\n\nvar express = require('express')\nvar mysql = require('mysql')\nvar crypto = require('crypto')\nvar config = require('./config.json')\n\nvar connection = mysql.createConnection(config.m... | javascript | chosen |
[
{
"from": "system",
"value": "Add test for date formatter\n"
},
{
"from": "human",
"value": "import columnAccessor from './columnAccessor';\n\ndescribe('Util:columnAccessor', () => {\n it('should access the value of a column', () => {\n const accessor = columnAccessor({ column: 'foo' }... | javascript | chosen |
[
{
"from": "system",
"value": "Set csrf header in AngularJS’ $http requests\n\nCakePHP provides the csrf token in a cookie already.\nThese two lines instruct AngularJS to read the token\nfrom that cookie and to send it as a header in all\nthe requests emitted by the $http service.\n"
},
{
"from": "hu... | javascript | chosen |
[
{
"from": "system",
"value": "Fix window is not defined error\n\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport Link from 'gatsby-link';\nimport Helmet from 'react-helmet';\nimport Container from '../components/Container';\nimport Header... | javascript | chosen |
[
{
"from": "system",
"value": "Add sl-bootstrap to blueprint bower includes\n"
},
{
"from": "human",
"value": "/* globals module */\n\nmodule.exports = {\n afterInstall: function() {\n var self = this;\n\n return this.addBowerPackageToProject( 'bootstrap-datepicker' )\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add wrapper for service run function.\n"
},
{
"from": "human",
"value": "var PermissionConstructor = require('./PermissionConstructor').PermissionConstructor;\n\nfunction WebService(currentUser) {\n\tthis._currentUser = currentUser;\n\tthis._dependencies = {};\n}\n\... | javascript | chosen |
[
{
"from": "system",
"value": "Reduce cache time to reduce cors problems\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst tickerGenerator = require('./functions/ticker');\nconst fetch = require('node-fetch');\nconst AWS = require('aws-sdk'); // eslint-disable-line import/no-extraneous-de... | javascript | chosen |
[
{
"from": "system",
"value": "Use takeAll in place of forEach, because we can"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nvar Iterator = require('kld-array-iterators').Iterator,\n CrossProductIterator = require('kld-array-iterators').CrossProductIterator,\n RandomIterator = req... | javascript | chosen |
[
{
"from": "system",
"value": "Switch to LF-ending, change console.log to make it commitable\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nconst currentNodeVersion = process.versions.node;\nconst semver = currentNodeVersion.split('.');\nconst major = semver[0];\n\nconsole.error('[neo-... | javascript | chosen |
[
{
"from": "system",
"value": "Use the new Tracker API\n"
},
{
"from": "human",
"value": "var _currentRetryTime = 0\nvar currentRetryTimeDep = new Deps.Dependency\n\ncurrentRetryTime = function () {\n currentRetryTimeDep.depend()\n\n return _currentRetryTime\n}\n\nMeteor.setInterval(function ()... | javascript | chosen |
[
{
"from": "system",
"value": "Update wrong value of monthBeforeYear"
},
{
"from": "human",
"value": "export default {\n today: 'วันนี้',\n now: 'ตอนนี้',\n backToToday: 'กลับไปยังวันนี้',\n ok: 'ตกลง',\n clear: 'ลบล้าง',\n month: 'เดือน',\n year: 'ปี',\n timeSelect: 'เลือกเวลา',\n dateS... | javascript | chosen |
[
{
"from": "system",
"value": "Remove buildnumber from version when tag\n"
},
{
"from": "human",
"value": "var jsonfile = require('jsonfile');\n\n// Read in the file to be patched\nvar file = process.argv[2]; // e.g. '../src/MyProject/project.json'\nif (!file)\n console.log(\"No filename provi... | javascript | chosen |
[
{
"from": "system",
"value": "Fix for plug-in : Dribbble\n"
},
{
"from": "human",
"value": "var hoverZoomPlugins = hoverZoomPlugins || [];\nhoverZoomPlugins.push({\n name:'Dribbble',\n version:'0.1',\n prepareImgLinks:function (callback) {\n var res = [];\n $('img[src*=\"... | javascript | chosen |
[
{
"from": "system",
"value": "Fix error when empty string\n"
},
{
"from": "human",
"value": "$(document).ready(function() {\n $(\"#search-lots\").autocomplete({\n minLength: 2,\n source: \"/lots/search-ajax/\",\n focus: function( event, ui ) {\n $(\"#search-lot... | javascript | chosen |
[
{
"from": "system",
"value": "Fix output css file name\n"
},
{
"from": "human",
"value": "/**\n * ReactFashionWatch - a carefully crafted Fashion Watch component for React.\n * https://github.com/virtyaluk/react-fashion-watch\n *\n * Copyright (c) 2016 Bohdan Shtepan\n * http://modern-dev.com/\n... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the component path line in the styleguide.\n"
},
{
"from": "human",
"value": "const {createConfig} = require('@webpack-blocks/webpack2')\nconst babel = require('@webpack-blocks/babel6')\nconst path = require('path')\n\nconst webpackConfig = createConfig([\n bab... | javascript | chosen |
[
{
"from": "system",
"value": "Use static path in morphRetriever\n"
},
{
"from": "human",
"value": "annotationApp.service('morphRetriever', function($http) {\n this.getAnalyses = function(callback) {\n return $http.get('./js/controllers/analyses.json').then(callback);\n };\n});\n"
},
{
... | javascript | chosen |
[
{
"from": "system",
"value": "Refresh after tab selection changed.\n\nRefresh after tab selection changed.\n"
},
{
"from": "human",
"value": "\n\n$(document).ready(function () { \n $('a[data-toggle=\"tab\"]').on('shown.bs.tab', function (e) {\n\n localStorage.setItem('activeTab', $... | javascript | chosen |
[
{
"from": "system",
"value": "Make Measure.add return new measureId\n"
},
{
"from": "human",
"value": "import { Meteor } from 'meteor/meteor';\nimport Expressions from './measures-expressions.js';\n\nconst Measures = {};\n\nMeasures.Expressions = Expressions;\n\nMeasures.collection = new Meteor.... | javascript | chosen |
[
{
"from": "system",
"value": "feat: Add method that updates all focusable elements when called\n\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport $ from 'jquery';\nexport default Ember.Mixin.create({\n\n lockBackground (obj) {\n const focusableElementQuery = 'select:not(... | javascript | chosen |
[
{
"from": "system",
"value": "Fix JS error on homepage load\n"
},
{
"from": "human",
"value": "$(document).ready(function() {\n $(function(){\n $('[rel=\"tooltip\"]').tooltip();\n });\n \n $(function(){\n $('#myTabs a').click(function (e) {\n \te.preventDefault();\n \t \n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix search query filtering issues\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\r\n\r\nclass TableRow extends Component {\r\n static displayName = 'TableRow';\r\n\r\n shouldComponentUpdate(nextProps) {\r\n const isNewTermDiff = ne... | javascript | chosen |
[
{
"from": "system",
"value": "Disable debug mode (so there are no messages written to the javascript console)\n"
},
{
"from": "human",
"value": "jQuery(document).ready(function($){\n $('notices_primary').infinitescroll({\n debug: true,\n infiniteScroll : false,\n nextSelector : 'bo... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure the right file content gets written.\n"
},
{
"from": "human",
"value": "// @flow\nimport {\n assertThat\n} from 'hamjest';\nimport {\n buildFunctionSpy, wasNotCalled, callCountWas,\n} from 'hamjest-spy';\n\ntype Filename = string;\ntype KataifyableFile =... | javascript | chosen |
[
{
"from": "system",
"value": "Add Chapter 05, exercise 1\n"
},
{
"from": "human",
"value": "console.log(arrays.reduce(function(a, b) {\n return a.concat(b);\n}));\n"
},
{
"from": "gpt",
"value": "let arrays = [[1, 2, 3], [4, 5], [6]];\n\nlet array = arrays.reduce((a, b) => a.conca... | javascript | chosen |
[
{
"from": "system",
"value": "Use substrings rather than prefixes"
},
{
"from": "human",
"value": "chrome.extension.sendMessage({}, function(response) {\n var readyStateCheckInterval = setInterval(function() {\n if (document.readyState === \"complete\") {\n clearInterval(readyStateCheck... | javascript | chosen |
[
{
"from": "system",
"value": "Fix issue where double clicking in char select causes game breakage.\n"
},
{
"from": "human",
"value": "var CharSelect = {\n showing: false,\n bound: false,\n\n $ov: null,\n $ui: null,\n $chars: null,\n\n bind: function () {\n if (this.bound... | javascript | chosen |
[
{
"from": "system",
"value": "Move socket connection into main App container, pass the connection instance as a property to children components\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\n\n/* global styles for app */\nimport './styles/app.scss';\n\n/* applicati... | javascript | chosen |
[
{
"from": "system",
"value": "Fix cache tests to account for callback style.\n\nWere built with a return value in mind\n"
},
{
"from": "human",
"value": "var Memory = require('../lib/cache').Memory\n , assert = require('assert')\n ;\n\ndescribe('cache', function(){\n\tvar cache = new Memory();... | javascript | chosen |
[
{
"from": "human",
"value": ":white_check_mark: Add UI tests for welcome page\n"
},
{
"from": "gpt",
"value": "/* global describe, it */\n'use strict';\n\ndescribe('Load', function() {\n\n it('shows welcome page', function(client) {\n client\n .urlHash('/notes')\n .expect... | javascript | chosen |
[
{
"from": "system",
"value": "Remove obsolete variable from tokenize\n"
},
{
"from": "human",
"value": "const EXPR = /{([\\s\\S]+?)}/g;\nconst BLOCK_START = 'block:';\nconst BLOCK_END = '/block:';\n//const BLOCK_START_EXPR = /{block:([\\s\\S]+?)}/g;\n//const BLOCK_END_EXPR = /{\\/block:([\\s\\S]... | javascript | chosen |
[
{
"from": "system",
"value": "Add links to arrows in lessons\n"
},
{
"from": "human",
"value": "// ==UserScript==\n// @name Wanikani for Vimperator\n// @namespace rr-@sakuya.pl\n// @description Improves Wanikani navigation on Vimperator\n// @include https://www.wanikani.com/review/s... | javascript | chosen |
[
{
"from": "system",
"value": "Use statusCode instead of status\n"
},
{
"from": "human",
"value": "function UnauthorizedError (code, error) {\n Error.call(this, error.message);\n Error.captureStackTrace(this, this.constructor);\n this.name = \"UnauthorizedError\";\n this.message = error.messa... | javascript | chosen |
[
{
"from": "system",
"value": "Refactor slim graph filter logic\n\nFilter out configMain's dependencies instead of maintaining a list of\nmodule names to filter out.\n"
},
{
"from": "human",
"value": "var keys = require(\"lodash/keys\");\nvar omit = require(\"lodash/omit\");\nvar through = requir... | javascript | chosen |
[
{
"from": "system",
"value": "Remove ES6 code from tests as well for backwards compatibility.\n"
},
{
"from": "human",
"value": "var chai = require('chai'),\n\tchordprojs = require('../');\n\nvar expect = chai.expect;\n\ndescribe('Parse Directives', () => {\n\n\tit('{title:Song Title} should set... | javascript | chosen |
[
{
"from": "system",
"value": "Fix some grunt / linting issues\n"
},
{
"from": "human",
"value": "'use strict';\n\nangular.module('core').controller('HeaderController', ['$scope', '$state', 'Authentication', 'Menus',\n function ($scope, $state, Authentication, Menus) {\n // Expose view variab... | javascript | chosen |
[
{
"from": "system",
"value": "Add comment about synchronous token retrieval\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nannotationApp.service('tokenRetriever', function($http) {\n this.getData = function(callback) {\n var request = $.ajax({\n url: './static/tokens.json',\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Handle rejections when refreshing doesn’t work.\n"
},
{
"from": "human",
"value": "/* global angular, console, toml */\n\nangular.module('app')\n.controller('HomeCtrl', function ($location, $route, $scope, $http, Anchors, History, Wallet) {\n\t'use strict';\n\n\tvar... | javascript | chosen |
[
{
"from": "system",
"value": "Update test suite to get it to pass\n"
},
{
"from": "human",
"value": "describe('Landing page', function() {\n it('should have the correct title', function(done, server, client) {\n // Get the title with some Laika mumbo jumbo and a dash of jQuery:\n var titl... | javascript | chosen |
[
{
"from": "system",
"value": "Call widgetManager when data received\n"
},
{
"from": "human",
"value": "/* jshint browser: true, jquery: true */\n/* global AgileSprint:false, console:false */\n\n\nvar AgileSprintManager = function(options) {\n// if(options.server === null || options.server === u... | javascript | chosen |
[
{
"from": "system",
"value": "Edit form now pulls live data\n"
},
{
"from": "human",
"value": "'use strict';\n\nangular\n.module('app.controllers')\n.controller('EditCtrl', function($scope, $rootScope, $stateParams, $sce, $interval, Restangular, apiDescription, formElementProvider) {\n var reso... | javascript | chosen |
[
{
"from": "system",
"value": "Disable auto-update until next year\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar config = require('./server/config');\nvar helper = require('./server/helper');\nvar express = require('express');\nvar expressLayouts = require('express-ejs-layouts');\nvar c... | javascript | chosen |
[
{
"from": "system",
"value": "Add special loader since Redux is unusable in the browser as is\n\n"
},
{
"from": "human",
"value": "var resolve = require( \"rollup-plugin-node-resolve\" );\nvar cjs = require( \"rollup-plugin-commonjs\" );\nvar json = require( \"rollup-plugin-json\" );\n\nmodule.e... | javascript | chosen |
[
{
"from": "system",
"value": "Fix up uncaught ajax error alert message\n"
},
{
"from": "human",
"value": "import DS from 'ember-data';\nimport JsonApiAdapter from 'ember-json-api/json-api-adapter';\n\nimport config from 'flarum/config/environment';\nimport AlertMessage from 'flarum/components/ui... | javascript | chosen |
[
{
"from": "system",
"value": "feat(passport): Use passport middleware in API\n\nAdd two middleware helper functions.\nYou can put them before any routes & handlers you need to protect.\n"
},
{
"from": "human",
"value": "/* eslint new-cap: 'off' */\nconst { Router } = require('express');\nconst a... | javascript | chosen |
[
{
"from": "system",
"value": "Fix clicking activated sub-menu will hide context\n"
},
{
"from": "human",
"value": "// Javasctipt file for index.html\n\n// sub-nav toggle\n// Toggle contents by clicking #sub-nav\n\n$(function (){\n var subMenuChild = $('#sub-nav').children();\n for (i = 0; i < ... | javascript | chosen |
[
{
"from": "system",
"value": "Store options with Minimongo indexes if passed\n"
},
{
"from": "human",
"value": "/* eslint-disable no-underscore-dangle */\n\nexport const MiniMongo = {}\n\nconst NAME_TO_CAUSE_MINIMONGO = null\n\nif (global.Mongo) {\n MiniMongo.Collection = class MiniMongoCollect... | javascript | chosen |
[
{
"from": "system",
"value": "Hide instagram tiles if the API fails\n"
},
{
"from": "human",
"value": "var userFeed = new Instafeed({\n get: 'user',\n userId: '182831931',\n clientId: '467ede5a6b9b48ae8e03f4e2582aeeb3',\n resolution: 'low_resolution',\n sortBy: 'most-recent',\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Change the color of bars in the result scene\n"
},
{
"from": "human",
"value": "var ResultScene = InformationScene.extend({\n ctor: function (game) {\n this._super(game);\n return true;\n },\n\n createSceneNode: function () {\n return c... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.