conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Check that breaking the tests stops the build from going live.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports.getTodos = (userId) => Promise.resolve([]);\n\nmodule.exports.addTodo = (userId, todo) => Promise.resolve();\n\nmodule.exports.removeTod...
javascript
chosen
[ { "from": "system", "value": "Use colons in routes instead of brackets\n" }, { "from": "human", "value": "module.exports = function(string, data) {\n\n return string.replace(/{([^{}]*)}/g, function(original, match) {\n\n var result = data;\n\n var parts = match.split('.');\n\n ...
javascript
chosen
[ { "from": "system", "value": "Change transform option to jsx and not ts\n" }, { "from": "human", "value": "module.exports = {\n transform: {\n \"^.+\\\\.[jt]sx?$\": \"<rootDir>/jest-preprocess.js\",\n },\n moduleNameMapper: {\n \".+\\\\.(css|styl|less|sass|scss)$\": `identity-obj-proxy`...
javascript
chosen
[ { "from": "system", "value": "Build: Make Promises/A+ tests use the dot reporter instead of the default\n\nThe default reporter is very verbose as it prints all the test names it\r\nencounters. We already use the dot reporter for Karma tests.\r\n\r\nCloses gh-4313" }, { "from": "human", "value":...
javascript
chosen
[ { "from": "system", "value": "Allow app.json without templateType key\n\nThe v2 app.json should not have a templateType key in it. MeshInteraction\ndoes require that it is constructed with that key, at least until we\nrefactor it, so pass a blank string when the app.json does not contain\na templateType key...
javascript
chosen
[ { "from": "system", "value": "Fix build success message color" }, { "from": "human", "value": "import webpack from 'webpack'\nimport { logError } from '../util/log'\n\nexport default function buildAndDistribute ({ webpackConfig, watch }) {\n const compiler = webpack(webpackConfig)\n\n compiler...
javascript
chosen
[ { "from": "system", "value": "Add description to repository field\n" }, { "from": "human", "value": "define(function() {\n return codebox.settings.schema(\"packages\",\n {\n \"title\": \"Package Control\",\n \"type\": \"object\",\n \"properties\": {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix issues with Babel transpilation\n" }, { "from": "human", "value": "module.exports = {\n presets: [\n '@babel/preset-env',\n '@babel/preset-react',\n ],\n plugins: [\n ['@babel/plugin-transform-runtime', {\n corejs: false,\n regenerator: fal...
javascript
chosen
[ { "from": "system", "value": "Create container for both car make and model pickers\n" }, { "from": "human", "value": "import React from 'react-native';\nconst {\n Image,\n TouchableOpacity,\n StyleSheet,\n Text,\n View,\n} = React;\n\nimport globalVariables from '../styles/globalVariables.j...
javascript
chosen
[ { "from": "system", "value": "Add admin label and icon to account general view\n\n" }, { "from": "human", "value": "import React from \"react\";\nimport { capitalize, map } from \"lodash-es\";\nimport { connect } from \"react-redux\";\nimport { Label } from \"react-bootstrap\";\n\nimport { Flex,...
javascript
chosen
[ { "from": "system", "value": "Fix item-item script to reference correct package\n" }, { "from": "human", "value": "/* Configuration script to run a pretty good item-item recommender. */\nrec.name = \"ItemItem\"\nrec.module = org.grouplens.reflens.knn.item.ItemRecommenderModule\nrec.module.knn.si...
javascript
chosen
[ { "from": "system", "value": "Define new release for Raven tracking\n" }, { "from": "human", "value": "import bootstrapper from \"bootstrapper\";\nimport \"css/app/app.scss\";\nimport Raven from 'raven-js';\n\nlet sentryDSN = 'https://27643f06676048be96ad6df686c17da3@app.getsentry.com/73366';\n\...
javascript
chosen
[ { "from": "system", "value": "Fix unreachable code in report modal.\n" }, { "from": "human", "value": "angular.module( 'gj.Report.Modal' ).controller( 'Report_ModalCtrl', function( $modalInstance, Game, User, Comment, Forum_Topic, Forum_Post, Growls, gettextCatalog, resource )\n{\n\tvar _this = ...
javascript
chosen
[ { "from": "system", "value": "Remove rendering semi colon on load icon\n" }, { "from": "human", "value": "import React, { Component } from \"react\";\nimport Octicon from \"react-octicon\";\nimport { Col } from \"react-bootstrap\";\n\nclass Load extends Component {\n render() {\n return (\n ...
javascript
chosen
[ { "from": "system", "value": "Test Depth First Search: Remove console logs\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst dfs = require('../../../src').algorithms.search.dfs;\nconst assert = require('assert');\n\ndescribe('DFS', () => {\n it('should perform dfs on a tree', () ...
javascript
chosen
[ { "from": "system", "value": "Print a message and leave if couldn't obtain invite link\n\nCloses #25\n" }, { "from": "human", "value": "'use strict';\n\n// Bot\nconst bot = require('../../bot');\nconst { replyOptions } = require('../../bot/options');\n\nconst { admin } = require('../../stores/us...
javascript
chosen
[ { "from": "system", "value": "Add what transport type we're using in the emails\n" }, { "from": "human", "value": "'use strict';\n\nconst path = require('path');\nconst nodemailer = require('nodemailer');\nconst transports = require('../transports');\n\nmodule.exports = class Emailer {\n\n cons...
javascript
chosen
[ { "from": "system", "value": "Add new method for adding members to a project\n" }, { "from": "human", "value": "Projects = new Mongo.Collection('projects');\n\nMeteor.methods({\n insertProject: function(projectAttributes) {\n check(Meteor.userId(), String);\n check(projectAttributes, {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove link view deprecation so jscs passes\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport TouchActionMixin from '../mixins/touch-action';\n\nlet LinkComponent = Ember.LinkComponent || Ember.LinkView;\n\nexport default LinkComponent.reopen(Tou...
javascript
chosen
[ { "from": "system", "value": "Fix image path on jekyll template\n" }, { "from": "human", "value": "var path = require('path');\nmodule.exports = function jekyllTemplate(answers) {\n return [\n '---',\n 'layout: post',\n 'date: ' + answers.date,\n 'duration: ' + answers.duration,\n ...
javascript
chosen
[ { "from": "system", "value": "Handle also .pm and .pl file types\n" }, { "from": "human", "value": "\"use babel\";\n\nfs = require('fs-plus')\n\n/**\n * This class provides the file-icons service API implemented by tree-view\n * Please see https://github.com/atom/tree-view#api\n */\nmodule.expor...
javascript
chosen
[ { "from": "system", "value": "Add a few methods to query builder\n" }, { "from": "human", "value": "Astro.QueryBuilder = function() {\n this.selector = {};\n this.options = {};\n};\n\n_.extend(Astro.QueryBuilder.prototype, {\n select: function(selector) {\n _.extend(this.selector, selector...
javascript
chosen
[ { "from": "system", "value": "Send email after store message from contactUs\n" }, { "from": "human", "value": "// TODO feedback to user when message has reached server, not just mini mongo\n\nMeteor.methods({\n addContactUsMessage: function(message) {\n ContactUsMessages.insert({\n name...
javascript
chosen
[ { "from": "system", "value": "Test to find working dir run for grunt test on TravisCI\n" }, { "from": "human", "value": "var assertions = require('../../assertions')(),\n should = assertions.chai.should(),\n sinon = assertions.sinon;\n\ndescribe('Given middleware for unhandled exceptions',...
javascript
chosen
[ { "from": "system", "value": "Fix url for otalk.im websocket endpoint\n" }, { "from": "human", "value": "var parts = window.location.hash.slice(1).split('&');\n\nparts.forEach(function (value) {\n if (value.substr(0, 12) === \"access_token\") {\n var token = value.substr(13);\n ...
javascript
chosen
[ { "from": "system", "value": "Fix wrong usage of fs.linkSync()\n" }, { "from": "human", "value": "\"use strict\";\n\nvar path = require(\"path\");\nvar fs = require(\"fs\");\n\nfunction linkPackage() {\n var packageName = require(\"../../package.json\").name;\n var nodeModules = path.resol...
javascript
chosen
[ { "from": "system", "value": "Update mongoDB address by env.\n" }, { "from": "human", "value": "var express = require('express'),\n app = express();\nvar scores = require('./server/routes/scores');\nvar users = require('./server/routes/users');\nvar chats = require('./server/routes/chats');\n...
javascript
chosen
[ { "from": "system", "value": "Set global promise library to bluebird\n" }, { "from": "human", "value": "'use strict';\n// configuration ===========================================\nrequire('dotenv').config();\nvar config = require('./app/config/config'); // general configuration\nvar app = requi...
javascript
chosen
[ { "from": "system", "value": "Refactor MeanQ to use Array.reduce().\n" }, { "from": "human", "value": "/**\n * checks if there are scores which can be combined\n */\nfunction checkValidity (scores) {\n if (scores == null) {\n throw new Error('There must be a scores object parameter')\n }\n ...
javascript
chosen
[ { "from": "system", "value": "Set the text area readOnly and added a onClick function.\n" }, { "from": "human", "value": "import React from 'react';\nimport CsvToSqlForm from './CsvToSqlForm'\n\nexport const ConvertCsv = (props) => (\n <div className=\"\">\n <CsvToSqlForm></CsvToSqlFor...
javascript
chosen
[ { "from": "system", "value": "Use Buffer.from (added in node v5.10) instead of deprecated new Buffer()\n\nFixes #3.\n" }, { "from": "human", "value": "module.exports = function(content) {\n this.cacheable && this.cacheable();\n this.value = content;\n\n return 'module.exports = new Buffer(\"'...
javascript
chosen
[ { "from": "system", "value": "Use match() in meteor methods to be able to use the \"audit-argument-checks\" MDG package - Part II\n" }, { "from": "human", "value": "/***\n * loggerSet - checks to see if the Logger object has been created on server\n * @returns {boolean} - return true if the Logg...
javascript
chosen
[ { "from": "system", "value": "Rename exported function to match package\n" }, { "from": "human", "value": "module.exports = LevelCommonFormProject\n\nfunction LevelCommonFormProject(levelup) {\n if (!(this instanceof LevelCommonFormProject)) {\n return new LevelCommonFormProject(levelup) }\n...
javascript
chosen
[ { "from": "system", "value": "Check if rule.selectors exists before forEach'ing over them\n" }, { "from": "human", "value": "/*jshint node: true, strict: false*/\nvar css = require('css');\n\nvar RULE = 'rule';\n\nmodule.exports = function(source) {\n if (this.cacheable) {\n this.cache...
javascript
chosen
[ { "from": "system", "value": "Move the weapon roll from the modifiers to main properties\n" }, { "from": "human", "value": "define([], function(){\n return {\n \"name\": {\n \"default\": \"New Item\",\n \"save\": true\n },\n \"id\": {\n \"...
javascript
chosen
[ { "from": "system", "value": "Remove unneeded css parser options\n" }, { "from": "human", "value": "\"use strict\";\n\nvar CssSelectorParser = require('css-selector-parser').CssSelectorParser\nvar cssSelector = new CssSelectorParser()\n\ncssSelector.registerSelectorPseudos('has');\ncssSelector.r...
javascript
chosen
[ { "from": "system", "value": "Use webhooks and ready for heroku!\n" }, { "from": "human", "value": "const Telegraf = require('telegraf');\nconst bot = new Telegraf(process.env.BOT_TOKEN);\n\nfunction repeatIt(messageText = '') {\n const timesPosition = messageText.indexOf(' ');\n const times =...
javascript
chosen
[ { "from": "system", "value": "Remove iopipe until promises are supported\n" }, { "from": "human", "value": "\nconst env = require('./env');\n\nconst config = require('./config.json');\nconst secrets = require('./secrets.json');\n\nenv(config);\nenv(secrets, true);\n\n// Setup env vars before req...
javascript
chosen
[ { "from": "system", "value": "Increase number of results to choose from\n" }, { "from": "human", "value": "#! /usr/bin/env node\n\nvar http = require('http');\n\n// http://www.reddit.com/r/jokes\n//\nvar request = http.get('http://www.reddit.com/r/oneliners/hot.json?limit=10', function (response...
javascript
chosen
[ { "from": "system", "value": "Fix VS Code integration when ESLint project outside VS Code project\n\nWhen an ESLint project is not in the root directory, e.g.\r\n\r\n+ our-project\r\n|--+ client\r\n| |--- src/\r\n| |--- package.json\r\n| |--- eslint-local-rules.js\r\n|--+ server\r\n| |--- stuff\r\n\r\nS...
javascript
chosen
[ { "from": "system", "value": "Remove --no-bin-links flag from default `npm rebuild` arguments.\n\nAfter recent discussion on https://github.com/meteor/meteor/issues/7401,\n@glasser and I think the relatively obscure benefit of --no-bin-links is\noutweighed by the problems it causes for packages whose rebuil...
javascript
chosen
[ { "from": "system", "value": "Include favicons in the main bundle\n\nRefs #354.\n" }, { "from": "human", "value": "/* eslint-disable no-var */\n\nvar autoprefixer = require('autoprefixer');\nvar path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n module: {\n lo...
javascript
chosen
[ { "from": "system", "value": "Check for offsetTop from body element as opposed to from parent\n" }, { "from": "human", "value": "define('editor-plugin-sticky-toolbar', [], function () {\n return function(toolbarNode, options) {\n return function() {\n var toolbarOffsetTop,\n sc...
javascript
chosen
[ { "from": "system", "value": "Load tasks now takes an object literal as parameter\n" }, { "from": "human", "value": "var fs = require('fs'),\n Path = require('path');\n\nvar parent = module.parent;\nvar parentFile = parent.filename;\nvar parentDir = Path.dirname(parentFile);\n\nmodule.exports...
javascript
chosen
[ { "from": "system", "value": "Add cleaner error messages for single-string options\n" }, { "from": "human", "value": "var request = require('request');\nvar Promise = require('bluebird');\nvar _ = require('lodash');\n\nvar internals = {\n convertJSONSafe: function(s){\n if(s && (typeof s ===...
javascript
chosen
[ { "from": "system", "value": "Change path to load global application configuration\n" }, { "from": "human", "value": "class ConfigLoader {\n\t/**\n\t * loadFromGlobal - load file from global configurations directory\n\t *\n\t * @param {string} file\n\t * @returns {Object}\n\t */\n\tstatic loadF...
javascript
chosen
[ { "from": "system", "value": "Enable secure, httpOnly cookie for production\n" }, { "from": "human", "value": "import koaRouter from 'koa-router';\nimport parse from 'co-body';\nimport bcrypt from 'bcrypt';\nimport jwt from 'jsonwebtoken';\n\nimport {Author} from '../storage/schemas';\n\nconst r...
javascript
chosen
[ { "from": "system", "value": "Add config folder path to node-config\n" }, { "from": "human", "value": "const sharedConfig = require('./universal')\nconst path = require('path')\nconst PATH_ROOT = path.resolve(__dirname, '../')\nconst resolve = file => path.resolve(PATH_ROOT, file)\n\nconst confi...
javascript
chosen
[ { "from": "system", "value": "Change buttons state for color and color picker after a click.\n" }, { "from": "human", "value": "var session = null;\n\n// instead of windows.onload\n$(document).ready( function() {\n // hide iphone/ipad URL bar\n //setTimeout(function() { window.scrollTo(0, ...
javascript
chosen
[ { "from": "system", "value": "Add fields required for reason & voting reason\n" }, { "from": "human", "value": "// A request from users for an article to be replied.\n// (articleId, userId, appId) should be unique throughout DB.\n//\nexport default {\n properties: {\n // The article ID and u...
javascript
chosen
[ { "from": "system", "value": "Remove conditional of window width for start carrousel logos\n" }, { "from": "human", "value": "/**\n * The Footer view.\n */\ndefine([\n 'jquery',\n 'backbone',\n 'slick'\n], function($,Backbone,slick) {\n\n 'use strict';\n\n var FooterView = Backbone.View.ext...
javascript
chosen
[ { "from": "system", "value": "Fix bug in students object creation\n" }, { "from": "human", "value": "var tweets = require('../public/javascripts/tweets');\n\nfunction load() {\n var students = {};\n for(var i=0; i<tweets.length; i++) {\n var name = tweets[i].user.name;\n var text = tweet...
javascript
chosen
[ { "from": "system", "value": "Use Schema for updating the OnlineUser-Entry to use the doc validation\n\nUnfortunately, the `update` method of our schema class does not support the `upsert`-option. So we check if the entry already exists and perform an insert or an update depending on the findOne result.\n" ...
javascript
chosen
[ { "from": "system", "value": "Make compass pointer consistent with LineChart\n" }, { "from": "human", "value": "import React from 'react';\n\nclass Compass extends React.Component {\n static defaultProps = {\n width: 100,\n height: 100,\n color: \"rgb(255, 128, 0)\"\n ...
javascript
chosen
[ { "from": "system", "value": "Remove param from datapoint store\n" }, { "from": "human", "value": "import _ from 'lodash'\nimport Reflux from 'reflux'\nimport StateMixin from'reflux-state-mixin'\nimport DatapointActions from 'actions/DatapointActions'\n\nvar DatapointStore = Reflux.createStore({...
javascript
chosen
[ { "from": "system", "value": "Add a count to support non sequential dialog closes\n" }, { "from": "human", "value": "import React, { Component, PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport { getNodeFromSelector } from './util';\n\n/**\n Provides an HOC component fo...
javascript
chosen
[ { "from": "system", "value": "Fix decimal limit of total to 2\n\nDecimal limit is fixed to 2 as earlier at some values the decimal limit were crossing this limit\n" }, { "from": "human", "value": "function update_price($this){\n var id = $this.data('id');\n\n // Calculate price for row\n ...
javascript
chosen
[ { "from": "system", "value": "Add optional icon in error dialog\n" }, { "from": "human", "value": "import React from 'react'\n\nexport default ({ message }) => (\n <div className={ 'error-dialog ' + (message ? 'visible' : 'hidden') }>\n <strong>{ message }</strong>\n </div>\n)\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Configure user object on creation\n" }, { "from": "human", "value": "Meteor.publish(\"userInfo\", function() {\n\treturn Meteor.users.find(this.userId, {\n\t\tfields: {\n\t\t\t\"admin\": 1,\n\t\t\t\"alive\": 1,\n\t\t\t\"target\": 1,\n\t\t\t\"assassinations\": 1\n\t\...
javascript
chosen
[ { "from": "system", "value": "Load tests immediately instead of onload\n" }, { "from": "human", "value": "window.addEventListener('load', function(){\n\n // mousedown\n\n module('mousedown', environment);\n\n test('should respond to mousedown', 1, function() {\n listen('mousedown...
javascript
chosen
[ { "from": "system", "value": "Fix Example to match new syntax" }, { "from": "human", "value": "const HeadlessChrome = require('../index')\n\nconst browser = new HeadlessChrome({\n headless: false\n})\nasync function navigateWebsite () {\n await browser.init()\n // Navigate to a URL\n await b...
javascript
chosen
[ { "from": "system", "value": "Fix bug - pick list name and property swapped.\n" }, { "from": "human", "value": "import declare from 'dojo/_base/declare';\nimport _ModelBase from 'argos/Models/_ModelBase';\nimport MODEL_NAMES from '../Names';\nimport getResource from 'argos/I18n';\n\nconst resour...
javascript
chosen
[ { "from": "system", "value": "Fix a simple lint issue\n" }, { "from": "human", "value": "// We need require React from NPM before working on these tests\n\n// import {describe, it} from 'mocha';\n// import {expect} from 'chai';\n// import {stub, spy} from 'sinon';\n// import {composer, depsMappe...
javascript
chosen
[ { "from": "system", "value": "Update to pass Travis build" }, { "from": "human", "value": "/* eslint-env browser */\n\n;(function() {\n try {\n const onMessage = ({ data }) => {\n if (!data.wappalyzer) {\n return\n }\n\n const { technologies } = data.wappalyzer || {}\n\...
javascript
chosen
[ { "from": "system", "value": "Fix unsupported `headers` and `status` of undefined\n" }, { "from": "human", "value": "\n/**\n * OAuth interceptor.\n */\n\nfunction oauthInterceptor($q, $rootScope, OAuthToken) {\n return {\n request: function(config) {\n config.headers = config.headers ||...
javascript
chosen
[ { "from": "system", "value": "Make sure we have a response before using it\n" }, { "from": "human", "value": "/*****************************\n* Updates the contacts collection since we've added a new field to the dataMap\n*/\nvar request = require(\"request\");\nvar logger = require(\"logger\");...
javascript
chosen
[ { "from": "system", "value": "Fix element(data) always returns 0" }, { "from": "human", "value": "/*\n * This file is part of the Sylius package.\n *\n * (c) Paweł Jędrzejewski\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this...
javascript
chosen
[ { "from": "system", "value": "[Address] Clean all inputs before filling in the address\n" }, { "from": "human", "value": "/*\n * This file is part of the Sylius package.\n *\n * (c) Paweł Jędrzejewski\n *\n * For the full copyright and license information, please view the LICENSE\n * file that w...
javascript
chosen
[ { "from": "system", "value": "Fix marking notifications as read\n" }, { "from": "human", "value": "Template.notificationItem.helpers({\n niceTime: function () {\n return moment(this.timestamp).fromNow();\n },\n notificationHTML: function () {\n return this.message();\n }\n});\n\nTempla...
javascript
chosen
[ { "from": "system", "value": "Update drawer to not be docked\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport AppBar from 'material-ui/AppBar';\nimport Drawer from 'material-ui/Drawer';\nimport Menu from 'material-ui/Menu';\nimport CustomMenuItem from '../Cust...
javascript
chosen
[ { "from": "system", "value": "Add error handling to delete team\n\n" }, { "from": "human", "value": "'use strict';\n\nconst Boom = require('boom');\nconst Team = require('../../models/Team');\n\nmodule.exports = (req, res) => {\n Team.findByIdAndRemove(req.params.id, (err, team) => {\n res({...
javascript
chosen
[ { "from": "system", "value": "Enable Enumerator tab for all Akvo users\n" }, { "from": "human", "value": "export const flagOrgs = {\n ENUMERATORS: new Set([43])\n}\n\nexport const shouldShowFlag = (orgs, orgSet) => {\n return orgs && orgs.findIndex(it => orgSet.has(it.id) || orgSet.has(it.cont...
javascript
chosen
[ { "from": "system", "value": "Fix centered addon for IE11\n" }, { "from": "human", "value": "const styles = {\n style: {\n position: 'fixed',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflo...
javascript
chosen
[ { "from": "system", "value": "Fix create example jobs reqire paths\n" }, { "from": "human", "value": "const config = require('./config/config');\nconst Mongoose = require('mongoose');\nconst Job = require('./src/models/job');\n\n//Mongoose connection\nvar mongoose = Mongoose.connect(config.mongo...
javascript
chosen
[ { "from": "system", "value": "Connect total user count in VoteCounter\n" }, { "from": "human", "value": "import { connect } from 'react-redux';\nimport VoteCounter from '../components/VoteCounter';\n\nconst mapStateToProps = state => ({\n voteCount: state.issues.length ? state.issues[state.issu...
javascript
chosen
[ { "from": "system", "value": "Use appliesToPhase to prevent running\n" }, { "from": "human", "value": "/* @flow */\n\nimport path from 'path'\n\nimport File from '../File'\nimport Rule from '../Rule'\n\nimport type { Phase } from '../types'\n\nexport default class CreateOutputTree extends Rule {...
javascript
chosen
[ { "from": "system", "value": "Add a limit to number of undoable actions\n" }, { "from": "human", "value": "import undoable from 'redux-undo-immutable';\nimport { fromJS } from 'immutable';\nimport { findPathByNodeId } from '../utils/vertTreeUtils';\n\nconst verticalTreeData = (\n state = fromJS...
javascript
chosen
[ { "from": "system", "value": "Add partialHandle to Fragment class.\n" }, { "from": "human", "value": "'use strict';\n\nexport default class Fragment {\n constructor () {\n this.$uuid = `fragment-${Fragment.ID_COUNTER}`;\n Fragment.ID_COUNTER++;\n }\n\n get uuid () {\n ...
javascript
chosen
[ { "from": "system", "value": "Add yields to avoid race conditions\n" }, { "from": "human", "value": "import Component from '@ember/component';\nimport { inject as service } from '@ember/service';\nimport { task } from 'ember-concurrency';\n\nexport default Component.extend({\n currentUser: serv...
javascript
chosen
[ { "from": "system", "value": "Fix header in facilities view\n" }, { "from": "human", "value": "(function (angular) {\n \"use strict\";\n angular.module(\"mfl.facilities.base\", [\n \"ui.router\"\n ])\n .config([\"$stateProvider\", function ($stateProvider) {\n $statePro...
javascript
chosen
[ { "from": "system", "value": "Update angular service to not include angular\n" }, { "from": "human", "value": "import angular from 'angular';\nimport calculator from './src/calculator';\n\nvar app = angular.module('trewbrews', []);\n\napp.service('TrewbrewsCalculator', () => {\n return {\n ...
javascript
chosen
[ { "from": "system", "value": "Add test for auth routes\n" }, { "from": "human", "value": "var rfr = require('rfr');\nvar Lab = require('lab');\nvar lab = exports.lab = Lab.script();\nvar expect = require('code').expect;\nvar _ = require('underscore');\n\nvar Storage = rfr('app/models/Storage.js'...
javascript
chosen
[ { "from": "system", "value": "Install ember-simple-auth from forked repo\n" }, { "from": "human", "value": "module.exports = {\n normalizeEntityName: function() {\n },\n\n afterInstall: function() {\n return this.addBowerPackageToProject('ember-simple-auth', '0.8.0');\n }\n};\n" }, { ...
javascript
chosen
[ { "from": "system", "value": "Install ember-sinon as an addon.\n" }, { "from": "human", "value": "/* globals module */\n\nvar EOL = require('os').EOL;\n\nmodule.exports = {\n description: 'Register test helpers',\n\n afterInstall: function( options ) {\n // Import statement\n ...
javascript
chosen
[ { "from": "system", "value": "Allow passing of template folder path as a string argument" }, { "from": "human", "value": "/*\n * grunt-nunjucks-2-html\n * https://github.com/vitkarpov/grunt-nunjucks-2-html\n *\n * Copyright (c) 2014 Vit Karpov\n * Licensed under the MIT license.\n */\n\n'use str...
javascript
chosen
[ { "from": "system", "value": "Add events to tx log\n" }, { "from": "human", "value": "const {spec, valid} = require(\"js.spec\");\n\nconst EventSpec = spec.map({\n type: spec.string,\n data: spec.object,\n});\n\nconst validateEvent = function (evt) {\n return valid(EventSpec, evt);\n};\n\ncon...
javascript
chosen
[ { "from": "system", "value": "Remove component mount callbacks and top css\n" }, { "from": "human", "value": "import React, {Component} from 'react'\n\nconst css = {\n\ttop: 132,\n\tbackground: 'orange',\n}\n\nexport default class NoPositionBanner extends Component {\n\trender() {\n\t\treturn (\...
javascript
chosen
[ { "from": "system", "value": "Manage new Enum syntax in Ludwig\n" }, { "from": "human", "value": "var _ = require('lodash');\nvar moment = require('moment');\n\nvar requestedVariables = require('../openfisca/mapping/common').requestedVariables;\n\nmodule.exports = function extractResults(openfis...
javascript
chosen
[ { "from": "system", "value": "Remove android devices from test for now\n" }, { "from": "human", "value": "// Some user-accessible config for unit tests\n// Format is: { platform:{ ...settings.. } }\n\n// numDevices - The number of devices the server will start a test with\n// Any ot...
javascript
chosen
[ { "from": "system", "value": "Use TEST-NET-1 ip address for unresolvable address test\n\nUsing a local address may resolve to localhost depends on DNS\nconfiguration. i.e. systemd-resolved adds a 127.0.0.53 dns server in\nubuntu 17.0.4+ that would resolve 127.100.100.1 to localhost.\n" }, { "from":...
javascript
chosen
[ { "from": "system", "value": "Use _.template for the warning popup\n" }, { "from": "human", "value": "define(function() {\n 'use strict';\n\n var WIDGET_NAME = 'warning';\n\n var initialize = function(index, item) {\n var $item = $(item);\n var popup = '<div data-role=\"po...
javascript
chosen
[ { "from": "system", "value": "Add active class if fav selected" }, { "from": "human", "value": "// ==UserScript==\n// @name pr0-fav-in-nav\n// @namespace http://pr0gramm.com/user/playmax\n// @version 1.0\n// @description Adds a heart-shaped link to the users favorites in the nav...
javascript
chosen
[ { "from": "system", "value": "Use router instead of browser\n\n * Made things work witha a router to get \"no reload\".\n" }, { "from": "human", "value": "$(function(){\n console.log(\"cronus time is on!\")\n\n var Workspace = Backbone.Router.extend({\n routes: {\n \"logi...
javascript
chosen
[ { "from": "system", "value": "Make variable naming more specific\n" }, { "from": "human", "value": "'use strict';\n\nvar Client = require('./ifrau-client');\n\nvar REQUEST_KEY = require('./request-key');\n\nmodule.exports = function getFramedJwt(scope) {\n\treturn Client\n\t\t.then(function(clie...
javascript
chosen
[ { "from": "system", "value": "Change script timeout for Travis\n" }, { "from": "human", "value": "// Protractor configuration file, see link for more information\n// https://github.com/angular/protractor/blob/master/docs/referenceConf.js\n\n/*global jasmine */\nvar SpecReporter = require('jasmin...
javascript
chosen
[ { "from": "system", "value": "Add registration model to collection test.\n" }, { "from": "human", "value": "import { moduleForModel, test } from 'ember-qunit';\n\nmoduleForModel('collection', 'Unit | Model | collection', {\n // Specify the other units that are required for this test.\n needs: ...
javascript
chosen
[ { "from": "system", "value": "Change initial state in the counter example reducer\n" }, { "from": "human", "value": "import { NOTIFY_TOP } from '../actions/notification';\n\nexport default function notification(state = {}, action) {\n switch (action.type) {\n case NOTIFY_TOP:\n console....
javascript
chosen
[ { "from": "system", "value": "Add in tracking of when users print pages.\n" }, { "from": "human", "value": " // mathiasbynens.be/notes/async-analytics-snippet\nvar _gaq = [[\"_setAccount\", mzalendo_settings.google_analytics_account], [\"_trackPageview\"]];\n(function(d, t) {\n var g = d.create...
javascript
chosen
[ { "from": "system", "value": "Check whether image viewer widget exists before destroying it\n" }, { "from": "human", "value": "isic.views.ImageFullscreenWidget = isic.View.extend({\n render: function () {\n this.$el.html(isic.templates.imageFullscreenWidget({\n model: this.m...
javascript
chosen
[ { "from": "system", "value": "Return back to production api endpoint for searching plugins\n" }, { "from": "human", "value": "import { flow, map, sortBy } from 'lodash/fp'\n\n/**\n * API endpoint to search all cerebro plugins\n * @type {String}\n */\n// TODO: after ending beta-testing of new ver...
javascript
chosen