conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Use prop() instead of removeAttr()\n\nAccording to the jQuery upgrade guide:\n\n> It is almost always a mistake to use .removeAttr(\"checked\") on a DOM\n> element. The only time it might be useful is if the DOM is later going\n> to be serialized back to an HTML string. In all ... | javascript | chosen |
[
{
"from": "system",
"value": "Split the tags or an empty list if field is empty\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst fields = [\n 'tags',\n 'tags_vision'\n]\n\nmodule.exports = function(state, metadata) {\n fields.forEach(field => {\n if(typeof(metadata[field]) === 'st... | javascript | chosen |
[
{
"from": "system",
"value": "Add use of linking object\n"
},
{
"from": "human",
"value": "import Realm from 'realm';\n\nexport class InsuranceProvider extends Realm.Object {}\n\nInsuranceProvider.schema = {\n name: 'InsuranceProvider',\n primaryKey: 'id',\n properties: {\n id: 'string',\n... | javascript | chosen |
[
{
"from": "system",
"value": "Fix IE/Safari 10 uglify ecma option\n"
},
{
"from": "human",
"value": "process.env.NODE_ENV = process.env.NODE_ENV || 'production'\n\nconst environment = require('./environment')\n\nmodule.exports = environment.toWebpackConfig()\n"
},
{
"from": "gpt",
"v... | javascript | chosen |
[
{
"from": "system",
"value": "Fix for embark run crashing after console connects to it\n\nThe providerUrl being provided to the console VM was looking for a WebsocketProvider-specific property which did not exist on the HttpProvider.\n\nType checking was added to provide the necessary type-dependent propert... | javascript | chosen |
[
{
"from": "system",
"value": "Remove webpack version check in tslint\n"
},
{
"from": "human",
"value": "/**\n * Tslint webpack block.\n *\n * @see https://github.com/wbuchwalter/tslint-loader\n */\n\nmodule.exports = tslint\n\n/**\n * @param {object} [options] See https://gith... | javascript | chosen |
[
{
"from": "system",
"value": "Remove a now useless JS statement\n\nThis is now done in init.js"
},
{
"from": "human",
"value": "var TPS = TPS || {};\n\nTPS.toggleChart = function(event, chartClass) {\n var nextSelectorItem = $(event.target),\n nextChart = $(chartClass),\n nextChartId ... | javascript | chosen |
[
{
"from": "system",
"value": "Set no embed-codes option for multi-page-test-project\n"
},
{
"from": "human",
"value": "\nvar gulp = require('gulp');\n\nvar defs = [\n {\n title: 'Test Index Title',\n path: '',\n description: 'Test index description',\n twitterImage: '20euro.png',\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure AuthService is injected\n"
},
{
"from": "human",
"value": "'use strict';\n\nfunction LogoutController(AuthService) {\n AuthService.logout();\n}\n\nmodule.exports = LogoutController;\n"
},
{
"from": "gpt",
"value": "'use strict';\n\n/**@ngInjec... | javascript | chosen |
[
{
"from": "system",
"value": "Change default goal state to match Java applet.\n"
},
{
"from": "human",
"value": "$(function() {\n\n var enableDebug = false;\n\n // Set up the default configuration\n var configuration = new Configuration();\n configuration.getInitialState().setTiles([... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"fix(route): don't default to creating a new module\"\n"
},
{
"from": "human",
"value": "'use strict';\nvar path = require('path');\nvar util = require('util');\nvar ngUtil = require('../util');\nvar ScriptBase = require('../script-base.js');\n\nvar Generato... | javascript | chosen |
[
{
"from": "system",
"value": "Move example tags to jumbotron\n"
},
{
"from": "human",
"value": "// Require React\nReact = require('react/addons');\n\n// Define component\nconst Jumbotron = React.createClass({\n\n render() {\n\n return (\n <div className=\"header header--bg\">\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add alert for invalid creds\n"
},
{
"from": "human",
"value": "angular.module('ccdb.login', ['ccdb.authentication.authentication', 'ccdb.authentication.user.authentication', 'ui.bootstrap'])\n\n .config(function ($routeProvider) {\n $routeProvider.when(\n ... | javascript | chosen |
[
{
"from": "system",
"value": "[Content] Fireplace: Reduce fireplace runtime to 3 hours rather than 6\n"
},
{
"from": "human",
"value": "var BurningFirePlace = Entity.extend({\n HOURS_PER_LIGHTING: 6,\n\n timeStarted: 0,\n\n init: function () {\n this._super();\n\n this.wid... | javascript | chosen |
[
{
"from": "system",
"value": "Change expected scan prop type to number\n\n"
},
{
"from": "human",
"value": "import React, {PropTypes} from 'react'\nimport {List, ListItem} from 'material-ui/List';\nimport Divider from 'material-ui/Divider';\n\nconst StatusListItem = props => {\n let memberCount... | javascript | chosen |
[
{
"from": "system",
"value": "Set input focus on change without document.activeElement\n"
},
{
"from": "human",
"value": "import React, { Component, PropTypes } from 'react';\nimport TextareaAutosize from 'react-textarea-autosize';\nimport styles from '../../chat.scss';\n\nexport default class T... | javascript | chosen |
[
{
"from": "system",
"value": "Add a default cache for slide GET requests\n"
},
{
"from": "human",
"value": "var mainModule = angular.module('mainApp', ['ngSanitize', 'slideshow']);\nvar slideshowModule = angular.module('slideshow', ['ngResource']);\n\nslideshowModule.controller('slideshowControl... | javascript | chosen |
[
{
"from": "system",
"value": "Remove notice re practice trials (to avoid confusion)\n"
},
{
"from": "human",
"value": "/**\n * Instructions view block for jsSART\n */\nvar\n instructions = [],\n participant_id = getParticipantId();\n\nvar instructions_block = {\n type: \"instructions\",\n pa... | javascript | chosen |
[
{
"from": "system",
"value": "[Admin] Improve the UI of cancelling and completing an order\n"
},
{
"from": "human",
"value": "(function($) {\n $.fn.extend({\n requireConfirmation: function() {\n return this.each(function() {\n return $(this).on('click', function(event) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Check location.path against sidebar link href for active link\n"
},
{
"from": "human",
"value": "jQuery(function($) {\n\t$('#sidebar-toggle').click(function(e) {\n\t\te.preventDefault();\n\t\t$('body').toggleClass(\"sidebar-collapse\");\n\t});\n});\n"
},
{
"... | javascript | chosen |
[
{
"from": "system",
"value": "Update e2e tests in relation to latest ui changes\n"
},
{
"from": "human",
"value": "var utils = require('./utils.js');\n\ndescribe('admin add users', function() {\n it('should add new users', function(done) {\n browser.setLocation('admin/users');\n\n var add... | javascript | chosen |
[
{
"from": "system",
"value": "Remove array controller from dummy app\n"
},
{
"from": "human",
"value": "import Em from 'ember';\nvar computed = Em.computed;\nvar alias = Em.computed.alias;\n\nvar IndexFooterController = Em.ArrayController.extend({\n\tepisode: alias('content.length'),\n\tmillion_... | javascript | chosen |
[
{
"from": "system",
"value": "Update desc for latest too\n"
},
{
"from": "human",
"value": "{\n\t\"stable\": {\n\t\t\"CSIDE_version\": \"1.1.3\",\n \"nw_version\": \"0.21.4\",\n \"desc\": \"v1.1.3 - Provides a criticial bug fix related to persistent sessions\",\n\t\t\"target\": \"https://c... | javascript | chosen |
[
{
"from": "system",
"value": "Add learning test for sinon sandbox.\n"
},
{
"from": "human",
"value": "\ndefine(\n[\n 'chai',\n 'sinon',\n 'jquery'\n],\nfunction(chai, undefined, undefined) {\n\n var assert = chai.assert;\n\n describe('sinon', function() {\n\n it('should be ... | javascript | chosen |
[
{
"from": "system",
"value": "Add a watch grunt task to use karma's autoWatch\n"
},
{
"from": "human",
"value": "module.exports = function (grunt) {\n 'use strict';\n\n var initConfig;\n\n // Loading external tasks\n grunt.loadNpmTasks('grunt-contrib-jshint');\n grunt.loadNpmTasks('grunt-co... | javascript | chosen |
[
{
"from": "system",
"value": "Add file information to projects endpoints\n"
},
{
"from": "human",
"value": "'use strict';\nimport Joi from 'joi';\nimport Boom from 'boom';\n\nimport db from '../db/';\n\nmodule.exports = [\n {\n path: '/projects',\n method: 'GET',\n handler: (request, r... | javascript | chosen |
[
{
"from": "system",
"value": "Replace Meteor.call with Meteor.apply for supposedly synchronous behavior\n"
},
{
"from": "human",
"value": "Keys = new Mongo.Collection(\"keys\");\n\nKeySchema = new SimpleSchema({\n keyID: {\n type: Number,\n label: \"Key ID\",\n min: 0\n },\n vCode: {... | javascript | chosen |
[
{
"from": "system",
"value": "Fix zindex on bluedot overlay\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport { View } from 'react-native';\nimport * as Animatable from 'react-native-animatable';\n\nconst BlueDot = ({ dotSize, dotStyle }) => {\n\tconst innerWhiteDotSize = dot... | javascript | chosen |
[
{
"from": "system",
"value": "Load config relative to current dir."
},
{
"from": "human",
"value": "/*\n ** lite-proxyserver\n ** Design and Development by msg Applied Technology Research\n ** Copyright (c) 2016 msg systems ag (http://www.msg.group/)\n */\n\nmodule.exports = function (grunt) ... | javascript | chosen |
[
{
"from": "system",
"value": "Use 'spec' reporter for Mocha tests results\n"
},
{
"from": "human",
"value": "module.exports = function(grunt) {\n 'use strict';\n\n grunt.loadNpmTasks('grunt-coffeelint');\n grunt.loadNpmTasks('grunt-contrib-coffee');\n grunt.loadNpmTasks('grunt-contrib-jshint... | javascript | chosen |
[
{
"from": "system",
"value": "Allow passing of a hostname for the docs server.\n"
},
{
"from": "human",
"value": "module.exports = function(grunt) {\n\n 'use strict';\n\n grunt.loadNpmTasks('grunt-contrib');\n grunt.loadNpmTasks('grunt-karma');\n grunt.loadNpmTasks('grunt-traceur');\n\n gru... | javascript | chosen |
[
{
"from": "system",
"value": "[layout] Update left menu from props.\n"
},
{
"from": "human",
"value": "var builder = require('focus').component.builder;\nvar React = require('react');\nvar AppHeader = require('./app-header');\nvar stylableBehaviour = require('../../mixin/stylable');\nvar content... | javascript | chosen |
[
{
"from": "system",
"value": "Switch to a github access token for release process\n"
},
{
"from": "human",
"value": "module.exports = function(grunt) {\n\n grunt.loadNpmTasks(\"grunt-release\");\n\n grunt.initConfig({\n release: {\n options: {\n github: {\n... | javascript | chosen |
[
{
"from": "system",
"value": "Update coverage values to match current\n"
},
{
"from": "human",
"value": "'use strict';\n\nmodule.exports = function(grunt) {\n\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n allFiles: ['Gruntfile.js', 'li... | javascript | chosen |
[
{
"from": "system",
"value": "Make the buttons do something when clicked\n"
},
{
"from": "human",
"value": "$(document).ready(function() { \n\t// Add RFC1918 addresses\n\t$(\"#addrfc\").click(function(e) { e.preventDefault(); advancedAdd('addrfc', e.target); });\n\n\t// Add 'this host'\n\t$(\"#a... | javascript | chosen |
[
{
"from": "system",
"value": "Fix jshint to also check the files in bin/.\n"
},
{
"from": "human",
"value": "'use strict';\n\nmodule.exports = function(grunt) {\n\n\tgrunt.initConfig({\n\t\tjshint: {\n\t\t\toptions: {\n\t\t\t\tjshintrc: '.jshintrc'\n\t\t\t},\n\t\t\tgruntfile: {\n\t\t\t\tsrc: 'Gr... | javascript | chosen |
[
{
"from": "system",
"value": "Add resize event to digit canvas\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar Utils = require('./Utils');\n\nfunction DigitCanvas(element, width, height) {\n this.canvas = document.getElementById(element);\n this.canvas.width = width;\n this.canv... | javascript | chosen |
[
{
"from": "system",
"value": "Deployment: Use connection string for production's sequelize connection\n"
},
{
"from": "human",
"value": "import fs from 'fs';\nimport path from 'path';\nimport Sequelize from 'sequelize';\nimport config from '../../config/config';\n\nconst basename = path.basename... | javascript | chosen |
[
{
"from": "system",
"value": "Fix release tracking script (again)\n"
},
{
"from": "human",
"value": "module.exports = {\n /**\n * Application configuration section\n * http://pm2.keymetrics.io/docs/usage/application-declaration/\n */\n apps: [\n {\n name: 'blair',\n script: ... | javascript | chosen |
[
{
"from": "system",
"value": "Implement A Current Time Middleware\n"
},
{
"from": "human",
"value": "#!/usr/local/bin/node\n\ncreateMiniHarp = require(\"../\")\nvar app = createMiniHarp();\nvar argv = require('minimist')(process.argv.slice(2));\nvar port = argv['port'];\n\nif (port == undefined)... | javascript | chosen |
[
{
"from": "system",
"value": "Add deleted_at key to User model\n"
},
{
"from": "human",
"value": "let mongoose = require('mongoose');\nlet Schema = mongoose.Schema;\n\nlet UserSchema = new Schema({\n name: {\n type: String,\n lowercase: true,\n required: true,\n un... | javascript | chosen |
[
{
"from": "system",
"value": "Update example to work with quickconnect@4\n"
},
{
"from": "human",
"value": "var quickconnect = require('rtc-quickconnect');\nvar buffered = require('..');\n\n// include the base64 encoded image data\nvar mentosImage = require('../test/data/dietcoke-mentos');\n\nqu... | javascript | chosen |
[
{
"from": "system",
"value": "Add power-select class to component\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport layout from '../templates/components/bootstrap-power-select';\nimport InputableMixin from '../mixins/components/inputable';\n\nexport default Ember.Component.ex... | javascript | chosen |
[
{
"from": "system",
"value": "Fix whitespace tabs-versus-spaces conflict in Npm Spice.\n"
},
{
"from": "human",
"value": "function ddg_spice_npm (api_result) {\n \"use strict\";\n\n\tif (api_result.error) {\n return;\n }\n\n Spice.render({\n data : api_result,\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix issue with base input class\n"
},
{
"from": "human",
"value": "import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { arg, string, bool } from 'ember-arg-types';\n\nexport default class FormControlsFfInputComponent extends... | javascript | chosen |
[
{
"from": "system",
"value": "Switch off file meta data edit links when uploading\n"
},
{
"from": "human",
"value": "/**\n * Base class for views used as `valueView` for file type meta data\n * attributes.\n *\n * @param {string} [options.name]\n * Name of the meta data item used in translatio... | javascript | chosen |
[
{
"from": "system",
"value": "Add integration tests for `animate-on-change`\n\nSummary:\nAdd integration tests for the `animate-on-change` component.\n\nDepends on D3916.\n\nReviewers: fdanielsen, asteinlein\n\nReviewed By: asteinlein\n\nDifferential Revision: http://dev.e5r.no/D3918\n"
},
{
"from":... | javascript | chosen |
[
{
"from": "system",
"value": "Make window.hasOwnProperty work in IE8.\n"
},
{
"from": "human",
"value": "Object.getOwnPropertyNames = function getOwnPropertyNames(object) {\n\tvar buffer = [];\n\tvar key;\n\n\t// Non-enumerable properties cannot be discovered but can be checked for by name.\n\t/... | javascript | chosen |
[
{
"from": "system",
"value": "Remove addColumn and removeColumn for archiveAt in collectiveHistories\n\nI'm removing this because I just realized archiveAt already exist in collectiveHistories table\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst colName = 'archivedAt';\n\n/**\n * Add ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix name of component input\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar noop = require('es5-ext/lib/Function/noop')\n , d = require('es5-ext/lib/Object/descriptor')\n , forEach = require('es5-ext/lib/Object/for-each')\n , map = requir... | javascript | chosen |
[
{
"from": "system",
"value": "Update extractor to export only one function, which uses previously used functions together\n"
},
{
"from": "human",
"value": "function removeDuplicateAliases(aliases){\n return aliases.map(alias => {\n return alias.toLowerCase();\n }).filter((alias, index, sel... | javascript | chosen |
[
{
"from": "system",
"value": "Fix node crash (server is not defined)\n\nProbably a copy-paste error. The express server variable is called `app'."
},
{
"from": "human",
"value": "var express = require('express');\nvar bodyParser = require('body-parser');\nvar redis = require('redis');\nvar swig ... | javascript | chosen |
[
{
"from": "system",
"value": "Enable CORS in the proxy\n"
},
{
"from": "human",
"value": "'use strict';\n\nrequire('app-module-path').addPath('./');\n\nprocess.env.NODE_ENV = process.env.NODE_ENV || 'development';\n\nconst config = require('./config');\nconst Hapi = require('hapi');\n\nconst ser... | javascript | chosen |
[
{
"from": "system",
"value": "Fix condition for when keys for self can be generated\n"
},
{
"from": "human",
"value": "import { ADDRESS_STATUS, ADDRESS_TYPE, MEMBER_PRIVATE, RECEIVE_ADDRESS } from 'proton-shared/lib/constants';\n\nconst { TYPE_ORIGINAL, TYPE_CUSTOM_DOMAIN, TYPE_PREMIUM } = ADDRE... | javascript | chosen |
[
{
"from": "system",
"value": "Use Promise.all to fetch project data in parallel\n"
},
{
"from": "human",
"value": "let fetch = require('node-fetch');\n\nconst getRepository = async (slug) => {\n const response = await fetch(`https://api.github.com/repos/mirego/${slug}`, {\n headers: {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add support for named exports\n\nCloses #63."
},
{
"from": "human",
"value": "'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\nconst regex = /module\\.exports = punycode;/;\n\nconst sourceContents = fs.readFileSync(path.resolve(__dirname,... | javascript | chosen |
[
{
"from": "system",
"value": "Use a span as the element\n"
},
{
"from": "human",
"value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport Box from '../box';\nimport cx from 'classnames';\nimport theme from './theme.css';\n\nclass Bullet extends PureCom... | javascript | chosen |
[
{
"from": "system",
"value": "Add isolate scope to permission directive.\n"
},
{
"from": "human",
"value": "(function () {\n 'use strict';\n\n /**\n * Show/hide elements based on provided permissions/roles\n *\n * @example\n * <div permission only=\"'USER'\"></div>\n * <div permissio... | javascript | chosen |
[
{
"from": "system",
"value": "Remove fermion.config.json event logic applying available components to store\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport { render } from 'react-dom';\nimport { AppContainer } from 'react-hot-loader';\nimport Root from './containers/Root';\... | javascript | chosen |
[
{
"from": "system",
"value": "Update wiki link for new year\n"
},
{
"from": "human",
"value": "import React from 'react';\n\nconst Fadder = () => {\n return (\n <div id=\"fadder\">\n <div className=\"component fadder-content\">\n <div className=\"fadder-description\">\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add backup role to enable mongodump\n"
},
{
"from": "human",
"value": "// WARNING This script creates MongoDB users and their permissions\n// as required by TresDB development. Do not use this script in production\n// without careful modification of all the credenti... | javascript | chosen |
[
{
"from": "system",
"value": "[previews] Fix more FAKE syntax errors\n"
},
{
"from": "human",
"value": "import React, {PropTypes} from 'react'\n\nimport PreviewComponentCard from 'part:@sanity/components/previews/card'\nimport PreviewComponentDefault from 'part:@sanity/components/previews/defaul... | javascript | chosen |
[
{
"from": "system",
"value": "Use an explicit intent when we want to invoke ourselves.\n"
},
{
"from": "human",
"value": "onload = function() {\n var feedUrlNode = document.getElementById('feed-url');\n feedUrlNode.focus();\n\n document.getElementById('intent-form').onsubmit = function(event)... | javascript | chosen |
[
{
"from": "system",
"value": "Fix in parser test for instances\n"
},
{
"from": "human",
"value": "\nvar vows = require('vows'),\n expect = require('expect.js'),\n types = require('../lib/types'),\n AST = require('../lib/ast'),\n parseAndWalk = require('.... | javascript | chosen |
[
{
"from": "system",
"value": "Copy arguments only when necessary\n"
},
{
"from": "human",
"value": "import _isArray from './_isArray.js';\nimport _isTransformer from './_isTransformer.js';\n\n\n/**\n * Returns a function that dispatches with different strategies based on the\n * object in list p... | javascript | chosen |
[
{
"from": "system",
"value": "Make timestamps seek video to their timecodes\n"
},
{
"from": "human",
"value": "const moment = require('moment')\n\nconst scrubVideoToTimestamp = function () {\n let player = document.querySelector('.video-js')\n const timeToGoTo = moment.duration(this.innerHTML)... | javascript | chosen |
[
{
"from": "system",
"value": "Support apps without a router\n"
},
{
"from": "human",
"value": "var set = Ember.set;\n\nEmber.onLoad('Ember.Application', function(Application) {\n Application.registerInjection({\n name: \"store\",\n before: \"controllers\",\n\n injection: function(app, ... | javascript | chosen |
[
{
"from": "system",
"value": "Test twitter image size bump\n"
},
{
"from": "human",
"value": "const environment = require('./environment');\n\nconst globals = {\n subreddits: {\n 'funny': 'funny',\n 'cute': 'aww',\n 'pics': 'pics',\n 'gifs': 'gifs',\n 'gaming': 'gaming',\n 'ea... | javascript | chosen |
[
{
"from": "system",
"value": "Enable console logs in karma tests\n\n"
},
{
"from": "human",
"value": "var webpackConfig = require('./webpack.config.js');\nwebpackConfig.devtool = 'inline-source-map';\nwebpackConfig.module.rules.push({\n test: /\\.ts$/,\n enforce: 'post',\n loader: 'ista... | javascript | chosen |
[
{
"from": "system",
"value": "Return __RequestVerificationToken cookie if it exists\n\n"
},
{
"from": "human",
"value": "// Dependencies\nvar url = require('url');\n\n// Includes\nvar http = require('./http.js').func;\nvar getHash = require('./getHash.js').func;\nvar getVerificationInputs = requ... | javascript | chosen |
[
{
"from": "system",
"value": "Add support to custom mongo database name\n"
},
{
"from": "human",
"value": "'use strict';\n\n// Load environment variables from .env file, where API keys and passwords are configured.\nconst dotenv = require('dotenv');\n\nif (!process.env.NODE_ENV) {\n process.env... | javascript | chosen |
[
{
"from": "system",
"value": "Move to using promises in auth-user-whoami\n"
},
{
"from": "human",
"value": "export default class {\n\n constructor(auth) {\n this.auth = auth;\n }\n\n /*\n * npm whoami sends its token to the server and requests a username\n * This route verifies which use... | javascript | chosen |
[
{
"from": "system",
"value": "Make Default Options a Class\n"
},
{
"from": "human",
"value": "/**\n * Provides default values and verifies that requied values are set.\n */\nvar DefaultOptions = {}\n\nDefaultOptions.options = {\n cacheDir: null,\n port: process.env.MOCKINGJAYS_PORT || 9000,\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Copy of \"gulp-oc-config\" module, but now in directory root (not yet referenced)\n"
},
{
"from": "human",
"value": "//Global gulp variables\ngulp = require('gulp');\nconfig = require('gulp-oc-config');\n\nvar fs = require('fs');\nvar path = require('path');\n\nfunc... | javascript | chosen |
[
{
"from": "system",
"value": "Set class on page load.\n"
},
{
"from": "human",
"value": "/*\n Leaflet.ZoomCSS\n Adding a css class on the map div element, so other elements, such as markers can be automatically styled based on the zoom level using css instead of javascript\n Copyright (c) 201... | javascript | chosen |
[
{
"from": "system",
"value": "Use a promise chain to be sure that everything's built\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nconst fs = require('fs')\nconst path = require('path')\n\nconst handlebars = require('handlebars')\nconst workingDir = process.cwd()\nconst output = work... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug when a deploymentBucket is used"
},
{
"from": "human",
"value": "const fse = require('fs-extra');\nconst path = require('path');\nconst {spawnSync} = require('child_process');\n\n/**\n * pipenv install\n * @return {Promise}\n */\nfunction pipfileToRequire... | javascript | chosen |
[
{
"from": "system",
"value": "Remove required on token properties\n"
},
{
"from": "human",
"value": "var mongoose = require('mongoose')\n , Schema = mongoose.Schema;\n\nvar FBToken = new Schema({\n facebookId: {\n type: String,\n required: true,\n unique: true\n },\n token: ... | javascript | chosen |
[
{
"from": "system",
"value": "Reset input when you remove filters.\n"
},
{
"from": "human",
"value": "'use strict';\n\nangular.module('okcCoffee.map', [\n 'okcCoffee.map.map-directive'\n])\n\n.controller('MapCtrl', ['$scope', function($scope){\n $scope.mapfilter = null;\n $scope.$watch('mapfi... | javascript | chosen |
[
{
"from": "system",
"value": "Define main module as a class\n"
},
{
"from": "human",
"value": "'use babel';\n\nimport Controller from './controller.js';\n\nexport default {\n controler: null,\n\n activate() {\n this.controller = new Controller();\n },\n\n deactivate() {\n this.controll... | javascript | chosen |
[
{
"from": "system",
"value": "Add quick test of Backbone access to API endpoint\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar Backbone = require('backbone');\nvar $ = require('jquery');\nBackbone.$ = $;\n\nvar InitView = Backbone.View.extend({\n\ttagName: 'div',\n\tinitialize: function... | javascript | chosen |
[
{
"from": "system",
"value": "Add value fallback to empty string\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\n// Prevents the defaultValue/defaultChecked fields from rendering with value/checked\nclass ComponentWrapper exten... | javascript | chosen |
[
{
"from": "system",
"value": "Fix \"Shown in Tray\" being hidden on Windows\n"
},
{
"from": "human",
"value": "import cp from 'child_process';\n\nimport platform from 'common/utils/platform';\n\nasync function elementaryOS () {\n if (!platform.isLinux) {\n return false;\n }\n\n let cmd = '... | javascript | chosen |
[
{
"from": "system",
"value": "Fix error when using `<base>` without `URL`\n\nRelated to cf92230.\n"
},
{
"from": "human",
"value": "'use strict'\n\nmodule.exports = resolve\n\nfunction resolve(h, url) {\n if (url === null || url === undefined) {\n return ''\n }\n\n return h.frozenBaseURL ?... | javascript | chosen |
[
{
"from": "system",
"value": "Set coverage/ as baseDir for lite-server\n"
},
{
"from": "human",
"value": "module.exports = {\n port: 8082,\n files: [\n 'coverage/**/*.html',\n ],\n snippetOptions: {\n rule: {\n match: /(<!DOCTYPE html>|^)/i,\n fn: function (snippet, match) {\... | javascript | chosen |
[
{
"from": "system",
"value": "Use HTTP as HTTPS is paid for.\n"
},
{
"from": "human",
"value": "var request = require(\"request\");\nvar Q = require(\"q\");\nvar log4js = require(\"log4js\");\nvar logger = log4js.getLogger(\"OpenWeatherMapInterface\");\n\nfunction OpenWeatherMapInterface(options... | javascript | chosen |
[
{
"from": "system",
"value": "Change bootstrap path to sterno-bootstrap.json\n"
},
{
"from": "human",
"value": "\"use strict\";\nvar async = require('async'),\n fs = require('fs');\n\nmodule.exports = function(ctx, done){\n var files = [];\n\n\n\n async.map(ctx.files(), ctx.getFileInfo,... | javascript | chosen |
[
{
"from": "system",
"value": ":bulb: Allow passing events list as args list\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar id = 0;\n\n/**\n * Track\n *\n * Represent a Standard MIDI file track\n *\n * @constructor\n * @param {Array<Event>} events - List of events in the track\n */\nfunc... | javascript | chosen |
[
{
"from": "system",
"value": "Implement review feedback: use querySelectorAll()\n"
},
{
"from": "human",
"value": "var classes = [\"MainMenuButton\", \"MainMenuDDButton\"];\nfor (var i=0; i<classes.length; i++) {\n\tvar elements = document.getElementsByClassName(classes[i]);\n\tfor (var j=0; j<e... | javascript | chosen |
[
{
"from": "system",
"value": "Fix a bug where loader disappears when navigating too fast\n"
},
{
"from": "human",
"value": "import { FETCH_START, FETCH_END, FETCH_ERROR, FETCH_CANCEL } from '../actions/fetchActions';\n\nexport default (previousState = 0, { type }) => {\n switch (type) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Move class list logic to it's own function\n"
},
{
"from": "human",
"value": "CenterScout.controller('HomeController', ['$scope', 'gradeData', 'assignmentData', function($scope, gradeData, assignmentData) {\n\n $scope.grades = [{ name: 'Loading...', class: '', da... | javascript | chosen |
[
{
"from": "system",
"value": "Disable the no-unused-vars and no-undef rules\n\nAvoid errors from the snippets being linted independently\n"
},
{
"from": "human",
"value": "module.exports = {\n root: false,\n plugins: ['markdown'],\n globals: {\n expect: false\n }\n};\n"
},
{
"from... | javascript | chosen |
[
{
"from": "system",
"value": "Refactor out Object.assign in favor of { ...merge }\n"
},
{
"from": "human",
"value": "const Howl = require('howler').Howl;\n\nmodule.exports = {\n initialize(soundsData) {\n let soundOptions;\n\n const soundNames = Object.getOwnPropertyNames(soundsData);\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add default fallback to mapping logic.\n"
},
{
"from": "human",
"value": "(function () {\n 'use strict';\n\n define(\n [\n 'lodash',\n 'knockout'\n ],\n function (_, ko) {\n return function (selectedSearchT... | javascript | chosen |
[
{
"from": "system",
"value": "Disable attempts for the cometd lib to try wss connections\n\nwss connections are not yet valid in Lightning context"
},
{
"from": "human",
"value": "({\n doInit: function(component, event, helper) {\n var action = component.get(\"c.getSessionId\");\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Move mcapid calls to top of api to make it easier to identify REST routes that need to be replaced\n"
},
{
"from": "human",
"value": "class AccountsAPIService {\n /*@ngInject*/\n constructor(apiService, Restangular, toast) {\n this.apiService = apiServi... | javascript | chosen |
[
{
"from": "system",
"value": "Make this component more smarter\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\n\nimport Threading from './Threading';\nimport Weave from './Weave';\nimport TieUp from './TieUp';\nimport Treadling from './Treadling';\n\nimport '../styl... | javascript | chosen |
[
{
"from": "system",
"value": "Validate works on decoded values now\n"
},
{
"from": "human",
"value": "import { decode } from './serialize';\n\n/**\n * Decodes a query based on the config. It compares against cached values to see\n * if decoding is necessary or if it can reuse old values.\n *\n *... | javascript | chosen |
[
{
"from": "system",
"value": "Scale the canvas to match the body\n"
},
{
"from": "human",
"value": "(function(){\n console.log('Ready to rock!');\n})();\n"
},
{
"from": "gpt",
"value": "(function(document){\n var playground = document.getElementById('playground');\n playgrou... | javascript | chosen |
[
{
"from": "system",
"value": "Add JSDoc info for loadJson\n"
},
{
"from": "human",
"value": "function loadJson (jsonFile, callback) {\n var xobj = new XMLHttpRequest();\n\n xobj.overrideMimeType('application/json');\n xobj.open('GET', jsonFile, true);\n\n xobj.onreadystatechange = fu... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.