conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Hide Blog button for now\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport Helmet from 'react-helmet';\nimport { StaticQuery, graphql } from 'gatsby';\nimport { ThemeProvider } from 'styled-components';\n\nimp...
javascript
chosen
[ { "from": "system", "value": "Add a watch for html changes and launch htmlmin\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n build: ['Gruntfile.js', 's...
javascript
chosen
[ { "from": "system", "value": "Return failed test count for CI build\n" }, { "from": "human", "value": "\nconsole.log();\nconsole.log('-------------------------------');\nconsole.log(' TESTING COMPLETED');\nconsole.log('-------------------------------');\nconsole.log('Total Tests: ' + assert.co...
javascript
chosen
[ { "from": "system", "value": "Fix path to css files\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n // Chargement automatique de tous nos modules\n require('load-grunt-tasks')(grunt);\n\n // Configuration des plugins\n grunt.initConfig({\n // Concat and...
javascript
chosen
[ { "from": "system", "value": "Add a bit of documentation\n" }, { "from": "human", "value": "var Correction = function(baseUrl) {\n var self = this;\n this.baseUrl = baseUrl;\n this.erroneousPages = 0;\n this.erroneousCents = 0;\n this._printJob = new PrintJob(this.baseUrl, new Cart(baseUrl)...
javascript
chosen
[ { "from": "system", "value": "Add logging for status changes\n" }, { "from": "human", "value": "let isEnabled = false;\n\nfunction toggleState() {\n isEnabled = !isEnabled;\n chrome.browserAction.setIcon({ path: isEnabled ? 'icon_enabled.png' : 'icon_disabled.png' });\n}\n\nchrome\n .browserA...
javascript
chosen
[ { "from": "system", "value": "Split TXT records into DNS-SD key-value pairs\n" }, { "from": "human", "value": "var serviceType = '_radiodan-http._tcp.local',\n serviceFinder = new ServiceFinder(handleServicesFound, serviceType),\n services = [],\n recipients = [],\n polling...
javascript
chosen
[ { "from": "system", "value": "Fix out of bounds issue for Ai\n" }, { "from": "human", "value": "import Prop from 'props/prop';\nimport canvas from 'canvas';\n\nexport default class Paddle extends Prop {\n constructor(x, y) {\n super(x, y, 10, 60);\n this.maxY = canvas.height - this.height...
javascript
chosen
[ { "from": "system", "value": "Add dummy result to /poll/:id\n" }, { "from": "human", "value": "'use strict';\n\nvar Polls = require('../models/polls.js');\n\nfunction pollHandler () {\n\n this.getPolls = function (req, res) {\n Polls.find(function (err, polls) {\n if (err) r...
javascript
chosen
[ { "from": "system", "value": "Add AuthService.withUser() call to CreateProjectController\n\nThis redirects to the login page if the user hits the URL when not\nlogged in.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc function\n * @name openshiftConsole.controller:CreateProje...
javascript
chosen
[ { "from": "system", "value": "Remove --harmony_collections & --harmony_iteration, their features are now on by default\n" }, { "from": "human", "value": "'use strict';\n\nvar findup = require('findup-sync');\nvar spawnSync = require('child_process').spawnSync;\nvar gruntPath = findup('node_modul...
javascript
chosen
[ { "from": "system", "value": "Upgrade severity of TS recommended rules from warning to error\n" }, { "from": "human", "value": "module.exports = {\n extends: [\n require.resolve('.'),\n 'plugin:@typescript-eslint/recommended',\n 'prettier/@typescript-eslint',\n ],\n parser: '@typescr...
javascript
chosen
[ { "from": "system", "value": "Add support for use_env_variable in config\n" }, { "from": "human", "value": "'use strict';\n\nvar Umzug = require('umzug');\nvar Sequelize = require('sequelize');\nvar DataTypes = require('sequelize/lib/data-types');\n\nfunction createMigrator(opts) {\n var db = n...
javascript
chosen
[ { "from": "system", "value": "Switch theme colors, grey looks a tad nicer\n" }, { "from": "human", "value": "angular.module('proxtop').config(['$mdThemingProvider', function(themingProvider) {\n\tthemingProvider.theme('default')\n\t\t.primaryPalette('brown')\n\t\t.accentPalette('grey')\n\t\t.dar...
javascript
chosen
[ { "from": "system", "value": "Change execute procedure exists test\n" }, { "from": "human", "value": "'use strict';\nvar expect = require('chai').expect;\nvar LEM2 = require('./lem2.js');\n\ndescribe('LEM2 Module', function() {\n it('should exist', function() {\n expect(LEM2).to.not.be...
javascript
chosen
[ { "from": "system", "value": "Add reading local config from file\n" }, { "from": "human", "value": "var Gitter = require('node-gitter');\n\n/**\n * Create new instance of GitterBot\n * @param {String} key Your API key\n * @constructor\n */\nfunction GitterBot(key) {\n this.setApiKey(key);\n}\n\...
javascript
chosen
[ { "from": "system", "value": "Make settings debug logs less confusing\n" }, { "from": "human", "value": "import { observable, toJS } from 'mobx';\nimport { pathExistsSync, outputJsonSync, readJsonSync } from 'fs-extra';\nimport path from 'path';\n\nimport { SETTINGS_PATH } from '../config';\n\nc...
javascript
chosen
[ { "from": "system", "value": "Add JSON object bio containing biographical info\n" }, { "from": "human", "value": "/*\n\nThis file contains all of the code needed to create four JSONs corresponding\nto four distinct sections in index.html: work, education, projects and a\nheader with biographical...
javascript
chosen
[ { "from": "system", "value": "Fix delete fail when only single deletion needed\n\nThe deleteMessages method only supports deleting more that one message,\nso deleteMessage is used when there is a single thing to delete.\n" }, { "from": "human", "value": "const DEFAULT_CHECK_FREQUENCY = 10;\ncons...
javascript
chosen
[ { "from": "system", "value": "Change to map rather use `FlatList` to avoid press event handling issues\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport {\n StyleSheet,\n FlatList,\n View\n} from 'react-native';\nimport Prediction from './Prediction';\...
javascript
chosen
[ { "from": "system", "value": "Add missing value check to Rating model's beforeBulkCreate\n" }, { "from": "human", "value": "module.exports = function (sequelize, DataTypes) {\n const Rating = sequelize.define('Rating', {\n id: {\n primaryKey: true,\n type: DataTypes.UUID,\n de...
javascript
chosen
[ { "from": "system", "value": "Test account name has changed\n" }, { "from": "human", "value": "(function( $ ) {\n\n var itemTemplate = '<div class=\"foton-item\"><span class=\"foton-item-title\"><%= title %></span><span class=\"foton-item-content\"><%= content %></span></div>';\n\n $.fn.fo...
javascript
chosen
[ { "from": "system", "value": "test: Fix broken node test by ensuring a default for HTMLElement.\n" }, { "from": "human", "value": "import { root } from './util';\n\nconst { HTMLElement } = root;\n\nexport function withRaw (Base = HTMLElement) {\n return class extends Base {\n static is = nul...
javascript
chosen
[ { "from": "system", "value": "Add functionality to see closure message\n" }, { "from": "human", "value": "var scrape = require('scrape');\nvar _ = require('underscore');\nvar bot = require('..')\n\nbot.addListener('message', function (nick, to, text, message) {\n if(text == \"!marco\") {\n v...
javascript
chosen
[ { "from": "system", "value": "Use `beforeInstall` instead of `afterInstall` for peer dependencies.\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n description: 'Initialize files needed for typescript compilation',\n\n files: function() {\n return [\n ...
javascript
chosen
[ { "from": "system", "value": "Fix error throwing in Store constructor\n" }, { "from": "human", "value": "var Store = require(\"./store\"),\n util = require(\"util\");\n\nvar createStore = function(spec) {\n var constructor = function(options) {\n options = options || {};\n Store.call(t...
javascript
chosen
[ { "from": "system", "value": "Make the slug function actually work." }, { "from": "human", "value": "var Posts = new Meteor.Collection('posts');\n\nvar titleToSlug = function(title) {\n // XXX: this is a first approximation, needs:\n // - deal with non-latin chars\n // - check for overlap...
javascript
chosen
[ { "from": "system", "value": "Replace undefined/null with something human-readable\n" }, { "from": "human", "value": "function restore() {\n var nurls = 0;\n for (var k in localStorage) {\n if (k.match(/^http:/)) {\n nurls++;\n var tr = document.createElement('...
javascript
chosen
[ { "from": "system", "value": "Use ES7 function property syntax" }, { "from": "human", "value": "'use strict';\n\nlet React = require('react-native');\n\nfunction cloneReferencedElement(element, config, ...children) {\n let cloneRef = config.ref;\n let originalRef = element.ref;\n if (original...
javascript
chosen
[ { "from": "system", "value": "Add forgotten JS for VK like button.\n" }, { "from": "human", "value": "// Заменяем MSN_ID на текстовые описания.\nfunction set_userlist_msn(){\n $('tr td:nth-child(2)', '.uTable').each(function(i){\n var $this = $(this);\n var h = $this.html();\n ...
javascript
chosen
[ { "from": "system", "value": ":muscle: Move internal definitions to the bottom\n" }, { "from": "human", "value": "// Copyright (c) 2017 The Regents of the University of Michigan.\n// All Rights Reserved. Licensed according to the terms of the Revised\n// BSD License. See LICENSE.txt for details....
javascript
chosen
[ { "from": "system", "value": "Call svg4everybody in a setTimeout\n\nFixing issue with svg4everybody not handling icons that are loaded with latency in e.g. Vue components" }, { "from": "human", "value": "'use strict';\n/*\n* Novicell master\n* Use this file to call functions in other files, on d...
javascript
chosen
[ { "from": "system", "value": "Fix default type of value\n" }, { "from": "human", "value": "import Node from \"./node\";\nimport Token from \"../lexer/token\";\nimport Key from \"./key\";\nimport Identifier from \"./identifier\";\nimport Inline from \"./inline\";\nimport Literal from \"./literal\...
javascript
chosen
[ { "from": "system", "value": "Add UI input event listener and a temp fix for the scrolling issue\n" }, { "from": "human", "value": "define('editor-plugin-auto-resize-textarea', [], function () {\n 'use strict';\n return function(markdownEditorNode, options) {\n return function(editor) {\n ...
javascript
chosen
[ { "from": "system", "value": "Fix url/redisURL in createRedisClient :\\\n" }, { "from": "human", "value": "'use strict';\n\nconst redis = require('redis');\nconst url = require('url');\n\n/**\n * A module for creating Redis clients, which we do a lot.\n * @module createRedisClient\n */\n\nmodu...
javascript
chosen
[ { "from": "system", "value": "Add comment to mystic null check :P\n" }, { "from": "human", "value": "import {TODO_TRX_PATH, DONE_TRX_PATH} from './settings'\nimport {push} from './firebase_useful'\n\nexport function getClient(firebase, options = {}) {\n let {todoTrxPath = TODO_TRX_PATH, doneTrx...
javascript
chosen
[ { "from": "system", "value": "Remove failing example from entry file for now\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\n\n// Load base requirements\nconst program = require('commander'),\n dotenv = require('dotenv').config(),\n path = require('path');\n\n// ...
javascript
chosen
[ { "from": "system", "value": "Test ES6 support with const and arrow functions\n" }, { "from": "human", "value": "console.log('TwentySeventeen Child Theme Initializing!');" }, { "from": "gpt", "value": "/**\n * Test ES6 support with const and arrow functions\n */\nconst initializeTwen...
javascript
chosen
[ { "from": "system", "value": "Add default empty code to sensors created through sensor manager\n" }, { "from": "human", "value": "// Default sensor generator.\nconst createSensor = ({ id, macAddress, name, location, batteryLevel, isActive, logInterval }) => ({\n id,\n macAddress,\n name,\n l...
javascript
chosen
[ { "from": "system", "value": "Use partyId to display PartyBadge for mps on front page\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport ListItem from '../list-item'\nimport ListItemImage from '../list-item-image'\nimport ListItemContent fr...
javascript
chosen
[ { "from": "system", "value": "Fix missing double quote mark\n" }, { "from": "human", "value": "'use strict';\n\nvar resolve = require( 'path' ).resolve;\nvar convert = require( './../lib' );\n\nvar fpath = resolve( __dirname, '..', 'README.md' );\nvar opts = {\n\t'title': 'Beep',\n\t'source': 'h...
javascript
chosen
[ { "from": "system", "value": "Fix a floating point issue\n" }, { "from": "human", "value": "var exports = {};\n\nexports.simplePrint = function(video) {\n return `**${video.title}**`;\n};\n\nexports.prettyPrint = function(video) {\n viewCount = video.view_count.replace(/\\B(?=(\\d{3})+(?!\\d))...
javascript
chosen
[ { "from": "system", "value": "Update error handling for Node.js 0.12.0.\n\nParse and output the error message context, which are now included in\nthe error output under Node.js 0.12.0.\n" }, { "from": "human", "value": "module.exports = IvyReporter;\n\nfunction IvyReporter(runner) {\n var error...
javascript
chosen
[ { "from": "system", "value": "Comment out flutter tests until we have set up CI to download it\n" }, { "from": "human", "value": "var path = require('path');\nvar childProcess = require('child_process');\n\nconst env = Object.create(process.env);\nconst args = ['node_modules/vscode/bin/test'];\n...
javascript
chosen
[ { "from": "system", "value": "Remove copyright notice from file\n" }, { "from": "human", "value": "/*\n * object-event\n * https://github.com/ileri/object-event\n *\n * Copyright (c) 2014 Malte-Maurice Dreyer\n * Licensed under the MIT license.\n */\n\n\"use strict\";\n\nimport {initEvent} from ...
javascript
chosen
[ { "from": "system", "value": "Use PREFIX pseudo-constant where appropriate." }, { "from": "human", "value": "var modulr = (function(global) {\n var _modules = {},\n _aliases = {},\n _cache = {},\n PREFIX = '__module__'; // Prefix identifiers to avoid issues in IE.\n \n function...
javascript
chosen
[ { "from": "system", "value": "Handle multiple patterns for organization URIs\n\n" }, { "from": "human", "value": "import React from 'react';\nimport { Route, Switch } from 'react-router-dom';\nimport OrganizationExplorer from './organization-explorer';\nimport OrganizationDetails from './organiz...
javascript
chosen
[ { "from": "system", "value": "Fix WebDAV integration tests initialization\n" }, { "from": "human", "value": "'use strict';\n\nvar webdavd = require('test/integration/utils/webdavd');\nvar scenarios = require('test/integration/scenarios');\n\nvar transfer = require('lib/file-transfer');\n\ndesc...
javascript
chosen
[ { "from": "system", "value": "Extend matchesAst() to support extracting fields\n\nInstead of returning true when match found, the matcher created by\nmatchesAst() will return an object with extracted fields - these\nare marked inside the object pattern using extract() utility.\n\nThis allows us to combine t...
javascript
chosen
[ { "from": "system", "value": "Make a comment on this file\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * 4차원 정보\n * @class Point4D\n */\nvar Point4D = function(x, y, z, w) \n{\n\tif (!(this instanceof Point4D)) \n\t{\n\t\tthrow new Error(Messages.CONSTRUCT_ERROR);\n\t}\n\n\tif (x !=...
javascript
chosen
[ { "from": "system", "value": "Update login api changes for steemconnect-v2\n" }, { "from": "human", "value": "import Promise from 'bluebird';\nimport steemConnect from 'sc2-sdk';\nimport Cookie from 'js-cookie';\nimport request from 'superagent';\nimport { getFollowing } from '../user/userAction...
javascript
chosen
[ { "from": "system", "value": "Set CSRF token to HTTP requests when present\n" }, { "from": "human", "value": "import SwaggerUI from 'swagger-ui'\nimport 'swagger-ui/dist/swagger-ui.css';\nimport './styles.css'\n\nwindow.drsSettings.dom_id = '#rest-swagger-ui';\nwindow.drsSettings.spec = window.d...
javascript
chosen
[ { "from": "system", "value": "Remove users from UserRole model\n\nno longer in the API\n" }, { "from": "human", "value": "import DS from 'ember-data';\n\nexport default DS.Model.extend({\n title: DS.attr('string'),\n users: DS.hasMany('user', {async: true}),\n});\n" }, { "from": "gpt",...
javascript
chosen
[ { "from": "system", "value": "Check that document is defined\n" }, { "from": "human", "value": "import imageLogoLight from 'app/assets/logo-dark.png';\nimport imageLogoDark from 'app/assets/logo.png';\n\nexport const applySelectedTheme = theme => {\n document.documentElement.setAttribute('data-...
javascript
chosen
[ { "from": "human", "value": "Add View para formulario de cadastro\n" }, { "from": "gpt", "value": "// This is a simple *viewmodel* - JavaScript that defines the data and behavior of your UI\nfunction ManterUsuarioViewModel() \n{\n\tvar self = this;\n self.lblTitulo = ko.observable(\"TESTE\");...
javascript
chosen
[ { "from": "system", "value": "Add setVec3Uniform and remove createIndicesBuffer\n\nDraw with gl.TRIANGLES instead of using indices.\n" }, { "from": "human", "value": "export function createShaderProgram(gl, vs, fs) {\n var program = gl.createProgram();\n\n function createShader(type, source) {...
javascript
chosen
[ { "from": "system", "value": "Add button caret to example for dropdown\n" }, { "from": "human", "value": "const React = require('react');\n\nconst Page = require('./components/Page');\nconst Example = require('./components/Example');\nconst CodeEditor = require('./components/CodeEditor');\n\ncon...
javascript
chosen
[ { "from": "system", "value": "Add next() function to SimpleQueue\n" }, { "from": "human", "value": "module.exports = SimpleQueue;\n\nfunction SimpleQueue() {\n var self = this;\n \n self.fifo = [];\n self.executing = false;\n}\n\nSimpleQueue.prototype.push = function (fn) {\n var self = thi...
javascript
chosen
[ { "from": "system", "value": "Update playground sizes to be more representitive of real-world usage\n" }, { "from": "human", "value": "'use strict';\n\nimport React, { Component } from 'react';\nimport Pic from '../lib/index.js';\n\nexport default class Playground extends Component {\n render()...
javascript
chosen
[ { "from": "system", "value": "Revert \"Making a test fail to ensure that the fix pickes up failing tests\"\n\nThis reverts commit 0868f63e58352ebc4f2db22564883c96664295db.\n" }, { "from": "human", "value": "const frisby = require('frisby')\nconst Joi = frisby.Joi\n\nconst REST_URL = 'http://loca...
javascript
chosen
[ { "from": "system", "value": "Allow picking ngrams (list) by cumulative index\n" }, { "from": "human", "value": "// Pick a random ngram weighted by frequency.\nfunction(head, req) {\n\tprovides(\"json\", function () {\n\t\tvar allowEmpty = !(\"nonempty\" in req.query);\n\t\tvar total = 0;\n\t\tv...
javascript
chosen
[ { "from": "system", "value": "Fix bug in abort functionality. We stored the deferred object instead of the complete XHR object, so attempting an xhr.abort() caused a fatal\n" }, { "from": "human", "value": "(function($) {\n\n// jQuery on an empty object, we are going to use this as our Queue\nva...
javascript
chosen
[ { "from": "system", "value": "Enable URL redirect, disable external data\n" }, { "from": "human", "value": "window.onload = initialize;\n\nvar DATAFILE = \"research.json\";\nvar DONE_READYSTATE = 4;\nvar DONE_STATUS = 200;\nvar OFFICIAL_URL = \"http://www.ecst.csuchico.edu/~kbuffardi/\";\nvar OF...
javascript
chosen
[ { "from": "system", "value": "Update test: Simplify, compact formatting\n" }, { "from": "human", "value": "var ACME = require( '..' )\nvar assert = require( 'assert' )\nvar nock = require( 'nock' )\n\nsuite( 'ACME', function() {\n\n var acme = new ACME({\n baseUrl: 'https://mock_encrypt.exam...
javascript
chosen
[ { "from": "system", "value": "Convert remaining merge to extend\n" }, { "from": "human", "value": "'use strict';\n\nvar merge = require('merge');\nvar rump = require('rump');\nvar webpack = require('./webpack');\n\nexports.rebuild = function() {\n rump.configs.main.globs = merge.recursive({\n ...
javascript
chosen
[ { "from": "system", "value": "Add missing \"require\" after refactor\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/java...
javascript
chosen
[ { "from": "system", "value": "Refactor to call getDetail on componentDidMount rather than on constructor\n" }, { "from": "human", "value": "import React from 'react';\nimport {List, ListItem} from 'material-ui/List';\nimport Divider from 'material-ui/Divider';\nimport Subheader from 'material-ui...
javascript
chosen
[ { "from": "system", "value": "Fix Heroku script (calling npm build)\n" }, { "from": "human", "value": "'use strict';\n\nif ('HEROKU' in process.env || ('DYNO' in process.env && process.env.HOME === '/app')) {\n\n const pkg = require('../package.json');\n const ChildProcess = require('child_pro...
javascript
chosen
[ { "from": "system", "value": "Use a regexp for the initial string search\n\nPreviously, we were using multiple String.indexOf() checks to determine\nif the URL contained any query string parameters we might need to strip.\nString.indexOf() is case-sensitive while our replacement pattern is not,\nso there we...
javascript
chosen
[ { "from": "system", "value": "Use HTTPS for communication with qrserver API\n" }, { "from": "human", "value": "'use strict';\n\nvar request = require('request');\nvar randomstring = require('randomstring');\nvar db = require('./database');\n\nvar handlers = {\n\n showIntro: function(req, res)...
javascript
chosen
[ { "from": "system", "value": "Add generate to_s method option\n" }, { "from": "human", "value": "define(function (require, exports, module) {\n 'use strict';\n\n var AppInit = app.getModule('utils/AppInit');\n var Core = app.getModule('core/Core');\n var PreferenceManager = app.getModule('co...
javascript
chosen
[ { "from": "system", "value": "Remove alias option from Arg\n" }, { "from": "human", "value": "'use strict';\n\n(function () {\n\n var utils = require('./utils');\n var getNodeProperties = utils.getNodeProperties;\n var validateName = utils.validateName;\n var serializeOptions = utils.seriali...
javascript
chosen
[ { "from": "system", "value": "Fix join links on home tab not working\n" }, { "from": "human", "value": "\nvar rohbot = new RohBot(\"wss://fpp.literallybrian.com/ws/\");\nvar chatMgr = new ChatManager(rohbot);\nvar ui = new UserInterface(rohbot, chatMgr);\n\nfunction send(room, message) {\n ui...
javascript
chosen
[ { "from": "system", "value": "Add responsive support for side menu\n" }, { "from": "human", "value": "var DOC = {\n \n 'menu':['api','configuration','recipe','core'],\n \n 'vars':{sass:{},rake:{}},\n \n 'modules':{},\n \n 'go':function(name, fade){\n\n var page,\n ...
javascript
chosen
[ { "from": "system", "value": "Add target to open in a new tab\n" }, { "from": "human", "value": "import React from 'react';\nimport styled from 'styled-components';\nimport generalInfos from '../../globals/data/general-info';\n\nconst Infos = styled.section`\n text-align: center;\n margin: 0.6...
javascript
chosen
[ { "from": "system", "value": "[Refactor] Use fetchAccount instead of receivedAccount\n" }, { "from": "human", "value": "import { receivedAccount } from './account';\nimport { fetchHomeTimeline, receivedHomeTimeline } from './timeline';\nimport { onError } from './error-handler';\nimport { Twitte...
javascript
chosen
[ { "from": "system", "value": "Modify to exclude final text input from enter-key blocking - Berke and Michael\n" }, { "from": "human", "value": "Template.submit.helpers({\n prompts: function() {\n return Prompts.inOrder();\n },\n alreadySubmitted: function() {\n return Session.get('submi...
javascript
chosen
[ { "from": "system", "value": "Add comment on sanitizeFileName option\n" }, { "from": "human", "value": "const config = {\n dir: 'dist',\n sanitizeFileName: (f) => f.includes('tXml') ? f.toLowerCase() : f,\n};\n\nexport default {\n input: ['index.js', 'tXml.js', 'transformStream.js'],\n outpu...
javascript
chosen
[ { "from": "system", "value": "Add snipper for action creator with Axios\n" }, { "from": "human", "value": "// Synchronous\nexport const acName = () => {\n return {\n\n };\n};\n\n// Async using Redux Thunk\n\nexport const acName = () => {\n return dispatch => {\n\n };\n};\n" }, { "fro...
javascript
chosen
[ { "from": "system", "value": "Fix bug when processing ajax response\n" }, { "from": "human", "value": "var request = require('axios')\n\nvar WebpackFeatures = function(featuresContext) {\n this.each = function(fn) {\n this.list().then(function(files) {\n files.forEach(fn)\n ...
javascript
chosen
[ { "from": "system", "value": "Add hooks for element add and remove.\n" }, { "from": "human", "value": "define(['dib',\n 'events',\n 'class'],\nfunction(Dib, Emitter, clazz) {\n \n function Controller() {\n Emitter.call(this);\n this._init();\n }\n clazz.inherits(Controlle...
javascript
chosen
[ { "from": "system", "value": "Refresh tweet when shown/displayed on timer.\n\nSuggested by #HotLange.\n" }, { "from": "human", "value": "$(document).ready(function () {\n\n $('#tweetfeature-change-tweet').click(function() {\n $.getJSON('https://api.twitter.com/1/statuses/oembed.json?ca...
javascript
chosen
[ { "from": "system", "value": "Change ropsten port to 8546 to avoid confusion\n" }, { "from": "human", "value": "var HDWalletProvider = require(\"truffle-hdwallet-provider\");\n\n// 12-word mnemonic\nvar mnemonic = \"onyx aloof polio bronco spearfish clustered refined earflap darkroom slashing ca...
javascript
chosen
[ { "from": "system", "value": "Add support for serving static files in eg folder\n" }, { "from": "human", "value": "/**\n * The simplest possible server for nodebotui\n **/\n\nvar app = require('http').createServer(),\n ui = require('./lib/nodebotui').listen(app);\n \napp.listen(3000);\n\nconso...
javascript
chosen
[ { "from": "system", "value": "Make gradle the first choice\n" }, { "from": "human", "value": "\"use strict\";\n\nconst {ipcRenderer} = require(\"electron\");\n\nwindow.addEventListener(\"DOMContentLoaded\", () => {\n const form = $(\"#form\");\n\n $(\".full\").removeClass(\"hidden\");\n ...
javascript
chosen
[ { "from": "system", "value": "Include newline in master check script\n" }, { "from": "human", "value": "var exec = require('child_process').exec;\n\nexec('git rev-parse --abbrev-ref HEAD', function (error, branch) {\n if (branch === \"master\") process.exit(0);\n else {\n console.lo...
javascript
chosen
[ { "from": "system", "value": "Add comment around tooltip lookup based on component class\n" }, { "from": "human", "value": "import $ from 'jquery';\n\nexport default function findTooltip(selector) {\n\n if (!selector) { // In case of passing null, undefined, etc\n selector = '.ember-tooltip,...
javascript
chosen
[ { "from": "system", "value": "[TIMOB-10000] Remove non wprking remote image url\n" }, { "from": "human", "value": "function image_view_position() {\n\tvar win = Ti.UI.createWindow();\n\t\n\tvar view = Ti.UI.createImageView({\n\t\timage:'http://www.appcelerator.com/wp-content/uploads/2009/06/tita...
javascript
chosen
[ { "from": "system", "value": "Add temporary exceptions to \"use this\" eslint rule\nIn the future, the getServer and getChannel methods of the repositories\nwill use the \"this\" keyword. However, we dont want builds to fail for now,\nso we just add exceptions to the rule which will be removed later\n" },...
javascript
chosen
[ { "from": "system", "value": "Increase refresh time for download list\n" }, { "from": "human", "value": "'use strict';\n\n/**\n* @ngdoc function\n* @name torrentSubscribeFrontendApp.controller:MainCtrl\n* @description\n* # MainCtrl\n* Controller of the torrentSubscribeFrontendApp\n*/\nangular.mo...
javascript
chosen
[ { "from": "system", "value": "Use 2578 as port on example\n" }, { "from": "human", "value": "const LocalDatabaseConnector = require('../shared/local-database-connector')\nconst os = require('os')\nglobal.instanceId = os.hostname();\n\nconst SyncProcessManager = require('./sync-process-manager')\...
javascript
chosen
[ { "from": "system", "value": "Transform emitted code with babel\n" }, { "from": "human", "value": "import fs from \"fs\";\nimport path from \"path\";\nimport babel from \"babel\";\nimport nodeEval from \"eval\";\nimport {parse, SyntaxError} from \"../../src/compiler/parser\";\nimport emit from \...
javascript
chosen
[ { "from": "system", "value": "Decrease mapLimit and pool maximums\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\n\nvar stdin = process.openStdin();\n\nvar async = require('async');\nvar cheerio = require('cheerio');\nvar ent = require('ent');\nvar request = require('req...
javascript
chosen
[ { "from": "system", "value": "Add notes on Pelco P serial port baud rate\n" }, { "from": "human", "value": "/*\n *\n * Read and decode Pelco D CCTV commands from a Serial Port / COM Port (using node-serialport)\n * Copyright 2016 Roger Hardiman\n *\n */\n\n// External Dependencies\nvar SerialPor...
javascript
chosen
[ { "from": "system", "value": "Remove syncHistoryWithStore from example code\n" }, { "from": "human", "value": "import { AppContainer } from 'react-hot-loader'\nimport { applyMiddleware, compose, createStore } from 'redux'\nimport { createBrowserHistory } from 'history'\nimport { routerMiddleware...
javascript
chosen
[ { "from": "system", "value": "Fix loadBlocks initializing all blocks to Undefined\n" }, { "from": "human", "value": "var $ = require('jquery');\nvar SirTrevor = require('sir-trevor-js');\n\nmodule.exports = {\n\n\tloadLocale: function(localeName, locale) {\n\t\tSirTrevor.Locales[localeName] = Si...
javascript
chosen
[ { "from": "system", "value": "Fix nasty bug with calculating bytes in patterns\n" }, { "from": "human", "value": "export const dataFactory = buffer => {\n const data = new DataView(buffer);\n let offset = 0;\n\n return {\n hasNext() {\n return offset < data.byteLength;\n },\n ne...
javascript
chosen
[ { "from": "system", "value": "Revert \"[CHORE] refactor startGateway function to take callback.\"\n\nThis reverts commit 6cf2e71a48801b7b6edee80d28806a48bc83aa17.\n" }, { "from": "human", "value": "var GatewayProcessManager = require(__dirname+'/../process_manager.js');\n\n/**\n * @function star...
javascript
chosen
[ { "from": "system", "value": "Rename DELETE request route to reflect prepended /collection\n" }, { "from": "human", "value": "const express = require('express'),\n router = express.Router({mergeParams: true}),\n db = require('../models');\n\nrouter.get('/', function(req, res, next) {\n...
javascript
chosen
[ { "from": "system", "value": "Test case for grant and exchange aliases.\n" }, { "from": "human", "value": "var vows = require('vows');\nvar assert = require('assert');\nvar util = require('util');\nvar oauth2orize = require('index');\nvar Server = require('server');\n\n\nvows.describe('oauth2ori...
javascript
chosen