conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add wordpress and GA capabilities to JS\n" }, { "from": "human", "value": "$(document).ready(function(){\n $(\"#related\").click(function(){\n $.post(\"http://localhost:8080/dummy_backend.php\",\n {\n related: \"true\"\n },\n ...
javascript
chosen
[ { "from": "system", "value": "Add helper to format price value\n" }, { "from": "human", "value": "import getRandomValues from 'get-random-values';\n\nexport const getRandomString = (length) => {\n const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let i;\n ...
javascript
chosen
[ { "from": "system", "value": "Implement remainder of the write plugin\n" }, { "from": "human", "value": "var File = require('vinyl');\nvar mix = require('mix');\nvar path = require('path');\nvar rimraf = require('rimraf');\nvar vfs = require('vinyl-fs');\n\nmodule.exports = function (dir) {\n ...
javascript
chosen
[ { "from": "system", "value": "Order Aphabetical: Add listeners for at-rules\n\nViewport was completely missing, but the others were also not reporting\nat the end of the rule scope\n" }, { "from": "human", "value": "/*\n * Rule: All properties should be in alphabetical order..\n */\n/*global CSS...
javascript
chosen
[ { "from": "system", "value": "Clean up item price updating (1/2 runtime!)\n" }, { "from": "human", "value": "const mongo = require('../../helpers/mongo.js')\nconst api = require('../../helpers/api.js')\nconst async = require('gw2e-async-promises')\nconst transformPrices = require('./_transformPr...
javascript
chosen
[ { "from": "system", "value": "Remove no-console rule from estlint configuration\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n env: {\n node: true,\n \"jest/globals\": true\n },\n plugins: [\"jest\"],\n 'extends': [\n 'plugin:vue/essential',\n '@vue/standa...
javascript
chosen
[ { "from": "system", "value": "Add basic users module test\n" }, { "from": "human", "value": "const mockCreate = jest.fn()\njest.mock('@/services/api/users', () => ({ create: mockCreate }))\n\nimport { createStore } from '>/helpers'\n\ndescribe('users', () => {\n beforeEach(() => jest.resetModul...
javascript
chosen
[ { "from": "system", "value": "Modify eslint rules; change indent spaces from 4 to 2\n" }, { "from": "human", "value": "module.exports = {\n \"env\": {\n \"browser\": true,\n \"es6\": true,\n \"node\": true\n },\n \"extends\": \"eslint:recommended\",\n \"parserOpt...
javascript
chosen
[ { "from": "system", "value": "Add remove formatting with symbol from Currency object\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2020\n */\n\nimport currency from 'currency.js';\nimport { LANGUAGE_CODES } from '.';\n\nconst CURRENCY_CONFIGS = {\n...
javascript
chosen
[ { "from": "system", "value": "Make the rotating direction go back and forth\n" }, { "from": "human", "value": "(function (PIXI) {\n 'use strict';\n\n var stage = new PIXI.Stage(0x66FF99);\n var renderer = PIXI.autoDetectRenderer(400, 300);\n document.body.appendChild(renderer.view);\n\n win...
javascript
chosen
[ { "from": "system", "value": "Remove clear_id for signup page\n\nStill need it for /act so we get zip codes.\n" }, { "from": "human", "value": "requirejs.config({\n shim: {\n 'call': {\n deps: ['form', 'jquery', 'campaign'],\n exports: 'call'\n },\n ...
javascript
chosen
[ { "from": "system", "value": "Move logging above asset serving\n" }, { "from": "human", "value": "var coffee = require('coffee-script/register'),\n express = require('express'),\n assets = require('connect-assets'),\n logfmt = require('logfmt'),\n app = express();\n\...
javascript
chosen
[ { "from": "system", "value": "Support separate jshintrc for lib\n" }, { "from": "human", "value": "module.exports = function(gulp, config) {\n var jshint = require('gulp-jshint');\n var stylish = require('jshint-stylish');\n var jscs = require('gulp-jscs');\n var logger = require('../utils/l...
javascript
chosen
[ { "from": "system", "value": "Use open to launch the browser.\n" }, { "from": "human", "value": "/*global require: false, console: false */\n(function () {\n \"use strict\";\n var proxy = require(\"./proxy/proxy\"),\n server = require(\"./server/server\"),\n cprocess = requir...
javascript
chosen
[ { "from": "system", "value": "Add support for {harmony: true} to react-tools\n\n```\r\nrequire('react-tools').transform(code, {harmony: true});\r\n```\r\n\r\nnow enables all the harmony es6 transforms that are supported.\r\n\r\nThis is modeled after https://github.com/facebook/react/blob/master/bin/jsx#L17-...
javascript
chosen
[ { "from": "system", "value": "Refactor mapStateToProps to use reshapeNewsData\n" }, { "from": "human", "value": "/* NewsFeedContainer.js\n * Container for our NewsFeed as a view \n * Dependencies: ActionTypes\n * Modules: NewsActions, and NewsFeed\n * Author: Tiffany Tse\n * Created: July 29, 20...
javascript
chosen
[ { "from": "system", "value": "Return rejected promise and don't set cache if key or value is null.\n" }, { "from": "human", "value": "const redis = require(\"redis\")\nconst client = redis.createClient()\n\nclass Cache {\n /**\n * Retrieve an unexpired cache entry by key.\n * @param {String...
javascript
chosen
[ { "from": "system", "value": "Disable browsersync ghostMode (user actions mirroring) and notify\n(corner notifications)\n" }, { "from": "human", "value": "module.exports = {\n port: 3001,\n {{#notServer}}server: true,\n startPath: {{#lib}}\"demo.html\"{{/lib}}{{#client}}\"index.html\"{{/clien...
javascript
chosen
[ { "from": "system", "value": "Fix route provider to be string for minification\n" }, { "from": "human", "value": "angular.module('Gistter')\n\n.config([$routeProvider, function($routeProvider) {\n $routeProvider\n\n .when('/', {\n controller: 'TwitterController',\n templateUrl: 'te...
javascript
chosen
[ { "from": "human", "value": "feat: Introduce main React component DOM injector\n" }, { "from": "gpt", "value": "'use strict';\nimport React, { Component } from 'react';\nimport ReactDOM from 'react-dom';\n\n// Top-level React (pure functional) component:\nconst App = () => (\n <div>\n Hello,...
javascript
chosen
[ { "from": "system", "value": "Add get movie details endpoint\n" }, { "from": "human", "value": "import models from '../models';\nimport express from 'express';\nimport _ from 'lodash';\n\nlet router = express.Router();\n\nconst defaults = {\n limit: 10,\n page: 1,\n category: null\n};\n\nrout...
javascript
chosen
[ { "from": "system", "value": "Fix site bar decorate example - specify correct accessors and pad x-domain\n" }, { "from": "human", "value": "var width = 500, height = 250;\nvar container = d3.select('#decorate-bars')\n .append('svg')\n .attr({'width': width, 'height': height});\n\nvar dataG...
javascript
chosen
[ { "from": "system", "value": "Add neon version and print the package version in the usage info\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar minimist = require('minimist');\n\nif (process.argv.length < 3) {\n printUsage();\n process.exit(1);\n}\n\nvar command = process.argv[2];...
javascript
chosen
[ { "from": "system", "value": "Fix for ion-modal spurious blaze errors\n" }, { "from": "human", "value": "IonLoading = {\n show: function (userOptions) {\n var userOptions = userOptions || {};\n var options = _.extend({\n delay: 0,\n duration: null,\n customTemplate: null,\n...
javascript
chosen
[ { "from": "system", "value": "Use own implementation of live reload RN middleware\n" }, { "from": "human", "value": "/**\n * Copyright 2017-present, Callstack.\n * All rights reserved.\n *\n * MIT License\n *\n * Copyright (c) 2017 Mike Grabowski\n *\n * Permission is hereby granted, free of cha...
javascript
chosen
[ { "from": "system", "value": "Refactor to ensure pathnames are all the same\n" }, { "from": "human", "value": "function checkPathParsed (uri) {\n if (uri.charAt(uri.length-1) === '/') {\n uri = uri.slice(0, -1);\n }\n if (path.charAt(0) !== '/') {\n path = '/' + path;\n }\n var myUr...
javascript
chosen
[ { "from": "system", "value": "Add site footer to each documentation generator\n" }, { "from": "human", "value": "var _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tac...
javascript
chosen
[ { "from": "system", "value": "Support fetching urls for inbox attachments\n" }, { "from": "human", "value": "var express = require('express');\n\nvar router = module.exports = express.Router();\n\nrouter.post('/url', function(req, res, next) {\n var data = req.body,\n model;\n if (data.ty...
javascript
chosen
[ { "from": "system", "value": "Add banner to CSS files\n" }, { "from": "human", "value": "/*global module:false*/\nmodule.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n // Metadata.\n pkg: grunt.file.readJSON('package.json'),\n banner: '/*! <%= pkg.tit...
javascript
chosen
[ { "from": "system", "value": "Watch bower.json and run wiredep\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function (grunt) {\n\n // Load grunt tasks automatically\n require('load-grunt-tasks')(grunt);\n\n // Configure tasks\n grunt.initConfig({\n\n // Project set...
javascript
chosen
[ { "from": "system", "value": "Fix resolver failing for default param descriptions.\n" }, { "from": "human", "value": "import BaseResolver from './BaseResolver';\nimport { STRING } from '../parsers/Types';\n\n/**\n * @classdesc Options resolver for command parameter definitions.\n * @extends Base...
javascript
chosen
[ { "from": "system", "value": "Apply consistent tabbing to gruntfile\n\n2 space tabs\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n\n banner: '/*! <%= pkg.name %> <%= pkg.version %> | Copyri...
javascript
chosen
[ { "from": "system", "value": "Load grunt-* dependencies with matchdep\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n grunt.loadNpmTasks('grunt-contrib-watch');\n grunt.loadNpmTasks('grunt-browserify');\n\n grunt.registerTask('default', ['browserify']);\n\n gr...
javascript
chosen
[ { "from": "system", "value": "Fix use of Array.includes not supported in current node version\n" }, { "from": "human", "value": "import FilterModule from \"../FilterModule\";\nimport { dependencies as Inject, singleton as Singleton } from \"needlepoint\";\nimport Promise from \"bluebird\";\nimpo...
javascript
chosen
[ { "from": "system", "value": "Use same maxRetries as rimraf did\n" }, { "from": "human", "value": "\"use strict\";\n\nconst fs = require(\"./utils/fs\");\nconst validate = require(\"./utils/validate\");\n\nconst validateInput = (methodName, path) => {\n const methodSignature = `${methodName}([p...
javascript
chosen
[ { "from": "system", "value": "Throw error is there are now state params to redirect to upon authentication" }, { "from": "human", "value": "'use strict';\n\nmodule.exports =\n\n/*@ngInject*/\nfunction ($httpProvider, $stateProvider) {\n $httpProvider.interceptors.push(require('./oauth_intercept...
javascript
chosen
[ { "from": "system", "value": "Change some \"debug\" level log messages to \"info\"\n" }, { "from": "human", "value": "var log = require('./log');\nvar TunerTwitter = require('./tuner_twitter');\n\nvar tt = TunerTwitter.create({twitterName: 'L2G', keywords: 'test'});\n//var tt = TunerTwitter.crea...
javascript
chosen
[ { "from": "system", "value": "Fix a bug where the user was not redirected because of wrong use of waitOn\n" }, { "from": "human", "value": "/**\n * AdminLogonController: Creates a endpoint where a user can log\n * into the system. It renders the login template only if user is\n * not already log...
javascript
chosen
[ { "from": "system", "value": "Add //bindings_list = ['sidorares-nodejs-mysql-native'] for tests\n" }, { "from": "human", "value": "#!/usr/bin/env node\n/*\nCopyright (C) 2010, Oleg Efimov <efimovov@gmail.com>\n\nSee license text in LICENSE file\n*/\n\nvar\n bindings_list = ['Sannis-node-mysql-l...
javascript
chosen
[ { "from": "system", "value": "Implement logic for player and disc movements and collision between them\n" }, { "from": "human", "value": "var Game = (function () {\n var Game = function (canvasRenderer,svgRenderer ) {\n\n };\n\n return Game;\n}());\n" }, { "from": "gpt", "va...
javascript
chosen
[ { "from": "system", "value": "Make reporters' loader work on windows\n" }, { "from": "human", "value": "var gutil = require('gulp-util'),\n fs = require('fs');\n\n/**\n * Loads reporter by its name.\n *\n * The function works only with reporters that shipped with the plugin.\n *\n * @param {S...
javascript
chosen
[ { "from": "system", "value": "Update line that was pointing to the erstwhile ./website/addons now ./addons\n" }, { "from": "human", "value": "// Generate a single webpack bundle for all tests for faster testing\n// See https://github.com/webpack/karma-webpack#alternative-usage\n\n// Configure ra...
javascript
chosen
[ { "from": "system", "value": "Remove only links that have not the data.role class.\n" }, { "from": "human", "value": "var Bind = require(\"github/jillix/bind\");\nvar Events = require(\"github/jillix/events\");\n\nmodule.exports = function(config) {\n\n var self = this;\n Events.call(self,...
javascript
chosen
[ { "from": "system", "value": "Add about: pages to open home page\n" }, { "from": "human", "value": "const trimStart = (str) => {\n // NOTE String.trimStart is available on Firefox 61\n return str.replace(/^\\s+/, '');\n};\n\nconst SUPPORTED_PROTOCOLS = ['http:', 'https:', 'ftp:', 'mailto:'];\n...
javascript
chosen
[ { "from": "system", "value": "Refresh the page when successfully uploading a photo\n" }, { "from": "human", "value": "$(document).ready(function(){\n $('.entries').slick({\n slidesToShow: 3,\n variableWidth: true,\n autoplay: true,\n lazyLoad: 'ondemand'\n });\n...
javascript
chosen
[ { "from": "system", "value": "Add styling for new meal form\n" }, { "from": "human", "value": "import React, { Component } from 'react'\nimport { reduxForm, Field } from 'redux-form'\n\nclass NewMealForm extends Component {\n\n render() {\n return (\n <form onSubmit={this.props.handleSu...
javascript
chosen
[ { "from": "system", "value": "Allow slow scrolling with shift.\n\nBecause we can." }, { "from": "human", "value": "$(window).scroll\n ( function ()\n {\n $( \"header\" ).css\n ( \"top\"\n , Math.max(-280, Math.min(0, -$(\"body\").scrollTop()))\n );\n }\n );\n\n$...
javascript
chosen
[ { "from": "system", "value": "Add the 'viewBox' attribute to htmlhint ignore list\n" }, { "from": "human", "value": "/**\n * Hint HTML\n */\n'use strict';\n\nconst gulp = require('gulp'),\n htmlhint = require('gulp-htmlhint'),\n notify = require('gulp-notify');\n\nmodule.exports ...
javascript
chosen
[ { "from": "system", "value": "Make sure to close REPLs started by tests.\n" }, { "from": "human", "value": "const assert = require(\"assert\");\n\n// Masquerade as the REPL module.\nmodule.filename = null;\nmodule.id = \"<repl>\";\nmodule.loaded = false;\nmodule.parent = void 0;\n\ndelete requir...
javascript
chosen
[ { "from": "system", "value": "Make polestar's config useRawDomain = false\n\nFix https://github.com/uwdata/voyager2/issues/202\n" }, { "from": "human", "value": "'use strict';\n\n// Service for the spec config.\n// We keep this separate so that changes are kept even if the spec changes.\nangular...
javascript
chosen
[ { "from": "system", "value": "Initialize controllers to empty array\n" }, { "from": "human", "value": "var registerSystem = require('../core/system').registerSystem;\n\n/**\n * Tracked controls system.\n * Maintain list with available tracked controllers.\n */\nmodule.exports.System = registerSy...
javascript
chosen
[ { "from": "system", "value": "Add required prop types checker, and make it default loaded tester\n" }, { "from": "human", "value": "import React from 'react';\n\nfunction allMustExist(props) {\n Object.keys(props).every(propName => props[propName] != null);\n}\n\nexport default function pending...
javascript
chosen
[ { "from": "system", "value": "Add canvas to export seeing as it is part of public api\n" }, { "from": "human", "value": "// @flow\nexport {default as ChartData} from './chartdata/ChartData';\n\nexport {default as LineCanvas} from './component/canvas/LineCanvas';\nexport {default as ColumnCanvas}...
javascript
chosen
[ { "from": "system", "value": "Enable our version of the jenkins-notifier script\n" }, { "from": "human", "value": "\nvar fs = require('fs'),\n Path = require('path'),\n scripts;\n\nscripts = [\n 'pokemonfusion.js',\n 'catoverflow.js',\n 'nugme.coffee',\n 'mta.coffee',\n 'spo...
javascript
chosen
[ { "from": "system", "value": "Add dummy routes to try react-router-dom\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { createStore, applyMiddleware } from 'redux';\n\nimport App from './components...
javascript
chosen
[ { "from": "system", "value": "Disable select2 on mobile devices" }, { "from": "human", "value": "\n$(document).ready(function() {\n\n $('select[multiple]').each(function() {\n var select = $(this),\n search = $('<button/>', {\n 'class': 'btn'\n }).a...
javascript
chosen
[ { "from": "system", "value": "Refactor the main logic block\n" }, { "from": "human", "value": "#!/usr/bin/env node\n'use strict';\nimport fs from 'fs';\nimport snfe from './index';\nimport { name, version } from './package.json';\n\nlet printHelpMesage = () => {\n console.log(`\\nStrip Named ...
javascript
chosen
[ { "from": "system", "value": "[BUGFIX] Set the correct sub-task name for the uglify task\n" }, { "from": "human", "value": "/**\n * Compile:JS task.\n * Uglify and merge all javascript files in 'Public/Javascripts/Sources/'.\n */\n\nvar config = require(\"../../Config\");\n\nmodule.exports = fun...
javascript
chosen
[ { "from": "system", "value": "Load babel polyfills, to work in less ES6 ready browsers." }, { "from": "human", "value": "import React from 'react';\n\nimport Logo from './components/logo'\nimport SocialButtons from './components/social-buttons'\nimport Navigation from './components/navigation'\n...
javascript
chosen
[ { "from": "system", "value": "Disable origin textfield for forms != first one\n\nIt will be automatically set to previous form's destination\n" }, { "from": "human", "value": "$(function () {\n $(\".inline.\" + formset_prefix).formset({\n prefix: formset_prefix, // The form prefix for ...
javascript
chosen
[ { "from": "system", "value": "Remove kube and add react touch events\n" }, { "from": "human", "value": "require('./lib/whatwg-fetch/fetch.js')\nrequire('./lib/kube-6.0.1/kube.min.css')\n\nimport 'react-hot-loader/patch'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport Root fr...
javascript
chosen
[ { "from": "system", "value": "Update Index.js to import new components\n\nUpdate Index.js to import new components\n" }, { "from": "human", "value": "import Player from './components/Player';\nimport Video from './components/Video';\nimport BigPlayButton from './components/BigPlayButton';\nimpor...
javascript
chosen
[ { "from": "system", "value": "Rebuild the query every time it's needed so that preseeded results display\n" }, { "from": "human", "value": "var environment = require('../environment'),\n offload = require('../../graphworker/standalone');\n\nmodule.exports.search = function (options, recordcb,...
javascript
chosen
[ { "from": "system", "value": "Add drawObject function to draw matrix of pixels\n" }, { "from": "human", "value": "var BOARD_HEIGHT = 288;\nvar BOARD_WIDTH = 224;\nvar VERT_TILES = BOARD_HEIGHT / 8;\nvar HORIZ_TILES = BOARD_WIDTH / 8;\n\ngameBoard = new Array(VERT_TILES);\nfor(var y = 0; y < VERT...
javascript
chosen
[ { "from": "system", "value": "Return only rgb swatches (gonna add a toggle for this later)\n" }, { "from": "human", "value": "angular\n .module('ngVibrant')\n .provider('$vibrant', $vibrantProvider);\n\nfunction $vibrantProvider() {\n this.$get = function() {\n function $vibrant(...
javascript
chosen
[ { "from": "system", "value": "TEST fix error cant resolve module\n" }, { "from": "human", "value": "import { combineReducers } from 'redux';\nimport { routerReducer } from 'react-router-redux';\nimport { reducer as formReducer } from 'redux-form';\n\n// Import all of your reducers here:\nimport ...
javascript
chosen
[ { "from": "system", "value": "Add update to usermodel upon login with login controller\n" }, { "from": "human", "value": "(function(){\n\n'use strict';\n\nangular\n .module('secondLead')\n \n .controller('LoginCtrl', [\n 'Restangular',\n '$state', \n 'store',\n 'UserModel',\n fu...
javascript
chosen
[ { "from": "system", "value": "Add getData overrides for multiple views.\n" }, { "from": "human", "value": "var phonecatControllers = angular.module('leaguecontrollers', []);\n\nphonecatControllers.factory(\"dataProvider\", ['$q', function($q) {\n console.log(\"Running dataProvider factory...
javascript
chosen
[ { "from": "system", "value": "Kill trailing whitespace in benchmark.\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nvar wrench = require('wrench');\n\nvar files = 0;\nwrench.readdirRecursive(process.argv[2], function (err, curFiles) {\n if (curFiles === null) {\n console.log(files...
javascript
chosen
[ { "from": "system", "value": "Add dataSourceConfig to link passed datasource keys\n" }, { "from": "human", "value": "/**\n * Created by XaviTorello on 30/05/18\n */\nimport React from 'react';\nimport ComposedComponent from './ComposedComponent';\nimport AutoComplete from 'material-ui/AutoComple...
javascript
chosen
[ { "from": "system", "value": "Check for GraphQL error in TimeProvider\n" }, { "from": "human", "value": "import React, { PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport moment from 'moment';\nimport { gql, graphql } from 'react-apollo';\n\nimport { getCurrentTimeSuccess...
javascript
chosen
[ { "from": "system", "value": "Test Riak delete object with allow_mult=true\n" }, { "from": "human", "value": "\"use strict\";\n\n/* global describe, it */\n\ndescribe('Riak client', function() {\n\n var riakClient = require('../lib/riak')();\n\n it('#getServerInfo', function() {\n r...
javascript
chosen
[ { "from": "system", "value": "Use port 3000 instead of 5000." }, { "from": "human", "value": "var express = require('express');\nvar app = express();\n\n// Serve assets in /public\nvar path = require('path');\napp.use(express.static(path.join(__dirname, '../client')));\n\n// Body parsing for JSO...
javascript
chosen
[ { "from": "system", "value": "Refactor filre for hosting heroku\n" }, { "from": "human", "value": "import express from 'express';\nimport logger from 'morgan';\nimport bodyParser from 'body-parser';\nimport http from 'http';\n\nconst app = express();\n\napp.use(logger('dev'));\n\napp.use(bodyPar...
javascript
chosen
[ { "from": "system", "value": "Make nodeModulesBabelLoader compatible with Babel 6\n" }, { "from": "human", "value": "import { includePaths, excludePaths } from '../config/utils';\n\nexport default options => ({\n test: /\\.(mjs|jsx?)$/,\n use: [\n {\n loader: 'babel-loader',\n opt...
javascript
chosen
[ { "from": "system", "value": "Remove import of config.json for Heroku to work\n" }, { "from": "human", "value": "/*\n * Evernote-webhooks: A project to use webhooks to automate things in Evernote\n */\nvar express = require('express');\nvar config = require('./config.json');\n\nvar app = express...
javascript
chosen
[ { "from": "system", "value": "Rewrite the logic without using directive\n" }, { "from": "human", "value": "'use strict';\n\nangular.module('ngAppInit', []).\n\nprovider('$init', function(\n){\n this.$get = function() {\n return {};\n };\n}).\n\ndirective('ngAppInit', function(\n $window,\n...
javascript
chosen
[ { "from": "system", "value": "Change port of Async example\n" }, { "from": "human", "value": "const webpack = require('webpack');\nconst webpackDevMiddleware = require('webpack-dev-middleware');\nconst webpackHotMiddleware = require('webpack-hot-middleware');\nconst config = require('./webpack.c...
javascript
chosen
[ { "from": "system", "value": "Update query to make e-mail in sign-in not case sensitive\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(con...
javascript
chosen
[ { "from": "system", "value": "Add maximum check for pyramid height\n" }, { "from": "human", "value": "(function() {\n let height = 1,\n block = '#',\n space = ' ';\n\n if (height<2) {\n return console.log('Error! Height must be >= 2');\n }\n\n for (let i = 0; i <...
javascript
chosen
[ { "from": "system", "value": "Fix apidoc to allow `npm install` to complete\n" }, { "from": "human", "value": "module.exports = function(app) {\r\n /**\r\n * @apiGroup buildings\r\n * @apiName Show list of buildings\r\n * @apiVersion 3.0.0\r\n * @api {get} buildings Show list ...
javascript
chosen
[ { "from": "system", "value": "Remove description for pingPong, leave tests for pingPongType and isPingPong\n" }, { "from": "human", "value": "describe('pingPong', function() {\n it(\"is false for a number that is not divisible by 3 or 5\", function() {\n expect(pingPong(7)).to.equal(false);\...
javascript
chosen
[ { "from": "system", "value": "Clean any previous usage of blanket (because re-run in the same process)\n" }, { "from": "human", "value": "/*eslint-env node*/\n\n// Import assert function\nglobal.assert = require(\"assert\");\n\n// Code coverage helper\nrequire(\"blanket\")({\n pattern: \"src/...
javascript
chosen
[ { "from": "system", "value": "Add a submitted value to the form\n" }, { "from": "human", "value": "app.controller('LoginCtrl', ['$scope', '$log', '$route', 'User',\n function($scope, $log, $route, User) {\n $scope.loginForm = {};\n $scope.errors = {};\n\n $scope.login = f...
javascript
chosen
[ { "from": "system", "value": "Use correct sails.config for GCM key\n" }, { "from": "human", "value": "/**\n * GCMKey provider\n *\n * @description :: Server-side logic for managing users\n * @help :: See http://links.sailsjs.org/docs/controllers\n */\n\nmodule.exports = {\nkey: function k...
javascript
chosen
[ { "from": "system", "value": "Add optional payload to ajsonp\n" }, { "from": "human", "value": "var qb;\nfunction launch() {\n if ( ! qb ) qb = QBug.create();\n qb.launchBrowser();\n// qb.launchBrowser('chromium');\n}\n\nif ( chrome.app.runtime ) {\n ajsonp = (function() {\n var factory =...
javascript
chosen
[ { "from": "system", "value": "Add min task to watch\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n\tgrunt.initConfig({\n\n\t\tmeta: {\n\t\t\tbanner: '// ' + grunt.file.read('src/loStorage.js').split(\"\\n\")[0]\n\t\t},\n\n\t\tmin: {\n\t\t\tdist: {\n\t\t\t\tsrc: ['<ban...
javascript
chosen
[ { "from": "system", "value": "Add jshint options and comments." }, { "from": "human", "value": "this.Element && function (ElementPrototype) {\n ElementPrototype.matches = ElementPrototype.matches ||\n ElementPrototype.matchesSelector || \n ElementPrototype.mozMatchesSelector ||\n Ele...
javascript
chosen
[ { "from": "system", "value": "Add method to check is content is in another collection\n" }, { "from": "human", "value": "import http from '../http';\n\nexport default class collections {\n\n static get(collectionID) {\n return http.get(`/zebedee/collectionDetails/${collectionID}`)\n ...
javascript
chosen
[ { "from": "system", "value": "Remove import ref so builds.\n" }, { "from": "human", "value": "/**\n * Settings component.\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compli...
javascript
chosen
[ { "from": "system", "value": "Add PATCH to Access-Control-Allow-Methods header\n" }, { "from": "human", "value": "import config from 'config';\n\n\nexport const originMiddleware = async (ctx, next) => {\n ctx.response.set('Access-Control-Allow-Origin', config.origin);\n ctx.response.set('Acces...
javascript
chosen
[ { "from": "system", "value": "Stop requiring a polyfill that we don't need\n" }, { "from": "human", "value": "/* jshint node:true */\n\nmodule.exports = {\n afterInstall: function() {\n return this.addBowerPackageToProject('polyfills-pkg');\n },\n\n normalizeEntityName: function() {\n }\n...
javascript
chosen
[ { "from": "system", "value": "Remove -dev suffix for pilot-5 release.\n" }, { "from": "human", "value": "/*\r\n\tEach Enyo-provided library will annotate this structure with its own\r\n\tversion info. Why? In general, Enyo and its libraries are versioned\r\n\tand released together, but libraries...
javascript
chosen
[ { "from": "system", "value": "Fix name of writeFile test\n" }, { "from": "human", "value": "var path = require('path'),\n fs = require('fs'),\n crypto = require('crypto');\n\ndescribe(\"writeFile functionality\", function() {\n var _this = this;\n require('./harness.js')(_this);\n ...
javascript
chosen
[ { "from": "system", "value": "Use createActions to create actioncreator\n" }, { "from": "human", "value": "import { createAction } from 'redux-actions';\n\nexport const REQUEST_LOGIN = \"REQUEST_LOGIN\";\nexport const SUCCESS_LOGIN = \"SUCCESS_LOGIN\";\nexport const FAILURE_LOGIN ...
javascript
chosen
[ { "from": "system", "value": "Add a click hook to IsolatedInlineNodeComponent.\n" }, { "from": "human", "value": "import { IsolatedInlineNodeComponent as SubstanceIsolatedInlineNodeComponent } from 'substance'\n\n/*\n This is overriding Substance.IsolatedInlineNodeComponent to support Models.\n...
javascript
chosen
[ { "from": "system", "value": "Copy get all logic into a getAll function.\n" }, { "from": "human", "value": "var nano = require('nano')('http://localhost:5984');\nvar db = nano.db.use('todo');\n\nvar todo = {};\n\nmodule.exports = todo;\n" }, { "from": "gpt", "value": "var nano = requ...
javascript
chosen
[ { "from": "system", "value": "Integrate socket.io to the backend.\n\nwith dummy lines.\n" }, { "from": "human", "value": "\"use strict\";\n\nvar debug = require('debug')('server');\nvar express = require('express');\nvar path = require('path');\n\nvar routes = require('./routes/index');\n\nvar a...
javascript
chosen
[ { "from": "system", "value": "Make isic.events an alias for girder.events\n\nMake isic.events an alias for girder.events instead of a separate object. For\none, this ensures that triggering the 'g:appload.before' and 'g:appload.after'\nevents in main.js reach plugins that observe those events on girder.even...
javascript
chosen
[ { "from": "system", "value": "Add test for using `addRemote` and `remote(['set-url', ...])'`\n\nRef: #452\n" }, { "from": "human", "value": "const Test = require('./include/runner');\n\nconst setUp = (context) => {\n return context.gitP(context.root).init();\n};\n\ndescribe('remote', () => {\n...
javascript
chosen