conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Clarify student status of older children\n\nRe: MoH legal feedback" }, { "from": "human", "value": "module.exports = {\n pageTitle: 'Tell us a bit about who is applying for health care coverage',\n addSpouseButton: 'Add Spouse/Common-Law Partner',\n addChildUnder...
javascript
chosen
[ { "from": "system", "value": "Change virtual prop to an instance method\n" }, { "from": "human", "value": "'use strict';\n\nvar bcrypt = require('bcrypt');\nvar mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\n// export a mongoose model\n\nvar userSchema = new Schema({\n\tuserName...
javascript
chosen
[ { "from": "system", "value": "Test passes a seqJS.Seq, not String\n" }, { "from": "human", "value": "/*global seqJS:true */\n\n(function() {\n /*\n ======== A Handy Little QUnit Reference ========\n http://api.qunitjs.com/\n\n Test methods:\n module(name, {[setup][ ,teardown]})\n...
javascript
chosen
[ { "from": "system", "value": "Remove old CSS classes (breaks stuff)\n" }, { "from": "human", "value": "_kiwi.view.Member = Backbone.View.extend({\n tagName: \"li\",\n initialize: function (options) {\n this.model.bind('change', this.render, this);\n this.render();\n },\n ...
javascript
chosen
[ { "from": "system", "value": "Make node also response with pretty JSON\n" }, { "from": "human", "value": "var mongo = require('mongodb').MongoClient;\n\nmongo.connect('mongodb://localhost:27017/akkavsnode', function(err, db) {\n var http = require('http');\n\n http.createServer(function (req, ...
javascript
chosen
[ { "from": "system", "value": "Set up Travis test environment (cont. 3)\n\nAutowatch didn't help. Seeing if `singleRun = true` causes\nit to stop after running the tests.\n" }, { "from": "human", "value": "// Karma configuration file, see link for more information\n// https://karma-runner.github....
javascript
chosen
[ { "from": "system", "value": "Allow customizable pattern and callback\n" }, { "from": "human", "value": "(function ($) {\n $.fn.clone_form_template = function (options) {\n if (!options) {\n options = {};\n }\n return $(this).map(function () {\n return update($(this).clone(),...
javascript
chosen
[ { "from": "system", "value": "Disable modal confirmation without values.\n" }, { "from": "human", "value": "import { $$ } from '../dom'\nimport { Form, FormRow, Modal, MultiSelect } from '../ui'\n\nexport default function CitationModal (props) {\n const { document, node, mode } = props\n const...
javascript
chosen
[ { "from": "system", "value": "Support \"source\" as a src folder" }, { "from": "human", "value": "/* eslint-disable max-len */\nexports.extensions = {\n supported: [\n { icon: 'dist', extensions: ['dist', 'out'] },\n { icon: 'git', extensions: ['git', 'github'] },\n { icon: 'node', ext...
javascript
chosen
[ { "from": "system", "value": "Rollback blueprints for base model\n\ntfs #116013\n" }, { "from": "human", "value": "import { Model as <%= className %>Mixin<%if (projections) {%>, defineProjections<%}%> } from '../mixins/regenerated/models/<%= name %>';\nimport <%if(parentModelName) {%><%= parentC...
javascript
chosen
[ { "from": "system", "value": "Use strict equality in Pitchfork connector\n" }, { "from": "human", "value": "'use strict';\n\n/* global Connector */\n\nConnector.artistSelector = '.track-title .artist';\n\nConnector.trackSelector = '.track-title .title';\n\nConnector.isPlaying = function () {\n\t...
javascript
chosen
[ { "from": "system", "value": "Add tests for Base fs\n" }, { "from": "human", "value": "jest.autoMockOff();\njest.unmock('../base.js');\n\nconst base = require('../base.js');\n\ndescribe('Base', () => {\n it('does a lot of cool stuff', () => {\n });\n});\n" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Remove template literal as it isn't necessary\n" }, { "from": "human", "value": "const CleanCSS = require(\"clean-css\");\n\nmodule.exports = function (eleventyConfig) {\n\televentyConfig.addPassthroughCopy(\"src/img\");\n\televentyConfig.addPassthroughCopy(\"src/we...
javascript
chosen
[ { "from": "system", "value": "Disable eslint rules disallowing `any` to be used\n" }, { "from": "human", "value": "module.exports = {\n root: true,\n parser: \"@typescript-eslint/parser\",\n parserOptions: {\n tsconfigRootDir: __dirname,\n project: [\"./tsconfig.json\"]\n },\n plugins...
javascript
chosen
[ { "from": "human", "value": "Update HTML files with the updates.\n" }, { "from": "gpt", "value": "require(['gitbook', 'jquery'], function(gitbook, $) {\n var SITES = {\n 'facebook': {\n 'label': 'Facebook',\n 'icon': 'fa fa-facebook',\n 'onClick': funct...
javascript
chosen
[ { "from": "system", "value": "Remove unused init() add render() method\n" }, { "from": "human", "value": "var ContactModel = require('../model/Contacts');\nvar ContactView = require('../view/Contact');\nvar AddContactForm = require('../view/AddContactForm');\n\n/**\n * Controller Object to dispa...
javascript
chosen
[ { "from": "system", "value": "Add Macedonian date format (with leading zero)." }, { "from": "human", "value": "/**\n * Macedonian translation for bootstrap-datepicker\n * Marko Aleksic <psybaron@gmail.com>\n */\n;(function($){\n $.fn.datepicker.dates['mk'] = {\n days: [\"Недела\", \"По...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary argument from seeder file\n" }, { "from": "human", "value": "// auth_seed.js\nconst User = require('./../../database/models').User;\n\nmodule.exports = {\n emptyDB(done) {\n User.destroy({ truncate: true })\n .then((rows) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Return names as json array\n\nNow the identify results are returned as json.\n" }, { "from": "human", "value": "const pkg = require('../package.json');\nconst Identify = require('./identifyPeople.js');\n\nfunction handlers() {\n function index(req, reply) {\n ...
javascript
chosen
[ { "from": "system", "value": "Change product group api authentication\n" }, { "from": "human", "value": "import express from 'express';\nimport * as controller from '../controllers/product-group.controller';\nimport { createAuthMiddleware } from '../auth';\nimport { MODERATOR } from '../auth/con...
javascript
chosen
[ { "from": "system", "value": "Add logic to getting the presentation to the editor\n" }, { "from": "human", "value": "import './index.css';\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Viewer from '../Viewer';\n\nclass Editor extends Component {\n ren...
javascript
chosen
[ { "from": "system", "value": "test(vdom): Add basic tests for all api points that override Incremental DOM.\n" }, { "from": "human", "value": "import * as IncrementalDOM from 'incremental-dom';\nimport { vdom } from '../../../src/index';\n\ndescribe('IncrementalDOM', function () {\n it('should ...
javascript
chosen
[ { "from": "system", "value": "Change the way properties on document.body are set while loading canvas.\n\nIn the default setup, when no width and height options are passed and\n`createGL` is called on page load, it throws an error if the script is\nincluded before the body element, since `document.body.styl...
javascript
chosen
[ { "from": "system", "value": "Use dash pattern in tests for better console visibility\n" }, { "from": "human", "value": "var replace = require( \"../src/str-replace\" );\n\nmodule.exports = {\n replaceAll: function( assert ) {\n var actual = replace.all( \"/\" ).from( \"/home/dir\" ).to( \"\...
javascript
chosen
[ { "from": "system", "value": "Use content-type header in upload endpoint\n" }, { "from": "human", "value": "\nvar loadTemplate = require('../loadTemplate')\n\nvar getRepository = require('./getRepository')\n\nfunction UploadEndpoint(req, res, next) {\n\n var repo = getRepository(req)\n\n r...
javascript
chosen
[ { "from": "system", "value": "Fix url hash when changing tabs\n" }, { "from": "human", "value": "export class Tabs {\n initEventListeners () {\n this.loadTab()\n $('.nav-tabs a').on('click', $.proxy(this.changeTab, this))\n }\n\n changeTab (event) {\n let $current = $(event.currentTa...
javascript
chosen
[ { "from": "system", "value": "Make ignore browser.js from jshint\n" }, { "from": "human", "value": "'use strict';\nmodule.exports = function (grunt) {\n // Show elapsed time at the end\n require('time-grunt')(grunt);\n // Load all grunt tasks\n require('load-grunt-tasks')(grunt);\n\n grunt....
javascript
chosen
[ { "from": "system", "value": "Put the todos reducer into the root reducer\n\n" }, { "from": "human", "value": "import { combineReducers } from 'redux'\n\nimport counter from './counter'\n\nconst reducer = combineReducers({\n counter\n})\n\nexport default reducer\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Disable specimens which are not upgraded yet\n" }, { "from": "human", "value": "import Audio from './specimens/Audio';\nimport Code from './specimens/Code';\nimport Color from './specimens/Color';\nimport Html from './specimens/Html';\nimport Hint from './specimens/...
javascript
chosen
[ { "from": "system", "value": "Improve message on prebuild test failure\n" }, { "from": "human", "value": "'use strict';\n\nvar Mocha = require('mocha');\nvar colors = require('colors');\nvar build = require('./build.js');\nvar mocha = new Mocha({ui: 'bdd', reporter: 'list'});\n\nmocha.addFile('t...
javascript
chosen
[ { "from": "system", "value": "Grunt/deploy: Use private ACL for S3\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n 'use strict';\n\n // Project configuration.\n grunt.initConfig({\n\n pkg: grunt.file.readJSON('package.json'),\n\n // Task configuration.\n aws: ...
javascript
chosen
[ { "from": "system", "value": "change: Rename dist script as compile\n" }, { "from": "human", "value": "/**\n * Copyright (c) Ajay Sreedhar. All rights reserved.\n *\n * Licensed under the MIT License.\n * Please see LICENSE file located in the project root for more information.\n */\n\n'use stri...
javascript
chosen
[ { "from": "system", "value": "Set jshint to ignore minified files.\n" }, { "from": "human", "value": "module.exports = function (grunt) {\n\n require('load-grunt-tasks')(grunt);\n\n grunt.initConfig({\n\n handlebars: {\n\n compile: {\n\n options: {\n ...
javascript
chosen
[ { "from": "system", "value": "Change deploy Grunt taskname to snake case\n" }, { "from": "human", "value": "const zipFileName = 'extension.zip';\nmodule.exports = function (grunt) {\n\tgrunt.initConfig({\n\t\tpkg: grunt.file.readJSON('package.json'),\n\t\twebstoreUpload: {\n\t\t\taccounts: {\n\t...
javascript
chosen
[ { "from": "system", "value": "Add a postbuild task to grunt to remove unnecessary build artifacts\n" }, { "from": "human", "value": "module.exports = function(grunt) {\n\n // load grunt tasks from package.json\n require('load-grunt-tasks')(grunt);\n\n // Project configuration.\n grunt.initCo...
javascript
chosen
[ { "from": "system", "value": "Add rescue field to store client's messages\n" }, { "from": "human", "value": "var mongoose, RatSchema, Schema;\n\nmongoose = require( 'mongoose' );\nSchema = mongoose.Schema;\n\nRatSchema = new Schema({\n 'archive': {\n default: false,\n type: Boolean\n },\...
javascript
chosen
[ { "from": "system", "value": "Fix iframe height after migration to vh\n" }, { "from": "human", "value": "import React, {PropTypes} from 'react'\nimport injectSheet from '../../utils/jss'\n\nfunction Iframe({src, sheet: {classes}}) {\n return <iframe src={src} className={classes.iframe} />\n}\n\...
javascript
chosen
[ { "from": "system", "value": "Fix the root component id.\n" }, { "from": "human", "value": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport { Provider } from 'react-redux'\n\nimport Routes from './routes'\nimport Store from './store'\n\nReactDOM.render(\n <Provider store={St...
javascript
chosen
[ { "from": "system", "value": "Load language config for highlight.js dynamically\n" }, { "from": "human", "value": "// @flow\nimport { PureComponent } from 'react'\nimport Lowlight from 'react-lowlight'\nimport js from 'highlight.js/lib/languages/javascript'\n\nimport type { Children } from 'reac...
javascript
chosen
[ { "from": "system", "value": "Add nodejs guard for nodejs test\n" }, { "from": "human", "value": "\"use strict\";\n\n\nvar Promise = require(\"../../js/debug/bluebird.js\");\nPromise.longStackTraces();\nvar assert = require(\"assert\");\n\ndescribe(\"github276 - stack trace cleaner\", function()...
javascript
chosen
[ { "from": "system", "value": "Handle modifier keys in mouse dispatcher\n" }, { "from": "human", "value": "var slice = [].slice\n\nexports = function mouseDispatcher(name, fn) {\n return function(x, y) {\n var target = document.elementFromPoint(x, y) || document\n var event = new MouseEven...
javascript
chosen
[ { "from": "system", "value": "Use single name field for authors\n" }, { "from": "human", "value": "var keystone = require('keystone');\nvar Types = keystone.Field.Types;\n\n/**\n * Author Model\n * ==========\n */\nvar Author = new keystone.List('Author');\n\nAuthor.add({\n firstName: { type: T...
javascript
chosen
[ { "from": "system", "value": "Fix bug on window platform\n\n--Overview\n1. Window's ping command treat '-i 2' as an invalid option. Therefore,\nwe must split them up. IE using ['-i', '2'] instead of ['-i 2']\n" }, { "from": "human", "value": "var ping = require(\"../index\");\n\nvar hosts = ['19...
javascript
chosen
[ { "from": "system", "value": "Set verbose to false in webpack clean plugin" }, { "from": "human", "value": "var path = require('path');\nvar webpack = require('webpack');\nvar Clean = require('clean-webpack-plugin');\n\nvar webpackConfig = require(\"./webpack-base-config\");\nwebpackConfig.entry...
javascript
chosen
[ { "from": "system", "value": "Fix deploy button for second player\n" }, { "from": "human", "value": "\"use strict\";\n\nvar _ = require('mori');\nvar Router = require('react-router');\nvar React = require('react');\nvar mori = require(\"mori\");\nvar UnitCell = require('../board/UnitCell.react.j...
javascript
chosen
[ { "from": "system", "value": "Add Extra Loading Logic to Assessment Info Pane Component\n" }, { "from": "human", "value": "/*!\n Copyright (C) 2017 Google Inc., authors, and contributors\n Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n */\n\n(function (can, GGRC) ...
javascript
chosen
[ { "from": "system", "value": "Remove default class switch-off (fix css bug when a switcher is set to true by default)\n" }, { "from": "human", "value": "angular.module('toggle-switch', ['ng']).directive('toggleSwitch', function() {\n return {\n restrict: 'EA',\n replace: true,\n scope:...
javascript
chosen
[ { "from": "system", "value": "Change AuthenticatedUser URL to query /v1/get_authenticated_users instead of /v3/me\n" }, { "from": "human", "value": "var Backbone = require('backbone');\n\nmodule.exports = Backbone.Model.extend({\n defaults: {\n username: '',\n avatar_url: ''\n },\n\n ur...
javascript
chosen
[ { "from": "system", "value": "Use `var` instead of `const` for node 0.12 support.\n" }, { "from": "human", "value": "/**\n * NOTE: This file must only use node v0.12 features + ES modules.\n */\n\nimport babel from 'rollup-plugin-babel';\nimport json from 'rollup-plugin-json';\nimport babelrc fr...
javascript
chosen
[ { "from": "system", "value": "Remove unnecessary uglify `passes` property" }, { "from": "human", "value": "import commonjs from 'rollup-plugin-commonjs';\nimport babel from 'rollup-plugin-babel';\nimport uglify from 'rollup-plugin-uglify';\nimport replace from 'rollup-plugin-replace';\nimport re...
javascript
chosen
[ { "from": "system", "value": "Make the initial shared secret less obnoxiously long\n" }, { "from": "human", "value": "var bcrypt = require('bcrypt');\nvar crypto = require('crypto');\nvar passport = require('passport');\nvar request = require('request');\n\nvar SALT = process.env.SALT;\nvar SIGN...
javascript
chosen
[ { "from": "system", "value": "Update server to be from port 3010\n" }, { "from": "human", "value": "/* eslint-disable no-process-env */\n\nexport const NODE_ENV = process.env.NODE_ENV || 'development';\nexport const isDevelopment = () => NODE_ENV === 'development';\nexport const isProduction = (...
javascript
chosen
[ { "from": "system", "value": "Add filtering /locations by category\n" }, { "from": "human", "value": "var assert = require('assert');\nvar config = require('config');\nvar express = require('express');\nvar mongoose = require('mongoose');\n\nvar db = mongoose.connection;\n\nvar locationSchema = ...
javascript
chosen
[ { "from": "system", "value": "Add bsd 2 to menu" }, { "from": "human", "value": "#!/usr/bin/env node --harmony\n\nvar inquirer = require(\"inquirer\");\nvar makeLicense = require(\"./make-license.js\")\n\nconsole.log(\"make-license\");\n\n\nvar questions = [\n {\n type: \"list\",\n name:...
javascript
chosen
[ { "from": "system", "value": "Remove shortcut for about dialog\n" }, { "from": "human", "value": "define([\n \"text!src/welcome.md\"\n], function(welcomeMessage) {\n var commands = codebox.require(\"core/commands\");\n var dialogs = codebox.require(\"utils/dialogs\");\n var File = co...
javascript
chosen
[ { "from": "system", "value": "Use a dom ready event instead of timeout speculations\n" }, { "from": "human", "value": "/* @flow */\nimport './vendor';\nimport ReactDOM from 'react-dom';\nimport routes from './routes';\n\nsetTimeout(() => {\n ReactDOM.render(routes, document.querySelector('#webe...
javascript
chosen
[ { "from": "system", "value": "Set state.video value to undefined\n" }, { "from": "human", "value": "import React, { Component } from 'react';\nimport ReactDOM from 'react-dom';\nimport YTSearch from 'youtube-api-search';\nimport SearchBar from './components/SearchBar';\nimport VideoList from './...
javascript
chosen
[ { "from": "system", "value": "Add Switch and Redirect for Router\n" }, { "from": "human", "value": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { BrowserRouter, Route } from 'react-router-dom';\nimport './styles/index.css';\nimport Background from './components/Backgrou...
javascript
chosen
[ { "from": "system", "value": "Allow array of src strings to be passed in\n" }, { "from": "human", "value": "// Return Promise\nconst imageMerge = (sources = []) => new Promise(resolve => {\n\t// Load sources\n\tconst images = sources.map(source => new Promise(resolve => {\n\t\tconst img = new Im...
javascript
chosen
[ { "from": "system", "value": "Call of console was deleted\n" }, { "from": "human", "value": "import { certificates, certificatesAsync } from './certificates';\nimport { sign, signAsync } from './sign';\nimport {\n paramsForDetachedSignature,\n paramsForDetachedSignatureAsync,\n} from './params...
javascript
chosen
[ { "from": "system", "value": "Remove promises returning data from Friend Service. Unused.\n" }, { "from": "human", "value": "'use strict';\n\nmodule.exports = function(app) {\n app.service('FriendService', ['$rootScope', '$http', function($rs, $http) {\n let allFriends = {};\n\n let getAl...
javascript
chosen
[ { "from": "system", "value": "Fix bug of session data being stored with an extra `values` key\n\n" }, { "from": "human", "value": "'use strict';\n\nexport default {\n setup,\n};\n\n/**\n * Module dependencies.\n */\n\nimport SequelizeStore from 'koa-generic-session-sequelize';\n// import conver...
javascript
chosen
[ { "from": "system", "value": "Swap deprecated findDOMNode to the version from the react-dom module.\n" }, { "from": "human", "value": "import React, { Component, findDOMNode } from 'react';\nimport styles from './GlobalSearch.scss';\n\nexport default class GlobalSearch extends Component {\n ren...
javascript
chosen
[ { "from": "system", "value": "Update REGEX to accept also public keys\n" }, { "from": "human", "value": "import { getKeys } from 'pmcrypto';\n\nimport { readFileAsString } from '../helpers/file';\n\nconst PRIVATE_KEY_EXPR = /-----BEGIN PGP PRIVATE KEY BLOCK-----(?:(?!-----)[\\s\\S])*-----END PGP...
javascript
chosen
[ { "from": "system", "value": "Add custom message for invalid url\n" }, { "from": "human", "value": "import Messages from 'ember-cp-validations/validators/messages';\n\nexport default Messages.extend({\n blank: 'Поле не может быть пустым',\n email: 'Значение должно быть адресом электронной почт...
javascript
chosen
[ { "from": "system", "value": "Change assert style: use method isTrue\n" }, { "from": "human", "value": "var assert = require('chai').assert;\nvar string = require('../../util/string');\n\ndescribe('util/string', function () {\n\tdescribe('#isEmpty', function () {\n\t\tit('should return true', fu...
javascript
chosen
[ { "from": "system", "value": "Fix for toggle all windows\n" }, { "from": "human", "value": "import React, {Component} from 'react';\nimport Mousetrap from 'mousetrap';\n\nclass StatusBar extends Component {\n\n componentDidMount() {\n Mousetrap.bind(['alt+a'], this.toggleSearchAllWindows);\n...
javascript
chosen
[ { "from": "system", "value": "Rename GET parameter from ?filter to ?search\n" }, { "from": "human", "value": "export default class AutoCompleteSubjects {\n\n constructor(wrapper) {\n this.wrapper = wrapper;\n }\n\n initialize(selector) {\n const $input = this.wrapper.find(...
javascript
chosen
[ { "from": "system", "value": "Secure content that must not be altered by grunt\n" }, { "from": "human", "value": "\"use strict\";\n/*jshint node: true*/\n/*eslint-env node*/\n\nmodule.exports = function (grunt) {\n\n require(\"time-grunt\")(grunt);\n\n // Since the tasks are split using lo...
javascript
chosen
[ { "from": "system", "value": "Fix provideConfig() in configure using event.type instead of event.name\n" }, { "from": "human", "value": "const { next, hookStart, hookEnd } = require('hooter/effects')\nconst assignDefaults = require('./assignDefaults')\nconst validateConfig = require('./validateC...
javascript
chosen
[ { "from": "system", "value": "Sort courses based on startDate\n" }, { "from": "human", "value": "const models = require('./models')\nconst Course = models.Course\nconst path = require('path')\nconst url = require('url')\n\nconst uri = url.format({\n pathname: path.join(__dirname, 'data.db'),\...
javascript
chosen
[ { "from": "system", "value": "Add CSS import to react-class template\n" }, { "from": "human", "value": "import React, { Component } from 'react'\n\nclass {{file}} extends Component {\n render () {\n return (\n <div className=\"{{file}}\">\n\n </div>\n )\n }\n}\n\nexport default...
javascript
chosen
[ { "from": "system", "value": "Add Exclude Formats to skip\n" }, { "from": "human", "value": "$(function() {\n\n $('form').preventDoubleSubmission();\n $('form').on('submit', function(e){\n $(this).find('button').text('Processing...')\n });\n\n select_profiles_tab_from_url_hash();\n disab...
javascript
chosen
[ { "from": "system", "value": "Add codeflask/prism to license banner\n" }, { "from": "human", "value": "import resolve from 'rollup-plugin-node-resolve'\nimport minify from 'rollup-plugin-minify-es'\nimport license from 'rollup-plugin-license'\n\nexport default {\n\tinput: 'src/micro-panel-all.js...
javascript
chosen
[ { "from": "system", "value": "Use Promises in node.js if found.\n" }, { "from": "human", "value": "var native = require('../build/Release/dhcurve'),\n common = require('./common.js'),\n Promise = require('es6-promises'),\n _ = require('goal');\n\nfunction generateKeyPair() {\n\n}\n\nmod...
javascript
chosen
[ { "from": "system", "value": "Fix that removes hover effect on touch devices\n" }, { "from": "human", "value": "import gtr from './global-translation.js'\nimport GraphicsHandler from './graphics-handler.js'\nimport MouseHandler from './mouse-handler.js'\nimport {getIsometricCoordinate} from './i...
javascript
chosen
[ { "from": "system", "value": "Check current time after pause\n" }, { "from": "human", "value": "var audio = document.getElementById(\"chris\");\n\nfunction pauseChris() {\n\tif (audio.currentTime >= 331000) {\n\t\taudio.pause();\n\t\talert(interval);\n\t}\n}\n\nfunction playChris() {\n\taudio.cu...
javascript
chosen
[ { "from": "system", "value": "Update copy for toggle feature notification\n" }, { "from": "human", "value": "import $ from 'jquery';\n\nexport default class ToggleFeatureNotifier {\n constructor({chromeWrapper}) {\n this._chromeWrapper = chromeWrapper;\n\n this.notify = this.notify.bind(t...
javascript
chosen
[ { "from": "system", "value": "Set error message using constructor\n" }, { "from": "human", "value": "var util = require('util');\n\nmodule.exports = function (name, defaultMessage, status) {\n\n util.inherits(Constructor, Error);\n\n return Constructor;\n\n function Constructor (message, code...
javascript
chosen
[ { "from": "system", "value": "Check for the existence of the resource cache key before attempting to make dirty\n" }, { "from": "human", "value": "import {\n SET_RESOURCE,\n MARK_DASHBOARD_DIRTY,\n RESET_RESOURCE_CACHE\n} from './actions';\n\nconst markAllDirty = (keys, state) => {\n ...
javascript
chosen
[ { "from": "system", "value": "Add student information to connection socket event\n" }, { "from": "human", "value": "//var Teachers = require('../models/teachers');\n//var TeacherClasses = require('../models/Teacher_classes');\n//var Classes = require('../models/classes');\n//var ClassLessons = r...
javascript
chosen
[ { "from": "system", "value": "Remove include of jquery, it should be included by host app\n" }, { "from": "human", "value": "//\n// General\n//\n\n//= require underscore\n//= require underscore.string\n//= require jquery\n//= require angular\n//= require angularytics\n//= require bootstrap-sass-...
javascript
chosen
[ { "from": "system", "value": "Move vender js files in manifest so the tree can access them\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this dire...
javascript
chosen
[ { "from": "system", "value": "Remove supercool.js from manifest as tag plugin causes errors in IE8.\n\nLooks like the plugin does not support empty jQuery sets for when the\nfield isn't present.\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into including all ...
javascript
chosen
[ { "from": "system", "value": "Load namespace javascript file before all others\n" }, { "from": "human", "value": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/a...
javascript
chosen
[ { "from": "system", "value": "Rollback district edit model when modal is closed" }, { "from": "human", "value": "VtTracker.DistrictModalController = Ember.ObjectController.extend({\n needs: ['index'],\n\n modalTitle: function() {\n if (this.get('isNew')) {\n return 'New District';\n ...
javascript
chosen
[ { "from": "system", "value": "Create a share link with ?status\n" }, { "from": "human", "value": "$(\"div.entry\").live('click', function( e ) {\n var item = $(e.target).closest('.entry');\n\n if (!item.find('.entry-actions span.google-plus').length) {\n item.find(\".entry-actions span.tag\...
javascript
chosen
[ { "from": "system", "value": "Fix target selector for imported projects\n" }, { "from": "human", "value": "/*\n * Copyright 2014 BlackBerry Ltd.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You ...
javascript
chosen
[ { "from": "system", "value": "Make debugging easier by always printing the log" }, { "from": "human", "value": "var _ = require('lodash')\nvar assert = require('assert')\n\nmodule.exports = function () {\n var log = []\n\n return {\n write: function () {\n log.push(_(arguments).toArray...
javascript
chosen
[ { "from": "system", "value": "Use included to fetch supervisees\n" }, { "from": "human", "value": "import Controller from '@ember/controller'\nimport { task } from 'ember-concurrency'\nimport QueryParams from 'ember-parachute'\nimport moment from 'moment'\n\nconst UsersEditResponsibilitiesQueryP...
javascript
chosen
[ { "from": "system", "value": "Implement basic create admin with username / password only\n" }, { "from": "human", "value": "/**\n * Admin Controller\n * @module AdminController\n */\nvar rfr = require('rfr');\nvar Joi = require('joi');\nvar Boom = require('boom');\n\nvar Utility = rfr('app/util/...
javascript
chosen
[ { "from": "system", "value": "Make updatedAt modifying node.id in Source nodes\n" }, { "from": "human", "value": "'use strict';\n\nvar Node = require('../node');\n\nvar TYPE = 'source';\nvar PARAMS = {\n query: Node.PARAM.STRING()\n};\n\nvar Source = Node.create(TYPE, PARAMS);\n\nmodule.expor...
javascript
chosen
[ { "from": "system", "value": "Reset output store if pane is closed\n" }, { "from": "human", "value": "/* @flow */\n\nimport { CompositeDisposable } from \"atom\";\nimport ResizeObserver from \"resize-observer-polyfill\";\n\nimport React from \"react\";\n\nimport { reactFactory, OUTPUT_AREA_URI }...
javascript
chosen
[ { "from": "system", "value": "Send 500 every now and then\n" }, { "from": "human", "value": "var config = {\n clientId: '',\n clientSecret: '',\n hashTag: 'ruisrock2014' \n}\n\nvar getIg = function(){\n var ig = require('instagram-node').instagram();\n ig.use({ client_id: config.clientId,\n...
javascript
chosen
[ { "from": "system", "value": "Remove .json from the set url\n" }, { "from": "human", "value": "AV.ComparisonSetCollection = Backbone.Collection.extend({\n url: AV.URL('set.json'),\n updateURL: function() {\n this.url = AV.URL('set.json');\n }\n});\n" }, { "from": "gpt", ...
javascript
chosen
[ { "from": "system", "value": "Add error handling to chekcing package.json\n" }, { "from": "human", "value": "#! /usr/bin/env node\nconst args = require('./args') // TODO\nconst path = require('path')\nconst { graphql: config } = require(path.join(process.cwd(), 'package.json'))\nconst { sendQuer...
javascript
chosen
[ { "from": "system", "value": "Fix for missing providers length\n" }, { "from": "human", "value": "\"use strict\";\nvar Anyfetch = require('anyfetch');\n\nmodule.exports.get = function get(req, res, next) {\n var anyfetchClient = new Anyfetch(req.accessToken.token);\n anyfetchClient.getDocument...
javascript
chosen
[ { "from": "system", "value": "Move step-by-step direction details into element\n" }, { "from": "human", "value": "(function () {\n 'use strict';\n\n /* ngInject */\n function RowDetail($compile) {\n // TODO: Animate the row appearing\n var template = [\n '<tr n...
javascript
chosen
[ { "from": "system", "value": "Set .path in dds textures for debugging.\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @note Returns texture immediately, but doesn't load till later.\n */\nvar ROSETexLoader = {};\nROSETexLoader.load = function(path, callback) {\n var tex = DDS.load(...
javascript
chosen
[ { "from": "human", "value": "Add initial global JS solution for problem 6\n" }, { "from": "gpt", "value": "var _ = require('lazy.js');\n\nvar square = function square (n) {\n return Math.pow(n, 2);\n};\n\nvar sum = function sum (n, m) {\n return n + m;\n};\n\nvar sumOfSquares = function sumOfS...
javascript
chosen