conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Implement Campuses service using Restangular\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc service\n * @name dashApp.Campuses\n * @description\n * # Campuses\n * Factory in the dashApp.\n */\nangular.module('dashApp')\n .factory('Campuses', fun...
javascript
chosen
[ { "from": "system", "value": "Remove reference to deleted file\n" }, { "from": "human", "value": "import passport from 'passport';\nimport passportLocal from 'passport-local';\nimport bcrypt from 'bcrypt';\nimport models from '../models';\nimport helpers from '../helpers';\n\nconst LocalStrategy...
javascript
chosen
[ { "from": "system", "value": "Simplify how query string is passed to search\n" }, { "from": "human", "value": "import * as Backbone from 'backbone';\nimport Items from '../collections/items';\nimport SearchBoxView from '../views/searchBox-view';\nimport SearchResultsView from '../views/searchRes...
javascript
chosen
[ { "from": "system", "value": "Fix zoom range to the corresponding range for Openmaptiles\n" }, { "from": "human", "value": "import {normalizeActionName} from '../common/helpers.js';\n\nexport const MAP_URL = 'https://tiles.hel.ninja/styles/hel-osm-light/{z}/{x}/{y}.png';\nexport const MAP_RETINA...
javascript
chosen
[ { "from": "system", "value": "Update comment and add named routes\n" }, { "from": "human", "value": "'use strict';\n\nimport VueRouter from 'vue-router';\n\nimport TaskListView from '../views/TaskListView';\nimport IndexView from '../views/IndexView';\n\nexport default new VueRouter({\n mode: '...
javascript
chosen
[ { "from": "system", "value": "Fix API url when region/realm/name is unknown\n" }, { "from": "human", "value": "import makeUrl from './makeUrl';\n\nexport default function makeApiUrl(endpoint, queryParams = {}) {\n return makeUrl(`${process.env.REACT_APP_SERVER_BASE}${process.env.REACT_APP_API_B...
javascript
chosen
[ { "from": "system", "value": "Delete span form nav bar on the header.\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport { Link } from 'react-router-dom';\nimport NavbarLogo from './NavbarLogo.js';\nimport '../stylesheets/components/navbar.css';\n\nclass NavCompon...
javascript
chosen
[ { "from": "system", "value": "Send c/form email to address specified in env var\n" }, { "from": "human", "value": "var nodemailer = require('nodemailer');\nvar transporter = nodemailer.createTransport({\n service: 'Mailgun',\n auth: {\n user: process.env.MAILGUN_USERNAME,\n pass: process...
javascript
chosen
[ { "from": "system", "value": "Add async action for default sql query\n" }, { "from": "human", "value": "import { polyfill } from 'es6-promise';\npolyfill();\nimport fetch from 'isomorphic-fetch';\nimport * as config from '../constants/app_config';\nimport * as actions from '../actions/';\nimport...
javascript
chosen
[ { "from": "system", "value": "[ADD] Add get object graphql query\n" }, { "from": "human", "value": "import { gql } from 'react-apollo';\n\n\n// ===========\n//\t QUERIES\n// ===========\n\nconst _listObjectsFromS3 = (params) => {\n\treturn gql`\n\tquery ListObjectsFromS3($MaxKeys:Int,$Prefix:Str...
javascript
chosen
[ { "from": "system", "value": "Add testURL to jest config\n\n" }, { "from": "human", "value": "// Licensed under the Apache License, Version 2.0 (the “License”); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the License at\n//\n// http://www.apa...
javascript
chosen
[ { "from": "system", "value": "Fix syntax on findByPage findBySlug\n" }, { "from": "human", "value": "(function() {\n\tangular.module('c4cWebsite.actions')\n\t.factory('ActionService', ['$q', 'Tabletop', actionService]);\n\t\n\t/**\n\t * Returns a promise when the action service is loaded\n\t *...
javascript
chosen
[ { "from": "system", "value": "Handle the case of <script> and webpack\n" }, { "from": "human", "value": "'use strict';\n\nimport Singleton from './singleton';\n\n// Due to the various ways packages can be included in JavaScript (e.g. <script>\n// tags vs included via webpack), it's possible for ...
javascript
chosen
[ { "from": "system", "value": "Add sorting by creation date on dialogues\n" }, { "from": "human", "value": "import { Actions } from '../constants';\nimport firebase from '../firebase';\nimport uuid from 'uuid';\n\nexport default {\n startNewDialogueCreation() {\n return { type: Actions.StartC...
javascript
chosen
[ { "from": "system", "value": "Introduce a helper to cast errors to a CellError\n" }, { "from": "human", "value": "export class CellError extends Error {\n constructor(msg, details) {\n super(msg)\n this.details = details\n }\n}\n\nexport class SyntaxError extends CellError {\n get type(...
javascript
chosen
[ { "from": "system", "value": "Fix new method signature and moved delta variable in lcs recorder\n\n" }, { "from": "human", "value": "/**\n * @file: Subclass of LCS which allows to observe progress of the algorithm\n * by intercepting function calls.\n */\n\n\nDeltaJS.lcs.InstallLCSRec...
javascript
chosen
[ { "from": "system", "value": "Fix ClickableBox dropping styles when not clickable\n" }, { "from": "human", "value": "// @flow\nimport React from 'react'\nimport type {Props} from './clickable-box'\nimport {TouchableHighlight, TouchableWithoutFeedback} from 'react-native'\nimport {globalColors} f...
javascript
chosen
[ { "from": "system", "value": "Fix missing data param in constructor\n" }, { "from": "human", "value": "const Base = require('./Base.js')\n\nclass FilterBase extends Base {\n constructor () {\n super()\n\n this.filters = this.getField('filters', {})\n }\n\n toObject () {\n if (Base.is...
javascript
chosen
[ { "from": "system", "value": "Hide node after nodeExited event\n" }, { "from": "human", "value": "// Define time interval model\n\n\n\nNetVisInterval = function(startEvents, endEvents, prevInterval) {\n\tthis.startEvents = startEvents;\n\tthis.endEvents = endEvents;\n\tthis._starts = startEvents...
javascript
chosen
[ { "from": "system", "value": "Prettier: Set `arrowParens` option to `avoid`\n\nto match prettier@1 behavior\n" }, { "from": "human", "value": "module.exports = {\n singleQuote: true,\n trailingComma: 'es5',\n printWidth: 100,\n};\n" }, { "from": "gpt", "value": "module.exports = {...
javascript
chosen
[ { "from": "system", "value": "Drop unused variables (make Uglify happy)\n" }, { "from": "human", "value": "let React = require(\"react\")\nlet ReactDOM = require(\"react-dom\")\nlet Colr = require('colr')\nlet draggable = require('./higher_order_components/draggable.js')\nlet { div } = React.DOM...
javascript
chosen
[ { "from": "system", "value": "Allow Stones to be added\n\nThe board can be clicked, and if the space is empty, it will add\na white Stone. Eventually this should use Game/Player state info to\ndetermine what Stone color should be added.\n" }, { "from": "human", "value": "import React from 'react...
javascript
chosen
[ { "from": "system", "value": "Remove autoConnect option from sample\n" }, { "from": "human", "value": "const fs = require(\"fs\");\nconst config = {\n kafkaHost: \"localhost:9093\",\n logger: {\n debug: _ => {},\n info: msg => console.log(msg),\n warn: msg => console.log(msg),\n...
javascript
chosen
[ { "from": "system", "value": "Create action for deleting messages from server\n" }, { "from": "human", "value": "export const SET_STATE = 'SET_STATE';\nexport const ADD_MESSAGE = 'ADD_MESSAGE';\nexport const UPDATE_MESSAGE = 'UPDATE_MESSAGE';\nexport const DELETE_MESSAGE = 'DELETE_MESSAGE';\n\ne...
javascript
chosen
[ { "from": "system", "value": "Use install for nvm to get auto-install behavior\n" }, { "from": "human", "value": "'use strict'\n\nvar spawn = require('child_process').spawn\n\nfunction Switcher (version) {\n var binArgs = {\n n: ['n', version],\n nvm: [process.env.SHELL, '-c', 'source $NV...
javascript
chosen
[ { "from": "system", "value": "Fix booleans not showing up in monitors\n" }, { "from": "human", "value": "import OpcodeLabels from './opcode-labels.js';\n\nconst isUndefined = a => typeof a === 'undefined';\n\n/**\n * Convert monitors from VM format to what the GUI needs to render.\n * - Convert ...
javascript
chosen
[ { "from": "system", "value": "Add text editing for aggregation\n" }, { "from": "human", "value": "/**\n @module ember-flexberry-designer\n*/\n\nimport FdUmlLink from './fd-uml-link';\nimport { Link } from './fd-uml-link';\n\n/**\n An object that describes an aggregation link on the UML diagram...
javascript
chosen
[ { "from": "system", "value": "Update sourcemap setting in rollup\n" }, { "from": "human", "value": "import resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollup-plugin-commonjs';\nimport babel from 'rollup-plugin-babel';\nimport postcss from 'rollup-plugin-postcss';\nimport ug...
javascript
chosen
[ { "from": "system", "value": "Fix error callback issue in pool modification\n\nWhen the user submit a pool modification with duplicate name\nor reduced pg count,rest-api returns the validation error.\nBut the corresponding error callback is not getting called and\nthe form doesn't show the errors.\n\nThe is...
javascript
chosen
[ { "from": "system", "value": "Improve safety on batch logger\n" }, { "from": "human", "value": "import batch from '../batch';\n\nconst batchType = batch.getType();\n\nexport function actionTransformer(action) {\n if (action && action.type === batchType) {\n action.payload.type = batchType;\n...
javascript
chosen
[ { "from": "system", "value": "Add testing of close event\n" }, { "from": "human", "value": "/* jshint mocha: true */\n'use strict';\n\nvar assert = require('assert');\nvar http = require('http');\nvar bowerBrowser = require('../lib/');\n\ndescribe('Server', function () {\n\n this.timeout(10000)...
javascript
chosen
[ { "from": "system", "value": "Update comments and rename props.data to props.buildStep\n" }, { "from": "human", "value": "import * as React from 'react';\n\nconst HEADERS = ['no', 'text', 'log'];\n\nexport const BuilderDataTable = props => {\n return (\n <table className='data-table'>\n ...
javascript
chosen
[ { "from": "system", "value": "Tweak test logging and speed.\n" }, { "from": "human", "value": "// Configure and set up the tests.\nrequire.config({\n baseUrl: \"../build/\"\n})\n\nvar specs = [\n 'chordmeister/chord_spec.js',\n 'chordmeister/song_spec.js',\n 'chordmeister/parser_spec.js',\n ...
javascript
chosen
[ { "from": "system", "value": "Allow spaces to substitute for any non-word character in forfeits\n" }, { "from": "human", "value": "module.exports = function forfeitRegExp(forfeit){\n if (forfeit.regex) return new RegExp(forfeit.regex,'i');\n else return new RegExp('\\\\b'+ forfeit.phrase.repla...
javascript
chosen
[ { "from": "system", "value": "Add method to access an element of sidebar-toggle-button\n" }, { "from": "human", "value": "(function(app) {\n 'use strict';\n\n var jCore = require('jcore');\n var helper = app.helper || require('../helper.js');\n\n var ContentHeader = helper.inherits(function(...
javascript
chosen
[ { "from": "system", "value": "Update default preferences to reflect --throw-keyids change\n" }, { "from": "human", "value": "pref(\"extensions.torbirdy.protected\", false);\npref(\"extensions.torbirdy.proxy\", 0);\npref(\"extensions.torbirdy.first_run\", true);\npref(\"extensions.torbirdy.warn\"...
javascript
chosen
[ { "from": "system", "value": "Fix compatibility issue with Jasmine 1.1.0." }, { "from": "human", "value": "/**\n * Selenium script for running Jasmine unit tests.\n */\nmodule.exports = function(browser, chain, options) {\n\tchain\n\t\t.waitForElementByClassName('alert', options.testReadyTimeout...
javascript
chosen
[ { "from": "system", "value": "Tidy js: use classes to more cleanly access table.\n" }, { "from": "human", "value": "$(document).ready(function(){\n\n // Instantiate cpliboard button event listeners\n new Clipboard('.copy-button');\n\n // Iterate over table rows, amending as necessary\n ...
javascript
chosen
[ { "from": "system", "value": "Add themes back to the build for testing\n" }, { "from": "human", "value": "'use strict';\n\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function (defaults) {\n let app = new EmberAddon(defaults, {\n 'ember-froala-editor...
javascript
chosen
[ { "from": "system", "value": "Create a new instance of ActiveUsersComponent. Call render method\n" }, { "from": "human", "value": "\"use strict\";\n\nfunction ActiveUsersComponent(target, topicId) {\n this.targetElement = target;\n this.topicId = topicId;\n}\n\nActiveUsersComponent.prototype.r...
javascript
chosen
[ { "from": "system", "value": "Use new simpler error handling interface to handle CMS errors\n" }, { "from": "human", "value": "var CMS = require('../agents/cms');\n\nmodule.exports = {\n displayCMSPage: function(request, reply) {\n CMS(request.params.slug).then(function(page) {\n reply....
javascript
chosen
[ { "from": "system", "value": "Fix AwaitExpression all field default value" }, { "from": "human", "value": "require(\"./core\");\nvar types = require(\"../lib/types\");\nvar def = types.Type.def;\nvar or = types.Type.or;\nvar builtin = types.builtInTypes;\nvar isBoolean = builtin.boolean;\nvar de...
javascript
chosen
[ { "from": "system", "value": "Use `path.resolve` to create path to `static/`\n" }, { "from": "human", "value": "var static = require('node-static');\nvar http = require('http');\n\nvar port = process.argv[2] || 3000;\nvar file = new static.Server(__dirname + '/static');\n\nhttp.createServer(func...
javascript
chosen
[ { "from": "system", "value": "Remove not needed synchronization statement.\nWe already do that in our configuration file.\n" }, { "from": "human", "value": "var mocha = require('mocha')\nvar chai = require('chai')\nvar chaiAsPromised = require('chai-as-promised')\nchai.use(chaiAsPromised)\nvar p...
javascript
chosen
[ { "from": "system", "value": "Fix JS for lectionary scripture links.\n" }, { "from": "human", "value": "(function ($) {\n\n $(function() {\n /**\n * Adds links to scripture references on song pages.\n */\n $( \"div.group-lectionary-scripture-ref\" ).wrap(function...
javascript
chosen
[ { "from": "system", "value": "Remove test covering module creation from alpha version\n" }, { "from": "human", "value": "'use strict';\nvar _ = require('lodash');\n\nfunction testProperties(BBY) {\n expect(BBY.options).not.toBe(undefined);\n expect(BBY.options.key).toBe(process.env.BBY_API...
javascript
chosen
[ { "from": "system", "value": "Switch juniors to seniors for w9d4\n" }, { "from": "human", "value": "// 'use strict';\n\nvar c = require('../lib/channels.js');\nvar date = require('../lib/date.js');\n\nvar events = [];\n\nevents.push({\n when: date('W9D4', 13, 40),\n who: c.juniors,\n message:...
javascript
chosen
[ { "from": "system", "value": "Simplify for an initial state.\n" }, { "from": "human", "value": "import {createStore, combineReducers, applyMiddleware} from 'rx-redux'\nimport thunkMiddleware from 'redux-thunk'\nimport * as reducers from './reducers'\nimport { render, getActionStream } from './vi...
javascript
chosen
[ { "from": "system", "value": "Use import instead of require\n\n" }, { "from": "human", "value": "#!/usr/bin/env node\nvar q = require('q');\nvar fs = require('fs');\nvar path = require('path');\nvar glob = require('glob');\nvar xml2js = require('xml2js');\nvar del = require('del');\n\nmodule.exp...
javascript
chosen
[ { "from": "system", "value": "Update service worker to fallback to cache\n" }, { "from": "human", "value": "self.addEventListener( 'install', function( e ) {\n\t// hey\n} );\n" }, { "from": "gpt", "value": "async function networkOrCache(event) {\n\ttry {\n\t\tconst response = await f...
javascript
chosen
[ { "from": "system", "value": "Use promises for both glob and jsdom.env\n" }, { "from": "human", "value": "'use strict';\n\nvar fs = require('fs');\nvar path = require('path');\nvar jsdom = require('jsdom').jsdom;\nvar utility = require('../utility');\nvar glob = require('glob');\n\n...
javascript
chosen
[ { "from": "system", "value": "Add error for invalid harness type\n" }, { "from": "human", "value": "const { applyFieldDescriptor, createFieldDescriptor } = require(\"./fields.js\");\n\nclass EntryFacade {\n\n constructor(entry) {\n this._entry = entry;\n }\n\n get entry() {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix Ai where it wasn't targeting the center of paddle on ball follow\n" }, { "from": "human", "value": "import Paddle from 'props/paddle';\nimport canvas from 'canvas';\n\nexport default class Ai extends Paddle {\n constructor(ball) {\n super(canvas.width - 15, ...
javascript
chosen
[ { "from": "system", "value": "Set small modal for catch all\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { c } from 'ttag';\nimport { Modal, ContentModal, FooterModal, ResetButton } from 'react-components';\n\nimport AddressesTable fr...
javascript
chosen
[ { "from": "system", "value": "Fix date parsing: use explicit constructor instead of dash format.\n\nE.g., new Date(\"2004-07-11\") does not work under Safari and FF.\n" }, { "from": "human", "value": "var MONTH_MAPPING = {\n \"1\": \"January\",\n \"2\": \"February\",\n \"3\": \"March\",\n \"...
javascript
chosen
[ { "from": "system", "value": "Update temperature tests to test api.\n" }, { "from": "human", "value": "var buster = require('buster')\n\nvar forOwn = require('mout/object/forOwn')\nvar conversion = require('./utility/conversion')\n\nvar temperature = require('../api/temperature')\nvar temperatur...
javascript
chosen
[ { "from": "system", "value": "Add import angular from \"angular\";\n" }, { "from": "human", "value": "// home.js\n\n\"use strict\";\n\nimport { welcome } from \"../welcome/welcome\";\n\nif (NODE_ENV == DEV_ENV) {\n welcome(\"home\");\n console.log(NODE_ENV);\n}\n\nrequire.ensure([\"../loadVend...
javascript
chosen
[ { "from": "system", "value": "Set Sentry sample rate to 1.0\n" }, { "from": "human", "value": "import { shim as shimFind } from 'array.prototype.find';\nimport { enable as enableRejectionTracking } from 'promise/lib/rejection-tracking';\nimport * as Sentry from '@sentry/browser';\n\nshimFind();\...
javascript
chosen
[ { "from": "system", "value": "Set workspaces node to default as expanded.\n" }, { "from": "human", "value": "/**\n * @constructor\n */\ngecui.MainMenuPanel = function(config) {\n\n\tvar root = new Ext.tree.TreeNode( {\n\t\ttext : 'Geoserver'\n\t});\n\n\tvar tree = new Ext.tree.TreePanel( {\n\t\t...
javascript
chosen
[ { "from": "system", "value": "Fix version resolve in browser - check if in node\n" }, { "from": "human", "value": "/* global exports */\n\"use strict\";\n\nvar fs = require('fs');\nvar path = require('path');\n\n// module Docopt.FFI\n\n/**\n * Try and detect the version as indicated in the packa...
javascript
chosen
[ { "from": "system", "value": "Add random ball start angle\n" }, { "from": "human", "value": "import Item, { MovingDirection, ItemType } from './Item'\nimport Ball from './Ball'\nimport ItemLoader from '../Loader/ItemLoader'\n\nexport default class Platform extends Item {\n constructor(width, he...
javascript
chosen
[ { "from": "system", "value": "Set the transaction for the hash explorer in history page details\n" }, { "from": "human", "value": "angular.module('omniControllers')\n\t.controller('WalletHistoryController', [\"$scope\", \"$q\", \"$http\", \"hashExplorer\", \"$translate\",\n\t\tfunction WalletHis...
javascript
chosen
[ { "from": "system", "value": "Fix for refreshing the max amount of the knob when the max value its bound to is changed\n" }, { "from": "human", "value": "angular.module('ui.knob', [])\n .directive('knob', function () {\n return {\n restrict: 'EACM',\n template: function(elem, attrs...
javascript
chosen
[ { "from": "system", "value": "UPDATE modFulfillment schema with mapping schema\n" }, { "from": "human", "value": "import { Mongo } from 'meteor/mongo';\nimport { SimpleSchema } from 'meteor/aldeed:simple-schema';\n\nclass ModuleFulfillmentCollection extends Mongo.Collection {}\n\nconst ModuleFul...
javascript
chosen
[ { "from": "system", "value": "Allow a path prefix in URLMaker\n" }, { "from": "human", "value": "// urlmaker.js\n//\n// URLs just like Mama used to make\n//\n// Copyright 2011-2012, E14N https://e14n.com/\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not u...
javascript
chosen
[ { "from": "system", "value": "Use runAndReturn to get result of function executed inside withId\n" }, { "from": "human", "value": "'use strict';\n\nconst uuid = require('uuid');\nconst cls = require('cls-hooked');\n\nconst store = cls.createNamespace('1d0e0c48-3375-46bc-b9ae-95c63b58938e');\n\nm...
javascript
chosen
[ { "from": "system", "value": "Add `columns` to the ignore list\n" }, { "from": "human", "value": "var postcss = require('postcss'),\n extend = require('extend');\n\nmodule.exports = postcss.plugin('postcss-default-unit', function (opts) {\n opts = opts || {};\n opts.unit = opts.unit || ...
javascript
chosen
[ { "from": "system", "value": "Test immutability of the gigasecond\n\nI have seen submissions which mutate the original date and return that. This works for the current test suite. However, when the `date` method gets called multiple times. That solution adds another gigasecond on a date where one is already...
javascript
chosen
[ { "from": "system", "value": "Add a check for whether the select option is an object\n" }, { "from": "human", "value": "import Ember from 'ember';\nconst {Component, computed} = Ember;\nconst {alias} = computed;\n\nexport default Component.extend({\n tagName: 'option',\n attributeBindings: ['v...
javascript
chosen
[ { "from": "system", "value": "Add GetCloudTemplate method to cloud services (saas-128)\n" }, { "from": "human", "value": "'use strict';\n\n(function() {\n angular.module('ncsaas')\n .service('cloudsService', ['RawCloud', cloudsService]);\n\n function cloudsService(RawCloud) {\n /*jshint ...
javascript
chosen
[ { "from": "system", "value": "Fix error on view using column alias to order by\n" }, { "from": "human", "value": "const knex = require('../../../knex').web\nconst orgUnitFinder = require('../helpers/org-unit-finder')\nconst orgUnitConstants = require('../../constants/organisation-unit')\n\nmodul...
javascript
chosen
[ { "from": "system", "value": "Correct add to has many\n" }, { "from": "human", "value": "import { Class } from 'orbit/lib/objects';\nimport SchemaUtils from 'orbit-firebase/schema-utils';\nimport { removeItem } from 'orbit-firebase/array-utils';\n\nexport default Class.extend({\n\tinit: function...
javascript
chosen
[ { "from": "system", "value": "Allow existing history framework to work with flow router\n" }, { "from": "human", "value": "import { FlowRouter } from 'meteor/ostrio:flow-router-extra';\n\nFlowRouter.route('/', {\n name: 'App.home',\n action() {\n this.render('canvas');\n },\n});\n" }, ...
javascript
chosen
[ { "from": "system", "value": "demo: Put the nested ThemeProvider inside a parent Consumer (still works!)\n" }, { "from": "human", "value": "import { createElement, Component, createContext, Fragment } from 'ceviche';\nconst { Provider, Consumer } = createContext();\n\nclass ThemeProvider extends...
javascript
chosen
[ { "from": "system", "value": "Remove eslint space before function parenthesis\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n parser: 'babel-eslint',\n parserOptions: {\n sourceType: 'module'\n },\n // https://github.com/feross/standard/blob/master/RULES.md#javascri...
javascript
chosen
[ { "from": "system", "value": "Add line wrap to RTE code editor\n" }, { "from": "human", "value": "(function () {\n \"use strict\";\n\n function CodeEditorController($scope, localizationService) {\n\n var vm = this;\n vm.submit = submit;\n vm.close = close;\n\n v...
javascript
chosen
[ { "from": "system", "value": "Fix super call to get from GitHub model\n" }, { "from": "human", "value": "const fs = require('fs')\nconst path = require('path')\nconst Config = require('../config.json')\nconst Fetcher = require('./fetcher')\n\nclass GitHub extends Fetcher {\n // https://develope...
javascript
chosen
[ { "from": "system", "value": "Make sure javascript gets minified every time the build runs.\n" }, { "from": "human", "value": "/**\n * grunt\n * CoffeeScript example\n */\nmodule.exports = function(grunt){\n\n grunt.initConfig({\n lint: {\n files: ['grunt.js', 'src/*.js']\n },\n c...
javascript
chosen
[ { "from": "system", "value": "[DDW-667] Hide staking from app menu\n" }, { "from": "human", "value": "// @flow\nimport { ROUTES } from '../routes-config';\nimport walletsIcon from '../assets/images/sidebar/wallet-ic.inline.svg';\nimport settingsIcon from '../assets/images/sidebar/settings-ic.inl...
javascript
chosen
[ { "from": "system", "value": "Throw if no cb provided, since that's an annoying error to track down.\n" }, { "from": "human", "value": "\n/*\nusage:\n\nasyncMap(myListOfStuff, function (thing, cb) { doSomething(thing, cb) }, cb)\nasyncMap(list, function (l, cb) { foo(l, cb) ; bar(l, cb) }, 2, cb...
javascript
chosen
[ { "from": "system", "value": "Make sure interval gets canceled\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport CarouselA from './CarouselA';\nimport CarouselB from './CarouselB';\n\nimport styles from './HeroCarousel.styl'\n\nclass HeroCarousel extends Compon...
javascript
chosen
[ { "from": "system", "value": "Fix sort by on reminders api call\n" }, { "from": "human", "value": "import { apiProxyAxios } from '../Task/utils'\n\nexport const fetchOutstandingPropositions = ({ adviser }) =>\n apiProxyAxios\n .get('/v4/proposition', {\n params: {\n adviser_id: a...
javascript
chosen
[ { "from": "system", "value": "Remove console.log from GifMe module\n" }, { "from": "human", "value": "// $ GifMe\n// $ Authors: victorgama\n// $ Created on: Mon Mar 14 15:29:14 BRT 2016\n// - Gif( me) <categoria>: Pesquisa por gifs contendo a categoria especificada\n// no giphy.com e retorna um ...
javascript
chosen
[ { "from": "system", "value": "Add todo for getting food facts\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('justFoodFactsApp')\n .controller('MainCtrl', function ($scope) {\n $scope.messages = messages\n\n $scope.foodFacts = [\n {name: 'Mozzarella', energy: '3...
javascript
chosen
[ { "from": "system", "value": "Use `__dirname` in export mechanism\n" }, { "from": "human", "value": "var fs = require('fs')\nvar path = require('path')\n\nfs.readdirSync('build').forEach(function(filename) {\n exports[path.basename(filename, '.html')] = fs.readFileSync(path.resolve('build', f...
javascript
chosen
[ { "from": "system", "value": "Remove unused service from demo controller\n" }, { "from": "human", "value": "angular.module('demo')\n.controller('AuthenticatedCtrl', function ($state, $translate, $window, eehNavigation) {\n 'use strict';\n eehNavigation.navbarMenuItem('user').text = 'Ethan'...
javascript
chosen
[ { "from": "system", "value": "Fix issue in regex with new lines\n" }, { "from": "human", "value": "/*jslint node:true */\n\"use strict\";\n\nfunction StripAssertCallsLoader(content) {\n\n this.regexPattern = /\\n[ \\t]*assert\\([^\\);]+\\);?[ \\t]*\\n/g;\n\n content = content.replace(this....
javascript
chosen
[ { "from": "system", "value": "Throw error when type is unknown\n" }, { "from": "human", "value": "module.exports.encode = function encode(type, message) {\n if(type == null) {\n throw new Error('Type cannot be empty');\n }\n message = message || '';\n var b = new Buffer(14 + message.lengt...
javascript
chosen
[ { "from": "system", "value": "Use `contentFor` if it is available.\n\nAvoids injecting the script tag via server middleware (which causes\nissues for certian file types).\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n name: 'live-reload-middleware',\n\n serverMiddlewa...
javascript
chosen
[ { "from": "system", "value": "Add call file update in file core test.\n" }, { "from": "human", "value": "var fileTests = require('./file_old').fileTests;\nvar helpers = require('../helpers');\n\ndescribe('File', function () {\n before(function(done) { helpers.create_user(done); });\n after...
javascript
chosen
[ { "from": "system", "value": "Use `app` from `included` argument\n" }, { "from": "human", "value": "/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'number-formatter',\n\n init: function () {\n this.treePaths['vendor'] = 'node_modules';\n },\n\n included: function () ...
javascript
chosen
[ { "from": "system", "value": "Use clean paths for SPA serving\n\n" }, { "from": "human", "value": "\"use strict\";\n\nconst colors = require(\"colors\");\n\nconsole.log(\"Starting ReDash\".cyan);\n\nconst express = require(\"express\");\nconst app = express();\n\nconst http = require(\"http\");\...
javascript
chosen
[ { "from": "system", "value": "Add oEmbed type and version\n" }, { "from": "human", "value": "'use strict';\n\nvar oembed = module.exports = {\n name: 'oembed'\n};\n\n// oEmbed endpoint with JSONP support.\noembed.embed = function(req, res) {\n var url = req.query.url;\n\n if (!url || !url.mat...
javascript
chosen
[ { "from": "system", "value": "Fix audio not played successively\n" }, { "from": "human", "value": "'use babel';\n\nimport { CompositeDisposable } from 'atom';\nimport memoize from 'memoizee';\nimport path from 'path';\n\nconst KEYS = {\n DELETE: 8,\n ENTER: 13,\n SPACE: 32\n};\n\nlet getAudio...
javascript
chosen
[ { "from": "system", "value": "fix: Use status code for 404 response\n" }, { "from": "human", "value": "/*jshint es5:true */\n\nmodule.exports = function(opts) {\n 'use strict';\n\n var port = opts.port || 8080\n , webroot = process.cwd();\n\n var connect = require('connect')\n , http = ...
javascript
chosen
[ { "from": "system", "value": "Fix tweets not being stored in list\n" }, { "from": "human", "value": "/**\n * ProcessedTweetList - Stores tweets/dms by room_id so we don't accidentally\n * repeat any messages. Please note that the cache and slice size values are\n * per room, not the total size o...
javascript
chosen
[ { "from": "system", "value": "Modify the way middlewares are initialized so they can use Mockiji's logger and config\n" }, { "from": "human", "value": "'use strict';\n\nconst express = require('express');\nconst cors = require('cors');\nconst path = require('path');\nconst MockCtrl = require('.....
javascript
chosen
[ { "from": "system", "value": "Fix for babel polyfill not loading on server\n" }, { "from": "human", "value": "/*\n * src/server/index.js\n */\n\nimport express from 'express';\nimport routes from './routes';\n\nconst app = express();\n\napp.get('/happysad', routes.happysad.fn);\n\napp.listen(808...
javascript
chosen
[ { "from": "system", "value": "Add function to play tone and adjust gain based on frequency\n" }, { "from": "human", "value": "var audio = new AudioContext || new webkitAudioContext;\n\nfunction playRadarPing() {\n var osc = audio.createOscillator();\n var gain = audio.createGain();\n var time...
javascript
chosen
[ { "from": "system", "value": "Add explicit errors for `after` and `action`\n" }, { "from": "human", "value": "var assert = require('assert');\nvar common = require('./util/common.js');\nvar Understudy = require('../').Understudy;\n\nvar actor = new Understudy();\n\nactor.before('no-functions', f...
javascript
chosen