conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix bug wher only one element was returned\n" }, { "from": "human", "value": "export function extractAttributes(el) {\n const map = el.hasAttributes() ? el.attributes : []\n const attrs = {}\n for (let i = 0; i < map.length; i++) {\n const attr = map[i]\n i...
javascript
chosen
[ { "from": "system", "value": "Remove empty route and controller\n" }, { "from": "human", "value": "/*\r\n Copyright, 2013, by Tomas Korcak. <korczis@gmail.com>\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation f...
javascript
chosen
[ { "from": "system", "value": "Remove check for environment to add data reset endpoint\n" }, { "from": "human", "value": "'use strict';\nvar express = require('express');\n\nmodule.exports = function buildAdminRouter(mediator) {\n var router = express.Router();\n\n // TODO: Remove this endpoint...
javascript
chosen
[ { "from": "system", "value": "Add lodash access in global scope\n" }, { "from": "human", "value": "global.assert = require('assert');\nglobal.chai = require(\"chai\");\nglobal.chaiAsPromised = require(\"chai-as-promised\");\nglobal.jsf = require('json-schema-faker');\nglobal.should = require('sh...
javascript
chosen
[ { "from": "system", "value": "Add JS lookup to object\n" }, { "from": "human", "value": "function clearAndHideResultTable() {\n var header = $('table.matching-term .header');\n $('table.matching-term').html(header);\n $('table.matching-term').hide();\n}\n\nfunction hideNoResults() {\n $('.no...
javascript
chosen
[ { "from": "system", "value": "Fix base files identified as wrong variation\n" }, { "from": "human", "value": "const parseVariations = require('../variations');\nconst createValidator = require('./validator');\nconst validate = createValidator({\n variations: {type: 'array', minLen: 1},\n /...
javascript
chosen
[ { "from": "system", "value": "Make sure that we're not trying to pull in things that don't exist, durr.\n" }, { "from": "human", "value": "jQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\njQuery.expr[\":\"] = jQuery.expr.filters;\njQuery.unique = Sizzle.uniqueSort;\njQuery.getText = getTe...
javascript
chosen
[ { "from": "system", "value": "Update acceptance test to dummy test\n\nSee if it solves issue on Travis\n" }, { "from": "human", "value": "import { test } from 'qunit';\nimport moduleForAcceptance from 'dw-collections-manager/tests/helpers/module-for-acceptance';\n\nmoduleForAcceptance('Acceptanc...
javascript
chosen
[ { "from": "system", "value": "Use dot notation in Javascript component\n" }, { "from": "human", "value": "KB.onClick('.js-autocomplete-email', function (e) {\n var email = KB.dom(e.target).data('email');\n var emailField = KB.find('.js-mail-form input[type=\"email\"]');\n\n if (email &&...
javascript
chosen
[ { "from": "system", "value": "Update ES client to support ES 5.x\n" }, { "from": "human", "value": "Package.describe({\n name: 'easysearch:elasticsearch',\n summary: \"Elasticsearch Engine for EasySearch\",\n version: \"2.1.1\",\n git: \"https://github.com/matteodem/meteor-easy-search.git\",...
javascript
chosen
[ { "from": "system", "value": "Refactor ember-utils imports in ember-testing package.\n" }, { "from": "human", "value": "import Adapter from './adapter';\nimport { inspect } from 'ember-metal';\n\n/**\n This class implements the methods defined by Ember.Test.Adapter for the\n QUnit testing fram...
javascript
chosen
[ { "from": "system", "value": "Fix wrong api for games list\n" }, { "from": "human", "value": "const API_URL = process.env.API_URL\n\nexport default {\n GET_TOP_GAMES : () => `${API_URL}/gamess`,\n GET_PRICES : appIds => `${API_URL}/games/prices?appIds=${appIds}`,\n GET_SUGGESTIONS: name ...
javascript
chosen
[ { "from": "system", "value": "Test that findTextAlternatives does not raise errors\n" }, { "from": "human", "value": "module(\"Text Descendant\", {\n});\n\ntest(\"Find text descendants in an iframe.\", function() {\n // Setup fixture\n var fixture = document.getElementById('qunit-fixture')...
javascript
chosen
[ { "from": "system", "value": "Move import 'reflect-metadata' before other ones.\n" }, { "from": "human", "value": "import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\n\r\nimport 'reflect-metadata'; // here location matters: has to be before import of AppModule\r\n\r\n...
javascript
chosen
[ { "from": "system", "value": "Implement bluebird instead of Q inside demo userDAO\n" }, { "from": "human", "value": "\"use strict\";\n\nvar loki = require('lokijs');\nvar _ = require('lodash');\nvar Q = require('q');\n\n// variable to hold the singleton instance, if used in that manner\nvar use...
javascript
chosen
[ { "from": "system", "value": ":cookie: Update script to be IE7+ compatible\n" }, { "from": "human", "value": "/* global document */\nfunction setCookie(name, value, options = {}) {\n let cookieString = `${name}=${value}; path=/`;\n\n if (options.days) {\n const date = new Date();\n date....
javascript
chosen
[ { "from": "system", "value": "test: Check transform definitions are well set\n" }, { "from": "human", "value": "/* global describe, it, expect */\nimport { filterByKeys, transform } from '../src/transform'\nimport * as mocks from './mocks'\n\ndescribe('Transform suite', () => {\n it('should fil...
javascript
chosen
[ { "from": "system", "value": "Fix problems on the latest electron\n" }, { "from": "human", "value": "var app = require('app');\nvar BrowserWindow = require('browser-window');\nvar mainWindow = null;\n\napp.on('window-all-closed', function() {\n app.quit();\n});\n\napp.on('ready', function() {...
javascript
chosen
[ { "from": "system", "value": "Fix for change log error\n" }, { "from": "human", "value": "angular\n .module('app')\n .controller('changelogController', [\n '$rootScope',\n '$scope',\n 'apiService',\n function($rootScope, $scope, api) {\n\n api.changel...
javascript
chosen
[ { "from": "system", "value": "Add logging information to a test script\n" }, { "from": "human", "value": "// Thests for the open method for fs module. This opens a file for reading only.\n// \nvar fs=newFS();\nvar fileName=\"hello.txt\";\nvar content=\"hello\";\nfunction testOpen(){\n\ttry{\n\t\...
javascript
chosen
[ { "from": "system", "value": "Tweak to result mapper. Fixed example contract to use new syntax\n" }, { "from": "human", "value": "'use strict'\n\nconst mapResult = result => {\n return {\n name: result.contract.name,\n consumer: result.contract.consumer,\n status: result.err ? 'Fail' :...
javascript
chosen
[ { "from": "system", "value": "chore: Fix lint problem in cleanup-plugin\n" }, { "from": "human", "value": "\r\nfunction cleanupPlugins(resolve, reject) {\r\n 'use strict';\r\n if (!axe._audit) {\r\n throw new Error('No audit configured');\r\n }\r\n\r\n var q = axe.utils.queue();\r\n // I...
javascript
chosen
[ { "from": "system", "value": "Update ngconstant version after releasing\n" }, { "from": "human", "value": "\"use strict\";\n// DO NOT EDIT THIS FILE, EDIT THE GRUNT TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\nangular.module('publisherApp')\n\n.constant('ENV', 'dev')\n\n.constant(...
javascript
chosen
[ { "from": "system", "value": "Allow for versions of ember that don't have Ember.assign yet\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Application from '../../app';\nimport config from '../../config/environment';\n\nexport default function startApp(attrs) {\n let appli...
javascript
chosen
[ { "from": "system", "value": "Fix path to python interpreter to make it work with chroot builds\n" }, { "from": "human", "value": "var nijs = require('nijs');\n\nexports.pkg = function(args) {\n return args.stdenv().mkDerivation({\n name : \"node-0.10.26\",\n src : args.fetchurl()({\n ...
javascript
chosen
[ { "from": "system", "value": "Add locale formatting to stats numbers\n\nThis addresses issue #10.\n" }, { "from": "human", "value": "import React from 'react'\nimport injectSheet from 'react-jss'\n\nimport styles from './styles'\n\nconst GenResults = ({ classes, newLine, results, stats }) => {\n...
javascript
chosen
[ { "from": "system", "value": "Implement Get List of Subcampaign HashIDs (By Filter)\n" }, { "from": "human", "value": "var configuration = require('../../config/configuration.json')\nvar utility = require('../../public/method/utility')\n\nmodule.exports = {\n getSubcampaignModel: function (redi...
javascript
chosen
[ { "from": "system", "value": "Edit trust_proxy setting of express.\n" }, { "from": "human", "value": "var config = {}\nmodule.exports = config;\n\nconfig.listen = {}\nconfig.listen.address = '0.0.0.0'\nconfig.listen.port = 3080;\n\n// Margan is used to be logger, visit here to get more info:\n//...
javascript
chosen
[ { "from": "system", "value": "Use is instead of instanceof to determine if it is an array\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport mergeDefaults from 'merge-defaults'\n_.mergeDefaults = mergeDefaults\n\nclass ConfigManager {\n\tconstructor() {\n\t\tthis.Riak = {\n\t\t\tn...
javascript
chosen
[ { "from": "system", "value": "Add sass sourcemaps to dev env\n" }, { "from": "human", "value": "const webpack = require('webpack');\nconst merge = require('webpack-merge');\nconst webpackConfig = require('./webpack.base.conf');\nconst config = require('./index');\n\nconst HtmlWebpackPlugin = req...
javascript
chosen
[ { "from": "system", "value": "Add method for checking if cordova is being used\n" }, { "from": "human", "value": "'use strict';\n\nif ($ === undefined) {\n throw 'Gelato requires jQuery as a dependency.'\n} else {\n window.jQuery = window.$ = $;\n}\n\nif (_ === undefined) {\n throw 'Gelato re...
javascript
chosen
[ { "from": "system", "value": "Update async-redux example to getConsensus -> consensus\n" }, { "from": "human", "value": "import fetch from 'isomorphic-fetch';\n\n\nexport function invalidateReddit({ reddit }) {}\n\nexport function requestPosts({ reddit }) {}\n\nexport function receivePosts({ red...
javascript
chosen
[ { "from": "system", "value": "Include webfont extensions in default filePatterns\n" }, { "from": "human", "value": "var Promise = require('ember-cli/lib/ext/promise');\n\nvar chalk = require('chalk');\nvar yellow = chalk.yellow;\nvar blue = chalk.blue;\n\nfunction applyDefaultConfigIfNecessar...
javascript
chosen
[ { "from": "system", "value": "Add 'isGameStarted' property to GameModelService\n" }, { "from": "human", "value": "export default class GameModelService {\n\tconstructor($log, $http, $localStorage, _, websocket) {\n\t\t'ngInject';\n\n\t\tthis.$log = $log;\n\t\tthis.$http = $http;\n\t\tthis.$local...
javascript
chosen
[ { "from": "system", "value": "Fix hanging promise in mocha\n" }, { "from": "human", "value": "function testFeature(feature) {\n if (feature.annotations.ignore) {\n describe.skip(`Feature: ${feature.title}`, () => {});\n } else {\n describe(`Feature: ${feature.title}`, function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add input to error messages\n" }, { "from": "human", "value": "'use strict'\n\nconst nearley = require('nearley')\nconst grammar = require('./grammar')\n\nfunction byLevel(a, b) {\n return a.level < b.level ? -1 : a.level > b.level ? 1 : 0\n}\n\nfunction limit(resu...
javascript
chosen
[ { "from": "system", "value": "Add original ArticleImage URL to admin panel\n" }, { "from": "human", "value": "import React from 'react'\nimport { inject, observer } from 'mobx-react'\n\nimport { IMAGE_BASE_URL } from '../../../constants'\nimport RedButton from '../../Buttons/Red'\n\n@inject('art...
javascript
chosen
[ { "from": "system", "value": "Fix bad require path in gulp plugin\n\nSigned-off-by: Vinson Chuong <6df075c17c17de53656cfe2eb11616735a18bb18@pivotal.io>\n" }, { "from": "human", "value": "var drFrankenstyle = require('dr-frankenstyle');\nvar through2 = require('through2');\nvar File = require('vi...
javascript
chosen
[ { "from": "system", "value": "Fix url for default user image\n" }, { "from": "human", "value": "define('app/views/user_menu', ['app/views/templated', 'md5'],\n /**\n * User Menu View\n *\n * @returns Class\n */\n function (TemplatedView) {\n\n 'user strict';\n\n ...
javascript
chosen
[ { "from": "system", "value": "Fix the position of expected and actual\n" }, { "from": "human", "value": "'use strict'\n\nvar test = require('tape')\nvar mito = require('./')\n\ntest('basic templating', function (t) {\n t.plan(3)\n\n t.equal('foo', mito('foo')())\n t.equal('<h1>Foo</h1>'...
javascript
chosen
[ { "from": "system", "value": "Implement checkCampaignModel for Update Purposes\n" }, { "from": "human", "value": "module.exports = {\n checkCampaignModel: function (redisClient, accountHashID, campaignHashID, callback) {\n\n }\n}" }, { "from": "gpt", "value": "var configuration = r...
javascript
chosen
[ { "from": "system", "value": "Add on ApiService functions for generate multi questions\n" }, { "from": "human", "value": "angular.module('app').factory('api', function($http, $q, config){\n\n return {\n single: function(sexe){\n\n sexe = sexe || 'mal';\n\n var def...
javascript
chosen
[ { "from": "system", "value": "Add a couple more items to the default whitelist.\n" }, { "from": "human", "value": "const DEFAULT_WHITELISTED_URL_REGEXPS = [\n 'abcnews.go.com\\/.+',\n 'arstechnica.com\\/.+',\n 'bbc.co.uk\\/.+',\n 'bbc.com\\/.+',\n 'business-standard.com\\/.+',\n 'cnn.com\\...
javascript
chosen
[ { "from": "system", "value": "Fix focus jumping to comment after cleaning the customer\n" }, { "from": "human", "value": "/**\n * @module timed\n * @submodule timed-components\n * @public\n */\nimport Component from 'ember-component'\nimport service from 'ember-service/inject'\nimport { observes...
javascript
chosen
[ { "from": "system", "value": "Use `occupied` instead of `waiting`.\n" }, { "from": "human", "value": "var slice = [].slice\n\nfunction Vestibule () {\n this._waiting = []\n this.waiting = 0\n this.open = null\n}\n\nVestibule.prototype.enter = function (callback) {\n if (this.open == ...
javascript
chosen
[ { "from": "system", "value": "Convert to a functional stateless component\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport { getProjectViewUrl } from 'utils/urlUtil';\nimport marked from 'marked';\n\nimport styles from './ProjectPreview.styl';\n\nclass Project...
javascript
chosen
[ { "from": "system", "value": "Define __DEV__ flag for tests\n" }, { "from": "human", "value": "require('babel-register')({\n // ignore node_modules except node_modules/react-native-gifted-spinner and node_modules/react-native-lock\n // because they need to be transpiled\n // syntax: /node_mod...
javascript
chosen
[ { "from": "system", "value": "Remove persist middleware of remotedev-app & Add monitor, test to persist whitelist\n" }, { "from": "human", "value": "import { createStore, applyMiddleware, compose } from 'redux';\nimport { autoRehydrate, persistStore } from 'redux-persist';\nimport persist from '...
javascript
chosen
[ { "from": "system", "value": "Update fcn to get an object's native class\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar specificationClass = require( '@stdlib/utils/specification-class' );\nvar RE = require( '@stdlib/regex/function-name' );\nvar isBuffer = require( '@st...
javascript
chosen
[ { "from": "system", "value": "Fix typo in require statement of is-binary-string\n" }, { "from": "human", "value": "'use strict';\n\n// MODULES //\n\nvar isString = require( '@stlib/utils/is-string' )[ 'primitive' ];\n\n\n// BINARY STRING //\n\n/**\n* FUNCTION: isBinaryString( value )\n*\tTests i...
javascript
chosen
[ { "from": "system", "value": "Comment out missed curly brace\n" }, { "from": "human", "value": "// ==========================================================================\n// Application JavaScript for IMTD?\n// ==========================================================================\n\ndoc...
javascript
chosen
[ { "from": "system", "value": "Discard rollback commands because we don't want get back to decimal(18,0) datatype\n" }, { "from": "human", "value": "exports.up = (knex, Promise) => {\n return Promise.all([\n knex.schema.raw('ALTER TABLE transactions ALTER COLUMN new_saldo decimal(8,2) not nul...
javascript
chosen
[ { "from": "system", "value": "Add roles \"body:wrapper\", \"toolbar:wrapper\", \"page:wrapper\"\n" }, { "from": "human", "value": "const GitBook = require('gitbook-core');\nconst { React } = GitBook;\n\nconst Page = require('./Page');\nconst Toolbar = require('./Toolbar');\n\nconst Body = React....
javascript
chosen
[ { "from": "system", "value": "Allow restore to be overridden\n" }, { "from": "human", "value": "import createAuthenticator from '../createAuthenticator'\nimport identity from '../utils/identity'\nimport invariant from 'invariant'\n\nexport default ({\n endpoint,\n contentType = 'application/js...
javascript
chosen
[ { "from": "system", "value": "Remove Ember.merge deprecation warnings. Dummy app requires Ember.assign.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Application from '../../app';\nimport Router from '../../router';\nimport config from '../../config/environment';\n\nexpor...
javascript
chosen
[ { "from": "system", "value": "Add data validation to custom title field in the social worker registration form.\n" }, { "from": "human", "value": "(function () {\n\t'use strict';\n\n\tmare.views.SocialWorkerRegistration = Backbone.View.extend({\n\t\tel: '.registration-form--social-worker',\n\n\t...
javascript
chosen
[ { "from": "system", "value": "Change TextArea overwrite props order\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport idgen from './idgen';\nimport Icon from './Icon';\nimport cx from 'classnames';\n\nclass Textarea extends ...
javascript
chosen
[ { "from": "system", "value": "Fix for duplicated event triggered when using ajax.\n" }, { "from": "human", "value": "/**\n * @copyright Copyright (c) 2014 2amigOS! Consulting Group LLC\n * @link http://2amigos.us\n * @license http://www.opensource.org/licenses/bsd-license.php New BSD License\n *...
javascript
chosen
[ { "from": "system", "value": "Include all of webcomponentsjs because it only checks for browser support there instead of in the individual files. Included named slots so we can integration test everything together.\n" }, { "from": "human", "value": "const base = require('skatejs-build/karma.conf...
javascript
chosen
[ { "from": "system", "value": "Add explicit https url in piwik config\n" }, { "from": "human", "value": "// App config the for production environment.\n// Do not require this directly. Use ./src/config instead.\n\nconst HOST = process.env.HOST || \"api.openfisca.fr\",\n apiBaseUrl = process.env....
javascript
chosen
[ { "from": "system", "value": "Fix bad indexing in array\n" }, { "from": "human", "value": "if (!localStorage['saved']){\n localStorage['letA'] = '#800000'; //maroon\n localStorage['letE'] = '#008000'; //green\n localStorage['letI'] = '#0000ff'; //blue\n localStorage['letO'] = '#008080'; //te...
javascript
chosen
[ { "from": "system", "value": "Correct spelling of downloand to download.\n" }, { "from": "human", "value": "var mongoose = require('mongoose');\n \nmongoose.connect('mongodb://localhost:8080/my_database');\n\nvar Schema = mongoose.Schema;\n\n// create a schema\nvar gameInfoSchema = new Schema({\...
javascript
chosen
[ { "from": "system", "value": "Add header and don't use $ for jQuery\n" }, { "from": "human", "value": "(function($) {\n $.fn.sameHeight = function() {\n var these = this;\n function setHeight() {\n var max = 0;\n these.height('auto').each(function() {\n max = Math.max(max...
javascript
chosen
[ { "from": "system", "value": "Add transition between changing images.\n" }, { "from": "human", "value": "var PhotoRenderer = function(container, photo) {\n bindEvents();\n\n this.render = function() {\n startProgress()\n renderImage(photo)\n\n return this\n }\n\n function bindEvents...
javascript
chosen
[ { "from": "system", "value": "Implement function to post by using michishiki API\n" }, { "from": "human", "value": "michishiki.api = {};\nmichishiki.api.uri = 'http://amateras.wsd.kutc.kansai-u.ac.jp/~otsuka/michishiki_api_server/';\n\nmichishiki.api.getPost = function(options) {\n var dfd = ...
javascript
chosen
[ { "from": "system", "value": "Change comment to json key" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash');\n\n/**\n* Format where expression.\n*\n* @param {string[]|string} keys Array of keys to omit in query\n* @param {string[]|string} query Array of parameter to use ...
javascript
chosen
[ { "from": "system", "value": "Fix is-in-viewport mock to return true\n" }, { "from": "human", "value": "const $ = require(\"jquery\");\n\nfunction isInViewport() {}\n$.extend($.expr[\":\"], {\n \"in-viewport\": $.expr.createPseudo\n ? $.expr.createPseudo(argsString => currElement => is...
javascript
chosen
[ { "from": "system", "value": "Change karma browser for tests from Chrome to PhantomJS\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = function(config) {\n config.set({\n browsers: ['Chrome'],\n coverageReporter: {\n reporters: [\n ...
javascript
chosen
[ { "from": "system", "value": "Return empty when data is empty\n\nFix for unit tests" }, { "from": "human", "value": "module.exports = function(data){\n let d = {},\n keys = Object.keys(data);\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i],\n value = data[key],\n ...
javascript
chosen
[ { "from": "system", "value": "Use template instead of render buffer\n" }, { "from": "human", "value": "import run from \"ember-metal/run_loop\";\nimport View from \"ember-views/views/view\";\n\nQUnit.module(\"Ember.View additions to run queue\");\n\nQUnit.skip(\"View hierarchy is done rendering ...
javascript
chosen
[ { "from": "system", "value": "ci: Put baseline version in filename\n" }, { "from": "human", "value": "import { defineConfig } from \"vite\";\nimport { metablock } from \"vite-plugin-userscript\";\nimport manifest from \"./package.json\" assert { type: \"json\" };\n\nconst isDevBuild = process.en...
javascript
chosen
[ { "from": "system", "value": "Fix special case for admin\n" }, { "from": "human", "value": "import { FREE_SUBSCRIPTION } from 'proton-shared/lib/constants';\nimport { SubscriptionModel } from 'proton-shared/lib/models/subscriptionModel';\nimport { UserModel } from 'proton-shared/lib/models/userM...
javascript
chosen
[ { "from": "system", "value": "Remove unused div and style\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react'\nimport classNames from 'classnames'\n\nconst VisHeader = ({views, view, onToggleView, name}) => (\n <div className=\"graph-heading\">\n <div className=\"graph-...
javascript
chosen
[ { "from": "system", "value": "Remove starting and trailing slashes\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {Router, Route, browserHistory, IndexRoute} from 'react-router'\nimport App from './components/app';\nimport Login from './c...
javascript
chosen
[ { "from": "system", "value": "Enable asynchronous notifications from Hyperdeck\n" }, { "from": "human", "value": "var HyperdeckCore = require(\"./hyperdeck-core.js\");\n\n\nvar Hyperdeck = function(ip) {\n //Start by connecting to Hyperdeck via HypderdeckCore\n var Core = new HyperdeckCore(ip)...
javascript
chosen
[ { "from": "system", "value": "Set API to Heroku address.\n" }, { "from": "human", "value": "angular\n .module('zibble', ['angular-jwt', 'ngResource', 'ui.router'])\n .constant('API', 'http://localhost:3000')\n .config(function($httpProvider){\n $httpProvider.interceptors.push('AuthIntercep...
javascript
chosen
[ { "from": "system", "value": "Fix config variable exposing to global scope" }, { "from": "human", "value": "/**\n * Simple wrapper to wrap around the Cacheman nodejs package to integrate easily with SailsJS for caching.\n * @param {[string]} name Name the Cache Instance.\n */\n\nvar Cache = func...
javascript
chosen
[ { "from": "system", "value": "Fix livechat knowledge base by properly initiating it's model\n\nCloses #6101" }, { "from": "human", "value": "class LivechatExternalMessage extends RocketChat.models._Base {\n\tconstructor() {\n\t\tsuper('livechat_external_message');\n\t}\n\n\t// FIND\n\tfindByRoom...
javascript
chosen
[ { "from": "system", "value": "Move static propTypes & defaultProps outside of the component class\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 './t...
javascript
chosen
[ { "from": "system", "value": "Reset loaded flag on new video. (Must be a better way to do this)\n" }, { "from": "human", "value": "module.exports = ['$sce', $sce => {\n return {\n restrict: 'E',\n template: require('./template.html'),\n controller: ['$scope', $scope => {\n $scope....
javascript
chosen
[ { "from": "system", "value": "Convert basic example to be controlled\n" }, { "from": "human", "value": "/* eslint-disable import/no-extraneous-dependencies */\n\nimport React, { Fragment } from 'react';\nimport { FormGroup } from 'react-bootstrap';\n\nimport Control from '../components/Control.r...
javascript
chosen
[ { "from": "system", "value": "Add orderRiver method to SortingController\n" }, { "from": "human", "value": "function SortingController(){\n\n}\nSortingController.prototype = {\n getFormData: function(form){\n var formData = {};\n formData.type = $(form).attr(\"method\");\n formData.url = ...
javascript
chosen
[ { "from": "system", "value": "Modify settings.json to allow deploy\n" }, { "from": "human", "value": "import { Meteor } from 'meteor/meteor';\nimport { Template } from 'meteor/templating';\n\n/* eslint-disable object-shorthand */\n\nTemplate.If_Admin_Logged_In.helpers({\n /**\n * @returns {*}...
javascript
chosen
[ { "from": "system", "value": "Hide bookmarks qtip after navigating to a module\n" }, { "from": "human", "value": "'use strict';\n\nvar App = require('../../app');\nvar Marionette = require('backbone.marionette');\nvar template = require('../templates/bookmark_item.hbs');\n\nmodule.exports = Mari...
javascript
chosen
[ { "from": "system", "value": "Use basic properties and make public properties consistent with other interfaces.\n" }, { "from": "human", "value": "\nvar Proteus = require(\"proteus\");\n\nmodule.exports = Proteus.Class.derive(Object.defineProperties({\n \n init: function () {\n Obje...
javascript
chosen
[ { "from": "system", "value": "Remove tomster script after injection\n\nFixes #194\n" }, { "from": "human", "value": "(function() {\n\n \"use strict\";\n\n window.addEventListener('message', function(event) {\n if (event.data === 'debugger-client') {\n var port = event.ports[0];\n ...
javascript
chosen
[ { "from": "system", "value": "Rename cookie message cookie name\nIt currently clashes with GOV.UK cookie name so if the user has previously\nvisited GOV.UK they won't see our cookie message.\n" }, { "from": "human", "value": "function setCookie(name, value, options = {}) {\n let cookieString = ...
javascript
chosen
[ { "from": "system", "value": "Add correct mongo connection string (pull from docker env)\n" }, { "from": "human", "value": "'use strict';\n\n// Development specific configuration\n// ==================================\nmodule.exports = {\n // MongoDB connection options\n mongo: {\n uri: 'mo...
javascript
chosen
[ { "from": "system", "value": "Revert \"Gen 3: A faint ends the turn just like in gens 1 and 2\"\n\nThis reverts commit ebfaf1e8340db1187b9daabcb6414ee3329d882b.\n" }, { "from": "human", "value": "exports.BattleScripts = {\n\tinherit: 'gen5',\n\tgen: 3,\n\tinit: function () {\n\t\tfor (var i in t...
javascript
chosen
[ { "from": "system", "value": "Add endpoints for Facebook OAuth and User Creation\n" }, { "from": "human", "value": "module.exports = function(app, express) {\n\n app.get('/test', function(req, res) {\n res.send('Testing123');\n });\n\n};" }, { "from": "gpt", "value": "module.exp...
javascript
chosen
[ { "from": "system", "value": "Create helper functions for selectively answering form questions" }, { "from": "human", "value": "// ***********************************************\n// This example commands.js shows you how to\n// create various custom commands and overwrite\n// existing commands....
javascript
chosen
[ { "from": "system", "value": "Fix to handle negative numbers in PHP way--thanks pilus!\n" }, { "from": "human", "value": "function dechex(number) {\n // http://kevin.vanzonneveld.net\n // + original by: Philippe Baumann\n // + bugfixed by: Onno Marsman\n // * example 1: deche...
javascript
chosen
[ { "from": "system", "value": "Load the gapi client drive library and change when promise is resolved\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n\nvar GoogleApiAuthForm = React.createClass({\n getInitialState: function() {\n return {apiKey: null, clientId: null};\n },\...
javascript
chosen
[ { "from": "system", "value": "Fix up callbacks in jQuery\n" }, { "from": "human", "value": "/*! [replace-name] v[replace-version] */\n/***************************************************************************************************************************************************************\n...
javascript
chosen
[ { "from": "system", "value": "Apply change to all Android 13 devices\n" }, { "from": "human", "value": "export default {\n // Android emits composition events when moving the cursor through existing text\n // Introduced in Chrome 65: https://bugs.chromium.org/p/chromium/issues/detail?id=764439...
javascript
chosen
[ { "from": "system", "value": "Fix a bug where new users couldn't access settings page\n\nSigned-off-by: Felipe Milani <6def120dcec8fcb28aed4723fac713cfff66d853@gmail.com>\n" }, { "from": "human", "value": "import { Meteor } from 'meteor/meteor';\nimport { Accounts } from 'meteor/accounts-base';\...
javascript
chosen
[ { "from": "system", "value": "Set rel noopener roreferrer on links\n" }, { "from": "human", "value": "function addimageerrors() {\n $(\".instagram-img, .battle-img, .fancybox-img, .fancybox-video\").off(\"error\").on(\"error\", function () {\n $(this).parents(\"div.image-tile, li.image...
javascript
chosen
[ { "from": "system", "value": "Use grunt log utility for errors logging\n" }, { "from": "human", "value": "/**\n * BBB `module` generator for Yeoman\n * Initialize a single module file and related test.\n */\n\n\"use strict\";\nvar util = require(\"util\");\nvar path = require(\"path\");\nvar _ =...
javascript
chosen
[ { "from": "system", "value": "Remove broken AMD and CJS exports\n" }, { "from": "human", "value": "/* global define, module */\n\nimport Ember from 'ember';\nimport {\n Inflector,\n defaultRules,\n pluralize,\n singularize\n} from \"./lib/system\";\n\nInflector.defaultRules = defaultRules;\n...
javascript
chosen
[ { "from": "system", "value": "Add checked class to checkbox option\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n classNames: ['multiselect-checkbox-option'],\n\n tagName: 'li',\n\n value: null,\n\n selection: [],\n\n labelProperty...
javascript
chosen