conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add refresh token service method\n" }, { "from": "human", "value": "angular.module('fleetonrails.controllers.login-controller', [])\n\n .controller('LoginController', ['$scope', 'LoginService', function ($scope, LoginService) {\n $scope.login = function ()...
javascript
chosen
[ { "from": "system", "value": "Create shortcut instances for each one." }, { "from": "human", "value": "var $ = document.getElementById.bind(document);\nvar exampleTests = require('./example-tests');\nvar Main = require('../src/main/main-controller');\n\nvar providedByAceEditor = function() {/* n...
javascript
chosen
[ { "from": "system", "value": "Set function to work with negative numbers as well\n" }, { "from": "human", "value": "export function capitalizeFirstLetter (string) {\n return string.charAt(0).toUpperCase() + string.slice(1)\n}\n\nexport function shortenNumber (number, decimals, abbreviate) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add recipient param to ls and agent to scope\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('geboRegistrantHaiApp')\n .controller('AccountCtrl', function ($scope, Token) {\n\n $scope.friends = [];\n\n /**\n * init\n */\n $scope....
javascript
chosen
[ { "from": "system", "value": "Fix bug from redirectUrl sent to auth0\n" }, { "from": "human", "value": "module.exports = {\n app_host_port: 'streetmix-staging.herokuapp.com',\n header_host_port: 'streetmix-staging.herokuapp.com',\n restapi: {\n baseuri: '/api'\n },\n facebook_app_id: '17...
javascript
chosen
[ { "from": "system", "value": "Include status code to 404 pages\n" }, { "from": "human", "value": "// @flow\n\nimport React, { Component } from 'react';\nimport withRedux from 'next-redux-wrapper';\nimport Error from 'next/error';\nimport { createStore } from '../store';\nimport { loadGame } from...
javascript
chosen
[ { "from": "system", "value": "Update to v0.5.2 for release\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Flight Management Computer for GeoFS\n// @description This extension adds an FMC which controls features such as VNAV, LNAV, route, progress information, etc.\n// @namespace ...
javascript
chosen
[ { "from": "system", "value": "Use /src/ unless running in the browser for easier debugging\n" }, { "from": "human", "value": "/**\n * The default irc-framework interface for nodejs\n * Usage: var IrcFramework = require('irc-framework');\n */\n\nmodule.exports.Client = require('./build/client');\...
javascript
chosen
[ { "from": "system", "value": "Modify Async && Sync Delete\n" }, { "from": "human", "value": "\n\"use strict\";\n\nvar fs = require('fs');\n\nexports.deleteFileSync = function(filePath, timeInterval) {\n function iterator(filePath, dirs) {\n var stat = fs.stat(filePath);\n if(sta...
javascript
chosen
[ { "from": "system", "value": "Set default max payload size to 5 MiB\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\nvar Hapi = require('hapi'),\n handlers = require('./handlers');\n\nvar server = Hapi.createServer(8000);\n\nserver.route([\n {\n ...
javascript
chosen
[ { "from": "system", "value": "Use string scanning instead of regex\n" }, { "from": "human", "value": "var debug = require('debug')('vmplate');\nvar vm = require('vm');\n\nmodule.exports = function vmplate(string, filename) {\n\n var script = vm.createScript(compile(string), filename || 'templat...
javascript
chosen
[ { "from": "system", "value": "Use a template literal to expand error messages\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nconst anybar = require('anybar');\nconst captureExit = require('capture-exit');\nconst exec = require('child_process').exec;\n\ncaptureExit.c...
javascript
chosen
[ { "from": "system", "value": "Add indentation to JSON in example\n" }, { "from": "human", "value": "/**\n * This basic example shows how to fetch updates to a deal.\n *\n * It starts by fetching the first deal from the account and then fetches 10 latest updates of this deal.\n *\n * Usage:\n * n...
javascript
chosen
[ { "from": "system", "value": "Use callback for polyfill loading" }, { "from": "human", "value": "import { getOptions, stringifyRequest } from 'loader-utils'\n\nmodule.exports = function (content, sourceMap) {\n this.cacheable()\n\n const options = getOptions(this)\n const { buildId, modules }...
javascript
chosen
[ { "from": "system", "value": "Reduce LED count to 350.\n" }, { "from": "human", "value": "var offgrid = require('./build/Debug/offgrid');\n\noffgrid.init(575);\n\n// Selectively re-export and/or wrap offgrid methods.\nexports.blank = offgrid.blank;\nexports.red = offgrid.red;\nexports.green = of...
javascript
chosen
[ { "from": "system", "value": "Update `concatStreams` to use `Buffer.concat`\n\nNow it is possible to concat binary files.\n" }, { "from": "human", "value": "module.exports = concatStreams;\n\nfunction concatStreams(readables, writable) {\n var fn = function asyncRead(s) {\n return new Promis...
javascript
chosen
[ { "from": "system", "value": "Clear local Storage on cancel\n" }, { "from": "human", "value": "function something()\n{\n var x = window.localStorage.getItem('bbb');\n x = x * 1 + 1;\n window.localStorage.setItem('bbb', x);\n\n alert(x);\n}\n\nfunction add_to_cart(id)\n{\n var key = 'product...
javascript
chosen
[ { "from": "system", "value": "Add empty onUnload to pass test\n" }, { "from": "human", "value": "const core = require(\"sdk/view/core\");\nconst hotkeys = require(\"sdk/hotkeys\");\nconst tabs = require(\"sdk/tabs\");\nconst windows = require(\"sdk/windows\").browserWindows;\n\nconst helpers = r...
javascript
chosen
[ { "from": "system", "value": "[fix] Add fix for \"no ca\" case.\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs'),\n path = require('path');\n\n/*\n * function readSsl (options, callback)\n * Reads the SSL certificate information in the\n * specified options:\n *\n * ...
javascript
chosen
[ { "from": "system", "value": "Refactor to take out form logic into its own function\n" }, { "from": "human", "value": "'use strict';\n\nconst choo = require('choo');\nconst html = require('choo/html');\nconst app = choo();\n\n\napp.model({\n state: {\n todos: [],\n },\n reducers: {\n ad...
javascript
chosen
[ { "from": "system", "value": "Revert \"Remove the 'end' type from format()\"\n\nThis reverts commit aff79b167029fa45c3bef6af187d795e1b012cd1.\n" }, { "from": "human", "value": "var util = require('util');\n\nvar mochaFormatter = {\n suite: \"describe('%s', function () {\",\n test: \"it('%s');...
javascript
chosen
[ { "from": "system", "value": "Use timeout to handle very slow node on some platforms\n\n[closes #17]\n" }, { "from": "human", "value": "'use strict';\n\nvar childProcess = require('child_process');\nvar nodeBin = process.argv[0];\n\nmodule.exports = sleep;\nfunction sleep(milliseconds) {\n var ...
javascript
chosen
[ { "from": "system", "value": "Create a new image element instead of changing the image src. This is a potential fix to a memory issue in Chromium.\n" }, { "from": "human", "value": "$(function() {\n var $body = $('body'),\n $caption = $('#caption'),\n $img = $('#main-image');\...
javascript
chosen
[ { "from": "system", "value": "Use yargs to parse the command line args\n" }, { "from": "human", "value": "var Fs = require(\"fs\")\n , ArcAssembler = require(\"./lib\")\n ;\n\nconst OUTPUT_FILE = __dirname + \"/out\"\n , INPUT_FILE = __dirname + \"/Test.asm\"\n ;\n\nvar outputStream = Fs...
javascript
chosen
[ { "from": "system", "value": "Add fetch polyfill for IE\n" }, { "from": "human", "value": "import Route from '@ember/routing/route';\nimport ResetScrollPositionMixin from 'frontend/mixins/reset-scroll-position';\n\nexport default Route.extend(ResetScrollPositionMixin, {\n model() {\n const h...
javascript
chosen
[ { "from": "system", "value": "feat: Remove style after image loaded\n" }, { "from": "human", "value": "\nexport default function lazyLoader (images: NodeList<HTMLElement>): void {\n const callback = function(entries, observer) { \n for (let entry of entries) {\n if (entry.isIntersecting...
javascript
chosen
[ { "from": "system", "value": "Fix previous error. Add require('./models/task')\n\nFix previous error. Add require('./models/task')\n\nContact: 0a00ae03c9edd21d50a229f9fa1f98d9b3912b9e@isla.io\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express(); \nvar htt...
javascript
chosen
[ { "from": "system", "value": "Use proper base object for Performance panel overlay\n" }, { "from": "human", "value": "/* See license.txt for terms of usage */\n\n\"use strict\";\n\nconst { Trace, TraceError } = require(\"firebug.sdk/lib/core/trace.js\").get(module.id);\nconst { loadSheet, remove...
javascript
chosen
[ { "from": "system", "value": "Update the cipher list to pass ssllabs BEAST tests\n" }, { "from": "human", "value": "var fs = require('fs'),\n http = require('http'),\n https = require('https'),\n httpProxy = require('http-proxy')\n\nenvironment = process.env.NODE_ENV || 'production'\nco...
javascript
chosen
[ { "from": "system", "value": "Enforce no curly spacing in jsx\n" }, { "from": "human", "value": "var assign = require('object-assign');\nvar baseRules = require('./base');\nvar rules = assign(baseRules, {\n 'jsx-quotes': [2, 'prefer-single'],\n 'react/jsx-no-bind': 1,\n 'react/sort-comp': 0, ...
javascript
chosen
[ { "from": "system", "value": "Add update cache frequency option\n" }, { "from": "human", "value": "export default {\n authToken: process.env.AUTH_TOKEN || 'secret',\n env: process.env.NODE_ENV,\n host: process.env.HOST || 'localhost',\n github: {\n apiUrl: 'https://api.github.com',\n u...
javascript
chosen
[ { "from": "system", "value": "Replace double quotes with &quot;\n" }, { "from": "human", "value": "/**\r\n * Escapes a HTML string.\r\n * @param {String} html The HTML string to escape.\r\n * @returns {String} The escaped string.\r\n */\r\nfunction escapeHTML(html) {\r\n return html.replace(/...
javascript
chosen
[ { "from": "system", "value": "Add position and zoom in project\n" }, { "from": "human", "value": "'use strict'\n\nconst Model = require('trails-model')\n\n/**\n * @module Project\n * @description Workspace group by users\n */\nmodule.exports = class Project extends Model {\n\n static config () ...
javascript
chosen
[ { "from": "system", "value": "Create containers to hold music data\n\nI.e. empty arrays for songs, artists, albums, and favorites\n" }, { "from": "human", "value": "'use strict';\n\n/* Controllers */\n\nangular.module('myApp.controllers', [])\n .controller('HomeController', ['$scope', function(...
javascript
chosen
[ { "from": "system", "value": "[DASH-2334] Fix randomly failing plan usage e2e tests\n" }, { "from": "human", "value": "import instances from '../../tempInstances';\nimport { addTestNamePrefixes } from '../../utils';\nimport _ from 'lodash';\n\nexport default addTestNamePrefixes({\n tags: ['plan...
javascript
chosen
[ { "from": "system", "value": "Add simple track cart state management to Vuex store.\n" }, { "from": "human", "value": "import localforage from 'localforage';\nimport Vue from 'vue'\nimport Vuex from 'vuex'\nimport SpotifyWebApi from 'spotify-web-api-js'\n\nimport App from './App.vue'\n\nVue.use(...
javascript
chosen
[ { "from": "system", "value": "Replace the uses of window with global\n" }, { "from": "human", "value": "window.ReflectionVariable = require('./ReflectionVariable');\nwindow.ReflectionAssignedFunctionExpression = require('./ReflectionAssignedFunctionExpression');\nwindow.ReflectionFunctionExpress...
javascript
chosen
[ { "from": "system", "value": "Correct implementation of joinParams() helper\n" }, { "from": "human", "value": "export default {\n /**\n * Naive polyfill for Object.assign()\n * Why I did it? Because even modular lodash adds too much code in final build\n * @param {Object} target\n...
javascript
chosen
[ { "from": "system", "value": "Fix redis error => If redis client subscribed a key, it cannot run another commands.\n" }, { "from": "human", "value": "import SocketIO from 'socket.io';\nimport { createClient } from 'redis';\n\nimport { redisUrl } from './config';\n\nconst io = SocketIO();\n\nio.u...
javascript
chosen
[ { "from": "system", "value": "Add new line character after output" }, { "from": "human", "value": "/*\n * grunt-dredd\n * https://github.com/mfgea/grunt-dredd\n *\n * Copyright (c) 2014 Matias Gea\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nvar Dredd = require('dredd');\n\nmodul...
javascript
chosen
[ { "from": "system", "value": "Replace e removed during build by _error" }, { "from": "human", "value": "module.exports = function(grunt) {\n return grunt.registerMultiTask('mkdir', 'Make directories.', function() {\n var options;\n options = this.options({\n mode: null,\n create...
javascript
chosen
[ { "from": "system", "value": "test: Use local variables instead of globals\n" }, { "from": "human", "value": "expect =require('chai').expect;\nfs = require('fs');\nPNG = require('png-js');\nQrCode = require('../dist/index.js');\n\nit('should work with basic image', function(done) {\n\n c = fs...
javascript
chosen
[ { "from": "system", "value": "Create line break for icons div.\n" }, { "from": "human", "value": "import React from 'react';\nimport icons from '../weather_icons/WeatherIcons';\n\nconst TenDay = ({ tenDayForecast }) => {\n if (!tenDayForecast) {\n return null;\n }\n const forecastArray = t...
javascript
chosen
[ { "from": "system", "value": "Move methods to module scope\n\n\n\nFormer-commit-id: cc0e31d8f83f92fb8240f2cf88839322b4ce36b4" }, { "from": "human", "value": "import {\n PositionalAudio,\n AudioListener,\n AudioLoader\n} from 'three';\n\nexport default class PositionalAudioModule {\n construc...
javascript
chosen
[ { "from": "system", "value": "Disable keyboard shortcut if target element is an input element.\n" }, { "from": "human", "value": "define(function (require) {\n\tvar documentKeyboardHandler = require(\"utilities/documentKeyboardHandler\");\n\n\tvar keyboardShortcuts = function (eventBus) {\n\t\td...
javascript
chosen
[ { "from": "system", "value": "Add basic widget create/destroy tests.\n" }, { "from": "human", "value": "( function() {\r\n\t'use strict';\r\n\r\n\tdescribe( 'vui', function() {\r\n\r\n\t\tvar node;\r\n\r\n\t\tbeforeEach( function () {\r\n\t\t\tjasmine.addMatchers( d2l.jasmine.matchers );\r\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Add type annotations to prevent issues with planned Flow changes\n\nSummary:\nWe're planning a fix in Flow (D24112595) that uncovers some existing errors that were\npreviously suppressed. Adding these annotations prevents them from surfacing during the\ndeploy of the fix.\n\nCh...
javascript
chosen
[ { "from": "system", "value": "Adjust Cursors render method map to iterate through a normal array\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\nimport Cursor from './Cursor';\n\nclass Cursors extends Co...
javascript
chosen
[ { "from": "system", "value": "Add link to 404 example page\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react';\nimport {IndexLink, Link} from 'react-router';\nimport {connect} from 'react-redux';\n\n@connect(\n state => ({\n loggedIn: state.auth.loggedIn\n ...
javascript
chosen
[ { "from": "system", "value": "Stop serialising fields with no name\n" }, { "from": "human", "value": "'use strict';\n\nfunction setElementsValueByName(name, value) {\n var elements = document.getElementsByName(name);\n for(var i = 0; i < elements.length; i++) {\n elements[i].value = value;\...
javascript
chosen
[ { "from": "system", "value": "Make sure all functions are curried\n\nAn extra test was added to the testrunner. Non functions and curry\nitself are ignored.\n\nThe test checks that the result of calling the function with no\narguments is the function itself since this is a property of a curried\nfunction an...
javascript
chosen
[ { "from": "system", "value": "Fix gap left in status bar on OS X after quit\n" }, { "from": "human", "value": "// This file is ES5; it's loaded before Babel.\nrequire('babel/register')({\n extensions: ['.desktop.js', '.es6', '.es', '.jsx', '.js']\n})\n\nconst menubar = require('menubar')\nconst...
javascript
chosen
[ { "from": "system", "value": "Add 7th chords with alt names to the test\n" }, { "from": "human", "value": "const chordRegex = require('../src/chord-regex')\nconst tape = require('tape')\n\ntape('Regex against valid chords', function (test) {\n let chords = [\n 'C', 'D', 'E', 'F', 'G', 'A', '...
javascript
chosen
[ { "from": "system", "value": "Add flag to skip controller keyword assertion\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(/* environment, appConfig */) {\n return { };\n};\n" }, { "from": "gpt", "value": "'use strict';\n\nmodule.exports = function(/* ...
javascript
chosen
[ { "from": "system", "value": "Fix parsing error in ERR_NEEDMOREPARAMS\n" }, { "from": "human", "value": "\nvar\n\textend = req('/utilities/extend'),\n\tServerMessage = req('/lib/server/message'),\n\tReplyNumerics = req('/constants/reply-numerics'),\n\tCommandValidator ...
javascript
chosen
[ { "from": "system", "value": "Fix PUT request for marking as visite\n" }, { "from": "human", "value": "import Ember from \"ember\";\r\nimport ResetScroll from '../mixins/reset-scroll';\r\nimport config from '../config/environment';\r\n\r\nexport default Ember.Route.extend(ResetScroll, {\r\n\tmod...
javascript
chosen
[ { "from": "system", "value": "Change case for the import\n" }, { "from": "human", "value": "'use strict';\n\nconst BOSHManager = require('./bosh-manager/BOSHManager');\nconst BOSHBindManager = require('./bosh-manager/BOSHBindManager');\nconst BOSHTaskpoller = require('./bosh-manager/BOSHTaskpoll...
javascript
chosen
[ { "from": "system", "value": "Add `rel=\"noopener noreferrer\"` to external links on GDPR banner\n\nSee https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/\n\nThanks @ketan\n" }, { "from": "human", "value": "(function ($, dc) {\n \"use strict\";\n\n $(...
javascript
chosen
[ { "from": "system", "value": "Fix bug where the BPM calculated was wrong" }, { "from": "human", "value": "class BpmCounter {\n constructor() {\n this.numTaps = 0;\n this.bpm = 0;\n this.lastTappedTime = new Date();\n }\n\n restart() {\n this.numTaps = 0;\n this.bpm = 0;\n th...
javascript
chosen
[ { "from": "system", "value": "Correct configuration of the jest plugin\n" }, { "from": "human", "value": "// @flow\nmodule.exports = {\n env: {\n jest: true,\n },\n plugins: ['testing-library'],\n extends: ['plugin:jest/recommended', 'plugin:testing-library/react'],\n rules: {\n 'reac...
javascript
chosen
[ { "from": "system", "value": "Remove _k parameter from url. This is used for old browsers.\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App.js';\nimport Home from './components/Home';\nimport Programs from './components/Prog...
javascript
chosen
[ { "from": "system", "value": "Enable regex searching in search plugin\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.search').service('search', function(state, configurator) {\n var self = this;\n this.conf = configurator.configurationFor('search');\n this.name...
javascript
chosen
[ { "from": "system", "value": "Apply spoilers to embedded posts as well.\n" }, { "from": "human", "value": "(function() {\n\n Discourse.addInitializer(function () {\n\n var applySpoilers = function($post) {\n // text\n $('.spoiler:not(:has(img))', $post).removeClass('spoiler')\n ...
javascript
chosen
[ { "from": "system", "value": "Remove course management concerns from course page\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport * as courseActions from '../../actions/course...
javascript
chosen
[ { "from": "system", "value": "Update method creation syntax to ES6 FreeRotationAction.js" }, { "from": "human", "value": "L.FreeRotateAction = L.EditAction.extend({\n initialize: function(map, overlay, options) {\n options = options || {};\n options.toolbarIcon = {\n svg: true,\n ...
javascript
chosen
[ { "from": "system", "value": "Revert target dao key to non-local groupPermissionJunctionDAO\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2017 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam.RELATIONSHIP({\n cardinality: '*:...
javascript
chosen
[ { "from": "system", "value": "Fix tests for client bootstrap\n\nAdd tests for ready classes\n" }, { "from": "human", "value": "define([\n 'client/client_bootstrap',\n 'client/controllers/dashboard'\n],\nfunction (bootstrap, DashboardController) {\n describe('client bootstrap', function () {\n...
javascript
chosen
[ { "from": "system", "value": "Make an anonymous JS func now named for re-usability.\n" }, { "from": "human", "value": "\n'use strict';\n\n// We assume this JS is sourced at the end of any HTML, avoiding the\n// need for a $(document).ready(…) call. But it really needs the\n// document fully load...
javascript
chosen
[ { "from": "system", "value": "Add scope variable for current nav tab\n" }, { "from": "human", "value": "angular.module('controllers', [])\n\n.controller('NavCtrl', function ($scope) {\n\n})\n\n.controller('HomeCtrl', function ($scope, json) {\n\n var data = json.data\n var width = 200\n var m...
javascript
chosen
[ { "from": "system", "value": "Load and test for admin users.\n" }, { "from": "human", "value": "module.exports = function(access) {\n 'use strict';\n\n let _ = require('lodash');\n let projectAccessCache = {};\n return {\n find: find,\n clear: clear,\n validateAc...
javascript
chosen
[ { "from": "system", "value": "Change TTS voice to sound more like yoda, voice name = bruce\n" }, { "from": "human", "value": "$(document).ready(function() {\n\n $('#show').on('click', displayList);\n $('#hide').on('click', hideList); \n $('.say').on('click', sayText); \n\n $(window).bind(\"p...
javascript
chosen
[ { "from": "system", "value": "Set command reducer memo to undefined\n" }, { "from": "human", "value": "import {Command} from '@grid/core/command';\nimport {noop} from '../utility';\n\nexport class Composite {\n\tstatic func(list, reduce = noop, memo = null) {\n\t\treturn (...args) => {\n\t\t\tfo...
javascript
chosen
[ { "from": "system", "value": "Fix test helper for setting up a test session.\n" }, { "from": "human", "value": "/* global vfs */\nimport {\n TextureConfigurator, ArticlePackage,\n EditorSession,\n ArticleAPI, createEditorContext,\n VfsStorageClient, TextureArchive, InMemoryDarBuffer\n} from ...
javascript
chosen
[ { "from": "system", "value": "[FEATURE] Update user links in angular to get resources.\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('publicApp')\n .controller('UsersCtrl', ['$scope', '$http', '$location', '$route', '$routeParams', 'UserService', function ($scope, $http, $l...
javascript
chosen
[ { "from": "system", "value": "Attach menu sections to place\n" }, { "from": "human", "value": "var mongoose = require('mongoose'),\r\n ObjectId = mongoose.Schema.Types.ObjectId,\r\n Product = require('./product');\r\n\r\nvar menuSectionSchema = new mongoose.Schema({\r\n title: String,\r...
javascript
chosen
[ { "from": "system", "value": "Add App global object for sanity\n" }, { "from": "human", "value": "import SkypeService from '../services/skype';\n\nexport function initialize(application) {\n application.register('service:skype', SkypeService, { initialize: true, singleton: true });\n}\n\nexpo...
javascript
chosen
[ { "from": "system", "value": "Add tests for isBitSet and setBit\n" }, { "from": "human", "value": "jest.dontMock('../util');\nlet {toCharCodeArray, simpleHashFn} = require('../util');\n\ndescribe('toCharCodeArray', function() {\n it('returns an array of proper char codes', function() {\n expe...
javascript
chosen
[ { "from": "system", "value": "Add 'inline-block' to status-bar item for proper margin-left" }, { "from": "human", "value": "'use babel'\n\nexport default class StatusBarItem {\n constructor () {\n this.element = document.createElement('a')\n this.element.className = 'line-ending-tile'\n ...
javascript
chosen
[ { "from": "system", "value": "Set offset from gameplan offset\n" }, { "from": "human", "value": "var React = require('react');\nvar DrawingArea = require('./drawing_area');\n\nmodule.exports = React.createClass({\n // TODO chat.offsetWidth or gameplan.offsetLeft (+5 border size of\n // drawing...
javascript
chosen
[ { "from": "system", "value": "Update for newly-added validateOnSubmit prop.\n" }, { "from": "human", "value": "// Removes component props that shouldn't be set on the form control.\nconst cleanProps = (props) => {\n\n const {\n\n // These props come from formsy-react\n // https:...
javascript
chosen
[ { "from": "system", "value": "Read in settings when loading settings page.\n" }, { "from": "human", "value": "function done(){\n\tconsole.log('nailed that done');\n\tvar userName=document.getElementById('userInput').value;\n\tvar time=document.getElementById('timeInput').value;\n\twindow.localSt...
javascript
chosen
[ { "from": "system", "value": "Add missing task `grunt test`\n\nThis command for test is documented in\n[README.md#from-the-cli](https://github.com/emberjs/data#from-the-cli).\n" }, { "from": "human", "value": "var matchdep = require('matchdep');\nmodule.exports = function(grunt){\n\n matchdep.f...
javascript
chosen
[ { "from": "system", "value": "Add method to check whether a user is a study administrator\n" }, { "from": "human", "value": "isic.models.StudyModel = girder.Model.extend({\n resourceName: 'study',\n\n /**\n * Add a user to the study.\n */\n addUser: function (userId) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add wait cursor when loading folder create menu\n" }, { "from": "human", "value": "// folder-create-menu.js\n\njQuery(function($) {\n $('#create-menu').one('click', function() {\n $.ajax({\n type: 'GET',\n url: $('#create-menu-json')[...
javascript
chosen
[ { "from": "system", "value": "Use ES6 bits in gruntfile\n\nReference #42\n" }, { "from": "human", "value": "/*global module, require*/\nmodule.exports = function(grunt){\n 'use strict';\n\n var gruntConfig = {\n pkg: grunt.file.readJSON('package.json')\n };\n\n\n // lint\n grunt.loadNpmT...
javascript
chosen
[ { "from": "system", "value": "Fix readdir -> writeFileSync to write filenames once\n" }, { "from": "human", "value": "const express = require('express');\nconst fs = require('fs');\nconst app = express();\nconst port = 3000;\nconst gifFolder = './public/gifs';\n\nlet fileNames = [];\n\napp.use(e...
javascript
chosen
[ { "from": "system", "value": "Fix ensure secure connection middleware\n" }, { "from": "human", "value": "const path = require('path')\nconst express = require('express')\n\nconst app = express()\n\nconst port = process.env.PORT ? process.env.PORT : 8081\nconst dist = path.join(__dirname, 'public...
javascript
chosen
[ { "from": "system", "value": "Mark notes as checkbox as checked if focus on textarea\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,...
javascript
chosen
[ { "from": "system", "value": "Change timeout time to 500, remove call for finishedLoading method\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 thi...
javascript
chosen
[ { "from": "system", "value": "Remove top padding from the iframe's wrapping div and set minimum height. Also, remove the .col-xs-12 class\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash');\nvar $ = require('jquery');\n\nfunction render(container, options) {\n contain...
javascript
chosen
[ { "from": "system", "value": "Add rules for validating property schema _type and units.\n" }, { "from": "human", "value": "module.exports = function(model) {\n return {\n mustExist: mustExist,\n mustNotExist: mustNotExist\n };\n\n function mustExist(what, modelName, done) ...
javascript
chosen
[ { "from": "system", "value": "Update Browsersync to watch correct directory for CSS.\n" }, { "from": "human", "value": "module.exports = {\n \"server\": {\n baseDir: \"./\"\n },\n \"files\": [\n \"assets/css/**/*.css\"\n ],\n \"browser\": \"default\",\n \"injectChanges\": true,\n \"...
javascript
chosen
[ { "from": "system", "value": "Convert number value to string\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react'\nimport FormBuilderPropTypes from '../FormBuilderPropTypes'\nimport DefaultTextField from 'component:@sanity/components/textfields/default'\n\nexport default cla...
javascript
chosen
[ { "from": "system", "value": "Fix regression - internal reflect lib changes!\n" }, { "from": "human", "value": "// satisfy ag-grid HTMLElement dependency\nHTMLElement = typeof HTMLElement === 'undefined' ? function () {} : HTMLElement;\nHTMLSelectElement = typeof HTMLSelectElement === 'undefined...
javascript
chosen
[ { "from": "system", "value": "Fix TimedEvent sets GUID twice\n\nTBR=nduca@chromium.org\nBUG=\n\nReview URL: https://codereview.appspot.com/12746044\n\ngit-svn-id: 3a56fcae908c7e16d23cb53443ea4795ac387cf2@896 0e6d7f2b-9903-5b78-7403-59d27f066143\n" }, { "from": "human", "value": "// Copyright (c)...
javascript
chosen
[ { "from": "system", "value": "domReady: Create a 'domReadyBuilder' and imporve algorithm\n" }, { "from": "human", "value": "/**\n * Execute a given function once the document has finished loading\n * @param {Function} cb - Function to execute once the document has finished loading\n */\nexport ...
javascript
chosen
[ { "from": "system", "value": "Configure Redux store to work with redux-devtools-extensions & react-native-debugger\n" }, { "from": "human", "value": "/**\n * @providesModule ZeroProj.Redux.Store\n */\n\n/* eslint-disable no-underscore-dangle */\n\nimport { applyMiddleware, createStore, compose }...
javascript
chosen
[ { "from": "system", "value": "Remove old option for tests\n" }, { "from": "human", "value": "var options = {\n dbname: 'yamb-test',\n storage: require('./storage')\n};\n\nif (process.env.yapi) {\n options.yapi = process.env.yapi;\n}\n\nmodule.exports = options;" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Append fields before files in FormData of request\n" }, { "from": "human", "value": "import registerListeners from './register-listeners';\n\nexport default ({ request, files, instance, progress }) =>\n new Promise(resolve => {\n const xhr = new XMLHttpRequest()...
javascript
chosen
[ { "from": "system", "value": "Fix destination at create account\n" }, { "from": "human", "value": "var baseUrl = \"http://marihachi.php.xdomain.jp/crystal-resonance\";\n$(function() {\n\t// ログイン処理\n\t$('#login-form').submit(function(e) {\n\t\te.preventDefault();\n\t\t$.ajax(baseUrl + \"/api/acco...
javascript
chosen