conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change way CSV parser opts are passed in\n\n- i'll open that up to the CLI args somehow so the user can alter the 'fast-csv' package parsing args\n" }, { "from": "human", "value": "const fs = require('fs')\nconst csv = require('fast-csv')\n\nconst transformToDocs = ...
javascript
chosen
[ { "from": "system", "value": "Fix eternal reload on pages with no stylesheets.\n\nThis fixes test-in-console, which was never completing test runs because\nthe page would reload constantly (or something).\n" }, { "from": "human", "value": "WebApp = {\n\n _isCssLoaded: function () {\n return ...
javascript
chosen
[ { "from": "system", "value": "Fix JSON parsing with primitive types\n" }, { "from": "human", "value": "\"use strict\";\n\nvar Serializer = require('./Serializer'),\n inherits = require('inherits');\n\nvar JSONSerializer = function () {\n\n};\n\ninherits(JSONSerializer, Serializer);\n\nJSONSer...
javascript
chosen
[ { "from": "system", "value": "Check DB connection, simplified counter\n" }, { "from": "human", "value": "var express = require('express');\nvar morgan = require('morgan');\nvar redis = require('redis');\n\nvar port = process.env.PORT || 3000;\nvar dbhost = process.env.DBHOST || \"redis\";\n\nvar...
javascript
chosen
[ { "from": "system", "value": "Use process.env.npm_execpath for non-windows systems\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n'use strict';\nconst childProcess = require('child_process');\nconst isCi = require('is-ci');\nconst isWindows = process.platform === 'win32';\nconst npmEx...
javascript
chosen
[ { "from": "system", "value": "Throw error when not able to find board ID\n" }, { "from": "human", "value": "(function (){\n \"use strict\";\n\n function getBoardID(){\n var pathname = window.location.pathname;\n var regex = /\\/b\\/(\\w*)(\\/*)/;\n var boardID = regex.exec(pathname);\...
javascript
chosen
[ { "from": "system", "value": "Add ignore all events function\n" }, { "from": "human", "value": "type LivEventHandler = (msgData: Object) => void;\n\nexport default class LiveEvents {\n\n messageHandlers: Object;\n\n constructor() {\n this.messageHandlers = {};\n }\n\n emitSing...
javascript
chosen
[ { "from": "system", "value": "Use Mongo's $or in Feature.search()\n" }, { "from": "human", "value": "var debug = require('debug')('rose');\nvar mongoose = require('mongoose');\n\nvar mongoURI = process.env.MONGOLAB_URI || 'mongodb://localhost/mydb';\ndebug('Connecting to MongoDB at ' + mongoURI ...
javascript
chosen
[ { "from": "system", "value": "Fix off-by-one error for line lengths\n" }, { "from": "human", "value": "var Issue = require('../issue');\n\nmodule.exports = {\n name: 'line-length',\n on: ['line']\n};\n\nmodule.exports.lint = function (line, opts) {\n var maxLength = opts[this.name];\n var ig...
javascript
chosen
[ { "from": "system", "value": "Fix a regression that broke pre-fill of username when sending private message\n" }, { "from": "human", "value": "/**\n This controller supports all actions on a user's activity stream\n\n @class UserActivityController\n @extends Discourse.ObjectController\n @nam...
javascript
chosen
[ { "from": "system", "value": "Add polymer-app test suite to grunt.\n" }, { "from": "human", "value": "module.exports = {\n\toptions: { reporter: 'spec' },\n\tall: {\n\t\tsrc: [\n\t\t\t'test/app-test.js',\n\t\t\t'test/node-test.js',\n\t\t\t'test/node-server-test.js'\n\t\t]\n\t},\n\tapp: { src: '...
javascript
chosen
[ { "from": "system", "value": "Fix partial the error 401 handler\n" }, { "from": "human", "value": "import React from 'react'\nimport { Provider } from 'react-redux'\nimport axios from 'axios'\nimport { store, history } from './redux/store'\nimport PublicRoutes from './router'\nimport '../src/sty...
javascript
chosen
[ { "from": "system", "value": "Fix website by adding unicode-categories to bundle\n" }, { "from": "human", "value": "var roy = {};\n\n//= node_modules/underscore/underscore.js\n\n(function(){\n var module = {\"parent\": true};\n var modules = {\"underscore\": _};\n var load = {};\n va...
javascript
chosen
[ { "from": "system", "value": "Use ',' to separate style names.\n" }, { "from": "human", "value": "/*global define*/\r\n/*jslint unparam:true*/\r\ndefine(function () {\r\n 'use strict';\r\n\r\n return {\r\n load: function (name, req, onLoad, config) {\r\n var names = name....
javascript
chosen
[ { "from": "system", "value": "Add publicPath so dev-server works\n" }, { "from": "human", "value": "var path = require('path');\n\nmodule.exports = {\n entry: path.join(__dirname, \"src\", \"react-three-exposeglobals.js\"),\n\n output: {\n path: path.join(__dirname, \"build\"),\n filenam...
javascript
chosen
[ { "from": "system", "value": "Update @ Sat Mar 11 2017 17:01:32 GMT+0800 (CST)\n" }, { "from": "human", "value": "const { exec } = require('child_process')\nconst ora = require('ora')\nconst config = require('../config')\n\nconst spinner = ora('Deploy to gh-pages...')\nspinner.start()\n\nfunctio...
javascript
chosen
[ { "from": "system", "value": "Fix for saml login redirect loop when user is not in internal database.\n" }, { "from": "human", "value": "angular.module(\"application\").controller(\"MainMenuController\", [\n \"$scope\", \"$window\", \"Person\", \"PersonalAddress\", \"HelpText\", \"$rootScope\"...
javascript
chosen
[ { "from": "system", "value": "Add back check for string 'undefined'\n\n(There was probably some case where this was happening instead of the 'null' thing)" }, { "from": "human", "value": "const utils = require('../lib/utils')\nconst insecurity = require('../lib/insecurity')\nconst models = requi...
javascript
chosen
[ { "from": "system", "value": "Make sure to go top to bottom for switch\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { createStore, applyMiddleware } from 'redux';\nimport { BrowserRouter, Route }...
javascript
chosen
[ { "from": "system", "value": "Replace browser router with hash router to avoid hadling routing on server side\n" }, { "from": "human", "value": "import React from 'react'\nimport {render} from 'react-dom'\nimport {Provider} from 'react-redux'\nimport Home from './components/home/Home'\nimport {\...
javascript
chosen
[ { "from": "system", "value": "Remove manual unhandled rejection handler since Raven does this by default finally\n" }, { "from": "human", "value": "import React from 'react';\nimport { render } from 'react-dom';\nimport { install, captureException } from 'common/errorLogger';\n\nimport './static...
javascript
chosen
[ { "from": "system", "value": "Use sendError to send back error\n" }, { "from": "human", "value": "const { send } = require('micro');\nconst Raven = require('raven');\n\nmodule.exports = exports = url => fn => {\n if (!url)\n throw Error('micro-sentry must be initialized with a Sentry DSN.');...
javascript
chosen
[ { "from": "system", "value": "Fix bug with dom-properties, support deprecated valueLink and checkedLink, support Caputre events\n" }, { "from": "human", "value": "import DOMProperty from 'react-dom/lib/DOMProperty'\nimport EventPluginRegistry from 'react-dom/lib/EventPluginRegistry'\n\n\nconst r...
javascript
chosen
[ { "from": "system", "value": "Add hapi extension to redirect route.\nNew behavior looks at query string for keyword 'hapi_method'. The value will override the current route-method.\nThis is currently used to map http-POST requests to PUT-defined routes.\nIdeally, a form-value would be used to do the same th...
javascript
chosen
[ { "from": "system", "value": "Resolve bug by chaging API context of overview gadget\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n * WSO2 Inc. licenses this file to you under the Apache License,\n * Version 2.0 (the \"Lic...
javascript
chosen
[ { "from": "system", "value": "Change behaviour of onShow / onHide for community video\n- set whole html as data\n" }, { "from": "human", "value": "Kwf.onJElementReady('.kwcAdvancedCommunityVideo', function(el, config) {\n el.data('config', config);\n}, {priority: -1});\n\nKwf.onJElementWidthC...
javascript
chosen
[ { "from": "system", "value": "Refresh BrowserSync if something changes.\n\n" }, { "from": "human", "value": "'use strict';\n\nvar gulp = require('gulp'),\n config = require('../config'),\n bs = require('browser-sync').get('SIM01');\n\nmodule.exports = function() {\n gulp.watch(config.wa...
javascript
chosen
[ { "from": "system", "value": "Fix listeners getting registered too many times on card scan\n" }, { "from": "human", "value": "var cardio = require('com.pointsource.card.io');\nfunction openCardIO() {\n\n\tconsole.log(\"Opening Card.io\");\n\tcardio.addEventListener(\"scan\", function(e) {\n\t\tc...
javascript
chosen
[ { "from": "system", "value": "Update properly guildes with priority 10\n" }, { "from": "human", "value": "\"use strict\";\n\n//Load dependencies\nvar async = require(\"async\");\nvar applicationStorage = process.require(\"core/applicationStorage.js\");\nvar updateModel = process.require(\"update...
javascript
chosen
[ { "from": "system", "value": "Remove lib reference from test\n" }, { "from": "human", "value": "var ultralite = require('../lib/ultralite.js');\n\ndescribe('combat', function() {\n\tdescribe('attack', function() {\n\t\tit(\"should allow a character to attack\");\n\t\tit(\"should allow a characte...
javascript
chosen
[ { "from": "system", "value": "Set log level of tests to error\n" }, { "from": "human", "value": "const bunyan = require(\"bunyan\");\nconst isTest = !process.env.npm_package_name;\nvar log;\n\nif (!isTest) {\n log = bunyan.createLogger({\n name: process.env.npm_package_name,\n l...
javascript
chosen
[ { "from": "system", "value": "Add new bot instance before each test\n" }, { "from": "human", "value": "describe('Bot class', function () {\n it('', function () {\n\n });\n});" }, { "from": "gpt", "value": "describe('Bot class', function () {\n\n beforeEach(function () {\n s.ini...
javascript
chosen
[ { "from": "system", "value": "Set 'usage' as the default task\n" }, { "from": "human", "value": "// blah blah\n\nvar path = require('path');\n\nfunction requireTask(task) {\n return require(path.join(process.cwd(), 'tasks', task + '.js'));\n}\nfunction requireScript(script) {\n return require(...
javascript
chosen
[ { "from": "system", "value": "Update dependency declarations to line up =\n" }, { "from": "human", "value": "'use strict';\n\nvar assert = require('assert')\n , fs = require('fs')\n , path = require('path')\n , handlebars = require('handlebars')\n , cssInjector = require('../wrappers/cssInje...
javascript
chosen
[ { "from": "system", "value": "Build system to include .html\n" }, { "from": "human", "value": "// Task configurations\nmodule.exports = function(grunt) {\n\tgrunt.initConfig({\n\t\tpkg: grunt.file.readJSON('manifest.json'),\n\t\tbumpup: {\n\t\t\toptions: {\n\t\t\t\tupdateProps: {\n\t\t\t\t\tpkg:...
javascript
chosen
[ { "from": "system", "value": "Add toString() for invalid URL error\n" }, { "from": "human", "value": "'use strict';\n\nvar querystring = require('querystring');\nvar shortener = require('../shortener');\nvar urlValidator = require('../urlValidator');\n\nmodule.exports = (req, res, done) => {\n\n...
javascript
chosen
[ { "from": "system", "value": "Add query to get user by email\n" }, { "from": "human", "value": "const pgp = require('pg-promise')()\n\nconst dbName = 'vinyl'\nconst connectionString = process.env.DATABASE_URL || `postgres://localhost:5432/${dbName}`\nconst db = pgp(connectionString)\n\nconst get...
javascript
chosen
[ { "from": "system", "value": "Substitute merge() with assign() - Ember deprecation\n" }, { "from": "human", "value": "import { get } from '@ember/object';\nimport { merge } from '@ember/polyfills';\n\nimport computeFn from '../utils/helper-compute';\nimport BaseHelper from './-base';\n\nexport d...
javascript
chosen
[ { "from": "system", "value": "Fix error when auth not present\n\nChange-Id: I8222b18587954fa00c5887aaf0e67db958509c7e\n" }, { "from": "human", "value": "'use strict'\n\nvar ComposrError = require('composr-core').ComposrError\nvar logger = require('../../utils/composrLogger')\nvar tokenVerifier =...
javascript
chosen
[ { "from": "system", "value": "Add undo/redo buttons and remove sub-/superscript buttons\n" }, { "from": "human", "value": "'use strict';\n\n(function (document, CKEDITOR) {\n document.addEventListener('DOMContentLoaded', function () {\n // RTE\n Array.prototype.forEach.call(docu...
javascript
chosen
[ { "from": "system", "value": "Fix \"revoke invite\" feature on /team page\n\nrefs #5947\n- override the `findRecord` method of the user adapter to always include \"status=all\" when querying by ID\n" }, { "from": "human", "value": "import ApplicationAdapter from 'ghost/adapters/application';\n\n...
javascript
chosen
[ { "from": "system", "value": "Revert \"change visibility to display\"\n\nThis reverts commit cdb30318519923f212b6e612f85d96c2aea6a078.\n" }, { "from": "human", "value": "\nmodule.exports = {\n sayHelloInEnglish: function() {\n return \"HELLO\";\n },\n\n sayHelloInSpanish: function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Add value getter/setter for hidden form field\n" }, { "from": "human", "value": "/**\n * @class CM_FormField_Hidden\n * @extends CM_FormField_Abstract\n */\nvar CM_FormField_Hidden = CM_FormField_Abstract.extend({\n\t_class: 'CM_FormField_Hidden'\n});" }, { ...
javascript
chosen
[ { "from": "system", "value": "Fix for jQuery version of isLoading()" }, { "from": "human", "value": "/*!\n * Ladda for jQuery\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2015 Hakim El Hattab, http://hakim.se\n */\n\n(function( Ladda, $ ) {\n\tif ($ === undefined)\n\t\tre...
javascript
chosen
[ { "from": "system", "value": "Make sure there's always an index\n" }, { "from": "human", "value": "'use strict'\n\nclass EventIndex {\n get() {\n return this._index\n }\n\n updateIndex(oplog) {\n this._index = oplog.items\n }\n}\n\nmodule.exports = EventIndex\n" }, { "from": "g...
javascript
chosen
[ { "from": "system", "value": "Fix problem with highlighting tokens after whitespace\n" }, { "from": "human", "value": "CodeMirror.defineMode(\"roy\", function(config, parserConfig) {\n return {\n token: function(stream, state) {\n var token;\n try {\n token = roy.lexer.token...
javascript
chosen
[ { "from": "system", "value": "[TASK] Add a path key for the main requireJS module\n" }, { "from": "human", "value": "/**\n * RequireJS configuration\n * @description Pass in options for RequireJS like paths, shims or the baseUrl\n */\nrequire.config({\n\tpaths: {\n\t\t\"jquery\" : \"Libaries/jqu...
javascript
chosen
[ { "from": "system", "value": "Update webpack externals to fix issue with React\n" }, { "from": "human", "value": "import { resolve } from 'path';\nimport { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';\n\nconst config = {\n entry: {\n core: resolve('src', 'core', 'index.js'),\n r...
javascript
chosen
[ { "from": "system", "value": "Remove 1px black border at bottom\n" }, { "from": "human", "value": "import styled from 'styled-components';\n\nconst Wrapper = styled.footer`\n display: flex;\n justify-content: space-between;\n padding: 3em 0;\n border-top: 1px solid #666;\n`;\n\nexport defaul...
javascript
chosen
[ { "from": "system", "value": "Integrate with localhost gocool application\n" }, { "from": "human", "value": "jsgvLoader.siteHandlers = [];\n \njsgvLoader.addSiteHandler = function(handler){\n this.siteHandlers[handler.length] = handler;\n}\n\njsgvLoader.handleThis = function(){\n var handled ...
javascript
chosen
[ { "from": "system", "value": "prettier: Fix code that slipped through the cracks\n" }, { "from": "human", "value": "// @flow\n\n/*\n * Monkey-patch RN's URL global.\n *\n * A history: get-urls@8 requires normalize-url@2, which uses the new\n * window.URL global object for URL parsing.\n *\n * RN...
javascript
chosen
[ { "from": "system", "value": "Fix chart on shows page, thanks to API changes.\n" }, { "from": "human", "value": "Chart.defaults.global.responsive = true;\nvar ctx = document.getElementById(\"showStats\").getContext(\"2d\");\nvar statsChart = new Chart(ctx).Bar(statsData, {});\n" }, { "fr...
javascript
chosen
[ { "from": "system", "value": "Fix code for new ESLint rules\n" }, { "from": "human", "value": "import React from 'react';\n\n\nconst Component = React.createClass({\n render() {\n return <div>Component</div>;\n }\n});\n\n\nexport default Component;\n" }, { "from": "gpt", "value"...
javascript
chosen
[ { "from": "system", "value": "Use a fixed size of 100 bytes for the randomly generated data\n" }, { "from": "human", "value": "'use strict';\n\nconst chai = require('chai');\nconst crypto = require('crypto');\nconst lzo = require('../index');\n\nconst expect = chai.expect;\n\nlet data = crypto.r...
javascript
chosen
[ { "from": "system", "value": "Return promise when loading sidebar\n" }, { "from": "human", "value": "class Sidebar {\n\n constructor() {\n const self = this;\n const doc = $(document);\n\n doc.on('click', 'a[href][data-open-sidebar]', function (e) {\n e.prevent...
javascript
chosen
[ { "from": "system", "value": "Add test for default allowHeaders\n" }, { "from": "human", "value": "var request = require('supertest');\r\nvar express = require('express');\r\nvar ach = require('../index.js');\r\n\r\ndescribe(\"using ach\", function() {\r\n describe(\"with defaults\", function()...
javascript
chosen
[ { "from": "system", "value": "Make the anchor working when edit a XML file\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @ngdoc directive\n * @name waxeApp.directive:editor\n * @description\n * # editor\n */\nangular.module('waxeApp')\n .directive('editor', ['$interval', 'Sessio...
javascript
chosen
[ { "from": "system", "value": "Implement basic in-task error handling\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict'\n\nconst fs = require('fs')\n\nconst argv = require('yargs')\n .usage('Usage: $0 [<task to run> ...]')\n .example('$0', 'Runs task \"default\" from file \"t...
javascript
chosen
[ { "from": "system", "value": "Convert Cell to ES6 class syntax\n" }, { "from": "human", "value": "export function Cell(index, rowIndex, value) {\n this.index = index;\n this.rowIndex = rowIndex;\n this.value = value;\n}\n\nCell.prototype.id = function() {\n return `${this.rowIndex}${this.ind...
javascript
chosen
[ { "from": "system", "value": ":art: Declare tree var in the root description\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.\n...
javascript
chosen
[ { "from": "system", "value": "Make docker-compose runner a little more robust\n" }, { "from": "human", "value": "var spawn = require('child_process').spawn;\n\nfunction Runner() {\n}\n\nRunner.prototype.init = function(bosco, next) {\n this.bosco = bosco;\n next();\n};\n\nRunner.prototype.list...
javascript
chosen
[ { "from": "system", "value": "Fix condition for fetching content\n" }, { "from": "human", "value": "import { contentsRef, routesRef } from '@/admin/firebase_config/index'\nimport contentFetch from '@/admin/mixins/contentFetch'\nimport _ from 'lodash'\n\nexport default {\n mixins: [contentFetch]...
javascript
chosen
[ { "from": "system", "value": "Add 2 more tests to cover cases where parent node isn't `computed`\n" }, { "from": "human", "value": "describe('lib/rules/disallow-computedany', function () {\n var checker = global.checker({\n plugins: ['./lib/index']\n });\n\n describe('not configu...
javascript
chosen
[ { "from": "system", "value": "Set z-index for spinner to 0\n\n- Would be nice to be able to disable z-index so css class could take over\n but for now the z-index is just set to 0\n" }, { "from": "human", "value": "(function ($) {\n\n $.fn.spin = function(opts) {\n this.each(function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Remove non gradable questions from the array.\n" }, { "from": "human", "value": "import {\n getAllSentenceFragmentConceptResults\n} from './sentenceFragment';\nimport {\n getConceptResultsForSentenceCombining\n} from './sentenceCombining';\nimport {\n getConceptR...
javascript
chosen
[ { "from": "system", "value": "Make lifecycle component a React class component since it requires React-Lifecycle states\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n * WSO2 Inc. licenses this file to you under the Apache ...
javascript
chosen
[ { "from": "system", "value": "Fix `variable is not defined` issue\n" }, { "from": "human", "value": "// Action Cable provides the framework to deal with WebSockets in Rails.\n// You can generate new channels where WebSocket features live using the rails generate channel command.\n//\n//= require...
javascript
chosen
[ { "from": "system", "value": "Add MIME type mapping for Handlebars files." }, { "from": "human", "value": "\"use strict\";\n\n/**\nMIME type definitions consisting of those in `mime-db` plus custom additions and\noverrides.\n\nSee <https://github.com/jshttp/mime-db> for details on the format.\n*...
javascript
chosen
[ { "from": "system", "value": "Allow kebab-cased CSS module selectors\n" }, { "from": "human", "value": "/**\n * Implement Gatsby's Node APIs in this file.\n *\n * See: https://www.gatsbyjs.org/docs/node-apis/\n */\n\n// You can delete this file if you're not using it\n\nexports.onCreateWebpackCo...
javascript
chosen
[ { "from": "system", "value": "Use map to make sure screen/image are in proportion\n" }, { "from": "human", "value": "var img;\nvar smallPoint, largePoint;\n\nfunction preload() {\n var url = unescape(decodeURIComponent(window.urlParams.screenshot));\n img = loadImage(url);\n}\n\nfunction s...
javascript
chosen
[ { "from": "system", "value": "Add messages to each assertion\n" }, { "from": "human", "value": "'use strict'\n\nvar test = require('tape')\nvar isURL = require('../../is/url')\n\nvar testCases = [\n// ['url',expectedResult]\n ['boom', false],\n ['perdu.com', true],\n ['http://domain.ext/path?...
javascript
chosen
[ { "from": "system", "value": "Fix brain error camelize -> underscoreize\n\nMeant the statistics was not being filtered for date range\n" }, { "from": "human", "value": "import axios from '@/base/api/axios'\nimport { camelizeKeys } from '@/utils/utils'\n\nexport default {\n async activityHistory...
javascript
chosen
[ { "from": "system", "value": "Fix the way in which the done callback was being fired\n" }, { "from": "human", "value": "'use strict';\n\nvar assign = require('lodash').assign;\nvar del = require('del');\n\nvar defaults = {\n dest: 'dist'\n};\n\nmodule.exports = function (gulp, options) {\n var...
javascript
chosen
[ { "from": "system", "value": "Use another way to set title.\n" }, { "from": "human", "value": "define([\n 'lib/underscore',\n 'lib/backbone',\n 'component/grid/projection/base',\n], function (_, Backbone, BaseProjection) {\n var Model = BaseProjection.extend({\n name: 'column-hovertext',\...
javascript
chosen
[ { "from": "system", "value": "Update api root to use scpr.org\n" }, { "from": "human", "value": "window.Kpcc = Ember.Application.create();\n\nKpcc.Store = DS.Store.extend({\n adapter: DS.RESTAdapter.extend({\n url : \"http://localhost:3000\",\n namespace : \"api/v3\"\n...
javascript
chosen
[ { "from": "system", "value": "Fix check for window, variable is not available in node context\n" }, { "from": "human", "value": "/**\n * Web3 Helper\n * Returns initialized web3 instance\n *\n * @author: U-Zyn Chua <chua@uzyn.com>\n */\nvar Web3 = require('web3');\nvar web3;\nif (typeof window.w...
javascript
chosen
[ { "from": "system", "value": "Fix mocha test (ts support)\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = {\n\n // TODO: cache\n transpile(src, filename, babelConfig, tsCompilerOptions) {\n const babel = require('babel-core');\n const tsc = require('typescript');\n ...
javascript
chosen
[ { "from": "system", "value": "Set editor height to original textarea height\n\nFor some reason, CKeditor doesn't do this automatically for height, although it does for width.\n" }, { "from": "human", "value": "//= requires \"editor\"\n//= requires <mootools/DomReady>\n//= requires <mootools/Sele...
javascript
chosen
[ { "from": "system", "value": "Fix jsdom tests to support jsdom10\n" }, { "from": "human", "value": "import { jsdom } from 'jsdom';\n\nglobal.document = jsdom('<div id=\"app\"></div>');\nglobal.window = document.defaultView;\n\nObject.keys(document.defaultView).forEach((property) => {\n if (type...
javascript
chosen
[ { "from": "system", "value": "Set the umask and chown the volume on launch.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar path = require('path');\nvar async = require('async');\nvar strider = require('strider');\nvar logger = require('strider/lib/logging');\n\nvar user = require(...
javascript
chosen
[ { "from": "system", "value": "Use new grunt files API.\n" }, { "from": "human", "value": "/*\n * grunt-markdown\n * https://github.com/treasonx/grunt-markdown\n *\n * Copyright (c) 2012 James Morrin\n * Licensed under the MIT license.\n */\n\nmodule.exports = function(grunt) {\n 'use strict';\n...
javascript
chosen
[ { "from": "system", "value": "Test for matching file contents\n" }, { "from": "human", "value": "var expect = require('expect.js'),\n fs = require('fs'),\n helper = require('./helper')\n\ndescribe('data copying', function() {\n\tbefore(function(done) {\n\t\thelper.nanodocHere(done);\n\t});...
javascript
chosen
[ { "from": "system", "value": "Allow salt to be an object with valueOf() -> string.\n" }, { "from": "human", "value": "var isArray = Array.isArray;\n\nexports.emaNeurt = function emaNeurt(o) {\n\treturn exports.trueName(o, '\\u202e');\n};\n\nexports.trueName = function trueName(obj, salt) {\n\tva...
javascript
chosen
[ { "from": "system", "value": "Save one line of code\n" }, { "from": "human", "value": "var lastField = null;\nvar currentFillColor = ''; // ???\nvar changeCounter = 0; // ???\n\nfunction setField(element) {\n // element contains the current html element\n if (element.style.backgrou...
javascript
chosen
[ { "from": "system", "value": "fix(frontend): Fix bug with games after first authorization.\n" }, { "from": "human", "value": "/**\n * Created by stas on 06.01.16.\n */\n'use strict';\n\nvar playzoneApp = angular.module('playzoneApp', [\n 'ngRoute',\n 'ngCookies',\n 'ngResource',\n 'n...
javascript
chosen
[ { "from": "system", "value": "Update dependency node-sass to v4.8.3" }, { "from": "human", "value": "Package.describe({\n name: 'angular-scss-compiler',\n version: '0.3.1_2',\n summary: 'Angular Scss Compiler Package',\n git: 'https://github.com/Urigo/angular-meteor/tree/master/atmosphere-pa...
javascript
chosen
[ { "from": "system", "value": "Test cases for required callbacks.\n" }, { "from": "human", "value": "var vows = require('vows');\nvar assert = require('assert');\nvar url = require('url');\nvar util = require('util');\nvar ConsumerStrategy = require('passport-http-oauth/strategies/consumer');\n\n...
javascript
chosen
[ { "from": "system", "value": "Add myself (roryokane) to the authorized user list\n" }, { "from": "human", "value": "module.exports = {\n users: [ // ADD YOUR USERNAME AT THE TOP\n\t\t'megamattron', \n\t\t'pents90',\n\t\t'michaelnovakjr',\n\t\t'markbao',\n\t\t'kalmi',\n\t\t'lablayers'\n\t]\n};...
javascript
chosen
[ { "from": "system", "value": "Fix typo in ternary expression\n" }, { "from": "human", "value": "'use strict';\n\nvar findup = require('findup-sync');\nvar spawnSync = require('child_process').spawnSync;\nvar win32 = process.platform === 'win32';\nvar gruntPath = findup('node_modules/{.,}bin/grun...
javascript
chosen
[ { "from": "system", "value": "Remove hack for news24 android app since loading pym async fixes it\n" }, { "from": "human", "value": "if (document.location.hostname == \"localhost\") {\n var baseurl = \"\";\n} else {\n var baseurl = \"https://noconfidencevote.openup.org.za\";\n}\n\nvar init...
javascript
chosen
[ { "from": "system", "value": "Fix autoselecting the current window's instance\n" }, { "from": "human", "value": "import { LIFTED_ACTION, SELECT_INSTANCE } from 'remotedev-app/lib/constants/actionTypes';\nimport { getActiveInstance } from 'remotedev-app/lib/reducers/instances';\n\nfunction panelD...
javascript
chosen
[ { "from": "system", "value": "Fix typo with the usage of req.query\n" }, { "from": "human", "value": "var express = require('express')\n , router = express.Router()\n , Qpv = require('../models/qpv.js')\n , geojson = require('../helpers/geojson.js')\n , isvalidgeo = require('../helpers/isval...
javascript
chosen
[ { "from": "system", "value": "Hide the flashes after 10 seconds\n" }, { "from": "human", "value": "import PostForm from './post_form';\n\n$(function() {\n $(document.body).on('click', '#flash p', function(e) {\n e.preventDefault();\n $(this).fadeOut(200);\n });\n\n $('.site_nav__search,...
javascript
chosen
[ { "from": "system", "value": "Fix tag preFetch request param bug.\n" }, { "from": "human", "value": "/**\n * Created by jack on 16-8-27.\n */\n\nimport vue from 'vue';\nimport { mapState, mapActions } from 'vuex';\n\nimport template from './tags.html';\nimport tagsActions from 'vuexModule/tags/a...
javascript
chosen
[ { "from": "system", "value": "Add reconnect/disconnect events to fallback connection." }, { "from": "human", "value": "function build_url(host, command, node = \"\") {\n if( node == \"local\" ){\n return 'http://' + host + '/api/' + encodeURI(command).replace(/#/g, '%23');\n } else {\n r...
javascript
chosen
[ { "from": "system", "value": "Disable right click on images\n" }, { "from": "human", "value": "import React from 'react';\n\nconst AssetImage = (\n ({ file }) => (\n <img src={file.src} style={file.computedStyle} />\n )\n);\n\nexport default AssetImage;\n" }, { "from": "gpt", "v...
javascript
chosen
[ { "from": "system", "value": "Fix the combineReducers utility to correct handling full module path.\n" }, { "from": "human", "value": "import {isFunction, get} from \"lodash\";\n\nexport function combineReducers(stateReducerMap) {\n return function(state, action) {\n let changed = false;\n\n...
javascript
chosen
[ { "from": "system", "value": "Add option to Ignore Comments\n" }, { "from": "human", "value": "'use babel'\n\nimport { lint } from 'mixedindentlint'\nimport LinterHelpers from 'atom-linter'\n\nexport default {\n\tconfig: {},\n\n\tactivate() {\n\t},\n\n\tdeactivate() {\n\t},\n\n\tscanFile( textEd...
javascript
chosen
[ { "from": "system", "value": "Define Trix.start when we declare Trix constant\n" }, { "from": "human", "value": "import { version } from \"../../package.json\"\n\nimport * as config from \"trix/config\"\nimport * as core from \"trix/core\"\nimport * as models from \"trix/models\"\nimport * as vi...
javascript
chosen
[ { "from": "system", "value": "Update user agent to v2 and add url to repo\n" }, { "from": "human", "value": "const {cpus} = require('os')\n\nconst defaultLogger = require('./logger')\n\nmodule.exports = {\n etag: null,\n lastModified: null,\n userAgent: 'plunger/1.0',\n timeout: {\n conne...
javascript
chosen