conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Check that note has name property before equivalency check.\n" }, { "from": "human", "value": "import React from 'react';\nimport SearchBar from './searchbar.component'\nimport NoteTable from './noteTable.component'\n\n//combines note table and searchbar\nclass Filt...
javascript
chosen
[ { "from": "system", "value": "Return Promise.reject if agent not found" }, { "from": "human", "value": "'use strict';\n\nvar Promise = require('promise');\nvar Connection = require('../Connection');\n\n/**\n * A local connection.\n * @param {LocalTransport} transport\n * @param {string | number}...
javascript
chosen
[ { "from": "system", "value": "Clean up destroyed modal properly" }, { "from": "human", "value": "/** @jsx React.DOM */\n\ndefine([\n \"React\"\n], function(React) {\n return React.createClass({\n destroy: function(event) {\n if (event.target.className === \"modal\" ||\n event....
javascript
chosen
[ { "from": "system", "value": "Add some logging to the phantom skipper" }, { "from": "human", "value": "/*eslint-env node*/\n// Borrowed from https://github.com/ember-cli/ember-cli/issues/3894#issuecomment-212946925\n// Custom version of the Testem PhantomJS runner.\n// This exists to block req...
javascript
chosen
[ { "from": "system", "value": "Test for email extraction message.\n" }, { "from": "human", "value": "/** @jsx React.DOM */\nvar assert = require('chai').assert;\nvar expect = require('chai').expect;\nvar _ = require('lodash');\nvar sinon = require('sinon');\nvar Chart = require('../../../../../cl...
javascript
chosen
[ { "from": "system", "value": "Fix bug with undefined auth function.\n" }, { "from": "human", "value": "/* @flow */\nimport * as firebase from 'firebase/auth'\nimport type { Action } from '../actions/types'\n\nexport default class AuthManager {\n static login (action: Action) {\n if (action.t...
javascript
chosen
[ { "from": "system", "value": "Clear duplicate key on set()" }, { "from": "human", "value": "\nconst Timeout = (() => {\n const keyId = {}\n const complete = {}\n\n // set(key, func, ms) -- user-defined key\n // set(func, ms) -- func used as key\n //\n // returns a function allowing you to ...
javascript
chosen
[ { "from": "system", "value": "Make devices discovered unique in example app\n" }, { "from": "human", "value": "import * as types from '../actions/DiscoveryActionTypes';\n\nconst initialState = {\n devicesDiscovered: [],\n discoveryStatus: \"\",\n};\n\nexport default function discovery(state = ...
javascript
chosen
[ { "from": "system", "value": "Check if component is present\n" }, { "from": "human", "value": "const backToTop = document.querySelector('#js-backToTop');\n\n$(window).scroll(function() {\n if($(window).scrollTop() > $(window).height()) {\n backToTop.classList.remove('down-self');\n }\n...
javascript
chosen
[ { "from": "system", "value": "Add load balancing using cluster\n" }, { "from": "human", "value": "require(\"dotenv\").config();\nrequire(\"./app/variables\");\nrequire(\"./app/models/user\");\nrequire(\"./app/models/record\");\nrequire(\"./app/passport/passport\");\nrequire(\"./app/middlewares\"...
javascript
chosen
[ { "from": "system", "value": "Update for new analytics dashboard\n" }, { "from": "human", "value": "import React, { Component } from 'react'\n\nexport class Dashboard extends Component {\n constructor(props) {\n super(props)\n }\n render() {\n return (\n <div>\n <div>\n ...
javascript
chosen
[ { "from": "system", "value": "Use a proper screen size\n" }, { "from": "human", "value": "/**\n * Config file\n */\n\nmodule.exports = {\n\n // BrowserWindow options\n browserWindow : {\n width : (process.env.DEBUG == 'true') ? 1000 : 400, // Provide space for debugger tools\n height : 6...
javascript
chosen
[ { "from": "system", "value": "Make app listen to public port\n\nOmit hostname to ensure app is accessible via Internet, i.e. hostname MUST be\n`0.0.0.0`, not `127.0.0.1`.\n\n/cc @iangilman @kenperkins @aseemk\n" }, { "from": "human", "value": "var http = require('http');\n\nvar PORT = 80;\nvar I...
javascript
chosen
[ { "from": "system", "value": "Update applyRef jsdoc to optional params\n" }, { "from": "human", "value": "/**\n * Mimics React ref behavior. First cleans oldRef, if possible, then applies new ref value\n * https://reactjs.org/docs/refs-and-the-dom.html#caveats-with-callback-refs\n *\n * @param {...
javascript
chosen
[ { "from": "system", "value": "Call advanceTurn al para que el juego avance luego de mover los tokens\n" }, { "from": "human", "value": "\"use strict\";\n\n$('#start').click(function() {\n let namePlayer1 = $('#p1name').val(),\n namePlayer2 = $('#p2name').val();\n \n if (namePlaye...
javascript
chosen
[ { "from": "system", "value": "Add custom error code: NO_RESET_METHODS\n" }, { "from": "human", "value": "export const HTTP_ERROR_CODES = {\n ABORTED: -1,\n TIMEOUT: 0,\n UNPROCESSABLE_ENTITY: 422,\n UNAUTHORIZED: 401,\n UNLOCK: 403,\n TOO_MANY_REQUESTS: 429,\n};\n\nexport const...
javascript
chosen
[ { "from": "system", "value": "Fix space bug for reflect and refract brdf\n" }, { "from": "human", "value": "(function (ns) {\n\n var Shade = require(\"../../interfaces.js\"),\n SpaceVectorType = Shade.SpaceVectorType;\n\n ns.emissive = {\n inputSpaces: [\n ...
javascript
chosen
[ { "from": "system", "value": "Use text as the datatype instead of the stupid type.STRING thing\n" }, { "from": "human", "value": "\"use strict\";\n\nmodule.exports = {\n up: function(m, types, done) {\n m.createTable(\"user\", {\n email: { type: types.STRING, primaryKey: true },\n ...
javascript
chosen
[ { "from": "system", "value": "Remove useless attributes and add \"allowfullscreen\"\n" }, { "from": "human", "value": "var extend = require('../../extend');\n\nextend.tag.register('iframe', function(args, content){\n var url = args[0],\n width = args[1] && args[1] != 'default' ? args[1] : '1...
javascript
chosen
[ { "from": "system", "value": "Use process id for increased uniqueness" }, { "from": "human", "value": "'use strict';\nvar crypto = require('crypto');\nvar INSTANCE_ID = crypto.randomBytes(2);\nvar BASE_UNIX_DATE = 421000000;\n\nvar buf = new Buffer(10);\nbuf[4] = INSTANCE_ID[0];\nbuf[5] = INSTAN...
javascript
chosen
[ { "from": "system", "value": "Make function string parsing more explicit\n" }, { "from": "human", "value": "options = JSON.stringify(options);\n\noptions = JSON.parse(options, function(key, value) {\n\n if (value && (typeof value===\"string\")) {\n\n // replace spaces then newline char...
javascript
chosen
[ { "from": "system", "value": "Fix bug with null values, refractorize code\n\nIf null values arrives the plugin crashes, with this little change not happens" }, { "from": "human", "value": "angular.module('igTruncate', []).filter('truncate', function (){\n return function (text, length, end){\n ...
javascript
chosen
[ { "from": "system", "value": "Write listToArray function that produces an array from a list\n" }, { "from": "human", "value": "// Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an...
javascript
chosen
[ { "from": "system", "value": "refactor: Fix classList misuse on error case\n\nFix the error on viewModel where assignment was used on document.body.classList instead of the add method.\n" }, { "from": "human", "value": "var ViewModel = function() {\n 'use strict';\n this.filter = ko.observable...
javascript
chosen
[ { "from": "system", "value": "Add try/catch to handle exceptions\n" }, { "from": "human", "value": "import fs from 'fs';\n\nfunction fileExists(filename){\n try{\n fs.accessSync(filename);\n return true;\n }catch(e){\n return false;\n }\n}\n\nfunction readDir(path){\n return fs.read...
javascript
chosen
[ { "from": "system", "value": "Return false from click handler to avoid a pop state event\n" }, { "from": "human", "value": " $(document).on('click', 'ul.ds-rejigger-menu li a', function(e) {\n var target = $(e.target).parent();\n var cols = target.attr('data-ds-cols');\n var section_ty...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix for scenario where we have no spawned children\n" }, { "from": "human", "value": "// STOP\n\nprocess.on('SIGINT', cleanExit)\nprocess.on('SIGTERM', cleanExit)\nprocess.on('uncaughtException', cleanExit)\n\nfunction cleanExit(e) {\n if (e) console.log(e.st...
javascript
chosen
[ { "from": "system", "value": "Initialize colors, and fix message registration\n" }, { "from": "human", "value": "$(function () {\n $(\"#start-towtruck\").click(TowTruck);\n randomize();\n});\n\nfunction cell(row, col) {\n return $(\"#cell-\" + row + \"-\" + col);\n}\n\nfunction randomColor() ...
javascript
chosen
[ { "from": "system", "value": "Configure imports on app js\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, ve...
javascript
chosen
[ { "from": "system", "value": "Switch to use keyup, but only perform lookup on input change." }, { "from": "human", "value": "var BookLookup = { }\n\nBookLookup.find_by_isbn = function(isbn, callback) {\n $.getJSON('/books/isbn/'+ encodeURI(isbn), callback);\n}\n\nBookLookup.find_and_render = fu...
javascript
chosen
[ { "from": "system", "value": "Work around rollup bug(?) which dropped this default-exported async function\n" }, { "from": "human", "value": "/* global API */\nimport { unescape } from 'plug-message-split'\nimport fetch from './fetch'\n\nconst jsonHeaders = {\n Accept: 'application/json',\n 'C...
javascript
chosen
[ { "from": "system", "value": "Test reflects passing raw string at initialization.\n" }, { "from": "human", "value": "var nodehun = require('./../lib/index.js'),\n\tDictionary = nodehun.Dictionary,\n\tmctime = require('microtime'),\n\tunit = typeof mctime !== \"undefined\" ? \"μs\":\"ms\",\n\ttim...
javascript
chosen
[ { "from": "system", "value": "Make javascript generated from coffeescript easier to read\n" }, { "from": "human", "value": "(function() {\n var asyncSpec, jasmineFunction, withoutAsync, _fn, _i, _len, _ref;\n var __slice = Array.prototype.slice;\n\n withoutAsync = {};\n\n _ref = [\"it\", \"b...
javascript
chosen
[ { "from": "system", "value": "[DDW-646] Make knob on delegation story in storybook\n" }, { "from": "human", "value": "// @flow\nimport React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport StoryDecorator from './support/StoryDecorator';\nimport Delegation from '../../source/...
javascript
chosen
[ { "from": "system", "value": "IssueNotesRefactor: Add existence check to find the note.\n" }, { "from": "human", "value": "import _ from 'underscore';\n\nexport const notes = state => state.notes;\nexport const targetNoteHash = state => state.targetNoteHash;\n\nexport const getNotesData = state ...
javascript
chosen
[ { "from": "system", "value": "[FIX] Add Item doesn`t appears instantly\n" }, { "from": "human", "value": "import { EventEmitter } from \"events\";\n\nimport dispatcher from \"../dispatcher\";\n\nclass BlogStore extends EventEmitter {\n constructor() {\n super();\n\n //this is a ...
javascript
chosen
[ { "from": "system", "value": "Set database connection params via database.json\n" }, { "from": "human", "value": "var Client = require('mariasql'),\n crypto = require('./crypto');\n\nvar c = new Client({\n host: '127.0.0.1',\n user: 'root',\n password: '',\n db: 'epicquest_development'\n}...
javascript
chosen
[ { "from": "system", "value": "REFACTOR TEST: Promise test no longer uses mooted collection callbacks\n" }, { "from": "human", "value": "var expect = require('chai').expect;\nvar asyncChainable = require('../index');\n\ndescribe('async-chainable.promise()', function() {\n\tvar output;\n\n\tbefore...
javascript
chosen
[ { "from": "system", "value": "Add test for implicit ip addresses\n" }, { "from": "human", "value": "'use strict'\n\n/* global describe, it */\n\nvar ipLocation = require('../')\nvar assert = require('assert')\n\nfunction randomInt () {\n return Math.round(Math.random() * 255)\n}\n\nfunction ran...
javascript
chosen
[ { "from": "system", "value": "Fix protocol check for site socket so that it actually works on https.\n" }, { "from": "human", "value": "import createNydus from 'nydus-client'\n\nconst location = window.location\nconst protocol = location.protocol === 'https' ? 'wss' : 'ws'\n\nconst siteSocket = ...
javascript
chosen
[ { "from": "system", "value": "Use Amplify to handle modal.andLoad and modal.onUnload\n" }, { "from": "human", "value": "/*\n * Place copyright or other info here...\n */\n\n(function(global, $){\n \n // Define core\n var codiad = global.codiad,\n scripts= document.getElementsByT...
javascript
chosen
[ { "from": "system", "value": "Check for clone options before continuing.\n" }, { "from": "human", "value": "// ==UserScript==\n// @name GitHubSourceTree\n// @namespace http://really-serious.biz/\n// @version 1.0\n// @description Adds a \"Clone in SourceTree\" button to github pages\n/...
javascript
chosen
[ { "from": "system", "value": "Add first test for computed property groupByPath\n" }, { "from": "human", "value": "import groupByPath from 'dummy/macros/group-by-path';\nimport { module, test } from 'qunit';\n\nmodule('Unit | Macro | group by path');\n\n// Replace this with your real tests.\ntest...
javascript
chosen
[ { "from": "system", "value": "Fix settings modal button position and size\n" }, { "from": "human", "value": "import EtherscanProxy from '@/wallets/web3-provider/etherscan-proxy';\nconst SERVERURL = 'https://api.etherscan.io/api';\nconst API_KEY = 'DSH5B24BQYKD1AD8KUCDY3SAQSS6ZAU175';\n\ndescribe...
javascript
chosen
[ { "from": "system", "value": "Convert object's length to unsigned integer first\n" }, { "from": "human", "value": "// forEach starting from last element\n\n'use strict';\n\nvar call = Function.prototype.call\n , assertCallable = require('../../Object/assert-callable')\n , toObject ...
javascript
chosen
[ { "from": "system", "value": "Fix home books to be the most recent\n" }, { "from": "human", "value": "import _ from 'underscore';\nimport db from 'dbContext';\n\nimport templatesHelper from '../views/helpers/templatesHelper.js';\nimport pagesHelper from '../views/helpers/pagesHelper.js';\n\nimpo...
javascript
chosen
[ { "from": "system", "value": "Add not found error (delete incidentupdates)\n" }, { "from": "human", "value": "import { deleteIncident, getIncidentUpdates, deleteIncidentUpdates } from '../utils/dynamoDB'\n\nexport async function handler (event, context, callback) {\n try {\n let incidentUpda...
javascript
chosen
[ { "from": "system", "value": "Add test for close in runner-interface\n" }, { "from": "human", "value": "'use strict'\n\nconst RunnerInterface = require(__source + 'runner-interface')\n\ndescribe('runner-interface', () => {\n beforeEach(() => {\n this.runnerInterface = new RunnerInterface()\n...
javascript
chosen
[ { "from": "system", "value": "Replace the width property animation and let css deal with setting the numbers\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.Component.extend({\n classNameBindings: [':sidebar', 'isCollapsed:collapsed'],\n\n applicationName:...
javascript
chosen
[ { "from": "system", "value": "Update server startup script to listen in on a port specified in the environment.\n" }, { "from": "human", "value": "// Server\n// ======\n// Main server startup script\n\n// Require dependencies\n// --------------------\nvar express = require('express'),\n app ...
javascript
chosen
[ { "from": "system", "value": "Use single quotes in test for everything except descriptions\n" }, { "from": "human", "value": "(function() {\n \"use strict\";\n\n describe(\"<%= pluginFullName %>\", function() {\n\n var slides, deck,\n\n createDeck = function() {\n slides = [];\n...
javascript
chosen
[ { "from": "system", "value": "Copy CSS from source to dist using Webpack\n" }, { "from": "human", "value": "const webpack = require(\"webpack\");\nconst path = require(\"path\");\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\nconst ExtractTextPlugin = require(\"extract-text-webpac...
javascript
chosen
[ { "from": "system", "value": "Remove vendor-exclude of react, it causes problems with RouterMixin.\n" }, { "from": "human", "value": "var webpack = require('webpack');\n\nvar node_dir = __dirname + '/node_modules';\n\nmodule.exports = {\n entry: ['./app/main.js'],\n output: {\n path: 'dist'...
javascript
chosen
[ { "from": "system", "value": "Set multi to true so all matching documents are updated\n" }, { "from": "human", "value": "// To mark expired and old alerts in the alerta database run this script from cron like so:\n// * * * * * /usr/bin/mongo --quiet monitoring /opt/alerta/sbin/removeExpiredAlert...
javascript
chosen
[ { "from": "system", "value": "Revert \"Remove need to call paramsFor on self\"\n\nThis reverts commit f190d4997853ced4d1982eb2f32388395594a994.\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';...
javascript
chosen
[ { "from": "system", "value": "Allow PeriodicRefresher to be force-refreshed\n" }, { "from": "human", "value": "import {autobind} from 'core-decorators';\n\nconst refreshMapPerUniqueId = new WeakMap();\n\nexport default class PeriodicRefresher {\n static getRefreshMap(uniqueId) {\n let refres...
javascript
chosen
[ { "from": "system", "value": "Test de cambio de dependencia en traduccion\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('core').controller('HeaderController', ['$scope', 'Authentication', 'Menus','$translate','$rootScope','$locale',\n\tfunction($scope, Authentication, Menus,...
javascript
chosen
[ { "from": "system", "value": "Fix bugs in user controller\n" }, { "from": "human", "value": "const User = require('../models').User;\n\nmodule.exports = {\n create(req, res) {\n return User\n .create({\n username: req.body.username,\n password: req.body.password,\n ...
javascript
chosen
[ { "from": "system", "value": "Discard notification of activities with null GroupId or type\n" }, { "from": "human", "value": "const axios = require('axios');\nconst activitiesLib = require('../lib/activities');\nconst slackLib = require('./slack');\n\nconst ACTIVITY_ALL = 'all';\n\nmodule.export...
javascript
chosen
[ { "from": "system", "value": "fix: Correct typo checkboses --> checkboxes\n\n[ci-skip]\n" }, { "from": "human", "value": "\r\n/**\r\n * Configurable settings for `ivh-treeview`\r\n *\r\n * @package ivh.treeview\r\n * @copyright 2014 iVantage Health Analytics, Inc.\r\n */\r\n\r\nangular.module('i...
javascript
chosen
[ { "from": "system", "value": "Set Promise to be Bluebird globally\n\ncloses #9064\n" }, { "from": "human", "value": "var moment = require('moment-timezone');\n\n/**\n * force UTC\n * - you can require moment or moment-timezone, both is configured to UTC\n * - you are allowed to use new Date(...
javascript
chosen
[ { "from": "system", "value": "Support Native Props For Lists\n" }, { "from": "human", "value": "import React from 'react';\nimport {\n ListView,\n} from 'react-native';\nimport { List, ListItem } from 'react-native-elements';\n\nimport EmptyView from '../EmptyView';\n\nexport default ({ loading...
javascript
chosen
[ { "from": "system", "value": "Add logs to app reloader\n" }, { "from": "human", "value": "'use strict';\n\nvar server = require('mano/lib/client/server-sync')\n , isReadOnlyRender = require('mano/client/utils/is-read-only-render')\n , reload = function () { window.location.href = '/'; };\n\nmo...
javascript
chosen
[ { "from": "system", "value": "Implement numbers divisible by 3 and 5\n" }, { "from": "human", "value": "var pingPongOutput = function(inputNumber) {\n if(inputNumber % 3 === 0) {\n return \"ping\";\n } else if (inputNumber % 5 === 0) {\n return \"pong\";\n } else {\n return inputNumb...
javascript
chosen
[ { "from": "system", "value": "Add var to variable declaration.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar dir = __dirname;\nvar root = dir + '/../..';\n\nrequire(root + '/src/foam.js');\n\nvar outDir = dir + '/build/src'\nsrcDirs = [\n global.FOAM_ROOT,\n dir + '/src',\n];\n...
javascript
chosen
[ { "from": "system", "value": "Include new build files from previous commit.\n" }, { "from": "human", "value": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst yargs = require(\"yargs\");\nconst allOptions = {\n count: {\n alias: 'c',\n de...
javascript
chosen
[ { "from": "system", "value": "Use Chrome_travis_ci (instead of Chrome) on Travis\n" }, { "from": "human", "value": "/* eslint-env node */\n\n'use strict';\n\nmodule.exports = function (config) {\n config.set({\n basePath: 'public',\n browsers: ['Chrome'],\n files: ['scripts/modules.js'...
javascript
chosen
[ { "from": "system", "value": "Revert \"refactor: add progress reporter back in for karma tests\"\n\nThis reverts commit c69ef2d06d27aa453bad35d55e7f30fa24cbafe1.\n" }, { "from": "human", "value": "module.exports = function (config) {\n config.set({\n basePath: './',\n frameworks: ['jasmin...
javascript
chosen
[ { "from": "system", "value": "Add first() to array to return first element of the array\n" }, { "from": "human", "value": "function l (text) {\n\tconsole.log(text);\n}" }, { "from": "gpt", "value": "Array.prototype.first = function () {\n return this.length ? this[0] : null;\n};\n...
javascript
chosen
[ { "from": "system", "value": "Remove jwt and document/facecapture complete from redux\n" }, { "from": "human", "value": "import objectAssign from 'object-assign'\nimport * as constants from '../../constants'\n\nconst initialState = {\n jwt: null,\n authenticated: false,\n supportsWebSockets: ...
javascript
chosen
[ { "from": "system", "value": "Correct PeriodicTable.showElement to use \"this.elements\"\n" }, { "from": "human", "value": "var PeriodicTable = function() {\n this.board = new Array;\n\n this.elements = new Object;\n for(var row = 0; row < 9; row++) {\n var tableRow = new Array;\n for(v...
javascript
chosen
[ { "from": "system", "value": "Make lowest priority value highest priority" }, { "from": "human", "value": "let sortMetaLawsFirst = (a, b) => {\n if (a.meta && !b.meta) return -1\n if (b.meta && !a.meta) return 1\n\n return a.priority > b.priority\n}\n\nlet selectBestLaw = (allLaws, lawType) =...
javascript
chosen
[ { "from": "system", "value": "Allow all for snapshot app\n" }, { "from": "human", "value": "var app = require('express')();\nvar dom = require('..');\nvar URL = require('url');\n\napp.get('*', function(req, res, next) {\n\tvar url = req.query.url;\n\tif (!url) return res.sendStatus(404);\n\tdom(...
javascript
chosen
[ { "from": "system", "value": "Fix for loading icon that wasn't displayed anymore for homepage's random sentence.\n\ngit-svn-id: 776ea4b3e47339c5b8782ec5e9346c740e073fb4@802 e0e46c49-be69-4f5a-ad62-21024a331aea\n" }, { "from": "human", "value": "/*\n Tatoeba Project, free collaborativ creation...
javascript
chosen
[ { "from": "system", "value": "Change anchor placement to avoid flash\n" }, { "from": "human", "value": "(function($) {\n // SVG polyfill\n svg4everybody();\n\n // Deep anchor links for headings\n anchors.options = {\n placement: 'right',\n visible: 'touch',\n ico...
javascript
chosen
[ { "from": "system", "value": "Reorganize the code a bit.\n" }, { "from": "human", "value": "var express = require('express');\nvar webpack = require('webpack');\nvar webpackDevMiddleware = require('webpack-dev-middleware');\nvar webpackHotMiddleware = require('webpack-hot-middleware');\nvar yarg...
javascript
chosen
[ { "from": "system", "value": "Set profile to load before post is rendered.\n" }, { "from": "human", "value": "define(function (require) {\n\n 'use strict';\n\n var $ = require('jquery'),\n Backbone = require('backbone'),\n PostView = require('views/post'),\n PostModel ...
javascript
chosen
[ { "from": "system", "value": "Use dependencies instead of required, all or nothing\n" }, { "from": "human", "value": "export default {\n type: 'object',\n properties: {\n page: {\n type: 'integer',\n default: 1,\n minimum: 1,\n required: true,\n },\n limit: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix Redux devtool extension error for unsupported browsers\n" }, { "from": "human", "value": "/* eslint-disable no-underscore-dangle */\n/* global DEVELOPMENT */\n\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport thunkMiddleware from 'redux-th...
javascript
chosen
[ { "from": "system", "value": "Add newline at end of file\n" }, { "from": "human", "value": "export default {\n draw_label_collision_boxes : false,\n draw_label_texture_boxes : true\n}" }, { "from": "gpt", "value": "export default {\n draw_label_collision_boxes : false,\n ...
javascript
chosen
[ { "from": "system", "value": "Update sending request status message\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n $('#deleteAccountSubmitLabel').on('click',function(){\n var userID = $('#userIDValue').val();\n var verifyCode = $('#verifyCodeValue').val();\...
javascript
chosen
[ { "from": "system", "value": "Change watcher to include the lib dir\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n browserify: {\n RTCReceiver: {\n src: './RTCReceiver/main.js',\n ...
javascript
chosen
[ { "from": "system", "value": "Refactor error middleware to suppress redux actions after auth expires and always show correct logout reason error notification\n" }, { "from": "human", "value": "// import {replace} from 'react-router-redux'\nimport {authExpired} from 'shared/actions/auth'\nimport ...
javascript
chosen
[ { "from": "system", "value": "Remove thunk add canvas middleware\n" }, { "from": "human", "value": "import { createStore, applyMiddleware, compose } from 'redux';\nimport { persistState } from 'redux-devtools';\nimport thunk from 'redu...
javascript
chosen
[ { "from": "system", "value": "Use theme propeties in CTAButton styled component\n" }, { "from": "human", "value": "import theme from 'react/styles/theme';\nimport GenericButton from 'react/components/UI/GenericButton';\nimport styled from 'styled-components';\n\nconst CTAButton = styled(GenericB...
javascript
chosen
[ { "from": "system", "value": "Fix require path for NoHostServer.js\n" }, { "from": "human", "value": "/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4,\nmaxerr: 50, browser: true */\n/*global define, brackets */\n\ndefine(function (require, exports, module) {\n \"use s...
javascript
chosen
[ { "from": "system", "value": "Fix units on wallet info screen\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('copayApp.controllers').controller('walletInfoController',\n function ($scope, $rootScope, $timeout, profileService, configService, lodash, coloredCoins, walletServ...
javascript
chosen
[ { "from": "system", "value": "Disable no-useless-escape of eslint rule on repository regular expression line\n" }, { "from": "human", "value": "'use strict';\n\nvar rRepoURL = /^(?:(?:git|https?|git\\+https|git\\+ssh):\\/\\/)?(?:[^@]+@)?([^\\/]+?)[\\/:](.+?)\\.git$/;\nvar rGithubPage = /\\.githu...
javascript
chosen
[ { "from": "system", "value": "Use const in place of var\n" }, { "from": "human", "value": "import test from 'ava'\nimport gutil from 'gulp-util'\nimport gulpCssScss from './'\n\ntest('converts CSS to Scss', t => {\n t.plan(2)\n\n var cssScssStream = gulpCssScss();\n\n var actual = ':root {\\n...
javascript
chosen
[ { "from": "system", "value": "Use KEYBASE_RUN_MODE to find unix socket\n" }, { "from": "human", "value": "'use strict'\n\nimport BaseTransport from './rpc'\nimport fs from 'fs'\n\nclass DesktopTransport extends BaseTransport {\n constructor (incomingRPCCallback, writeCallback, connectCallback) ...
javascript
chosen
[ { "from": "system", "value": "Fix resize proportions on window resize\n" }, { "from": "human", "value": "document.addEventListener('DOMContentLoaded', onDocumentReady, false);\n\nfunction onDocumentReady() {\n var aside = document.querySelector('aside');\n var section = document.querySelector(...
javascript
chosen
[ { "from": "system", "value": "Update gradient labels to use signal directive.\n" }, { "from": "human", "value": "import {Perc, Label} from './constants';\nimport guideMark from './guide-mark';\nimport {TextMark} from '../marks/marktypes';\nimport {LegendLabelRole} from '../marks/roles';\n\nvar a...
javascript
chosen
[ { "from": "system", "value": "Remove size restriction on video display in example.\n" }, { "from": "human", "value": "/* globals React, AudioPlayer */\n\n// eslint-disable-next-line no-unused-vars\nfunction ExampleAudioPlayer() {\n return React.createElement(AudioPlayer.PlayerContextConsumer, {...
javascript
chosen
[ { "from": "system", "value": "Fix Apollo Client subscription test\n" }, { "from": "human", "value": "/* eslint-disable prefer-arrow-callback, func-names */\n/* eslint-env mocha */\nimport chai from 'chai';\nimport gql from 'graphql-tag';\nimport { Promise } from 'meteor/promise';\nimport { Apoll...
javascript
chosen
[ { "from": "system", "value": "Fix testing the wrong module\n" }, { "from": "human", "value": "\nvar rework = require('rework')\n , inline = require('../')\n , fs = require('fs')\n , assert = require('assert')\n , read = fs.readFileSync;\n\nfunction fixture(name) {\n return read('test/fixtur...
javascript
chosen
[ { "from": "system", "value": "Move common behaviour into selectItem function\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Rightmove Enhancement Suite\n// @namespace https://github.com/chigley/\n// @description Keyboard shortcuts\n// @include http://www.rightmove.co...
javascript
chosen
[ { "from": "system", "value": "Change default day to 'empty' day for testing\n" }, { "from": "human", "value": "import {Controller} from 'ringa';\nimport Repository from '../Repository';\nimport moment from 'moment';\n\n\nexport default class RepositoryController extends Controller {\n construct...
javascript
chosen
[ { "from": "system", "value": "Deploy logger and log levels\n" }, { "from": "human", "value": "var cluster = require('cluster');\n\n\n/**\n * The clustering stuff is courtesy of Rowan Manning\n * http://rowanmanning.com/posts/node-cluster-and-express/\n * 2014-2-28\n */\nif (cluster.isMaster) {\n...
javascript
chosen
[ { "from": "system", "value": "Send all sensor data to Azure IoTHub\n" }, { "from": "human", "value": "var GrovePi = require('node-grovepi').GrovePi;\nvar GrovePiSensors = require('./GrovePiSensors');\n\nvar Commands = GrovePi.commands;\nvar Board = GrovePi.board;\n\nvar DeviceCommunication = req...
javascript
chosen
[ { "from": "system", "value": "Add client keys to config\n" }, { "from": "human", "value": "module.exports = {\n\n // API Port\n port: 3000,\n\n // Log file (check for errors here)\n log: 'app.log',\n\n // Database to save users and other data to\n mongo: {\n uri: 'mongodb://localhost:27...
javascript
chosen