conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "BUGFIX: Make sure to livequery the migrate button...\n" }, { "from": "human", "value": "\n/**\n * jQuery functionality used on the external content admin page\n */\n\n;(function ($, pt) {\n\t$().ready(function () {\n\t\t// bind the upload form\n\t\t$('#Form_EditForm...
javascript
chosen
[ { "from": "system", "value": "Disable cache busting for dashboard\n" }, { "from": "human", "value": "// Set the require.js configuration for your application.\nrequire.config({\n\n // Initialize the application with the main application file.\n deps: [\"main\"],\n\n paths: {\n\n // Librari...
javascript
chosen
[ { "from": "system", "value": "[cli] Improve help text on init command\n" }, { "from": "human", "value": "import lazyRequire from '@sanity/util/lib/lazyRequire'\n\nconst helpText = `\nOptions\n -y, --yes Use unattended mode, accepting defaults and using only flags for choices\n --project <proje...
javascript
chosen
[ { "from": "system", "value": "Add correct icon class to issuetype" }, { "from": "human", "value": "import React from \"react\";\nexport const default_icon = \"fa fa-circle-o\";\n\nexport const un_ocha_icon_mapping = {\n \"core-relief-item\": \"core-relief-item\",\n shelter: \"shelter\",\n hea...
javascript
chosen
[ { "from": "system", "value": "Add description to flatten function\n" }, { "from": "human", "value": "export function flatten(obj) {\n let flatObj = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== null && value !== undefined && value.hasOwnProperty('value')) {...
javascript
chosen
[ { "from": "system", "value": "Sort menus only in parent containment\n" }, { "from": "human", "value": "var initMenu=function(){var e=\"li:not(.toggle-blade-helper)\",n=function(e,t){var a=[];return e.children(t).map(function(e,o){var l={key:$(o).data(\"key\")};$(o).children(\"ul\").length>0&&(l....
javascript
chosen
[ { "from": "system", "value": "Add unit test for SC.run passing extra arguments to the method.\n" }, { "from": "human", "value": "// ==========================================================================\n// Project: SproutCore Runtime\n// Copyright: ©2011 Strobe Inc. and contributors.\n// L...
javascript
chosen
[ { "from": "system", "value": "Add a missing param doc.\n" }, { "from": "human", "value": "import findCounterpartCharacter from './findCounterpartCharacter';\n\n/**\n * Determines whether a node is surrounded by a matching pair of grouping\n * characters.\n *\n * @param {Object} node\n * @param {...
javascript
chosen
[ { "from": "system", "value": "Allow for 2nd argument to be destination filename\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nrequire('coffee-script').register()\n\nvar fs = require('fs'),\n indentation = require('../lib/indentation'),\n buf, emblemFile, hbsFile, output;\n\nif ...
javascript
chosen
[ { "from": "system", "value": "Add error handling to initial connection in repl" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar repl = require(\"repl\");\nvar massive = require(\"../index\");\nvar program = require('commander');\nvar assert = require(\"assert\");\n\nprogram\n .versio...
javascript
chosen
[ { "from": "system", "value": "Fix cursor position on scroll\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n angular\n .module('todoList')\n .controller('todoListCtrl', todoListCtrl);\n\n todoListCtrl.$inject = ['TodoListService'];\n\n function todoListCtrl(TodoLis...
javascript
chosen
[ { "from": "system", "value": "Send post data as form-urlencoded" }, { "from": "human", "value": "(function(window){\n window.ajax = function(route, options) {\n var data = options.data || {},\n success = options.success || function(response){},\n error = options.e...
javascript
chosen
[ { "from": "system", "value": "Disable Mangling as it does not play well with paralleljs\n" }, { "from": "human", "value": "var webpack = require(\"webpack\");\nvar Config = require(\"webpack-config\").Config;\n\nmodule.exports = new Config().extend(\"conf/webpack.base.config.js\").merge({\n d...
javascript
chosen
[ { "from": "system", "value": "Fix duplicate key in webpack config\n\nFix that `compress` key appears twice in\n`webpack.optimize.UglifyJsPlugin` params.\n" }, { "from": "human", "value": "const webpack = require('webpack');\nconst webpackMerge = require('webpack-merge');\nconst commonConfig = re...
javascript
chosen
[ { "from": "system", "value": "Make ball start by flying upwards\n" }, { "from": "human", "value": "/*\n * Object that contains Game initialization data.\n */\n\nexport default class {\n constructor(canvasWidth, canvasHeight) {\n this.gameInits = {};\n\n this._generateInitialSettings(canva...
javascript
chosen
[ { "from": "system", "value": "Fix reload after FavList clear to show changes immediately.\n" }, { "from": "human", "value": "$(document).ready(function(){\n\t\n\t$(\"#backbtn-settings\").click({\n param: 'route_view'\n }, showView);\n\t\n\t// first button in settings is to reset favori...
javascript
chosen
[ { "from": "system", "value": "Remove the browser-sync reload delay\n" }, { "from": "human", "value": "module.exports = {\n\t// browser: 'google chrome',\n\treloadDelay: 250,\n\topen: false,\n\tfiles: ['build/*.css', 'build/*.js', 'build/*.html'],\n\tserver: {\n\t\tbaseDir: './build',\n\t},\n\tno...
javascript
chosen
[ { "from": "system", "value": "Add a unit test case\n" }, { "from": "human", "value": "exports.tests = [\n\t{\n\t\tcss: '.foo body > h2 {}',\n\t\tmetrics: {\n\t\t\tredundantBodySelectors: 1\n\t\t}\n\t},\n\t{\n\t\tcss: 'body ul li a {}',\n\t\tmetrics: {\n\t\t\tredundantBodySelectors: 1\n\t\t}\n\t}...
javascript
chosen
[ { "from": "system", "value": "chore(webpack): Remove comments from minified version.\n" }, { "from": "human", "value": "var Clean = require('clean-webpack-plugin'),\n ExtractTextPlugin = require('extract-text-webpack-plugin'),\n webpack = require('webpack'),\n webp...
javascript
chosen
[ { "from": "system", "value": "Fix remove core source dependency\n" }, { "from": "human", "value": "import { camelToDash } from '@hybrids/core/src/utils';\nimport { error } from '../debug';\n\nexport default function style({ node, expr }, ...propertyNames) {\n if (!propertyNames.length) {\n r...
javascript
chosen
[ { "from": "system", "value": "Fix bug of test code\n" }, { "from": "human", "value": "'use strict';\n\nvar jf = require('../../'),\n expect = require('chai').expect,\n http = require('http');\n\nvar count = 0;\nfunction testValue(){\n count ++;\n return { num: count }\n}\n\nlet server...
javascript
chosen
[ { "from": "system", "value": "Remove startup code because $.material is undefined\n\nThere is no material design yet and on the material design branch this is also deleted\n" }, { "from": "human", "value": "import { Meteor } from 'meteor/meteor'\n\nMeteor.startup(function () {\n $.material.in...
javascript
chosen
[ { "from": "system", "value": "Remove trailing comma syntax error\n" }, { "from": "human", "value": "ManageIQ.angular.app.component('verifyButton', {\n bindings: {\n validate: '<',\n enabled: '<',\n validateUrl: '@',\n restful: '<',\n valtype: '<',\n buttonLabels: '<',\n },\n ...
javascript
chosen
[ { "from": "system", "value": "Add background for game scene\n" }, { "from": "human", "value": "var GameLayer = cc.Layer.extend({\n\n\tctor:function () {\n\t\t//\n\t\tthis._super();\n\t\t\n\t\tvar gameLayer = ccs.load(res.GameScene_json);\n\t\tthis.addChild(gameLayer.node)\n\t}\n});\n\nvar GameSc...
javascript
chosen
[ { "from": "system", "value": "Update search query in the url.\n" }, { "from": "human", "value": "/*globals angular, console*/\n/**\n * @author lattmann / https://github.com/lattmann\n */\n\nangular.module('RequirementsApp').controller('SearchController', function (SearchService, $scope) {\n '...
javascript
chosen
[ { "from": "system", "value": "Add s1 as the default server in the example config.\n" }, { "from": "human", "value": "/**\n * Ripple Client Configuration\n *\n * Copy this file to config.js and edit to suit your preferences.\n */\nvar Options = {\n server: {\n \"trusted\" : true,\n \"webso...
javascript
chosen
[ { "from": "system", "value": "Remove linting errors due to `jest` globals\n" }, { "from": "human", "value": "module.exports = {\n parser: 'babel-eslint',\n extends: ['airbnb-base', 'prettier'],\n plugins: ['prettier'],\n globals: {\n Promise: true\n },\n env: {\n node: true\n },\n ...
javascript
chosen
[ { "from": "system", "value": "Create root reducer for the application\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\nimport { routerReducer } from 'react-router-redux';\n\nconst rootReducer = combineReducers({\n routing: routerReducer\n});\n\nexport default rootR...
javascript
chosen
[ { "from": "system", "value": "Remove no-multi-spaces rule from eslint\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#javascript-stand...
javascript
chosen
[ { "from": "system", "value": "Fix getting baseUrl from component-div\n" }, { "from": "human", "value": "'use strict';\nvar $ = require('jQuery');\nvar onReady = require('kwf/on-ready');\nvar BaseUrl = require('kwf/base-url');\n\nonReady.onRender('.kwcClass', function(el) {\n //if embed templa...
javascript
chosen
[ { "from": "system", "value": ":see_no_evil: Tweak eslint config to ignore problematic packages\n" }, { "from": "human", "value": "module.exports = {\n extends: 'fyndiq',\n rules: {\n // This rules causes issues because of nested packages.json, disabling\n 'import/no-extraneous-dependenci...
javascript
chosen
[ { "from": "system", "value": "Add attempt to require bluebird first\n" }, { "from": "human", "value": "\nmodule.exports = global.Promise\n\nif (!module.exports) {\n try {\n module.exports = require('bluebird')\n } catch (_) {}\n}\n" }, { "from": "gpt", "value": "\ntry {\n modul...
javascript
chosen
[ { "from": "system", "value": "Allow env option to pass in a list of etcd peers\n" }, { "from": "human", "value": "var Proxy = require('./proxy');\nvar RouterClient = require('./router_client');\nvar ServiceRegistryClient = require('./service_registry_client');\nvar VersionClient = require('./ver...
javascript
chosen
[ { "from": "system", "value": "Set height info wrapper to 100%\n" }, { "from": "human", "value": "//Source: http://stackoverflow.com/questions/3837037/div-with-scrollbar-inside-div-with-positionfixed\n(function($) {\n $.fn.getPotentialHeight = function() {\n var $element = this;\n ...
javascript
chosen
[ { "from": "system", "value": "Add libraryTarget to make module exportable\n" }, { "from": "human", "value": "var path = require(\"path\");\nvar webpack = require(\"webpack\");\n\nvar DtsBundlePlugin = require(\"./webpack.dts.plugin\");\n\nmodule.exports = {\n entry: {\n main: \"./src/i...
javascript
chosen
[ { "from": "human", "value": "Add function to get all todos\n" }, { "from": "gpt", "value": "const promise = require('bluebird');\n\nconst options = {\n promiseLib: promise\n};\n\nconst pgp = require('pg-promise')(options);\nconst connectionString = 'postgres://localhost:5432/todos';\nconst db =...
javascript
chosen
[ { "from": "system", "value": "Clean hint logic from copy/paste\n" }, { "from": "human", "value": "(function(win, doc, $, ko){\n\n var options = {\n hiddenClass: 'hidden'\n };\n\n ko.bindingHandlers.hint = {\n init:function (element, valueAccessor, allBindingsAccessor) {\n ...
javascript
chosen
[ { "from": "system", "value": "Use the correct variable for ContainerPreference names\n" }, { "from": "human", "value": "import ContextualIdentities from '../ContextualIdentity';\nimport PreferenceGroup from './PreferenceGroup';\nimport ContainerPreference from './ContainerPreference';\n\n/**\n *...
javascript
chosen
[ { "from": "system", "value": "Add error detection in Identity.cobind\n" }, { "from": "human", "value": "var Identity = require('./Identity');\n\nmodule.exports = {\n pure : function(x){ return new Identity(x); },\n copure : function(idx){ return idx.val; }\n}" }, { "from": "gpt", "...
javascript
chosen
[ { "from": "system", "value": "refactor: Split code in separate function\n" }, { "from": "human", "value": "'use babel';\n\nimport { CompositeDisposable } from 'atom';\nimport fs from 'fs';\n\nexport default {\n modalPanel: null,\n subscriptions: null,\n\n config: {\n shouldCreateFile: {\n ...
javascript
chosen
[ { "from": "system", "value": "Change PDF to icon title\n" }, { "from": "human", "value": "import React from 'react'\n\nexport const ResumeIcon = ({ className, ...props }) => (\n <svg\n {...props}\n className={`text-resume ${className}`}\n role=\"img\"\n fill=\"none\"\n stroke=\"c...
javascript
chosen
[ { "from": "system", "value": "Fix Ember 2.4 test failures\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport Application from '../../app';\nimport config from '../../config/environment';\n\nexport default function startApp(attrs) {\n let application;\n\n // use defaults, but...
javascript
chosen
[ { "from": "system", "value": "Support null and array for addFragment()\n" }, { "from": "human", "value": "module.exports = require('xmlbuilder');\nmodule.exports.XMLFragment = require('xmlbuilder/lib/XMLFragment');\n\nmodule.exports.XMLFragment.prototype.addFragment = function(fragment) {\n fra...
javascript
chosen
[ { "from": "human", "value": "Implement basic tests for roles\n" }, { "from": "gpt", "value": "// Write a test that validates that a new role created has a unique title.\n// Write a test that validates that all roles are returned when Roles.all is called.\n\n'use strict';\n\nconst expect = req...
javascript
chosen
[ { "from": "system", "value": "Fix vex dialog being off topic\n" }, { "from": "human", "value": "(function() {\n 'use strict';\n\n angular.module('app.controllers.channels', []).\n controller('Channels', Channels);\n \n Channels.$inject = ['$rootScope', 'chat'];\n function C...
javascript
chosen
[ { "from": "system", "value": "Add links to storage providers.\n" }, { "from": "human", "value": "module.exports = function(app) {\n require('./storage/url')(app);\n};\n" }, { "from": "gpt", "value": "module.exports = function(app) {\n require('./storage/url')(app);\n require('./st...
javascript
chosen
[ { "from": "system", "value": "Add route for molecule mf\n" }, { "from": "human", "value": "'use strict';\n\nconst api = require('api');\n\nconst router = require('koa-router')();\n\nrouter.get('/search/em', function*() {\n const value = +this.query.value;\n if (!value) {\n return er...
javascript
chosen
[ { "from": "system", "value": "Make http server listen only on localhost\n" }, { "from": "human", "value": "var express = require('express')\n\t, app = express()\n\t, http = require('http').Server(app)\n\t, Q = require('q');\n\nvar ROOT = GLOBAL.proj_root\n\t, SENDFILE_OPTS = { root: ROOT }\n\t, ...
javascript
chosen
[ { "from": "system", "value": "Use default text when no data exists for query\n" }, { "from": "human", "value": "var scripts = document.getElementsByTagName('script'),\n script = scripts[scripts.length - 1],\n report = JSON.parse(script.getAttribute('data-report')),\n type = script.getAt...
javascript
chosen
[ { "from": "system", "value": "Configure app to include a components folder\n" }, { "from": "human", "value": "const express = require('express')\nconst app = express()\nconst path = require('path')\nconst nunjucks = require('nunjucks')\n\nmodule.exports = app\n\n// Set up App\nconst appViews = [...
javascript
chosen
[ { "from": "system", "value": "[FIX] Manage only 200 success answer for show results" }, { "from": "human", "value": "/**\n * \n */\n\n$(document).ready(function() {\n\tvar processCheckerUrl = 'AlignmentChecker?id=' + getUrlParameter('id');\n\t\n\t(function poll() {\n\t\t$.ajax({\n\t\t\turl : pro...
javascript
chosen
[ { "from": "system", "value": "Add persist language in local storage\n" }, { "from": "human", "value": "import {applyMiddleware, compose, createStore as rawCreateStore} from 'redux';\nimport {persistStore, autoRehydrate} from 'redux-persist';\nimport createSagaMiddleware from 'redux-saga';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Add keys to each video item\n" }, { "from": "human", "value": "import React from 'react';\nimport VideoListItem from './video_list_item';\n\nconst VideoList = (props) => {\n const videoItems = props.videos.map((video) => {\n return <VideoListItem video = {video}...
javascript
chosen
[ { "from": "system", "value": "Update server: split api & app\n" }, { "from": "human", "value": "const env = process.env;\n\nexport const nodeEnv = env.NODE_ENV || 'development';\n\nexport default {\n port: env.PORT || 3001,\n host: env.HOST || '0.0.0.0',\n get serverUrl() {\n return `http:...
javascript
chosen
[ { "from": "system", "value": "Add firebase auth event listener\n" }, { "from": "human", "value": "import React from 'react';\nimport {\n BrowserRouter as Router,\n Route,\n Switch\n} from 'react-router-dom';\nimport { NavigationBar } from '../NavigationBar';\nimport { PageHome } from '../Page...
javascript
chosen
[ { "from": "system", "value": "Add 2nd parameter to create that's generated for requires that allows you to overwrite context.\n" }, { "from": "human", "value": "/**\n * @license\n * Copyright 2017 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfoam....
javascript
chosen
[ { "from": "system", "value": "Test GCD: Tests handling of negative numbers\n" }, { "from": "human", "value": "/* eslint-env mocha */\nconst gcd = require('../../../src').algorithms.math.gcd;\n\nconst assert = require('assert');\n\ndescribe('GCD', () => {\n it('should return 0 for either or both...
javascript
chosen
[ { "from": "system", "value": "Fix error caused by a deleted Wikidata item\n\nIf an edited item was deleted, the request for labels for that item will not include a `labels` property for it.\n" }, { "from": "human", "value": "import { forEach } from 'lodash-es';\nimport { RECEIVE_WIKIDATA_LABELS ...
javascript
chosen
[ { "from": "system", "value": "Fix SC.Checkbox bug in IE\n" }, { "from": "human", "value": "// ==========================================================================\n// Project: SproutCore Handlebar Views\n// Copyright: ©2011 Strobe Inc. and contributors.\n// License: Licensed under MIT ...
javascript
chosen
[ { "from": "system", "value": "Fix on scrap link for domestika provider\n\n" }, { "from": "human", "value": "import JobProvider from './jobProvider'\n\nexport default class extends JobProvider {\n constructor() {\n super({\n id: 'dmtk',\n name: 'domestika.org',\n logo: 'http://...
javascript
chosen
[ { "from": "system", "value": "Support prod runmode on Linux\n\n(On Linux the service doesn't append .prod if it's prod, for some reason.)\n" }, { "from": "human", "value": "import {OS_DESKTOP} from './platform.shared'\nimport path from 'path'\n\nexport const isDev = process.env.NODE_ENV === 'dev...
javascript
chosen
[ { "from": "system", "value": "Load teams on the first load of the tournament matches page\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';\n\nexport default Ember.Route.extend(ApplicationRouteMixin, {\n...
javascript
chosen
[ { "from": "system", "value": "Fix labels using lookups (introduced in 0.0.4)\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = DatasetView;\n\n/** @ngInject **/\nfunction DatasetView() {\n return {\n scope: {\n participant: '=',\n dataset: '=',\n onEdit: '&'...
javascript
chosen
[ { "from": "system", "value": "Fix widget url generation when missing apikey and authtoken\n" }, { "from": "human", "value": "var _ = require('underscore');\nvar Model = require('../../core/model');\n\n/**\n * This model is used for getting the total amount of values\n * from the category.\n *\...
javascript
chosen
[ { "from": "system", "value": "Use copy instead of create for easier debugging\n" }, { "from": "human", "value": "/*\n\tExample usage:\n\n\tvar A = Class(function() {\n\t\t\n\t\tvar defaults = {\n\t\t\tfoo: 'cat',\n\t\t\tbar: 'dum'\n\t\t}\n\n\t\tthis.init = function(opts) {\n\t\t\topts = std.exte...
javascript
chosen
[ { "from": "system", "value": "Create base api endpoint and adjust player stats path\n" }, { "from": "human", "value": "'use strict';\r\n\r\nlet Games = require('./games.js');\r\nlet uuid = require('node-uuid');\r\n\r\nlet games = new Games(uuid.v4);\r\n\r\nexports.registerRoutes = app => {\r\n ...
javascript
chosen
[ { "from": "system", "value": "Fix an edge case when a file is dropped outside <body>\n" }, { "from": "human", "value": "import union from 'lodash/array/union';\nimport without from 'lodash/array/without';\n\nexport default class EnterLeaveCounter {\n constructor() {\n this.entered = [];\n }...
javascript
chosen
[ { "from": "system", "value": "Fix grammar mistake in commment\n" }, { "from": "human", "value": "import logger from '../logger'\n\nconst openedModules = {}\n\nconst hotModules = {}\n\nconst createHotModule = () => ({ instances: [], updateTimeout: 0 })\n\nexport const hotModule = moduleId => {\n ...
javascript
chosen
[ { "from": "system", "value": "Add hashmap for fast components lookups" }, { "from": "human", "value": "const createTransform = require('./transform')\nconst assert = require('assert')\n\nlet entityId = 0\n\nfunction Entity (components, tags, renderer) {\n assert(!tags || Array.isArray(tags), 'E...
javascript
chosen
[ { "from": "system", "value": "Fix addPackagesToProject in blueprint afterInstall\n" }, { "from": "human", "value": "/*jshint node:true*/\nmodule.exports = {\n description: 'ember-cli-tooltipster',\n normalizeEntityName: function() {\n // this prevents an error when the entityName is not spe...
javascript
chosen
[ { "from": "system", "value": "Use path instead of concatenation\n\nUse path.join() instead of string concatenation.\n" }, { "from": "human", "value": "// Copyright (c) Martin Costello, 2017. All rights reserved.\n// Licensed under the Apache 2.0 license. See the LICENSE file in the project root ...
javascript
chosen
[ { "from": "system", "value": "Use static properties for the sub-items\n" }, { "from": "human", "value": "\"use strict\"\n\nimport Context from \"./context\"\nimport ShadowTree from \"./shadowtree\"\n\nclass Lint {\n constructor(tree, filename = null, namespace = []) {\n Object.assign(\...
javascript
chosen
[ { "from": "system", "value": "Add get list ui and feature\n" }, { "from": "human", "value": "import React from 'react';\nimport axios from 'axios';\n\nclass App extends React.Component {\n\n render() {\n return (\n <Abc/>\n )\n }\n}\n\nclass Abc extends React.Component {\n render()...
javascript
chosen
[ { "from": "system", "value": "Remove bonzo and qwery dependencies\n" }, { "from": "human", "value": "// Scans your stylesheet for pseudo classes and adds a class with the same name.\n// Thanks to Knyle Style Sheets for the idea.\n(function () {\n\n'use strict';\n\nvar toArray = function(arr) {\n...
javascript
chosen
[ { "from": "system", "value": "Add simple public API tests\n" }, { "from": "human", "value": "describe('Smooth Scroll', function () {\n\n describe('init', function () {\n it('should include the smoothScroll module', function () {\n expect(!!smoothScroll).toBe(true);\n });\n });\n\n})...
javascript
chosen
[ { "from": "system", "value": "LT-275: Fix bug with loading measurement flow\n" }, { "from": "human", "value": "import { Template } from 'meteor/templating';\nimport { Blaze } from 'meteor/blaze';\nimport { OHIF } from 'meteor/ohif:core';\n\nconst toolMap = {\n bidirectional: 'targets'\n};\n\n...
javascript
chosen
[ { "from": "system", "value": ":bug: Fix Punchcard JS and images compilation\n" }, { "from": "human", "value": "const gulp = require('gulp');\nconst config = require('config');\nconst runner = require('punchcard-runner');\n\nconst options = runner.config({\n application: {\n library: {\n ...
javascript
chosen
[ { "from": "system", "value": "Set gulp autoprefixer cascade to true\n" }, { "from": "human", "value": "var gulp = require('gulp'),\n\tless = require('gulp-less'),\n\tautoprefixer = require('gulp-autoprefixer'),\n\tminifycss = require('gulp-minify-css'),\n\tnotify = require('gulp-notify'),\n\tren...
javascript
chosen
[ { "from": "system", "value": "Adjust error color to be darker\n" }, { "from": "human", "value": "// You still need to register Vuetify itself\n// src/plugins/vuetify.js\n\nimport Vuetify from 'vuetify/lib'\nimport PbsLogo from '@/assets/PbsLogo.svg'\nimport GoogleLogo from '@/assets/GoogleLogo.s...
javascript
chosen
[ { "from": "system", "value": "Fix property name for ember-simple-auth\n" }, { "from": "human", "value": "import Ember from 'ember';\nimport DS from 'ember-data';\nimport ENV from '../config/environment';\n\n\nfunction getToken() {\n var token;\n var session = window.localStorage['ember_sim...
javascript
chosen
[ { "from": "system", "value": "Implement checkDate function for date string arguments\n" }, { "from": "human", "value": "const checkDate = () => {\n return;\n}\nmodule.exports = checkDate;\n" }, { "from": "gpt", "value": "const checkDate = (dateString) => {\n if (isNaN(Date.parse(da...
javascript
chosen
[ { "from": "system", "value": "Remove css to apply each time.\n" }, { "from": "human", "value": "$('#dripbot-title').css({\n\t\"display\": \"inline-block\",\n\t\"margin-right\": \"20px\"\n});\n\n$('#dripbot').css({\n \"text-align\": \"left\"\n});\n\n$('#dripbot-toggle.stop').css({\n \"backg...
javascript
chosen
[ { "from": "system", "value": "Increase compatibility with other plugins\n\nPlugins such as viptool+ or 大虫\n" }, { "from": "human", "value": "// ==UserScript==\n// @name agar-mass-ejector\n// @namespace http://github.com/dimotsai/\n// @version 0.02\n// @description A faster, cont...
javascript
chosen
[ { "from": "system", "value": "Switch to GitHub Pages as Host\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 OFFICIAL_HOST ...
javascript
chosen
[ { "from": "system", "value": "Determine protocol when generating game links\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": "Use custom template for registrant step\n" }, { "from": "human", "value": "Template.registerWizard.helpers({\n 'steps': function () {\n return [\n {\n id: 'registrant',\n title: 'Registrant',\n schema: WizardSchemas.registrant\n },...
javascript
chosen
[ { "from": "system", "value": "Configure bundling for images and fonts\n" }, { "from": "human", "value": "const path = require('path')\nconst webpack = require('webpack')\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\n\nmodule.exports = {\n entry: [path.resolve(__dirname, '.....
javascript
chosen
[ { "from": "system", "value": "Fix bin entry point for Unix-based OS's\n" }, { "from": "human", "value": "'use strict';\n\nrequire('./lib/polyfill');\nmodule.exports = require('../dist/bin/cli/harmonic');\n" }, { "from": "gpt", "value": "#!/usr/bin/env node\n'use strict';\n\nrequire('...
javascript
chosen
[ { "from": "system", "value": "Add .apply() to inventory loading to refresh ng-repeat\n" }, { "from": "human", "value": "myApp.controller('InventoryController', function($scope, $window, $location, $routeParams, inventoryService) {\n inventoryService.loadInventories()\n .then(function(i...
javascript
chosen
[ { "from": "system", "value": "Fix removing module from exam timetable\n" }, { "from": "human", "value": "define(['backbone.marionette', 'app', 'hbs!../templates/exam'],\n function (Marionette, App, template) {\n 'use strict';\n\n return Marionette.ItemView.extend({\n tagName: 'tr',\n...
javascript
chosen
[ { "from": "system", "value": "Add login and logout route\n" }, { "from": "human", "value": "var express = require('express');\nvar router = express.Router();\nvar usersController = require('../controllers/users');\n\n/**\n * Get all\n */\nrouter.get('/', usersController.all);\n\n/**\n * Get by i...
javascript
chosen
[ { "from": "system", "value": "Fix typo \"dump\" => \"dumper\"\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\n// Requires\nvar _ = require('underscore');\n\nvar fs = require('fs');\n\n// Comannder\nvar prog = require('commander');\n\n// etcd-dump's package.json file\nvar pkg = require(...
javascript
chosen
[ { "from": "system", "value": "Fix not working language switch in production environment\n\nFixes #64\n" }, { "from": "human", "value": "import Ember from \"ember\";\nimport translations from \"croodle/lang/translations\";\n/* global Croodle */\n\nexport default Ember.View.extend({\n templateNam...
javascript
chosen
[ { "from": "system", "value": "[connected_components/javascript] Replace fat arrow by traditional function for clarity\n" }, { "from": "human", "value": "export class AdjacencyList {\n constructor(graph) {\n this.a = constructAdjacencyList(graph);\n }\n depthFirstSearch(start, ear...
javascript
chosen
[ { "from": "system", "value": "Fix loading media list row layout\n" }, { "from": "human", "value": "import cx from 'clsx';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport MediaLoadingIndicator from './MediaLoadingIndicator';\n\nconst LoadingRow = ({\n className,\n selec...
javascript
chosen
[ { "from": "system", "value": "Update example to check for query and body parameters.\n" }, { "from": "human", "value": "'use strict'\n\nconst sitemap = require('./../index')\nconst express = require('express')\n\nconst app = express()\nconst core = new express.Router()\nconst other = new express...
javascript
chosen
[ { "from": "system", "value": "Fix bug that was crashing worker.\n" }, { "from": "human", "value": "var request = require('request');\n\nvar {processAddress, prefetchAddress} = require('./utils');\n\nconst GEOCODE_BASE_URL = 'http://open.mapquestapi.com/geocoding/v1/address';\n\nfunction MapQuest...
javascript
chosen
[ { "from": "system", "value": "Change config editor theme to dawn\n" }, { "from": "human", "value": "import React from 'react'\nimport AceEditor from 'react-ace'\nimport 'brace/mode/yaml'\nimport 'brace/theme/github'\n\nimport './ConfigEditor.scss'\n\nexport default function ConfigEditor(props) {...
javascript
chosen
[ { "from": "system", "value": "Hide year of birth in notification component\n" }, { "from": "human", "value": "import DS from 'ember-data';\n\nexport default DS.Transform.extend({\n deserialize(serialized) {\n const date = moment(serialized).format('DD MMMM YYYY');\n \n return date;\n },...
javascript
chosen
[ { "from": "system", "value": "Refactor xhr functionality into ajax object\n" }, { "from": "human", "value": "'use strict';\n\nvar events = [];\nvar requestInterval = 5000;\n\nwindow.addEventListener('click', function(e) {\n e = event || window.event;\n\n events.push(processEvent(e));\n});\...
javascript
chosen