conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix proto lang handler to work minified and to use the type style for types like uint32.\n" }, { "from": "human", "value": "// Copyright (C) 2006 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file exce...
javascript
chosen
[ { "from": "system", "value": "Add get one user in API\n" }, { "from": "human", "value": "// Api Routes --\n// RESTful API cheat sheet : http://ricostacruz.com/cheatsheets/rest-api.html\n\nvar express = require('express'),\n router = express.Router(),\n db = require('../modules/database');\...
javascript
chosen
[ { "from": "system", "value": "Use builtin to build url\n" }, { "from": "human", "value": "(function() {\n chrome.browserAction.onClicked.addListener(function() {\n var newURL = \"chrome-extension://\" + chrome.runtime.id + \"/index.html\";\n chrome.tabs.create({ url: newURL });\n });\n})...
javascript
chosen
[ { "from": "system", "value": "Add license and comment describing the Safari GC bug workaround.\n" }, { "from": "human", "value": "export function safariGCBugWorkaround() {\n if (customElements.polyfillWrapFlushCallback === undefined) {\n console.warn('The custom elements polyfill was reinsta...
javascript
chosen
[ { "from": "system", "value": "Add support for Dates to stringify, also improve stringify Object and Array\n" }, { "from": "human", "value": "// based on the qs module, but handles null objects as expected\n// fixes by Tomas Pollak.\n\nfunction stringify(obj, prefix) {\n if (prefix && (obj === n...
javascript
chosen
[ { "from": "system", "value": "Use file to generate screenshot\n" }, { "from": "human", "value": "import { remote } from 'electron'\n\nexport default async function takeScreenshot (html, deviceWidth) {\n return new Promise(resolve => {\n const win = new remote.BrowserWindow({\n width: de...
javascript
chosen
[ { "from": "system", "value": "Determine enumerability by $ prefix\n" }, { "from": "human", "value": "var Struct = require('../base/Struct');\nvar Data = require('../base/Data');\nvar Text = require('../base/Text');\nvar List = require('../base/List');\nvar AnyPointer = require('../base/AnyPointe...
javascript
chosen
[ { "from": "system", "value": "Enable policy feedback in interaction creation selection" }, { "from": "human", "value": "module.exports = function ({\n returnLink,\n errors = [],\n}) {\n return {\n buttonText: 'Continue',\n errors,\n children: [\n {\n macroName: 'MultipleC...
javascript
chosen
[ { "from": "system", "value": "Make request to flickr for group images and parse results into a standard json format.\n" }, { "from": "human", "value": "$(document).ready(function(){\n\t$('.swipeGal').each(function(i, obj){\n\t\t\n\t});\n});\n" }, { "from": "gpt", "value": "flickrPars...
javascript
chosen
[ { "from": "system", "value": "Use aggregation to namespace the connection id\n\nre #506\n" }, { "from": "human", "value": "define(['backbone', '../models/dataset/connection'],\n function(Backbone, Connection) {\n 'use strict';\n\n var ConnectionPool = Backbone.Collection.extend({\n\...
javascript
chosen
[ { "from": "system", "value": "Add create method to Todo Api\n" }, { "from": "human", "value": "var $ = require('jquery');\nvar _ = require('lodash');\n\nvar BASE_URL = '/api/todos/';\n\nvar TodoApi = {\n destroy: function(_id, success, failure) {\n $.ajax({\n url: BASE_URL + _id,\n ...
javascript
chosen
[ { "from": "system", "value": "Reduce auto-connect loop to 2 seconds.\n" }, { "from": "human", "value": "\n//\n// TODO: Window resizing needs finer-grain control\n// TODO: Take into account where user has moved the windows\n// TODO: Controls need automatic resizing within their parent windows\n//...
javascript
chosen
[ { "from": "system", "value": "Change the event handler, the `click` handler is only called on left clicks, use the fake `mouseclick` event to catch any kind of click.\n" }, { "from": "human", "value": "var domElementValue = require('dom-element-value');\nvar EventManager = require('dom-event-man...
javascript
chosen
[ { "from": "system", "value": "Add XML and JSON modes\n" }, { "from": "human", "value": "module.exports = [\n {name:'C++', mode:'c_cpp'},\n {name:'CSS', mode:'css'},\n {name:'HTML', mode:'html'},\n {name:'JavaScript', mode:'javascript'},\n {name:'Perl', mode:'perl'}...
javascript
chosen
[ { "from": "system", "value": "Rename the test on watcher API to have something more specific\n" }, { "from": "human", "value": "describe('asking if a visible div scrolled', function() {\n require('./fixtures/bootstrap.js');\n beforeEach(h.clean);\n afterEach(h.clean);\n\n var visible = false...
javascript
chosen
[ { "from": "system", "value": "Handle not found error in win32 auto launcher\n" }, { "from": "human", "value": "import manifest from '../../../../package.json';\nimport filePaths from '../../utils/file-paths';\nimport Winreg from 'winreg';\n\nimport BaseAutoLauncher from './base';\n\nclass Win32A...
javascript
chosen
[ { "from": "system", "value": "Update debug message to be less incorrect\n" }, { "from": "human", "value": "var email = require('emailjs')\n , debug = require('debug')('wifi-chat:mailer')\n\nvar config = null\n , server = null\n\nvar connect = function() {\n debug('Connecting to mail server'...
javascript
chosen
[ { "from": "system", "value": "Adjust block time to 14.4 seconds\n" }, { "from": "human", "value": "HandlebarsIntl.registerWith(Handlebars);\n\n$(function() {\n\twindow.state = {};\n\tvar source = $(\"#stats-template\").html();\n\tvar template = Handlebars.compile(source);\n\trefreshStats(templat...
javascript
chosen
[ { "from": "system", "value": "Update code to follow standard style\n" }, { "from": "human", "value": "/**\n * Comma number formatter\n * @param {Number} number Number to format\n * @param {String} [separator=','] Value used to separate numbers\n * @returns {String} Comma formatted number\n */\nm...
javascript
chosen
[ { "from": "system", "value": "TEST: Remove jQuery dependency, not used\n" }, { "from": "human", "value": "'use strict';\nif (!Function.prototype.bind) {\n // PhantomJS doesn't support bind yet\n Function.prototype.bind = Function.prototype.bind || function(thisp) {\n var fn = this;\...
javascript
chosen
[ { "from": "system", "value": "Handle initial page laod via express\n" }, { "from": "human", "value": "import express from 'express';\nimport ReactDOMServer from 'react-dom/server'\nimport {Router} from 'react-router';\nimport MemoryHistory from 'react-router/lib/MemoryHistory';\nimport React fro...
javascript
chosen
[ { "from": "system", "value": "Store widget_id on field element\n\nThis allows the captcha element to be targeted via the js api in situations where there is more than one nocaptcha widget on the page. See examples referencing `opt_widget_id` here https://developers.google.com/recaptcha/docs/display#js_api" ...
javascript
chosen
[ { "from": "system", "value": "Fix bug with inner reset time" }, { "from": "human", "value": "var Store = module.exports = function () {\n\n};\n\nStore.prototype.hit = function (req, configuration, callback) {\n var self = this;\n\n\tvar ip = req.ip;\n\tvar path;\n\tif (configuration.pathLimit...
javascript
chosen
[ { "from": "system", "value": "Update sample config for new modules.\n" }, { "from": "human", "value": "/* Magic Mirror Config Sample\n *\n * By Michael Teeuw http://michaelteeuw.nl\n * MIT Licensed.\n */\n\nvar config = {\n port: 8080,\n\n language: 'en',\n timeFormat: 12,\n units: 'imperial...
javascript
chosen
[ { "from": "system", "value": "Remove flow typchecking from InstrumentCard\n\n- Removed typchecking from AttachedInstrumentCard since mock data is currently being used.\n" }, { "from": "human", "value": "// @flow\n// RobotSettings card for wifi status\nimport * as React from 'react'\nimport {type...
javascript
chosen
[ { "from": "system", "value": "Set the default size to 40 on SVGBoxes\n\nThe null value was causing some weird rendering issues on a few icons\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react'\nimport classNames from 'classnames'\n\nexport const SVGComponent = ({ childre...
javascript
chosen
[ { "from": "system", "value": "Fix bower packages installation for addon\n" }, { "from": "human", "value": "/* globals module */\nmodule.exports = {\n afterInstall: function () {\n this.addBowerPackageToProject('git://github.com/BreadMaker/semantic-ui-daterangepicker.git#5d46ed2e6e5a0bf398bb6...
javascript
chosen
[ { "from": "system", "value": "Add error listener to test\n" }, { "from": "human", "value": "var patch = require(\"../lib/patch\")\n , net = require(\"net\")\n , https = require(\"https\")\n , fs = require(\"fs\");\n\n// This is probably THE most ugliest code I've ever written\nvar responseReg...
javascript
chosen
[ { "from": "system", "value": "Improve ESLint options for Webpack" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst webpack = require('webpack');\n\nmodule.exports = {\n cache: true,\n\n devtool: '#source-map',\n\n entry: [\n path.resolve(__dirname, 'src...
javascript
chosen
[ { "from": "system", "value": "Add vue.js release build option\n" }, { "from": "human", "value": "const path = require('path');\r\nconst webpack = require(\"webpack\");\r\n\r\nconst DEBUG = process.argv.includes('--debug'); // `webpack --debug` or NOT\r\nconst plugins = [\r\n new webpack.optim...
javascript
chosen
[ { "from": "system", "value": "Use more general bower syntax to import antiscroll\n" }, { "from": "human", "value": "module.exports = {\n normalizeEntityName: function() {},\n\n afterInstall: function(options) {\n // We assume that handlebars, ember, and jquery already exist\n // FIXME(az...
javascript
chosen
[ { "from": "system", "value": "Use beforeExit event to send coverage\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nprocess.on('exit', function sendCoverage() {\n process.send({'coverage': global.__coverage__});\n});\n" }, { "from": "gpt", "value": "#!/usr/bin/env node\n\n...
javascript
chosen
[ { "from": "system", "value": "Refactor matrix creation to use values slice\n" }, { "from": "human", "value": "\nfunction Matrix(options) {\n options = options || {};\n \n var values;\n \n if (options.values)\n values = options.values;\n \n if (options.rows && options....
javascript
chosen
[ { "from": "system", "value": "Revert \"Reduce the min number of devices to test.\"\n\nThis reverts commit 90e5494b3212350d7cb7ef946c5b9d8fa62189d5.\n" }, { "from": "human", "value": "'use strict';\n\n// Default amount of devices required to run tests.\n\nmodule.exports = {\n devices: {\n // ...
javascript
chosen
[ { "from": "system", "value": "Define where to find the component stories\n" }, { "from": "human", "value": "module.exports = {\n addons: ['@storybook/addon-backgrounds', '@storybook/addon-knobs'],\n};\n" }, { "from": "gpt", "value": "module.exports = {\n stories: ['../**/*.stories....
javascript
chosen
[ { "from": "system", "value": "Fix having not set this up correctly\n" }, { "from": "human", "value": "//\n// This file talks to the main process by fetching the path to the user data.\n// It also writes updates to the user-data file.\n//\n\nvar ipc = require('electron').ipcRenderer\nvar fs = req...
javascript
chosen
[ { "from": "system", "value": "Use promise all at the right place in the server connecting action" }, { "from": "human", "value": "import { sqlectron } from '../../browser/remote';\n\n\nexport const CONNECTION_REQUEST = 'CONNECTION_REQUEST';\nexport const CONNECTION_SUCCESS = 'CONNECTION_SUCCESS'...
javascript
chosen
[ { "from": "system", "value": "Update the JS to remove alerts etc and login now has to have its success method called\n" }, { "from": "human", "value": "PG = ( typeof PG == 'undefined' ? {} : PG );\nPG.FB = {\n init: function(apiKey) {\n PhoneGap.exec(function(e) {\n ...
javascript
chosen
[ { "from": "system", "value": "Allow commands to define internal options\n\nSo those options don't appear in the help output\n" }, { "from": "human", "value": "var command = {\n command: \"help\",\n description:\n \"List all commands or provide information about a specific command\",\n help...
javascript
chosen
[ { "from": "system", "value": "Fix webpack lodash external require\n" }, { "from": "human", "value": "var webpack = require('webpack')\n , glob = require('glob').sync\n , ExtractTextPlugin = require('extract-text-webpack-plugin');\n\n// Find all the css files but sort the common ones first\nvar...
javascript
chosen
[ { "from": "system", "value": "Add style to Webpack rules.\n" }, { "from": "human", "value": "const path = require('path')\n\nmodule.exports = {\n context: __dirname,\n entry: './js/ClientApp.js',\n devtool: 'source-map',\n output: {\n path: path.join(__dirname, '/public'),\n filename: ...
javascript
chosen
[ { "from": "system", "value": "Fix ref on downshift element\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport Popper from '../Popper';\n\nconst OptionsListWrapper = React.forwardRef(({\n useLegacy,\n children,\n controlRef,\n isOpen,\n ...
javascript
chosen
[ { "from": "system", "value": "Hide demo alert by default.\n" }, { "from": "human", "value": "const initialState = {\n count: 0,\n redditReactjsList: [],\n // navTreeData: null,\n // projectData: null,\n elementById: {},\n fileContentById: {},\n features: null,\n projectDataNeedReload: fa...
javascript
chosen
[ { "from": "system", "value": "Fix dumb bug in link-props handling\n" }, { "from": "human", "value": "/*import * as reactRouter3 from 'react-router';\n\nexport const Link = reactRouter3.Link;\n\nexport const withRouter = reactRouter3.withRouter;*/\n\nimport React from 'react';\n\nimport * as reac...
javascript
chosen
[ { "from": "system", "value": "Update methods to send object params" }, { "from": "human", "value": "//must have a blank option one for question of type dropdown\n\nstandard('qTypes',[\"\",\"Drop Down\", \"Multidrop-down\", \"Number Fillin\", \"Essay\", \"Code\"]);\n\nstandard('qTypes2',[\"\",\"d...
javascript
chosen
[ { "from": "system", "value": "Update node version in babel preset\n" }, { "from": "human", "value": "/* eslint-env commonjs */\n/* eslint-disable global-require */\n\nmodule.exports = function buildPreset () {\n\treturn {\n\t\tpresets: [\n\t\t\trequire('babel-preset-env').default(null, {\n\t\t\t...
javascript
chosen
[ { "from": "system", "value": "Fix <this> is not valid\n" }, { "from": "human", "value": "import restate from 'regular-state';\nimport { Component } from 'nek-ui';\nimport App from './modules/app';\nimport Home from './modules/home';\nimport Detail from './modules/detail';\nimport Setting from '....
javascript
chosen
[ { "from": "system", "value": "Add support for multiple role assertions\n\nThe `https://aws.amazon.com/SAML/Attributes/Role` attribute supports\nsingle or multiple values. This fixes Awsaml to work when a\nmultiple-value attribute is passed.\n\nCurrently, the first role is always used. Support for selectin...
javascript
chosen
[ { "from": "system", "value": "Use util instead of sys in example.\n\nMake sure the example Jerk script continues to work in future node.js\nreleases. The node.js `sys` library has been a pointer to `util` since\n0.3 and has now been removed completely in the node.js development\nbranch.\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Change default language : en\n" }, { "from": "human", "value": "'use strict'\n\nangular\n .module('serinaApp', [\n 'ngAnimate',\n 'ngCookies',\n 'ngResource',\n 'ngRoute',\n 'ngSanitize',\n 'ngMaterial'\n ])\n .config(function ($routeProvider) {...
javascript
chosen
[ { "from": "system", "value": "Fix for older versions of Node.\n\nOlder versions of Node had a conflicting implementation of buffer.set.\n" }, { "from": "human", "value": "export default function(a, b) {\n var ab = new a.constructor(a.length + b.length);\n ab.set(a, 0);\n ab.set(b, a.length);\...
javascript
chosen
[ { "from": "system", "value": "Fix heartbeat sender timer handle cleanup\n" }, { "from": "human", "value": "\"use strict\";\n\nconst WebSocket = require(\"ws\");\nconst Constants = require(\"../../Constants\");\n\nconst heartbeat = new WeakMap();\n\nclass BaseSocket extends WebSocket {\n constru...
javascript
chosen
[ { "from": "system", "value": "Add task name override functionality\n" }, { "from": "human", "value": "var fs = require('fs')\n , request = require('request')\n\nmodule.exports = function (pliers) {\n\n pliers('npmSecurityCheck', function (done) {\n fs.createReadStream('./npm-shrinkwrap.json...
javascript
chosen
[ { "from": "system", "value": "Fix trip router (forget to export module)\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar trip = require('../lib/trip')\n\nrouter.post('/', function(req, res, next) {\n var trip_path = trip.generate_trip(req...
javascript
chosen
[ { "from": "system", "value": "Add simple sample for user router\n" }, { "from": "human", "value": "var\n express = require('express'),\n router = express.Router();\n\nrouter.get('/', function (req, res, next) {\n res.json([\"users\"]);\n return next();\n});\n\nmodule.exports = router;\n" }...
javascript
chosen
[ { "from": "system", "value": "Debug mode not set sometimes issue fixed\n" }, { "from": "human", "value": "angular.module('h54sNavbar', ['sasAdapter', 'h54sDebugWindow'])\n\n.controller('NavbarCtrl', ['$scope', 'sasAdapter', '$rootScope', '$sce', function($scope, sasAdapter, $rootScope, $sce) {\n...
javascript
chosen
[ { "from": "system", "value": "Add a public repo example\n" }, { "from": "human", "value": "var global = {\n host: 'http://subdomain.yourdomain.com',\n port: 8461,\n secretUrlSuffix: 'putSomeAlphanumericSecretCharsHere'\n};\n\nvar projects = [\n {\n repo: {\n owner: 'yourbitbucketuser...
javascript
chosen
[ { "from": "system", "value": "Improve regex for getting appid\n" }, { "from": "human", "value": "'use strict';\n\nvar CurrentAppID,\n\tGetCurrentAppID = function()\n\t{\n\t\tif( !CurrentAppID )\n\t\t{\n\t\t\tCurrentAppID = location.pathname.match( /\\/([0-9]{1,6})(?:\\/|$)/ );\n\t\t\t\n\t\t\tif(...
javascript
chosen
[ { "from": "system", "value": "Allow to override 'required' value\n" }, { "from": "human", "value": "'use strict';\n\nvar Db = require('dbjs')\n , relation = module.exports = require('dbjs/lib/_relation');\n\nrequire('./base');\n\nrelation.set('toDOMInputBox', function (document/*, options...
javascript
chosen
[ { "from": "system", "value": "Remove clearStatus action; not in use\n" }, { "from": "human", "value": "import Axios from 'axios';\nimport {\n PROVIDER_CHANGE,\n FILTER_BOARD, FILTER_THREAD,\n SERACH_BOARD, SEARCH_THREAD,\n STATUS_UPDATE\n} from '../constants';\n// TODO: Filter + Sear...
javascript
chosen
[ { "from": "system", "value": "Change the read book test and populate index test\n" }, { "from": "human", "value": "describe (\"Read book data\",function(){\n\n\tit(\"assert JSON file is not empty\",function(){\n\t\tvar isNotEmpty = function IsJsonString(filePath) {\n \t\ttry {\n \t\tJS...
javascript
chosen
[ { "from": "system", "value": "Add initialProgress property to make start from the given value\n" }, { "from": "human", "value": "var React = require('react-native');\n\nvar {\n Animated,\n Easing,\n StyleSheet,\n View\n} = React;\n\nvar styles = StyleSheet.create({\n background: {\n back...
javascript
chosen
[ { "from": "system", "value": "Disable test cleanup for debugging\n" }, { "from": "human", "value": "/**\n * require dependencies\n */\nWebdriverIO = require('webdriverio');\nWebdriverCSS = require('../index.js');\nfs = require('fs-extra');\ngm = require('gm');\nglob = require('glob');\nasync =...
javascript
chosen
[ { "from": "system", "value": "Add test for custom root (setted by babelrc)\n" }, { "from": "human", "value": "import BabelRootImportPlugin from '../plugin';\nimport * as babel from 'babel-core';\n\ndescribe('Babel Root Import - Plugin', () => {\n describe('Babel Plugin', () => {\n it('transf...
javascript
chosen
[ { "from": "system", "value": "Add some validation to my model\n" }, { "from": "human", "value": "/**\n * User\n *\n * @module :: Model\n * @description :: A short summary of how this model works and what it represents.\n * @docs\t\t:: http://sailsjs.org/#!documentation/models\n */\n\nmodule...
javascript
chosen
[ { "from": "system", "value": "Fix para iphone al abrir controlador\n\nAl abrir el controlador de forms no se veia el window title\n" }, { "from": "human", "value": "/**\n * Global Navigation Handler\n */\nAlloy.Globals.Navigator = {\n\t\n\t/**\n\t * Handle to the Navigation Controller\n\t */\n\t...
javascript
chosen
[ { "from": "system", "value": "Put back in handling for animation being a function for transition definitions\n" }, { "from": "human", "value": "var getInterpolation = require('interpolation-builder');\nvar createTransitions = require('./createTransitions');\n\nmodule.exports = function(driver, s...
javascript
chosen
[ { "from": "system", "value": "Add filtering for \"Best BLAHBLAHBLAH ever made\"" }, { "from": "human", "value": "// ==UserScript==\n// @name Steam Review filter\n// @namespace https://github.com/somoso/steam_user_review_filter/raw/master/steam_user_review_filter.user.js\n// @version ...
javascript
chosen
[ { "from": "system", "value": "Enable logging for test environment\n" }, { "from": "human", "value": "const dotenv = require('dotenv');\ndotenv.config({silent: true});\nconst config = {\n \"development\": {\n \"username\": process.env.DB_DEV_USER,\n \"password\": process.env.DB_DEV_PASS,\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"https doesn't work at the moment for osma tiles served from vizzuality\"\n\nThis reverts commit 96c3024ca822cbe801a6c2af43eae5b12c3fa9a4.\n" }, { "from": "human", "value": "const mapbox_token = 'pk.eyJ1IjoiaG90IiwiYSI6ImNpbmx4bWN6ajAwYTd3OW0ycjh3bTZvc3QifQ....
javascript
chosen
[ { "from": "system", "value": "Update the email selection UI\n" }, { "from": "human", "value": "var getThat = {};\n\ngetThat.controller = function() {\n\n};\n\ngetThat.header = function() {\n return m('.row', [\n m('.col-md-10', [\n m('.jumbotron', [\n m('h1', ...
javascript
chosen
[ { "from": "system", "value": "Fix test starting two connections to server\n" }, { "from": "human", "value": "window.requirejs = window.yaajs;\n\nwindow.history.replaceState(null, document.title = 'Piki Test Mode', '/');\n\n\ndefine(function(require, exports, module) {\n var koru = require('koru...
javascript
chosen
[ { "from": "system", "value": "Use `done` callback for smooth animation\n" }, { "from": "human", "value": "$(function() {\n $('.accordion_head').each( function() {\n $(this).after('<ul style=\"display: none;\"></ul>');\n });\n\n $(document).on(\"click\", '.accordion_head', function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix name of sidebar acceptance test.\n\n[ci skip]\n" }, { "from": "human", "value": "var App;\n\nmodule(\"Acceptances - Index\", {\n setup: function(){\n var sampleDataUrl = '';\n\n if (typeof __karma__ !== 'undefined')\n sampleDataUrl = '/base';\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add a publication restriction to not share premium content unless the user is signed in.\n" }, { "from": "human", "value": "Letterpress.Collections.Pages = new Mongo.Collection('pages');\nLetterpress.Collections.Pages.before.insert(function (userId, doc) {\n doc.pa...
javascript
chosen
[ { "from": "system", "value": "Remove Babel dependency and convert to standard code style\n" }, { "from": "human", "value": "/** @babel */\n\nimport TabStop from './tab-stop';\n\nclass TabStopList {\n constructor (snippet) {\n this.snippet = snippet;\n this.list = {};\n }\n\n get length...
javascript
chosen
[ { "from": "system", "value": "Move getRole to separate file\n\nWork better with cache\n" }, { "from": "human", "value": "// Dependencies\nvar request = require('request');\n\n//Define\nmodule.exports = function(group, rank, callbacks) {\n request.get('http://www.roblox.com/api/groups/' + group ...
javascript
chosen
[ { "from": "system", "value": "Add support for non-default domains\n" }, { "from": "human", "value": "var Snoocore = require('snoocore');\n\nvar pkg = require('../../package.json');\n\nvar uaString = \"QIKlaxonBot/\" + pkg.version + ' (by /u/StuartPBentley)';\n\nmodule.exports = function(cfg, dur...
javascript
chosen
[ { "from": "system", "value": "Update test helper due to deprecated function\n" }, { "from": "human", "value": "import { merge } from '@ember/polyfills';\nimport { run } from '@ember/runloop'\nimport Application from '../../app';\nimport config from '../../config/environment';\n\nexport default f...
javascript
chosen
[ { "from": "system", "value": "Set owner_id on new post.\n" }, { "from": "human", "value": "List = new Meteor.Collection( 'List' );\n\nList.allow({\n insert: (userId, document) => true,\n update: (userId, document) => document.owner_id === Meteor.userId(),\n remove: (userId, document) =>...
javascript
chosen
[ { "from": "system", "value": "Add grey no avatar image\n" }, { "from": "human", "value": "// @flow\n\nimport React, {Component} from 'react'\nimport resolveRoot from '../../desktop/resolve-root'\nimport type {Props} from './avatar'\n\nconst noAvatar = `file:///${resolveRoot('shared/images/no-ava...
javascript
chosen
[ { "from": "system", "value": "Fix code snippet codetype so it passes in correctly\n" }, { "from": "human", "value": "import React from 'react';\nimport Highlight, { defaultProps } from 'prism-react-renderer';\nimport darkTheme from 'prism-react-renderer/themes/duotoneDark';\n\nconst InlineCode =...
javascript
chosen
[ { "from": "system", "value": "Improve logging (timestamp and level)\n" }, { "from": "human", "value": "import colors from 'colors/safe';\n\nexport function printDebug() {\n console.log(...arguments);\n const fileLogger = require('browser/utils/file-logger');\n fileLogger.writeLog(...arguments...
javascript
chosen
[ { "from": "system", "value": "Add workaround for bad YouTube results\n\nThe upstream module used for YouTube search breaks when results are\nneither videos nor channels. This commit forces YouTube to return only\nvideos and channels, in order to work around the bug.\n\nBug: MaxGfeller/youtube-search#15\n" ...
javascript
chosen
[ { "from": "system", "value": "Allow external disable of stylesheets hack\n" }, { "from": "human", "value": "'use strict';\n\nvar isParentNode = require('dom-ext/parent-node/is')\n , isStyleSheet = require('html-dom-ext/link/is-style-sheet')\n\n , forEach = Array.prototype.forEach;\n\nmodule.ex...
javascript
chosen
[ { "from": "system", "value": "Handle array case in keyboard command comparison\n" }, { "from": "human", "value": "import dEqual from 'fast-deep-equal';\n\n// Compares two possible objects\nexport function compareKbdCommand(c1, c2) {\n return dEqual(c1, c2);\n}\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Convert Player base model to ES6 class\n" }, { "from": "human", "value": "// An abstract base model representing a player in a game\nfunction Player(args) {\n // The name of the player (e.g. 'Human 1')\n this.name = args.name;\n // The player's chip color (suppor...
javascript
chosen
[ { "from": "system", "value": "Set description as fallback for name\n\nBoth are optional, so might be empty or undefined, for which depending\non use-case might need to handle (for basemap will get a custom name)\n" }, { "from": "human", "value": "/**\n * Model to representing a TileJSON endpoint...
javascript
chosen
[ { "from": "system", "value": "Tidy up firefox prefs, and added CTRL+TAB through tabs :)\n" }, { "from": "human", "value": "user_pref(\"accessibility.typeaheadfind\", 1);\nuser_pref(\"browser.fixup.alternate.enabled\", false);\nuser_pref(\"browser.newtab.url\", \"https://www.google.co.nz\");\nuse...
javascript
chosen
[ { "from": "system", "value": "Send back the socket id with the pong message\n" }, { "from": "human", "value": "\nvar ds = require('./discovery')\nvar rb = require('./rubygems')\nvar sc = require('./scrape')\n\n\nvar WebSocketServer = require('ws').Server\nvar wss = new WebSocketServer({host: 'lo...
javascript
chosen
[ { "from": "system", "value": "Allow queryLogs to be without params\n" }, { "from": "human", "value": "export const queryLogs = ({ Page, PageSize } = {}) => ({\n method: 'get',\n url: 'logs/auth',\n params: { Page, PageSize }\n});\n\nexport const clearLogs = () => ({\n method: 'delete...
javascript
chosen
[ { "from": "system", "value": "Use 'babel' Prettier parser instead of deprecated 'bablyon'.\n\nAs per warning when using jest-react-fela.\n\nconsole.warn node_modules/prettier/index.js:7939\n { parser: \"babylon\" } is deprecated; we now treat it as { parser: \n\"babel\" }.\n" }, { "from": "human",...
javascript
chosen
[ { "from": "system", "value": "[BPK-1053] Add elevation tokens under shadows\n" }, { "from": "human", "value": "/*\n * Backpack - Skyscanner's Design System\n *\n * Copyright 2017 Skyscanner Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this fil...
javascript
chosen
[ { "from": "system", "value": "Add @xstate/vue to publishable packages\n" }, { "from": "human", "value": "const { exec } = require('@actions/exec');\nconst getWorkspaces = require('get-workspaces').default;\n\nasync function execWithOutput(command, args, options) {\n let myOutput = '';\n let my...
javascript
chosen
[ { "from": "system", "value": "Fix yarn type annotation error\n" }, { "from": "human", "value": "// @flow\n\nimport { connect } from 'react-redux'\nimport { compose } from 'recompose'\nimport { getEncryptedWIF } from '../../../modules/generateEncryptedWIF'\n\nimport EncryptQR from './EncryptQR'\n...
javascript
chosen
[ { "from": "system", "value": "Update IAM Role cfn resource\n" }, { "from": "human", "value": "var AWSResource = require('../awsresource')\n , types = require('../types');\n\nvar Role = AWSResource.define('AWS::IAM::Role', {\n AssumeRolePolicyDocument : { type: types.object('iam-assume-role...
javascript
chosen
[ { "from": "system", "value": "Move DeviceType valuesArray to constructor\n\nclassProperties is not enabled for Polymer compiler\n\nSee: https://github.com/Polymer/tools/issues/3360\nBug: 137847631\nChange-Id: Iae68919462765e9672539fbc68c14fa9818ea163\n" }, { "from": "human", "value": "/**\n * Co...
javascript
chosen
[ { "from": "system", "value": "Set updatedAt field on insertion\n" }, { "from": "human", "value": "events = {};\n\nevents.beforeInsert = function() {\n // Find a class on which the behavior had been set.\n var behaviorData = Astro.utils.behaviors.findBehavior(this.constructor, 'timestamp');\n\n...
javascript
chosen
[ { "from": "system", "value": "style: Add missing 'use strict' declaration\n" }, { "from": "human", "value": "/* global require, module, process, console, __dirname */\n/* jshint -W097 */\nvar\n mongoose = require('mongoose'),\n Schema = mongoose.Schema;\n\nvar MediaSchema = new Schema({\n n...
javascript
chosen
[ { "from": "system", "value": "Set editing border color to lightgrey\n" }, { "from": "human", "value": "var rows = 0;\nvar cols = 10;\nvar table;\nvar edit_border = \"thin dotted grey\";\n\nfunction text(str)\n{\n return document.createTextNode(str);\n}\n\nfunction cellContents(rowindex, colin...
javascript
chosen