conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Set output target as UMD\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar webpack = require('webpack');\nvar prod = process.env.NODE_ENV === 'production';\n\nvar config = {\n devtool: prod ? null : 'eval',\n\n entry: [\n ...
javascript
chosen
[ { "from": "system", "value": "Update admin js for new admin UX\n" }, { "from": "human", "value": "import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PermissionGrid from 'flarum/components/PermissionGrid';\n\napp.initializers.add('flarum-approval', () => {\n extend(ap...
javascript
chosen
[ { "from": "system", "value": "[webpack] Disable uglifier and enable debugging in non-production mode" }, { "from": "human", "value": "var webpack = require('webpack');\n\nmodule.exports = {\n entry: './src/index.js',\n output: {\n path: __dirname + '/lib',\n filename: 'index.browser.js'\...
javascript
chosen
[ { "from": "system", "value": "Enable top level assets config" }, { "from": "human", "value": "var js = require('atomify-js')\n , css = require('atomify-css')\n , server = require('./lib/server')\n\nmodule.exports = atomify\n\nfunction atomify (opts, cb) {\n if (opts.css) css(opts.css, callbac...
javascript
chosen
[ { "from": "system", "value": "Enable source maps in demo\n" }, { "from": "human", "value": "module.exports = {\n entry: './docs/App.jsx',\n output: {\n filename: './docs/bundle.js'\n },\n devServer: { \n inline: true \n },\n module: {\n loaders: [\n {\n test: /\\.jsx?$...
javascript
chosen
[ { "from": "system", "value": "Add json loader and add historyApiFallback true\n" }, { "from": "human", "value": "const path = require('path')\n\nmodule.exports = {\n context: __dirname,\n entry: './js/ClientApp.js',\n devtool: 'eval',\n output: {\n path: path.join(__dirname, '/public'),\n...
javascript
chosen
[ { "from": "system", "value": "Remove writing to options object. This allows options parameter to be readonly\n" }, { "from": "human", "value": "\"use strict\";\n\nvar mischief = require('./mischief');\n\n// The only surface area for this module is the middleware factory\n// prototype defined her...
javascript
chosen
[ { "from": "system", "value": "Fix style text hiding on ThemeScreen\n" }, { "from": "human", "value": "import { StyleSheet } from 'react-native'\nimport { Colors, ApplicationStyles } from '../../Themes/'\n\nexport default StyleSheet.create({\n ...ApplicationStyles.screen,\n groupContainer: {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix query for active tickets on incorrect model\n" }, { "from": "human", "value": "import bookshelf from 'server/lib/db';\n\n\nconst User = bookshelf.Model.extend({\n tableName: 'users',\n\n opened() {\n return this.hasMany('Ticket', 'studentId');\n },\n clai...
javascript
chosen
[ { "from": "system", "value": "Allow numbers to be passed to get the protocol.\n" }, { "from": "human", "value": "//\n// Copyright (C) 2015 Seth Holladay.\n//\n// This Source Code Form is subject to the terms of the Mozilla Public\n// License, v. 2.0. If a copy of the MPL was not distributed w...
javascript
chosen
[ { "from": "system", "value": "Rework env tests to match against stdout.\n\nLame returns a exit code of 1 after displaying help, which makes Node\nthink an error has happened. For that test we are matching against\nerror. Lame indeed.\n" }, { "from": "human", "value": "\ndescribe('the environment...
javascript
chosen
[ { "from": "system", "value": "Add country and use user model\n\n" }, { "from": "human", "value": "import cuid from 'cuid';\nimport { database } from '@/config/firebase';\n\nexport default function Tipp(tipp = {}) {\n // Properties\n this.id = tipp.id || cuid();\n this.created = tipp.created |...
javascript
chosen
[ { "from": "system", "value": "Fix single quotes issues of Catalog.js\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport Catalog from '../Catalog/Catalog'\n\nclass Catalogs extends Component {\n constructor(props) {\n super(props)\n this.state = {catalogs: ...
javascript
chosen
[ { "from": "system", "value": "Check if setInterval().unref() exists before call\n\nTest if unref() exists before calling it. This allows node-resque to work in a browser context (such as an electron render process)." }, { "from": "human", "value": "// inspired by https://github.com/tj/node-bloc...
javascript
chosen
[ { "from": "system", "value": "Fix footer links colors on hover\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport { translate } from 'react-i18next'\n\nimport Link from '../../link'\n\nconst Sitemap = ({ t }) => (\n <ul className='links'>\n ...
javascript
chosen
[ { "from": "system", "value": "Add more tests for findWhere util function\n" }, { "from": "human", "value": "import { findWhere } from './utils';\n\ndescribe('Utils', () => {\n describe('findWhere', () => {\n it('finds the first item in a list where a predicate matches', () => {\n const ...
javascript
chosen
[ { "from": "system", "value": "Update min width and display for button." }, { "from": "human", "value": "import styled from 'styled-components';\nimport { darken, lighten } from 'polished';\nimport { pickColorFromProps } from '../utils';\n\nimport {\n buttonBackground,\n buttonColor,\n} from '....
javascript
chosen
[ { "from": "system", "value": "Add a touchend event to the admin menu. Hopefully helps IE11 Touch.\n" }, { "from": "human", "value": "/**\n This view is used for rendering the topic admin menu\n\n @class TopicAdminMenuView\n @extends Discourse.View\n @namespace Discourse\n @module Discourse\...
javascript
chosen
[ { "from": "system", "value": "Add support for Select placeholder option customization without `option.value: ''`\n\nFixes #72\n" }, { "from": "human", "value": "import React from 'react'\n//\nimport { buildHandler } from './util'\nimport FormInput from '../formInput'\n\nexport default function F...
javascript
chosen
[ { "from": "system", "value": "Switch to single quotes for consistency\n\nFor consistency's sake!\n" }, { "from": "human", "value": "angular.module(\"HydroZone\", [\n 'ngMaterial',\n 'ui.router'\n])\n.config(\n [\n '$mdThemingProvider',\n function($mdThemingProvider) {\n ...
javascript
chosen
[ { "from": "system", "value": "Add begin testing of point\n" }, { "from": "human", "value": "const chai = require('chai');\nconst assert = chai.assert;\n\nconst Player = require('../lib/player');\nconst Point = require('../lib/point');\nconst Vector = require('../lib/vector');\nconst Edge = requi...
javascript
chosen
[ { "from": "system", "value": "Fix upload api in tests\n" }, { "from": "human", "value": "var nock = require('nock');\nvar sinon = require('sinon');\nvar should = require('should');\nvar Client = require('../lib/client');\n\ndescribe('Client', function() {\n var TOKEN = 'test token';\n var serv...
javascript
chosen
[ { "from": "system", "value": "Add test references to root test runner\n" }, { "from": "human", "value": "/** @jsx React.DOM */\n\nrequire('./barchart-tests');\nrequire('./linechart-tests');\n" }, { "from": "gpt", "value": "/** @jsx React.DOM */\n\nrequire('./barchart-tests');\nrequir...
javascript
chosen
[ { "from": "system", "value": "Check window for Element state\n" }, { "from": "human", "value": "export default function(state, ctx, models, helper) {\n models.add(Element.prototype.getAttribute, helper.NoOp);\n models.add(Element.prototype.setAttribute, helper.NoOp);\n}\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Remove ember fastboot guard from build file and put it into index.js\n" }, { "from": "human", "value": "/*jshint node:true*/\n/* global require, module */\nvar EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n va...
javascript
chosen
[ { "from": "system", "value": "Allow staging redis to not ruin everything.\n" }, { "from": "human", "value": "'use strict';\nlet co = require('co');\nlet columnify = require('columnify');\nlet Heroku = require('heroku-client');\nlet api = require('./shared.js');\n\nmodule.exports = {\n topic: 'r...
javascript
chosen
[ { "from": "system", "value": "Change canvas size into 612x612\n" }, { "from": "human", "value": "\n(function() {\n\tvar frameContainer = document.getElementById(\"frame\");\n\tvar capturing = false;\n\n\tcamera.init({\n\t\twidth: 160,\n\t\theight: 120,\n\t\tfps: 30,\n\t\tmirror: true,\n\t\ttarge...
javascript
chosen
[ { "from": "system", "value": "Configure config file to Config.js properly\n" }, { "from": "human", "value": "import express from 'express';\nimport logger from 'morgan';\nimport bodyParser from 'body-parser';\n\nconst app = express();\n\napp.use(logger('dev'));\n\napp.use(bodyParser.json());\nap...
javascript
chosen
[ { "from": "system", "value": "Hide message form on success\n" }, { "from": "human", "value": "/**\n * @class Denkmal_Component_MessageAdd\n * @extends Denkmal_Component_Abstract\n */\nvar Denkmal_Component_MessageAdd = Denkmal_Component_Abstract.extend({\n\n /** @type String */\n _class: 'Denk...
javascript
chosen
[ { "from": "system", "value": "Use jQuery live events for radio button detection.\n\nAllow the field to be used in Django inlines.\n" }, { "from": "human", "value": "(function($)\n{\n $(document).ready(function(){\n var widgets = $(\"ul.any_urlfield-url_type\");\n widgets.find(\"input\").c...
javascript
chosen
[ { "from": "system", "value": "Handle not yet named avatars\n" }, { "from": "human", "value": "\nvar signifier = require('../plugs').first(exports.signifier = [])\nvar h = require('hyperscript')\n\nexports.needs = { signifier: 'first' }\n\nexports.gives = 'avatar_name'\n\nexports.create = functio...
javascript
chosen
[ { "from": "system", "value": "Add item object model import" }, { "from": "human", "value": "define(['mac/roman'], function(macRoman) {\n\n 'use strict';\n \n function open(item) {\n function onBlock(item, byteSource) {\n return byteSource.slice(0, 8).getBytes().then(function(headerByt...
javascript
chosen
[ { "from": "system", "value": "Add POST methods and refactor\n" }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\nvar options = {\n root: __dirname + '/public/'\n};\n\nfunction sendFile(req, res, addPath, ending) {\n res.sendFile(addPath + '/' + req.para...
javascript
chosen
[ { "from": "system", "value": "Add onChange handling -- part of STRIPES-85.\n" }, { "from": "human", "value": "import React from 'react';\nimport css from './FilterPaneSearch.css';\nimport Icon from '@folio/stripes-components/lib/Icon';\nimport Button from '@folio/stripes-components/lib/Button';\...
javascript
chosen
[ { "from": "system", "value": "Add example to README.md & update blueprint\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n description: 'pull leaflet.markercluster assets using bower',\n\n // locals: function(options) {\n // // Return custom template variables ...
javascript
chosen
[ { "from": "system", "value": "Fix plugin.withOptions() when no config function is passed\n" }, { "from": "human", "value": "function createPlugin(plugin, config) {\n return {\n handler: plugin,\n config,\n }\n}\n\ncreatePlugin.withOptions = function(pluginFunction, configFunction) {\n c...
javascript
chosen
[ { "from": "system", "value": "Switch imgae requests to https\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar $ = require('jquery');\n\nvar objects = [];\nvar requests = [\n\t[]\n];\n\nwindow.requests = requests;\n\nvar requestInProgress = false;\n\nfunction getRequest(deferred...
javascript
chosen
[ { "from": "system", "value": "Put the script loading in test in a try/catch because it was causing an error in certain cases with Opera.\n" }, { "from": "human", "value": "var loadScripts = function(js_files, onComplete){\n var len = js_files.length;\n var head = document.getElementsByTagN...
javascript
chosen
[ { "from": "system", "value": "Add cache buster to bundle.js\n" }, { "from": "human", "value": "import React from 'react'\nimport DocumentTitle from 'react-document-title'\n\nimport { prefixLink } from 'gatsby-helpers'\nimport { TypographyStyle } from 'utils/typography'\n\n\nmodule.exports = Reac...
javascript
chosen
[ { "from": "system", "value": "Fix tests, since a transformer was added\n" }, { "from": "human", "value": "/* global beforeEach, describe, expect, it */\n'use strict';\n\nimport { getClient } from 'ponyjs/api/client.js';\n\n\ndescribe('The API client interface', () => {\n\n it('should return t...
javascript
chosen
[ { "from": "system", "value": "Rewrite initialization code to use jokes_source.\n" }, { "from": "human", "value": "define(function() {\n\n var Util = require('lib/util');\n\n var Message = require('message');\n var HandlerAdaptor = require('handler_adaptor');\n var Pipeline = require('message...
javascript
chosen
[ { "from": "system", "value": "Add window maximize shortcut key (Return key) in External window.\n" }, { "from": "human", "value": "(function () {\n var nw = require(\"nw.gui\"),\n guiWin = nw.Window.get();\n\n window.onkeydown = function (e) {\n if ((e.ctrlKey || e.meta...
javascript
chosen
[ { "from": "system", "value": "Make marker visible on android\n" }, { "from": "human", "value": "// @flow\n\nimport * as React from 'react';\nimport { StyleSheet } from 'react-native';\nimport { Icon } from '@kiwicom/react-native-app-shared';\n\nimport Color from '../Color';\n\ntype Props = {|\n ...
javascript
chosen
[ { "from": "system", "value": "Update randomuser api to https\n" }, { "from": "human", "value": "// Random User API logic\nimport { receiveRandom } from '../actions/TodoServerActions';\nimport request from 'superagent';\n\nexport function getRandomApi() {\n request.get('http://api.randomuser.me/...
javascript
chosen
[ { "from": "system", "value": " Make Flappy Wumpus Great Again Ad Campaign!" }, { "from": "human", "value": "$(document).ready(function(){\n\n// Displaying random banner ads below the game\nvar bannerArray = [\n\t{\"url\":\"https://www.youtube.com/watch?v=POnldqfm3Rw\",\"banner\":\"img/trailerad....
javascript
chosen
[ { "from": "system", "value": "Make node not die on error\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nGLOBAL.WALLACEVERSION = \"Err\";\nGLOBAL.PLUGIN_CONTRIBUTORS = [];\n\n\nvar fs = require(\"fs\");\n\ntry {\n var p = JSON.parse(fs.readFileSync(__dirname+\"/package.json\"));\n ...
javascript
chosen
[ { "from": "system", "value": "Add '-c' flag to input and output a JSON AST\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar brushtail = require('./index'),\n fs = require('fs'),\n content;\n\nprocess.stdin.resume();\n\nif(process.argv.length > 2) {\n content = fs.readFileSync...
javascript
chosen
[ { "from": "system", "value": "OwnCloud: Fix JS error after closing dialog\n" }, { "from": "human", "value": "// This file is part of the Indico plugins.\n// Copyright (C) 2002 - 2022 CERN\n//\n// The Indico plugins are free software; you can redistribute\n// them and/or modify them under the ter...
javascript
chosen
[ { "from": "system", "value": "Fix protocol join group including the assigner metadata\n" }, { "from": "human", "value": "const Encoder = require('../../../encoder')\nconst { JoinGroup: apiKey } = require('../../apiKeys')\n\n/**\n * JoinGroup Request (Version: 0) => group_id session_timeout membe...
javascript
chosen
[ { "from": "system", "value": "Update defaults for CLI arguments\n" }, { "from": "human", "value": "var argv = require('minimist')(process.argv.slice(2));\nvar fs = require('fs');\nvar ngBoba = require('./ngBoba');\n\nif (argv.config) {\n\n\t// stores all the configuration for ng-boba\n\tvar conf...
javascript
chosen
[ { "from": "system", "value": "Update the path to the methods\n" }, { "from": "human", "value": "// Define DrupalAjaxRequest\nvar DrupalAjaxRequest = (function () {\n var fetchNode = function(node_id, callback) {\n Zepto.ajax(\n {\n url: Kiosk.contentUrl('node'),\n dataType...
javascript
chosen
[ { "from": "system", "value": "Update to use new computed property syntax\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nexport default Ember.ArrayController.extend({\n queryParams: ['query', 'offset'],\n query: null,\n offset: 0,\n increment: 20,\n\n queryField: Ember.comp...
javascript
chosen
[ { "from": "system", "value": "Add card hiding to track page\n" }, { "from": "human", "value": "function filter() {\n chrome.storage.local.get(\"state\", function(result) {\n if(result[\"state\"] == \"on\") {\n $(\"img.cover\").remove()\n }\n });\n}\n// Make sure that when we...
javascript
chosen
[ { "from": "system", "value": "Fix color picker being off screen\n" }, { "from": "human", "value": "'use strict';\n\nlet paper = require('js/index/paper-core.min');\n\n\nclass ColorPicker {\n\n /**\n * @param colorPickerObject jquery color picker object\n * @param defaultColor initial ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary Views object instantiation\n" }, { "from": "human", "value": "define([\n 'app',\n 'backbone',\n 'modules/diary/router'\n], function (App, Backbone, DiaryRouter) {\n\n var DiaryModule = App.module.extend({\n\n Views: {},\n\n ...
javascript
chosen
[ { "from": "system", "value": "Use focus/blur events so that touch and keyboard only users can see the overlay as well (SAAS-856)\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n angular.module('ncsaas')\n .directive('helpicon', ['$document', helpicon]);\n\n function helpi...
javascript
chosen
[ { "from": "system", "value": "Fix problem with translation sanitation (Danish characters appear as HTML entities on the page): we don't need to sanitize our translations themselves, just the parameters substituted in.\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n ang...
javascript
chosen
[ { "from": "system", "value": "Add loader js file for web client" }, { "from": "human", "value": "\n// SwellRT bootstrap script\n\n// A fake SwellRT object to register on ready handlers\n// before the GWT module is loaded\n\n\nwindow.SwellRT = {\n\n _readyHandlers: [],\n\n ready: function(handl...
javascript
chosen
[ { "from": "system", "value": "Define constant for the max epic count\n" }, { "from": "human", "value": "const localStorageKey = 'recent-epics';\n\nconst hasLocalStorage = () => {\n return typeof(Storage) !== \"undefined\"\n};\n\nconst getRecentEpics = () => {\n if (!hasLocalStorage) {\n ...
javascript
chosen
[ { "from": "system", "value": "Revert \"fix: Results blob incorrectly identifying tests as part of setup file\"\n\nThis reverts commit 602507f9410e57727848ab1786f4822f177b0d56.\n" }, { "from": "human", "value": "var Mocha = require('mocha');\nvar decycle = require('cycle').decycle;\n\nprocess.on(...
javascript
chosen
[ { "from": "system", "value": "Make sure app won't crash on missing user email\n" }, { "from": "human", "value": "const _ = require('lodash')\nconst excelWriter = require('./excel-writer')\nconst fs = require('fs')\nconst enums = require('../shared/enums')\n\nvar dateFormat = 'DD.MM.YYYY'\n\nexpo...
javascript
chosen
[ { "from": "system", "value": "Remove code that is not needed since do not need to react to bound values\n" }, { "from": "human", "value": "import Component from 'ember-forge-ui/components/ef-list-item';\nimport Ember from 'ember';\n\nconst {\n get\n} = Ember;\n\n/**\n * @module\n * @augments em...
javascript
chosen
[ { "from": "system", "value": "Fix restoreConsole test util not working properly\n" }, { "from": "human", "value": "const fs = require('fs');\n\nexport const makeAsyncCallback = (callbackValue) => {\n let promiseResolve;\n const promise = new Promise((resolve) => {\n promiseResolve = resolve...
javascript
chosen
[ { "from": "system", "value": "Move `jest.setTimeout` to module scope\n\nIt didn't work inside the `describe` block.\n" }, { "from": "human", "value": "import path from 'path';\nimport webpack from 'webpack';\nimport config from '../webpack.config';\n\ndescribe('example', () => {\n jest.setTimeo...
javascript
chosen
[ { "from": "system", "value": "[react-redux-subspace] Add string to prop types of mapState prop\n" }, { "from": "human", "value": "/**\n * Copyright 2017, IOOF Holdings Limited.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file...
javascript
chosen
[ { "from": "system", "value": "Add new function for newDomainSubmit\n\nThis submits the form and thus adds the new domain to the database.\n" }, { "from": "human", "value": "app.controller('DomainsCtrl', ['$scope', '$log', 'Domains',\n function($scope, $log, Domains) {\n $scope.domains ...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary logs and comments (used for debugging)\n" }, { "from": "human", "value": "function solvePassword() {\n $(\".js-mod-passwords .js-mod-passwords-word\").each(function() {\n wordOfInput = $(this).attr('js-data-word');\n arrayOfWordInput = word...
javascript
chosen
[ { "from": "system", "value": "Fix syntax error in UserForm\n" }, { "from": "human", "value": "Slipmat.Views.UserForm = Backbone.View.extend({\n\n tagName: \"form\",\n id: \"user-form\",\n template: JST[\"users/form\"],\n\n events: {\n \"submit .button-main\": \"submit\"\n },\n\n render:...
javascript
chosen
[ { "from": "system", "value": "Add save data to commentsRetriever\n" }, { "from": "human", "value": "\"use strict\";\n\nangular.module('arethusa.comments').factory('CommentsRetriever', [\n 'configurator',\n function(configurator) {\n var comments = {};\n var alreadyLoaded;\n\n function...
javascript
chosen
[ { "from": "system", "value": "fix(docs): Set GDPR cookie expiration date\n" }, { "from": "human", "value": "import { Cookies, Notify, openURL } from 'quasar'\n\nif (Cookies.has('gdpr') !== true) {\n Notify.create({\n message: `Our third-party tools use cookies, which are necessary for its fu...
javascript
chosen
[ { "from": "system", "value": ":green_heart: Fix Flow errors in locations module\n" }, { "from": "human", "value": "/* @flow */\n\n/**\n * Start the local workers.\n *\n * @return {void}\n *\n * $FlowFixMe\n */\nexport default function* foreman() {\n\tconsole.log('work, work!');\n}\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Add minor change, enforce coding style\n" }, { "from": "human", "value": "import { Meteor } from 'meteor/meteor';\n\nconst Elements = {};\n\nMeteor.Elements = Elements;\n\nElements.collection = new Meteor.Collection('Elements');\n\nElements.types = [\n { humanName:...
javascript
chosen
[ { "from": "system", "value": "Move statsd stats under default statsd prefix\n" }, { "from": "human", "value": "(function() {\n return {\n\t\tport: 8125,\n\t\tmgmt_port: 8126,\n\n\t\tpercentThreshold: [ 50, 75, 90, 95, 98, 99, 99.9, 99.99, 99.999],\n\n\t\tgraphitePort: parseInt(process.env.GRA...
javascript
chosen
[ { "from": "system", "value": "Add callback script to ubuntu installation workflow\n" }, { "from": "human", "value": "// Copyright 2015, EMC, Inc.\n\n'use strict';\n\nmodule.exports = {\n friendlyName: 'Install Ubuntu',\n injectableName: 'Task.Os.Install.Ubuntu',\n implementsTask: 'Task....
javascript
chosen
[ { "from": "system", "value": "Use proper name and args for setPassword\n" }, { "from": "human", "value": "'use strict';\n\nvar $ = require('jquery');\nvar $osf = require('js/osfHelpers.js');\nvar accountSettings = require('js/accountSettings.js');\nvar changePassword = require('js/setPassword');...
javascript
chosen
[ { "from": "system", "value": "Update npm-react error to point to autoflow\n" }, { "from": "human", "value": "var copyProperties = require('./lib/copyProperties');\n\nvar WARNING_MESSAGE = (\n 'It looks like you\\'re trying to use jeffbski\\'s React.js project.\\n' +\n 'The `react` npm package ...
javascript
chosen
[ { "from": "system", "value": "Fix minimum required runtime version\n" }, { "from": "human", "value": "module.exports = {\n Object: {\n clean: function clean(obj) {\n for (var key in obj) {\n if (JSON.stringify(obj[key]) == \"{}\" || !obj[key]) {\n delete obj[key];\n ...
javascript
chosen
[ { "from": "system", "value": "Fix redirection rule inside post comment route.\n" }, { "from": "human", "value": "var path = require('path');\nvar posts = require('data-post');\nvar express = require('express');\nvar app = module.exports = express();\n\napp.set('view engine', 'jade');\napp.set('v...
javascript
chosen
[ { "from": "system", "value": "Fix adapter endpoint (pantheon changed their urls…)\n" }, { "from": "human", "value": "/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType:...
javascript
chosen
[ { "from": "system", "value": "Upgrade CTA dialog will appear when import fails with error 8001\n" }, { "from": "human", "value": "var cdb = require('cartodb.js');\n\n/**\n * Error details view, to be used together with an error object from an import model.\n */\nmodule.exports = cdb.core.View.ex...
javascript
chosen
[ { "from": "system", "value": "Add message between form submit and API response\n" }, { "from": "human", "value": "'use strict';\n\n/* Controllers */\n\nangular.module('myApp.controllers', [])\n .controller('formController', function ($scope, $http) {\n\n $scope.formData = {};\n\n $scope.p...
javascript
chosen
[ { "from": "system", "value": "Make lodash be extended by prana utils, not the other way arround.\n" }, { "from": "human", "value": "var prana = require('prana');\nvar mkdirp = require('mkdirp');\nvar lodash = require('lodash');\n\n/**\n * Create a directory recursivelly.\n *\n * @param dir Direc...
javascript
chosen
[ { "from": "system", "value": "Remove sanitize from marked conf\n" }, { "from": "human", "value": "'use strict';\n\nimport {Pipe} from 'angular2/angular2';\nimport {JsonPointer} from './JsonPointer';\nimport marked from 'marked';\n\nmarked.setOptions({\n renderer: new marked.Renderer(),\n gfm: ...
javascript
chosen
[ { "from": "system", "value": "Update simple demo for latest Coquette." }, { "from": "human", "value": ";(function(exports) {\n var Game = function(canvasId, width, height, autoFocus) {\n var coq = new Coquette(this, canvasId, width, height, \"#000\", autoFocus);\n\n coq.entities.create(Pe...
javascript
chosen
[ { "from": "system", "value": "Add complete attribute to todo\n" }, { "from": "human", "value": "// Placehold showing handler structure\n// Stupid example using in memory array as data store\n\nvar todos = [\n { id: 1, title: \"Learn Hapi\" },\n { id: 2, title: \"Learn Ember\" }\n];\n\nexports....
javascript
chosen
[ { "from": "system", "value": "Add some js functions to the list of symbols that should not be renamed\n" }, { "from": "human", "value": "\"use strict\";\n\nvar InputController = {};\n\nwindow.sha1 = function() {};\nString.prototype.codePointAt = function(index) {};\n\n/**\n * @type {(function(Ob...
javascript
chosen
[ { "from": "system", "value": "Remove cached file from require so that they got actually reloaded\n" }, { "from": "human", "value": "/* Define configuration from local environment */\nconst SERVER_IP = process.env.OPENSHIFT_NODEJS_IP || 'localhost'\nconst SERVER_PORT = process.env.OPENSHIFT_NODEJ...
javascript
chosen
[ { "from": "system", "value": "Make yui doc generate links from the project root instead of the filesystem root\n" }, { "from": "human", "value": "var YUIDoc = require('broccoli-yuidoc');\nvar calculateVersion = require('./calculate-version');\nvar path = require('path');\n\nmodule.exports = ...
javascript
chosen
[ { "from": "system", "value": "Refactor duplicate GET requests code\n" }, { "from": "human", "value": "var models = require('../db/models.js');\nvar util = require('../core/utilities.js');\nmodule.exports = function(router) {\n\n //{x: float, y: float, z: float}\n router.get('/messages', functi...
javascript
chosen
[ { "from": "system", "value": "Add keyboard trigger for voice command/search.\n" }, { "from": "human", "value": "//open command bar\nMousetrap.bindGlobal(['shift+up'], function(e) {\n document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'\n ...
javascript
chosen
[ { "from": "system", "value": "Use plain ASCII for License.\n" }, { "from": "human", "value": "// ==========================================================================\n// Project: Ember Data\n// Copyright: ©2011-2013 Tilde Inc. and contributors.\n// Portions ©2011 LivingSocial ...
javascript
chosen
[ { "from": "system", "value": "Add option to configure package file.\n" }, { "from": "human", "value": "/**\n * grunt-npm-validate\n * https://github.com/joshuaspence/grunt-npm-validate\n *\n * Copyright (c) 2014 Joshua Spence\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nvar PJV =...
javascript
chosen
[ { "from": "system", "value": ":bug: Abort clickoutside for null target\n" }, { "from": "human", "value": "function getTest(el) {\n if (Array.isArray(el)) {\n return target => el.includes(target);\n }\n if (typeof el === 'function') {\n return target => el(target);\n }\n...
javascript
chosen
[ { "from": "system", "value": "Use webpack define to replace process.env\n\nThis is so we can use env vars on the client.\n" }, { "from": "human", "value": "module.exports = () => ({})\n" }, { "from": "gpt", "value": "const webpack = require('webpack')\n\nmodule.exports = () => ({\n ...
javascript
chosen
[ { "from": "system", "value": "Reorder functions to fix linting\n" }, { "from": "human", "value": "const escapeClass = str => String(str).replace(/[^a-z0-9]/g, '');\n\nconst escapeHTML = str => {\n const div = document.createElement('div');\n div.appendChild(document.createTextNode(str));\n...
javascript
chosen
[ { "from": "system", "value": "Implement Icon.update() for ComponentWidget fix\n" }, { "from": "human", "value": "/**\n * brightwheel\n *\n * Copyright © 2016 Allen Smith &lt;loranallensmith@github.com&gt;. All rights reserved.\n *\n * This source code is licensed under the MIT license found in t...
javascript
chosen
[ { "from": "system", "value": "Move export into line where class is defined\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2015, Yahoo Inc. All rights reserved.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\n\nimport {BaseStore} ...
javascript
chosen
[ { "from": "system", "value": "Add return statement for error\n" }, { "from": "human", "value": "var fs = require('fs')\nvar concat = require('concat-stream')\n\n// 'Usage: dat rows put <file-path-to-read> [--key=row-key-to-use]'\nmodule.exports = function (dat, opts, cb) {\n var args = opts._.s...
javascript
chosen
[ { "from": "system", "value": "Fix react path for commonjs build\n" }, { "from": "human", "value": "'use strict';\n\nvar path = require('path');\nvar parse = require('./parse');\n\nvar reactRuntimePath;\n\ntry {\n reactRuntimePath = require.resolve('react');\n} catch (ex) {\n reactRuntimePath =...
javascript
chosen
[ { "from": "system", "value": "Fix check for model messages\n" }, { "from": "human", "value": "/** @babel */\n/** @jsx etch.dom */\n\nimport _ from 'lodash'\nimport etch from 'etch'\n\nexport default class ErrorIndicator {\n constructor (model) {\n this.model = model\n\n etch.initialize(th...
javascript
chosen