conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make the syntax checker happy\n" }, { "from": "human", "value": "var Tracer = require('tracer');\n\nfunction Logger (options) {\n this.options = options;\n this.tracer = this._setupTracer(options.enabled);\n}\n\nLogger.prototype.info = function () {\n this.tracer...
javascript
chosen
[ { "from": "system", "value": "Handle non-string & non-buffer scenarios for the password transform\n" }, { "from": "human", "value": "'use strict';\n\nconst { getOr, toNumber } = require('lodash/fp');\nconst bcrypt = require('bcrypt');\n\nconst transforms = {\n password(value, context) {\n co...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary BaseChart test code\n" }, { "from": "human", "value": "import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport BaseChart from '../../../src/components/BaseChart';\nimport { createMockChart } from '../../test-util...
javascript
chosen
[ { "from": "system", "value": "Fix bug in legends magic.\n" }, { "from": "human", "value": "var LegendFactory = require('../editor/layers/layer-content-views/legend/legend-factory');\n\nvar onChange = function (layerDefModel) {\n var styleModel = layerDefModel.styleModel;\n var canSuggestLegend...
javascript
chosen
[ { "from": "system", "value": "Select text instead of move cursor to the end\n" }, { "from": "human", "value": "function redirectKeyword(keyword) {\n document.location.href = '/keyword/' + keyword;\n}\n\n$(document).ready(function() {\n $('#keyword-form #keyword-input').focus();\n\n $('#...
javascript
chosen
[ { "from": "system", "value": "Use alphabetic ordering of nls.\n" }, { "from": "human", "value": "define( function( require, exports, module ) {\n\t'use strict';\n\t\n\tmodule.exports = {\n\t\troot: true,\n\t\tde: true,\n\t\tes: true,\n\t\tfr: true,\n\t\tgl: true,\n\t\tit: true,\n\t\tsv: true,\n\...
javascript
chosen
[ { "from": "system", "value": "Use github flavoured markdown as before\n" }, { "from": "human", "value": "var path = require('path')\nvar marked = require('marked')\nvar nunjucks = require('nunjucks')\n\nvar parseDocumentation = function (files) {\n files.forEach(function (file) {\n nunjucks....
javascript
chosen
[ { "from": "system", "value": "Set search area circle size to 0 on reset.\n" }, { "from": "human", "value": "function clearEOIMarkers(scope) {\n // Remove existing markers.\n scope.placesOfInterestMarkers.forEach(function (markerObj) {\n scope.map.removeLayer(markerObj.marker);\n ...
javascript
chosen
[ { "from": "system", "value": "Add buster-istanbul subdir as output directory.\n" }, { "from": "human", "value": "module.exports.unit = {\n environment: 'node',\n rootPath: process.cwd(),\n sources: [\n 'lib/**/*.js'\n ],\n tests: [\n 'test/**/*.js'\n ],\n extensions: [\n require(...
javascript
chosen
[ { "from": "system", "value": "Update default route to include trailing slash.\n" }, { "from": "human", "value": "(function() {\n var app = angular.module('notely', [\n 'ui.router',\n 'notely.notes',\n 'notely.notes.service'\n ]);\n\n function config($urlRouterProvider) {\n $urlRou...
javascript
chosen
[ { "from": "system", "value": "Correct FAQ link on footer\n" }, { "from": "human", "value": "export const siteMapData = [\n {\n title: 'Tools',\n links: [\n { title: 'Country Profiles', href: '/countries' },\n { title: 'NDCs', href: '/ndcs-content' },\n { title: 'NDC-SDG Lin...
javascript
chosen
[ { "from": "system", "value": "Remove test.syncFileSystem.js from the load list as it doesn't exist.\n" }, { "from": "human", "value": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICE...
javascript
chosen
[ { "from": "system", "value": "Make symbol unions non opaque types\n" }, { "from": "human", "value": "// @flow\nexport opaque type WideBar = \"W\"\nexport const WIDE_BAR: WideBar = \"W\"\n\nexport opaque type NarrowBar = \"N\"\nexport const NARROW_BAR: NarrowBar = \"N\"\n\nexport opaque type Wide...
javascript
chosen
[ { "from": "system", "value": "Split dependencies out in webpack to reduce bundle size\n" }, { "from": "human", "value": "const path = require(\"path\");\n\nmodule.exports = {\n entry: path.resolve(__dirname, \"./source/index.js\"),\n\n externals: {\n buttercup: \"buttercup\"\n },...
javascript
chosen
[ { "from": "system", "value": "Add devtool: 'eval' for Chrome DevTools\n" }, { "from": "human", "value": "var webpack = require('webpack');\n\nmodule.exports = {\n entry: [\n 'webpack-dev-server/client?http://localhost:3000',\n 'webpack/hot/dev-server',\n './scripts/index'\n ],\n outp...
javascript
chosen
[ { "from": "system", "value": "Add babel preset on serverBuild\n" }, { "from": "human", "value": "const TerserJsPlugin = require('terser-webpack-plugin');\n\nconst serverBuild = {\n mode: 'production',\n entry: './src/twig.js',\n target: 'node',\n node: false,\n output: {\n ...
javascript
chosen
[ { "from": "system", "value": "Use fastest method for api calls other than search\n" }, { "from": "human", "value": "module.exports = {\n navigateFallback: '/index.html',\n runtimeCaching: [{\n urlPattern: /\\/api\\/search\\/.*/,\n handler: 'networkFirst',\n options: {\n cache: {\...
javascript
chosen
[ { "from": "system", "value": "Update items in Firebase on change\n\nInitially only read operators were implemented.\nThe following write operators are now supported:\n - Edit item\n - Delete item\n - Add item\n" }, { "from": "human", "value": "import { ActionTypes } from '../config/constants';\n...
javascript
chosen
[ { "from": "system", "value": "Use 2.x flavor of ember data in canary and beta.\n" }, { "from": "human", "value": "module.exports = {\n scenarios: [\n {\n name: 'default',\n dependencies: { }\n },\n {\n name: 'ember-1.13.8',\n dependencies: {\n 'ember': '1.13....
javascript
chosen
[ { "from": "system", "value": "Set protocol correctly ... oops\n" }, { "from": "human", "value": "new Vue({\n el: '#app',\n\n // Using ES6 string litteral delimiters because\n // Go uses {{ . }} for its templates\n delimiters: ['${', '}'],\n\n data: {\n ws: null,\n message: '',\n ch...
javascript
chosen
[ { "from": "system", "value": "Create user adiciona json básico no arquivo\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst encryptor = require('./src/encryptor');\nconst argv = process.argv.slice(2);\n\nif(argv.length != 2) {\n console.log('Usage: node cr...
javascript
chosen
[ { "from": "system", "value": "Create the phone table when it existn't\n" }, { "from": "human", "value": "let db;\ntry {\n db = require(\"rethinkdbdash\")(require(\"../config\").connectionOpts);\n} catch (err) {\n console.error(\"You haven't installed rethinkdbdash npm module or you didn't ...
javascript
chosen
[ { "from": "system", "value": "Set atwho.js minLen param to 1 default was 0.\n" }, { "from": "human", "value": "jQuery(function( $ ) {\n\n var mOptions = $.extend({}, mOpt);\n console.log(mOptions);\n\n $('#cmessage').atwho({\n at: \"@\",\n displayTpl: \"<li>${username}<sma...
javascript
chosen
[ { "from": "system", "value": "Add validation for local component classes as well\nFirst try the official method, then fall-back to duck typing.\n" }, { "from": "human", "value": "import _ from 'lodash';\n\nexport default function canBeAsserted(vdom) {\n return _.all([].concat(vdom), node =>\n...
javascript
chosen
[ { "from": "system", "value": "Add tabbing to example insertion.\n" }, { "from": "human", "value": "'use babel';\n\nimport { TextEditor } from 'atom';\n\nexport default class EditorInserter {\n setText(text) {\n this.insertionText = text;\n }\n\n performInsertion() {\n if (...
javascript
chosen
[ { "from": "system", "value": "Use handlebars string format in distanceInWords localize function\n" }, { "from": "human", "value": "module.exports = function buildDistanceInWordsLocalizeFn () {\n var distanceInWordsLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n othe...
javascript
chosen
[ { "from": "system", "value": "Change position on model location change.\n" }, { "from": "human", "value": "var PointView = Backbone.View.extend({\n\n initialize:function (options) {\n this.model = options.model;\n this.gmap = options.gmap;\n\n this.marker = new google.maps.Marker({\n ...
javascript
chosen
[ { "from": "system", "value": "Use Array.from({ length: n }, factory)\n\nPR-URL: https://github.com/metarhia/metasync/pull/306\n" }, { "from": "human", "value": "'use strict';\n\nconst poolified = Symbol('poolified');\n\nconst mixFlag = { [poolified]: true };\n\nconst duplicate = (factory, n) => ...
javascript
chosen
[ { "from": "system", "value": "Add jstests to jshint checks\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n qunit: {\n files: ['jstests/index.html']\n },\n jshint: {\n all: [\n ...
javascript
chosen
[ { "from": "system", "value": "Use correct tag with grunt-release\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json')\n });\n\n grunt.loadNpmTasks('grunt-release');\n\n grunt.re...
javascript
chosen
[ { "from": "system", "value": "Split Grunt tasks into “build” and “test”\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n shell: {\n rebuild: {\n command: 'npm install --build-from-source'\n...
javascript
chosen
[ { "from": "system", "value": "Add jshint to a test suite\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n qunit: {\n files: ['test/index.html']\n }\n });\n\n grunt.loadNpmTasks('grunt-contrib-qunit');\n\n // Default task.\n grunt.regist...
javascript
chosen
[ { "from": "system", "value": "Add a generic load method for routes\n\nSigned-off-by: Kaustav Das Modak <ba1ce5b1e09413a89404909d8d270942c5dadd14@yahoo.co.in>\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Finder Model - Main model that uses FinderJS\n *\n * @constructor\n */\nvar Fi...
javascript
chosen
[ { "from": "system", "value": "[change] Change the time of loading external CSS\n\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n input: 'src/*.css',\n dir: 'dist',\n use: [\n 'postcss-import',\n 'postcss-import-url',\n 'postcss-custom-properties',\n ...
javascript
chosen
[ { "from": "system", "value": "Enhance RB.Diff to be able to create new diffs.\n\nThe existing diff model didn't do very much, and was really meant for dealing\nwith existing diffs. This change adds some attributes and methods that allow it\nto be used to create new diffs.\n\nTesting done:\nUsed this in anot...
javascript
chosen
[ { "from": "system", "value": "Use Web Audio volume fading only if player has getMediaElement\n\n`pagefow-vr` player does not support accessing the media element\ndirectly.\n" }, { "from": "human", "value": "//= require_self\n//= require_tree ./volume_fading\n\npageflow.mediaPlayer.volumeFading =...
javascript
chosen
[ { "from": "system", "value": "Allow admin store credit memo to be changed using rails-ujs\n\nrails-ujs has a different api handling ajax events than jquery_ujs.\n\nThe former passes all the event information into the event.detail object\nwhile the latter accept different parameters. For more details see:\n\...
javascript
chosen
[ { "from": "system", "value": "Use green for console intro instead" }, { "from": "human", "value": "var Bot = require( 'nodemw' ),\n\treadline = require( 'readline' ),\n\tc = require( 'ansi-colors' ),\n\trl = readline.createInterface( {\n\t\tinput: process.stdin,\n\t\toutput: process.stdout\n\t} ...
javascript
chosen
[ { "from": "system", "value": "Update script name and namespace\n" }, { "from": "human", "value": "// ==UserScript==\n// @name Google Service List\n// @namespace wsmwason.google.service.list\n// @description List all Google services on support page, and auto redirect to product url.\n// ...
javascript
chosen
[ { "from": "system", "value": "Write new page parent select box bug fixed\n" }, { "from": "human", "value": "$.jlm.component('WriteNew', 'wild_posts.wf_index, wild_posts.wf_edit, wild_pages.wf_index, wild_pages.wf_edit', function() {\n \n $('#sidebar .add').click(function() {\n var b...
javascript
chosen
[ { "from": "system", "value": "Destroy idle timer instance after test has finished\n" }, { "from": "human", "value": "(function($) {\n/*\n\t\t======== A Handy Little QUnit Reference ========\n\t\thttp://docs.jquery.com/QUnit\n\n\t\tTest methods:\n\t\t\texpect(numAssertions)\n\t\t\tstop(increment)...
javascript
chosen
[ { "from": "system", "value": "Fix issues with HTMLBars parser transition.\n" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert');\nvar buildTemplateCompiler = require('../helpers/template-compiler');\n\ndescribe('Ember template compiler', function() {\n var templateC...
javascript
chosen
[ { "from": "system", "value": "Fix up style to meet requirements for build\n" }, { "from": "human", "value": "'use strict'\nvar path = require('path')\n\nmodule.exports = function (top, buildpath, pkg, log, next) {\n if (pkg.package.version !== pkg.oldPkg.package.version)\n log.warn('update-l...
javascript
chosen
[ { "from": "system", "value": "Check for error and print when waiting for a particular table status.\n" }, { "from": "human", "value": "exports.runWhenTableIs = function (tableName, desiredStatus, db, callback) {\n\n var describeParams = {};\n describeParams.TableName = tableName;\n\n db...
javascript
chosen
[ { "from": "system", "value": "Fix Finnish week start to Monday, add format\n\nFinns *always* start their week on Mondays.\r\n\r\nThe d.m.yyyy date format is the most common one." }, { "from": "human", "value": "/**\n * Finnish translation for bootstrap-datepicker\n * Jaakko Salonen <https://gith...
javascript
chosen
[ { "from": "system", "value": "Change month format from 'MM' to 'mm'." }, { "from": "human", "value": "/**\n * Macedonian translation for bootstrap-datepicker\n * Marko Aleksic <psybaron@gmail.com>\n */\n;(function($){\n $.fn.datepicker.dates['mk'] = {\n days: [\"Недела\", \"Понеделник\...
javascript
chosen
[ { "from": "system", "value": "Add a little under-the-hood tests.\n" }, { "from": "human", "value": "import { assertThat, equalTo, containsString } from 'hamjest';\n\ndescribe('The core function, `assertThat()`', () => {\n it('is a function', () => {\n const typeOfAssertThat = typeof assertTh...
javascript
chosen
[ { "from": "system", "value": "Replace `Layer` to `Clip` on Project structure spec`\n" }, { "from": "human", "value": "import Project from '../../src/project/project'\nimport Asset from '../../src/project/asset'\nimport Composition from '../../src/project/composition'\nimport TimeLane from '../.....
javascript
chosen
[ { "from": "system", "value": "Add new test for opening pages\n" }, { "from": "human", "value": "module.exports = {\n \"open index page\": function(browser) {\n browser\n .url(browser.globals.url)\n .waitForElementVisible(\"#index-view\", 3000)\n .assert...
javascript
chosen
[ { "from": "system", "value": "Add aliase for primary and secondary AMP modes.\n" }, { "from": "human", "value": "\n/**\n * WordPress dependencies\n */\nimport { activatePlugin, visitAdminPage } from '@wordpress/e2e-test-utils';\n\n/**\n * The allow list of AMP modes.\n */\nexport const allowedAM...
javascript
chosen
[ { "from": "system", "value": "Add canonical url for docs\n" }, { "from": "human", "value": "import React from 'react'\nimport Head from 'next/head'\nimport {MDXProvider} from '@mdx-js/react'\n\nimport IndexMDX from './index.mdx'\nimport CodeBlock from '../doc-components/CodeBlock'\n\nconst compo...
javascript
chosen
[ { "from": "system", "value": "Add Input White List Checker to Utility\n" }, { "from": "human", "value": "module.exports = {\n generateQueryString: function (data) {\n var ret = []\n for (var d in data)\n if (data[d])\n ret.push(encodeURIComponent(d) + \"=\" + encodeURIComponen...
javascript
chosen
[ { "from": "system", "value": "Update to increase index insted of splicing first item off array.\n" }, { "from": "human", "value": "/**\n * Get a specified segment from the pathname.\n *\n * @param {String} pathname\n * @param {Number} segment\n * @return {Boolean}\n */\nexport function getPath...
javascript
chosen
[ { "from": "system", "value": "Change ref from string to callback\n" }, { "from": "human", "value": "import React from 'react'\nimport { Component } from 'react'\n\nclass InputHeader extends Component {\n focus = () => {\n this.refs.inputHeader.focus()\n }\n\n blur = () => {\n this.refs....
javascript
chosen
[ { "from": "system", "value": "Use token.hasRole to check for roles of other apps\n" }, { "from": "human", "value": "var UUID = require('./../uuid' );\n\nfunction forceLogin(keycloak, request, response) {\n var host = request.hostname;\n var headerHost = request.headers.host.split(':');\n var ...
javascript
chosen
[ { "from": "system", "value": "Make ARIA attrs actually update.\n" }, { "from": "human", "value": "$(function() {\n var panelContent = $('#panel-content');\n\n /**\n * Toggles the ARIA expanded and hidden attributes' state.\n *\n * @param Object elem The element on which to togg...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary whitespace from url string." }, { "from": "human", "value": "import * as ACTION_TYPES from '../constants/action_types'\n\nfunction extractToken(hash, oldToken) {\n const match = hash.match(/access_token=([^&]+)/)\n let token = !!match && match[1...
javascript
chosen
[ { "from": "system", "value": "Add comment to say this file isn't used.\n" }, { "from": "human", "value": "/*global chrome, console*/\n\nconsole.log(\"background.js\");\n\nchrome.runtime.getBackgroundPage(function() {\n console.log(\"getBackgroundPage\", arguments);\n});\n\nchrome.runtime.onMe...
javascript
chosen
[ { "from": "system", "value": "Load fuck my dom over https" }, { "from": "human", "value": "/**\n * Download FuckMyDom and call slowly()\n **/\n(function( window, document, undefined ) {\n\n var stag;\n\n if( !window.FuckMyDom ) {\n stag = document.createElement( 'script' );\n stag.setAtt...
javascript
chosen
[ { "from": "system", "value": "Use uglifyjs to minify instead" }, { "from": "human", "value": "javascript:(function(){$(\"tr.file-diff-line > td.diff-line-num-addition.empty-cell\").each(function(index,cell){var line=$(cell).parent().attr('data-line');var path=$(cell).parent().attr('data-path');v...
javascript
chosen
[ { "from": "system", "value": "Update for github commit settings\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport '../../css/style.css'\nimport FA from 'react-fontawesome'\n\n\n\nclass Footer extends Component {\n render(){\n return(\n <div cl...
javascript
chosen
[ { "from": "system", "value": "Add JSON Validator based on djv" }, { "from": "human", "value": "'use strict'\n\nconst { Fact, Rule, Operator, Engine } = require('json-rules-engine')\n\nclass ActiveRules {\n constructor () {\n this.Fact = Fact\n this.Rule = Rule\n this.Operator = Operato...
javascript
chosen
[ { "from": "system", "value": "Use sauce labs for e2e tests\n" }, { "from": "human", "value": "var HtmlReporter = require('protractor-html-screenshot-reporter');\n\nexports.config = {\n allScriptsTimeout: 11000,\n\n specs: [\n '*.js'\n ],\n\n multiCapabilities: [{\n 'browserName': 'ch...
javascript
chosen
[ { "from": "system", "value": "Handle not having loaded all projectdata yet\n\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\n\nexport default function ProjectInfo({ projectData }) {\n // console.log('projectData: ', projectData);\n const {\n urls,\n photo,\n...
javascript
chosen
[ { "from": "system", "value": "Convert the Zombie to a Prototype class." }, { "from": "human", "value": "function Zombie(map, location) {\n this._map = map;\n this._location = location;\n \n var markerimage = new google.maps.MarkerImage(\n \"res/zombie_meandering.png\",\n new goog...
javascript
chosen
[ { "from": "system", "value": "Make 'clear' command work on Windows.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n/**\n * Like GNU ncurses \"clear\" command.\n * https://github.com/mscdex/node-ncurses/blob/master/deps/ncurses/progs/clear.c\n */\n\nrequire('../../')(process.stdout)\n ...
javascript
chosen
[ { "from": "system", "value": "Change 'Scatter Plot' to 'Scatterplot'\n" }, { "from": "human", "value": "Settings = {\n chart: {\n padding: { right: 40, bottom: 80 },\n margins: { top: 30, bottom: 0, right: 35 },\n dots: {\n size: 5,\n color: '#378E00',\n opacity: 0.7\n ...
javascript
chosen
[ { "from": "system", "value": "Add logout link and method\n" }, { "from": "human", "value": "{\n angular\n .module('meganote.users')\n .directive('userLinks', [\n\n 'CurrentUser',\n\n (CurrentUser) => {\n\n class UserLinksController {\n user() {\n retur...
javascript
chosen
[ { "from": "system", "value": "Rename \"marker\" to \"nextAvailableIndex\" for better readability\n\n* Initialize poolSize with 1 (doubling 0 is not smart :)\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n function ObjectPoolMaker(Constructor, size) {\n var objectPool =...
javascript
chosen
[ { "from": "system", "value": "Call directly instead of sending\n" }, { "from": "human", "value": "import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\nimport { computed } from '@ember/object';\nimport ObjHash from './obj-hash';\nimport { unwrapper } from 'ember...
javascript
chosen
[ { "from": "system", "value": "Add request constants from spec\n" }, { "from": "human", "value": "var dgram = require('dgram');\r\n\r\nmodule.exports = {};" }, { "from": "gpt", "value": "/* Source Server Query (SSQ) library\r\n * Author : George Pittarelli\r\n *\r\n * SSQ protocol is ...
javascript
chosen
[ { "from": "system", "value": "Add openssl command to generate certificate\n" }, { "from": "human", "value": "//@ts-check\nconst fs = require(\"fs\");\nconst https = require('https');\nconst tls = require(\"tls\");\n\n\nmodule.exports = function (iface) {\n\t/** @type { import(\"tls\").TlsOptions...
javascript
chosen
[ { "from": "system", "value": "Support pass of reEvaluateScript options\n" }, { "from": "human", "value": "'use strict';\n\nvar normalizeOptions = require('es5-ext/object/normalize-options')\n , setPrototypeOf = require('es5-ext/object/set-prototype-of')\n , ensureObject = requir...
javascript
chosen
[ { "from": "system", "value": "Remove placeholder from state atom\n" }, { "from": "human", "value": "'use strict'\n\nvar zip = require('zippo')\nvar State = require('dover')\nvar Observ = require('observ')\nvar pipe = require('value-pipe')\nvar changeEvent = require('value-event/change')\nvar h =...
javascript
chosen
[ { "from": "system", "value": "Make `xit` and `xdescribe` not complain, they are shown after the test run anyways.\n" }, { "from": "human", "value": "module.exports = {\n parser: 'babel-eslint',\n extends: 'airbnb',\n globals: {\n before: true,\n beforeEach: true,\n after: true,\n ...
javascript
chosen
[ { "from": "system", "value": "Change mobx dependency version requirement from 2.3.x to 2.x\n" }, { "from": "human", "value": "import { Tracker } from 'meteor/tracker';\nimport { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions';\n\ncheckNpmVersions({\n 'mobx': '2.3.x'\n}, 'space:trac...
javascript
chosen
[ { "from": "system", "value": "Correct plugin name passed to constructor of PluginError.\n" }, { "from": "human", "value": "(function(){\n\t\"use strict\";\n\tvar gutil = require('gulp-util'),\n\t through = require('through2'),\n\t multimarkdown = require('multimarkdown');\n\n\tmodule.expor...
javascript
chosen
[ { "from": "system", "value": "Add excluded artist ids to suggested artist arguments\n" }, { "from": "human", "value": "import { GraphQLBoolean, GraphQLString, GraphQLInt } from \"graphql\"\n\nexport const SuggestedArtistsArgs = {\n artist_id: {\n type: GraphQLString,\n description: \"The ...
javascript
chosen
[ { "from": "system", "value": "Use data returned from PUT/POST after actions\n\nNow dates and other derived values should show up ok.\n" }, { "from": "human", "value": "'use strict';\nvar Reflux = require('reflux');\n\n\nmodule.exports = function(api, resource) {\n var asyncChildren = {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix editor font size brokenness\n" }, { "from": "human", "value": "import { SET_SETTINGS, EDITOR_DECREASE_FONT_SIZE, EDITOR_INCREASE_FONT_SIZE } from '../actions';\n\nconst initialState = {};\nconst MINIMUM_FONT_SIZE = 8;\n\nconst settings = (state = initialState, a...
javascript
chosen
[ { "from": "system", "value": "Enable cors for every route\n" }, { "from": "human", "value": "const express = require('express');\nconst bodyParser = require('body-parser');\nconst cors = require('cors');\n\nconst app = express();\n\napp.set('view engine', 'ejs');\napp.set('views', './')\n\napp.g...
javascript
chosen
[ { "from": "system", "value": "Add message for empty slide history\n" }, { "from": "human", "value": "import React from 'react';\nimport {connectToStores} from 'fluxible-addons-react';\nimport SlideHistoryStore from '../../../../stores/SlideHistoryStore';\nimport UserProfileStore from '../../../....
javascript
chosen
[ { "from": "system", "value": "Fix error checking for sentiment analysis\n" }, { "from": "human", "value": "\"use strict\";\nconst express = require('express');\nconst twilio = require('twilio');\nconst bodyParser = require('body-parser');\n\nconst app = express();\n\n// Run server to listen on p...
javascript
chosen
[ { "from": "system", "value": "Change the way a method is called\n" }, { "from": "human", "value": "window.$claudia = {\n imgAddLoadedEvent: function () {\n var images = document.querySelectorAll('.js-progressive-loading')\n\n // TODO: type is image ?\n // TODO: read data-...
javascript
chosen
[ { "from": "system", "value": "Return null when orientation isn't supported\n" }, { "from": "human", "value": "'use strict'\n\nvar window = require('global/window')\n\nmodule.exports = function screenOrientation () {\n var screen = window.screen\n if (!screen) return null\n var orientation = s...
javascript
chosen
[ { "from": "system", "value": "Mark as cacheable and use loader chaining shortcut values\n" }, { "from": "human", "value": "var loaderUtils = require('loader-utils');\nvar MessageFormat = require('messageformat');\n\nmodule.exports = function(content) {\n var query = loaderUtils.parseQuery(this....
javascript
chosen
[ { "from": "system", "value": "Add new methods to support keyup and keydown events\n" }, { "from": "human", "value": "import {Observable} from 'rx';\nimport keycode from 'keycode';\n\nexport function makeKeysDriver () {\n return function keysDriver() {\n return {\n presses (key) {\n ...
javascript
chosen
[ { "from": "system", "value": "Define localizable attrs for XUL elements\n\nDefine which attributes are localizable for the following XUL elements:\n\n key, menu, menuitem, toolbarbutton\n" }, { "from": "human", "value": "import { Localization } from './base';\nimport { overlayElement } from '...
javascript
chosen
[ { "from": "system", "value": "Fix the text alignment for the label\n" }, { "from": "human", "value": "import React from 'react'\nimport { Text, View } from 'react-native'\nimport styled from 'styled-components/native'\nimport defaultTheme from './theme'\n\nconst LabelWrapper = styled.View`\n fl...
javascript
chosen
[ { "from": "system", "value": "Move the selector matcher to OnceExit\n" }, { "from": "human", "value": "const { getRulesMatcher, getReset, createResetRule } = require(\"./lib\");\n\nfunction contains(array, item) {\n return array.indexOf(item) !== -1;\n}\n\nmodule.exports = (opts = {}) => {\n o...
javascript
chosen
[ { "from": "system", "value": "Add a workaround for requiring presets and options in the browser\n" }, { "from": "human", "value": "'use strict';\n\nvar babel = require('babel-core');\n\nexports.name = 'babel';\nexports.inputFormats = ['es6', 'babel', 'js'];\nexports.outputFormat = 'js';\n\n/**\n...
javascript
chosen
[ { "from": "system", "value": "Update to square to curly braces" }, { "from": "human", "value": "'use strict'\n\nrequire('eslint-plugin-html')\n\nmodule.exports = {\n settings: [\n 'html/html-extensions': ['.vue'],\n 'html/xml-extensions': []\n ],\n rules: {\n 'jsx-uses-vars': require...
javascript
chosen
[ { "from": "system", "value": "Fix \"Legend Position and Visibility\" example.\n" }, { "from": "human", "value": "var options = {\n container: document.getElementById('myChart'),\n data: [\n { label: 'Android', value: 56.9 },\n { label: 'iOS', value: 22.5 },\n { label: ...
javascript
chosen
[ { "from": "system", "value": "Hide search and delegate options\n" }, { "from": "human", "value": "// custom mods\ndocument.addEventListener(\"DOMContentLoaded\", function(event) {\n\n // hide email right/sharing menu entries (as they do not work with some imap servers)\n var hideElements = [\n...
javascript
chosen
[ { "from": "system", "value": "Check if ObjectId is type\n" }, { "from": "human", "value": "var Mystique = require('mystique');\nvar Mystique = require('mystique');\n\nvar getIdForModel = function(model, propertyName) {\n var prop = model.get(propertyName);\n if (typeof prop === 'string') {\n ...
javascript
chosen
[ { "from": "system", "value": "Make ajax proxy server flexible with HTTP and HTTPs\n" }, { "from": "human", "value": "/* remote ajax v 0.1.1 author by XericZephyr */\nvar rs = \"http://ajaxproxy.sohuapps.com/ajax\";\n\n(function($) {\n $.rajax = (function (url, obj) {\n \t(typeof(url)==\"ob...
javascript
chosen
[ { "from": "system", "value": "Use empty string for not existing properties.\n" }, { "from": "human", "value": "var $$ = React.createElement;\n\n// TextProperty\n// ----------------\n//\n\nvar TextProperty = React.createClass({\n displayName: \"TextProperty\",\n render: function() {\n var te...
javascript
chosen
[ { "from": "system", "value": "Fix definition of collection and model.\n" }, { "from": "human", "value": "define(['backbone'], function(B) {\n var M = {};\n\n M.Entry = B.Models.extend({});\n M.Entries = B.Models.extend({url: 'entries/data.json'});\n\n return M;\n});\n" }, { "from": "...
javascript
chosen
[ { "from": "system", "value": "Add wrapping modulators for js and rename amd.\n" }, { "from": "human", "value": "module.api = def(\n [\n module.runtime\n ],\n \n function (runtime) {\n var delegate = function (method) {\n return function () {\n runtime[method].apply(null, ar...
javascript
chosen
[ { "from": "system", "value": "Add model class with method.\n" }, { "from": "human", "value": "'use strict';\nimport backbone from 'backbone';\n\nclass Hello extends backbone.View {\n render() {\n this.$el.html('Hello, world.');\n }\n}\n\nvar myView = new Hello({el: document.getEleme...
javascript
chosen