conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Set only PhantomJS as the test browser for TravisCI.\n"
},
{
"from": "human",
"value": "module.exports = function(config) {\n config.set({\n\n basePath: '../',\n frameworks: ['jasmine'],\n autoWatch: false,\n browsers: ['Chrome', 'PhantomJS'],\n fi... | javascript | chosen |
[
{
"from": "system",
"value": "[Admin] Allow blank non-required e-mail fields.\n"
},
{
"from": "human",
"value": "const $ = require('jquery');\n\nconst Keys = require('keys/dist/client');\n\n$(() => {\n $('body').on('click', '[type=\"submit\"]', ev => {\n const $btn = $(ev.target);\n const... | javascript | chosen |
[
{
"from": "system",
"value": "Fix typo in sample test\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst TwitterService = require('./twitterService');\nconst assert = require('chai').assert;\nconst _ = require('lodash');\n\nsuite('Candidate API tests', function () {\n let service;\n\n b... | javascript | chosen |
[
{
"from": "system",
"value": "Change level to log_level to be compatible with django\n"
},
{
"from": "human",
"value": "var winston = require('winston');\nvar moment = require('moment');\nvar getSecret = require('./docker-secrets').getDockerSecret;\n\nfunction getLogger(nconf) {\n var log_level... | javascript | chosen |
[
{
"from": "system",
"value": "Remove logzio and make json log single line\n"
},
{
"from": "human",
"value": "var winston = require('winston');\nvar moment = require('moment');\nlet fs = require('fs')\n\nfunction getLogger(nconf) {\n var log_level = nconf.get('loglevel');\n var logger = new (wi... | javascript | chosen |
[
{
"from": "system",
"value": "Update template to use latest structure\n"
},
{
"from": "human",
"value": "// GitHub Gist Sub-Generator\n// =========================\n//\n// Usage: `$ yo realguess:gist 'mygist'\n//\n// TODO\n// ----\n//\n// 1. The current sub-generator only supports JavaScript Gis... | javascript | chosen |
[
{
"from": "system",
"value": "Add spaces to leaderboard names\n"
},
{
"from": "human",
"value": "require('./style.scss');\n\nvar $ = require(\"jquery\");\nvar Game = require(\"./game\");\nvar Menu = require(\"./menu\");\nvar canvas = document.getElementById('canvas');\nvar context = canvas.getCo... | javascript | chosen |
[
{
"from": "system",
"value": "Include modules to test through Bluegel, not individually\n"
},
{
"from": "human",
"value": "var expect = require('expect.js');\nvar utils = require(\"../lib/utils\");\n\ndescribe(\"Utils\", function() {\n describe(\"dominantMovement\", function() {\n it(\"retur... | javascript | chosen |
[
{
"from": "system",
"value": "Add dev as default gulp task\n"
},
{
"from": "human",
"value": "'use strict';\n\nimport fs from 'fs';\nimport onlyScripts from './util/scriptFilter';\n\nconst tasks = fs.readdirSync('./gulp/tasks/').filter(onlyScripts);\n\ntasks.forEach((task) => {\n requi... | javascript | chosen |
[
{
"from": "system",
"value": "Verify trimStart instead of startsWith\n"
},
{
"from": "human",
"value": "import { isIE11 } from '../helpers/browser';\n\n/**\n * This file is included in the main bundle. Its main purpose is to find out if the main bundle could execute,\n * or if it errored out due... | javascript | chosen |
[
{
"from": "system",
"value": "Stop dispatching extraneous `pjax:complete` events, correct typo\n"
},
{
"from": "human",
"value": "module.exports = function(el) {\n // console.log(\"going to execute script\", el)\n\n var code = (el.text || el.textContent || el.innerHTML || \"\")\n var src = (e... | javascript | chosen |
[
{
"from": "system",
"value": "Hide draft events from public event list\n"
},
{
"from": "human",
"value": "module.exports = () => (hook) => {\n const sequelize = hook.app.get('sequelize');\n\n hook.params.sequelize = {\n attributes: [\n 'id',\n 'title',\n 'date',\n 'regis... | javascript | chosen |
[
{
"from": "system",
"value": "Exit syncing script when it's done\n"
},
{
"from": "human",
"value": "'use strict'\n\nlet winston = require('winston')\nlet Rat = require('../api/models/rat')\nlet Rescue = require('../api/models/rescue')\nlet User = require('../api/models/user')\nlet mongoose = req... | javascript | chosen |
[
{
"from": "system",
"value": "Remove reference to missing file\n\n- this file was recently removed in https://github.com/alphagov/govuk_publishing_components/pull/2632 as it is no longer needed, so this reference to it is no longer needed\n"
},
{
"from": "human",
"value": "// This file contains ... | javascript | chosen |
[
{
"from": "system",
"value": "Expand pagination for Group manager\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';\n\nexport default Ember.Route.extend(AuthenticatedRouteMixin, {\n currentUse... | javascript | chosen |
[
{
"from": "system",
"value": "Add check to mail subscribe route to only subscribe on production.\n"
},
{
"from": "human",
"value": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mailChimp = require('../../node_modules/mailchimp-api/mailchimp'),\n\tvalidator = require('../../node_module... | javascript | chosen |
[
{
"from": "system",
"value": "fix: Update bundle if already installed\n"
},
{
"from": "human",
"value": "require('shelljs/global');\n\nvar installBundle = function(gitPath) {\n gitPath = gitPath.trim().replace(/#.*/, '');\n if(!gitPath) { return; }\n var repoName = gitPath.replace(/.*\\//, ''... | javascript | chosen |
[
{
"from": "system",
"value": "Use span rather than input text element to display selected file\n"
},
{
"from": "human",
"value": "/**\n\n*/\n(function($) {\n \n $.fn.inputFileText = function(userOptions) {\n var MARKER_ATTRIBUTE = 'data-inputFileText';\n\n if(this.attr(MARKER_AT... | javascript | chosen |
[
{
"from": "system",
"value": "Add update method to raw customer (saas-97)\n"
},
{
"from": "human",
"value": "'use strict';\n\n(function() {\n angular.module('ncsaas')\n .service('customersService', ['RawCustomer', customersService]);\n\n function customersService(RawCustomer) {\n /*jshin... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug in Settings | Preferences"
},
{
"from": "human",
"value": "(function () {\r\n \"use strict\";\r\n\r\n var appdata = Windows.Storage.ApplicationData.current;\r\n var tileColors = q(\"#tileColors > div\");\r\n \r\n WinJS.UI.Pages.define(\"/page... | javascript | chosen |
[
{
"from": "system",
"value": "Remove KC banner from repo"
},
{
"from": "human",
"value": "var $ = require('jquery');\nwindow.$ = window.jQuery = $;\n\nvar setupHomepage = require('./homepage');\nvar setupAllArticles = require('./all-articles');\nvar setupAdmonish = require('./admonish');\n\n// k... | javascript | chosen |
[
{
"from": "system",
"value": "Increment version number to 27.\n"
},
{
"from": "human",
"value": "var Zinc = { REVISION: '26' };\n\n\nZinc.defaultMaterialColor = 0x7F1F1A;\nZinc.defaultOpacity = 1.0;\n"
},
{
"from": "gpt",
"value": "var Zinc = { REVISION: '27' };\n\n\nZinc.defaultMate... | javascript | chosen |
[
{
"from": "system",
"value": "Add `s` suffix back to individual resources\n\nIe. `clients` instead of `client` and so on.\n"
},
{
"from": "human",
"value": "'use strict';\nvar upperCaseFirst = require('change-case').upperCaseFirst;\nvar fp = require('annofp');\n\n\nmodule.exports = swaggerify(re... | javascript | chosen |
[
{
"from": "system",
"value": "Add Travis UA for API calls\n"
},
{
"from": "human",
"value": "var Travis = require('travis-ci');\nvar child_process = require('child_process');\nvar repo = \"excaliburjs/excaliburjs.github.io\";\nvar travis = new Travis({\n\tversion: '2.0.0'\n});\n\nvar branch = pr... | javascript | chosen |
[
{
"from": "system",
"value": "Convert Variation class to ES6\n"
},
{
"from": "human",
"value": "'use strict';\n\n/**\n * Internal dependencies\n */\nlet SampleProportion = require( './sample-proportion' );\n\nfunction Variation( name, color, participants, conversions ) {\n\tthis.name = name;\n\t... | javascript | chosen |
[
{
"from": "system",
"value": "Provision of middleware now requires function to allow request to be passed in on server-side\n"
},
{
"from": "human",
"value": "import {createStore, combineReducers, compose, applyMiddleware} from 'redux';\nimport {routerReducer, routerMiddleware} from 'react-route... | javascript | chosen |
[
{
"from": "system",
"value": "fix: Save position on zero start\n"
},
{
"from": "human",
"value": "import _ from 'lodash'\n\nexport function saveCursorPosition ({ target }) {\n if (target.selectionStart) {\n return target.selectionStart\n }\n\n if (document.selection) { // IE support\n t... | javascript | chosen |
[
{
"from": "system",
"value": "Add build index modal extra changes message\n\n"
},
{
"from": "human",
"value": "import React from \"react\";\nimport { map, sortBy } from \"lodash-es\";\nimport { Row, Col, ListGroup, ListGroupItem, Panel } from \"react-bootstrap\";\n\nimport { LoadingPlaceholder }... | javascript | chosen |
[
{
"from": "system",
"value": "Change string to English and remove absolute paths to work on installations not located under site root\n"
},
{
"from": "human",
"value": "(function() {\n \nvar saml = document.createElement('script');\nsaml.type = 'text/javascript';\n(document.getElementsByTagNa... | javascript | chosen |
[
{
"from": "system",
"value": "Fix header parsing and add test\n"
},
{
"from": "human",
"value": "'use strict';\n\n/* lib/handshake.js\n * WebSocket handshake.\n * * */\n\nmodule.exports = exports = function(){\n\n};\n\nexports._headers = function(raw){\n if (raw instanceof Buffer) raw = raw.toS... | javascript | chosen |
[
{
"from": "system",
"value": "Make plugin name bold in /help\n"
},
{
"from": "human",
"value": "import Plugin from \"./Plugin\";\n\nexport default class MasterPlugin extends Plugin {\n\n static get plugin() {\n return {\n name: \"MasterPlugin\",\n description: \"\... | javascript | chosen |
[
{
"from": "system",
"value": "Remove iPhone scrollbar onload script\n\nSometimes jilts the page back to top if you've already scrolled down. Not a necessary feature."
},
{
"from": "human",
"value": "// DOM Ready\n$(function() {\n\n\t// www.conditionizr.com\n\t// Legacy content and retina scripts... | javascript | chosen |
[
{
"from": "system",
"value": "Add delegated listeners to topnav and bottomnav for actions\n\nSigned-off-by: Kaustav Das Modak <ba1ce5b1e09413a89404909d8d270942c5dadd14@yahoo.co.in>\n"
},
{
"from": "human",
"value": "(function () {\n\n // Add behaviour for option buttons\n app(function (api... | javascript | chosen |
[
{
"from": "system",
"value": "Drop support for unsupported browsers\n\nThis set of browsers that we target did not match our published support\nmatrix and was including IE11 which does not have CSS Grid support and\nlooks terrible. Instead we should only target browsers that we actually\nsupport.\n"
},
... | javascript | chosen |
[
{
"from": "system",
"value": "Add app object to global codebox\n"
},
{
"from": "human",
"value": "require([\n \"hr/utils\",\n \"hr/dom\",\n \"hr/promise\",\n \"hr/hr\",\n \"hr/args\",\n \"resources/init\",\n \"core/application\",\n \"core/packages\",\n \"utils/dialogs\... | javascript | chosen |
[
{
"from": "system",
"value": "Adjust Jira Regex to allow numbers in the prefix of project key\n"
},
{
"from": "human",
"value": "export const CompanyJiraMapping = {\n 'AB InBev': 'https://ab-inbev.atlassian.net'\n}\n\nexport const getJiraIssueKey = name => {\n const match = new RegExp(/[A-Z][A... | javascript | chosen |
[
{
"from": "system",
"value": "Remove unnecessary call to pinMode\n\nSigned-off-by: Rick Waldron <dd8fdbe95c7f81f312b273ef8860922803e9ef16@gmail.com>\n"
},
{
"from": "human",
"value": "var Galileo = rewire(\"../lib/galileo\");\nvar board = new Galileo();\n\nboard.on(\"ready\", function() {\n var... | javascript | chosen |
[
{
"from": "system",
"value": "Fix failing test case under logical operators.\n"
},
{
"from": "human",
"value": "if ( typeof window === 'undefined' ) {\n require('../../app/logicalOperators');\n var expect = require('chai').expect;\n}\n\ndescribe('logical operators', function(){\n it('you shou... | javascript | chosen |
[
{
"from": "system",
"value": "Connect body parser doesn't work in union (and not necessary for session)\n"
},
{
"from": "human",
"value": "/**\n * Auth cantina plugin.\n */\n\nvar connect = require('connect');\n\n// Expose this service's package info.\nrequire('pkginfo')(module);\n\n// The plugi... | javascript | chosen |
[
{
"from": "system",
"value": "Add media manager open JS method\n"
},
{
"from": "human",
"value": "( function( window, Backbone, $, _, Scrivener, undefined ) {\n\n\t\"use strict\";\n\tvar document = window.document;\n\n\tScrivener.Views.Sidebar = Backbone.View.extend( {\n\n\t\tclassName : 'scrive... | javascript | chosen |
[
{
"from": "system",
"value": "Add validate() and getImage() helper functions\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst crypto = require('crypto');\nconst request = require('request');\nconst url = process.env.UPLOAD_URL;\n\nmodule.exports = function upload(image, cb) {\n const s... | javascript | chosen |
[
{
"from": "system",
"value": "Update properties of plugin to include routes used\n\n"
},
{
"from": "human",
"value": "export class Plugin {\n\n\tconstructor(Knekt) {\n\t\tthis.registerRoutes(Knekt);\n\t}\n\n\tproperties = {\n\t\tname: \"My Plugin\",\n\t\tdescription: \"A demo plugin\",\n\t\twebs... | javascript | chosen |
[
{
"from": "system",
"value": "Increase Nightwatch.js check_process_delay to 5 seconds\n"
},
{
"from": "human",
"value": "var seleniumServer = require('selenium-server');\nvar chromedriver = require('chromedriver');\nvar geckodriver = require('geckodriver');\n\nmodule.exports = {\n src_folders: ... | javascript | chosen |
[
{
"from": "system",
"value": "Use `Object.create` instead of `new` for prototype inheritance.\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar google = global.google;\n\nfunction onAdd() {\n var panes = this.getPanes();\n\n panes.overlayLayer.appendChild(this.el);\n}\n\nfunction pos... | javascript | chosen |
[
{
"from": "system",
"value": "Add dev env as default\n"
},
{
"from": "human",
"value": "global.__pkg = require('./package.json')\nvar path = require('path')\nvar gulp = require('gulp')\nrequire('babel-register')({ presets: ['es2015', 'react', 'stage-0'] })\nrequire('babel-polyfill')\n\nglobal.__... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure linting is performed\n"
},
{
"from": "human",
"value": "const gulp = require('gulp');\nconst eslint = require('gulp-eslint');\nconst mocha = require('gulp-mocha');\n\ngulp.task('lint', () => {\n return gulp.src(['./*.js'])\n .pipe(eslint())\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add missed h2..h6 to whitelisted block tags\n"
},
{
"from": "human",
"value": "// List of valid html blocks names, accorting to commonmark spec\n// http://jgm.github.io/CommonMark/spec.html#html-blocks\n\n'use strict';\n\n\nmodule.exports = [\n 'address',\n 'artic... | javascript | chosen |
[
{
"from": "system",
"value": "Update docs for module loader.\n"
},
{
"from": "human",
"value": "/**\n * Module dependencies\n */\n\nvar buildDictionary = require('./buildDictionary');\n\n\n\n/**\n * Module loader (aka Cargo)\n *\n * Load a module into memory\n */\n\nmodule.exports = {\n\n\t/**\n... | javascript | chosen |
[
{
"from": "system",
"value": "Update license & add strict"
},
{
"from": "human",
"value": "// Copyright 2019 Google Inc.\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 may obtain a copy of the... | javascript | chosen |
[
{
"from": "system",
"value": "Fix tests for older envs.\n"
},
{
"from": "human",
"value": "import test from 'tape';\nimport { methods, isStamp } from '../';\n\ntest('methods()', nest => {\n const a = { a: () => {} };\n const b = { b: () => {} };\n const c = { c: () => {} };\n\n nest.test('..... | javascript | chosen |
[
{
"from": "system",
"value": "Apply sanitization to limit, skip & p\n"
},
{
"from": "human",
"value": "module.exports = function( action, options ) {\n this.reservedParams.push('limit', 'skip', 'p');\n\n if (action === 'index') {\n this.on('validate', function( req ) {\n var maxLimit =... | javascript | chosen |
[
{
"from": "system",
"value": "Fix promises params and this references\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar request = require('request');\n\nclass CartoDBMapClient {\n constructor(user, apiKey) {\n this.user = user;\n \tthis.apiKey = apiKey;\n this.baseURL = 'https://' ... | javascript | chosen |
[
{
"from": "system",
"value": "Return all properties (including nulls)\n"
},
{
"from": "human",
"value": "$.fn.filterByData = function(prop, val) {\n return this.filter(\n function() { return $(this).data(prop)==val; }\n );\n};\n\n$(document).ready(function() {\n var radios = $('.table-vie... | javascript | chosen |
[
{
"from": "system",
"value": "Add click function for myAds link\n"
},
{
"from": "human",
"value": "function startApp() {\n // sessionStorage.clear(); // Logout user after refresh web page\n showMenuHideLinks();\n listItems();\n\n if (sessionStorage.getItem('username')) {\n $('... | javascript | chosen |
[
{
"from": "system",
"value": "Exit with code 1 if no connection to the DB\n"
},
{
"from": "human",
"value": "var orm = require('orm');\n\nvar connectionString;\n\nif (process.env.SQLITE == 'true')\n connectionString = 'sqlite://' + __dirname + '/db.sqlite';\nelse\n connectionString = 'post... | javascript | chosen |
[
{
"from": "system",
"value": "Replace deprecated attr call with get\n"
},
{
"from": "human",
"value": "module.exports = function(can){\n\treturn function(data){\n\t\t// If this is not a CanJS project\n\t\tif(typeof can === \"undefined\" || !can.view) {\n\t\t\treturn {};\n\t\t}\n\n\t\tvar oldCanI... | javascript | chosen |
[
{
"from": "system",
"value": ":green_heart: Fix the check on parser being a string not object\n"
},
{
"from": "human",
"value": "'use strict';\n\nvar config = require('../lib/index');\nvar eslint = require('eslint');\nvar isObject = require('is-object');\nvar path = require('path');\nvar test = ... | javascript | chosen |
[
{
"from": "system",
"value": "Add message when opening prod build\n"
},
{
"from": "human",
"value": "// This file configures a web server for testing the production build\n// on your local machine.\n\nimport browserSync from 'browser-sync';\nimport historyApiFallback from 'connect-history-api-fa... | javascript | chosen |
[
{
"from": "system",
"value": "Add function to get table name from model\n"
},
{
"from": "human",
"value": "\nexports.get = function getMany(model, params) {\n}\n\nexports.add = function add(model, data) {\n}\n\nexports.update = function update(model, id, data) {\n}\n\nexports.delete = function d... | javascript | chosen |
[
{
"from": "system",
"value": "Use var instead of const for IE10\n\nUsing `const` in css-hot-loader content does not work in IE10, replacing it with var"
},
{
"from": "human",
"value": "const loaderUtils = require('loader-utils');\nconst defaultOptions = {\n fileMap: '{fileName}',\n};\nmodule.ex... | javascript | chosen |
[
{
"from": "system",
"value": "Check if we have any projects\n"
},
{
"from": "human",
"value": "App.Router.map(function () {\n this.resource('projects', {path: '/'}, function() {\n this.resource('project', {path: 'projects/:project_id'}, function() {\n this.resource('investigations', fun... | javascript | chosen |
[
{
"from": "system",
"value": "Fix command line arguments order for gjslint\n\nClosure Linter does not respect \"--strict\" flag\nif it goes after files list.\n"
},
{
"from": "human",
"value": "/**\n * common code goes here\n */\n\nvar grunt = require('grunt'),\n exec = require('child_process'... | javascript | chosen |
[
{
"from": "system",
"value": "Fix missing header causing crash\n"
},
{
"from": "human",
"value": "'use strict';\n\nmodule.exports = function(config, ircbot, utils) {\n\tircbot.emit('registerHttp', 'post', '/hooks/github', function(req, res) {\n\t\tconst crypto = require('crypto');\n\t\tconst sig... | javascript | chosen |
[
{
"from": "system",
"value": "Fix the CLI minor bug\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nconst jsdotmd = require('../lib')\nconst program = require('commander')\nconst path = require('path')\n\nprogram\n .usage('[options] <source> <destination')\n .option(\n '-l, --lang... | javascript | chosen |
[
{
"from": "system",
"value": "Fix karma tests in windows\n"
},
{
"from": "human",
"value": "var path = require('path');\nvar transformTools = require('browserify-transform-tools');\nvar constants = require('./constants');\n\nvar pathToStrictD3Module = path.join(\n constants.pathToImageTest,\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add example of test instructions in sample plugin\n"
},
{
"from": "human",
"value": "var hydra = require('hydra'),\n HydraHeadStatic = hydra.heads.HydraHeadStatic,\n HydraHead = hydra.heads.HydraHead;\n\nexports.getBodyParts = function(config, ... | javascript | chosen |
[
{
"from": "system",
"value": "Update name on swagger test\n"
},
{
"from": "human",
"value": "var request = require('supertest')\n , app = require('../express');\n\ndescribe(\"documentation tests\", function() {\n\n it(\"should get swagger document\", function(done) {\n request(app)\n .... | javascript | chosen |
[
{
"from": "system",
"value": "Fix a bunch of issues with the stub helper thingo\n"
},
{
"from": "human",
"value": "/*\n * node-http-cache.\n * Copyright © 2012 Chris Corbyn.\n *\n * See LICENSE file for details.\n */\n\n/* Convenience stuff for testing */\n\nmodule.exports = {\n httpCache: requ... | javascript | chosen |
[
{
"from": "system",
"value": "Use window.stringsLanguage by default if fulfilled\n"
},
{
"from": "human",
"value": "$(document).ready(function() {\n if (window.taskData) {\n var taskInstructionsHtml = $('#taskIntro').html();\n\n var hints = $('#taskHints > div').toArray().map(elm => {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Add global initialization to the lib\n"
},
{
"from": "human",
"value": "(function initialization(container) {\n container.Fmk = {\n Models: {},\n Views: {},\n Services: {},\n Helpers: {}\n };\n})(typeof module === 'undefined' && typeof window !== 'unde... | javascript | chosen |
[
{
"from": "system",
"value": "Fix content widget slate-editor toolbar z-index\n"
},
{
"from": "human",
"value": "export default {\n button: {\n borderRight: '1px solid #fff'\n },\n dropdown: {\n position: 'relative',\n top: 1,\n backgroundColor: 'white',\n height: 38,\n padd... | javascript | chosen |
[
{
"from": "system",
"value": "Improve JSON parsing error message\n"
},
{
"from": "human",
"value": "var fs = require('fs');\nvar parallelStream = require('pelias-parallel-stream');\n\nvar maxInFlight = 10;\n\nmodule.exports.create = function create_json_parse_stream(dataDirectory) {\n return pa... | javascript | chosen |
[
{
"from": "system",
"value": "Fix a bug inside the caching module\n"
},
{
"from": "human",
"value": "module.exports = () =>\n (\n (cache) =>\n (key, str) =>\n key === true\n ? cache = {}\n : str\n ? cache[key] = str\n : key[str]\n )({})\n\... | javascript | chosen |
[
{
"from": "system",
"value": "Add a new method to find language for user\n"
},
{
"from": "human",
"value": "getUserLanguage = function () {\n // Put here the logic for determining the user language\n\n return \"zh\";\n};\n\nif (Meteor.isClient) {\n Meteor.startup(function () {\n _.extend(N... | javascript | chosen |
[
{
"from": "system",
"value": "Gifs: Add image_mobile to show the animated gif on mobile.\n"
},
{
"from": "human",
"value": "(function(env){\n \"use strict\";\n\n env.ddg_spice_gifs = function (api_result) {\n\n if (!api_result || !api_result.data || !api_result.data.length){\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Remove duplicate check on redux.reducer"
},
{
"from": "human",
"value": "import { each } from 'lodash';\nimport mergeConfigs from '../bin/merge-configs';\n\nfunction validateConfig(config) {\n const errors = [];\n if (!config) {\n errors.push('==> ERROR: No... | javascript | chosen |
[
{
"from": "system",
"value": "Add support to run inside Meteor.\nWhen running this babel-plugin inside Meteor, it gives us\nweird errors.\nBut, we don't need this to use inside Meteor.\nMeteor do this for us automatically.\nSo, we simply turn off this when using inside Meteor.\n"
},
{
"from": "huma... | javascript | chosen |
[
{
"from": "system",
"value": "Adjust post-stimulus waiting period setting\n"
},
{
"from": "human",
"value": "/**\n * Settings configuration for jsPASAT\n */\n\nvar jsPASAT = {\n\n // Pace of PASAT trial presentation\n 'TIMING_STIM_DISPLAY': 1000,\n 'TIMING_POST_STIM': 3000,\n\n // Practice b... | javascript | chosen |
[
{
"from": "system",
"value": "[ng] Add home route and redirect others to /404\n"
},
{
"from": "human",
"value": "'use strict';\n\nangular.module('app', ['ngRoute']);"
},
{
"from": "gpt",
"value": "'use strict';\n\nangular\n .module('app', ['ngRoute'])\n .config(['$routeProvider', '... | javascript | chosen |
[
{
"from": "system",
"value": "[form-builder] Use .getDocument to fetch image record to avoid sync issues\n"
},
{
"from": "human",
"value": "import client from 'part:@sanity/base/client'\n\nfunction uploadAsset(assetType, asset) {\n return client.observable.assets.upload(assetType, asset.file)\n... | javascript | chosen |
[
{
"from": "system",
"value": "Split commit message in multiple link when issue found\n"
},
{
"from": "human",
"value": "/**\n *Background script\n */\nconst _BUGTRACKER_ISSUE_URL_ = \"http://redmine.microclimat.com/issues/\"\n\n$('.commit-title').each(function(){\n var content = $(this).text(... | javascript | chosen |
[
{
"from": "system",
"value": "Disable parallel requests for now\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nplugin.consumes = [\n \"db\", \"connect.static\"\n];\nplugin.provides = [\n \"unpacked_helper\"\n];\n\nmodule.exports = plugin;\n\nfunction plugin(options, imports, registe... | javascript | chosen |
[
{
"from": "system",
"value": "Use Set and methods of Set\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nlet tags = ;\n\nconsole.log(`Total items ${tags.size}`);"
},
{
"from": "gpt",
"value": "\"use strict\";\n\nlet tags = new Set();\n\ntags.add(\"JavaScript\");\ntags.add(\"Pro... | javascript | chosen |
[
{
"from": "system",
"value": "Make express-session version used by Turnpike available on turnpike.exports.express_session\n"
},
{
"from": "human",
"value": "exports.async = require('async');\nexports.connect = exports.express = require('express');\nexports.fs = require('fs-extra');\nexports.hook... | javascript | chosen |
[
{
"from": "system",
"value": "Include newline at end of rewritten manifest.json\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\nvar manifestPath = __dirname + '/manifest.json';\n\nvar fs = require('fs');\nvar manifest = JSON.parse(fs.readFileSync(manifestPath));\n\nconsole.assert(Array... | javascript | chosen |
[
{
"from": "system",
"value": "Revert to 'info' as default log level\n"
},
{
"from": "human",
"value": "const fs = require('fs');\nconst winston = require('winston');\nconst {createLogger, format, transports} = winston;\n\nconst logger = createLogger({\n level: process.env.LOG_LEVEL || 'debug',\... | javascript | chosen |
[
{
"from": "system",
"value": "Make the compilation return an object instead of a function\n\nTicket #13\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n/*\n * Compiles Hogan templates and prints result to stdout\n */\n\nvar hogan = require('../lib/hogan'),\n path = require('path'),\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix API root for latest Workspace.\n"
},
{
"from": "human",
"value": "angular.module('<%= appname %>', ['ngResource'])\n .service('TodosSvc', function ($resource) {\n var Todo = $resource('http://localhost:3000/todos/:todoId', { todoId: '@id' });\n var todos ... | javascript | chosen |
[
{
"from": "system",
"value": "Add create account get and post routes, attendance get and post routes, login route, and verifyCard dummy function for use in attendance."
},
{
"from": "human",
"value": "var express = require('express');\nvar router = express.Router();\nvar controller = require('..... | javascript | chosen |
[
{
"from": "system",
"value": "Make a point about CoffeeScript.\n"
},
{
"from": "human",
"value": "module.exports = normalize\n\nvar isValid = require(\"./is_valid\")\nvar fixer = require(\"./fixer\")\n\nvar fieldsToFix = ['name','version','description','repository'\n ,'files','b... | javascript | chosen |
[
{
"from": "system",
"value": "Update smooth scrolling script with focus added\n"
},
{
"from": "human",
"value": "(function ($) {\n $(document).ready(function () {\n // Media queries\n var mqExtraSmall = 480;\n var mqSmall = 768;\n var mqMedium = 992;\n var mqLarge = 1200;\n\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Set default chunk size to 10 kilobytes\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst applyDefaultOpts = opts => Object.assign({}, {\n\tencoding: 'utf8',\n\tchunkSize: 3\n}, opts);\n\nconst b64 = () => {\n\n};\n\nb64.encode = (input, opts) => new Promise(... | javascript | chosen |
[
{
"from": "system",
"value": "Set `planetaryjs` global when using AMD\n\nWhile using RequireJS to AMD load ng-planetaryjs, planetaryjs, and their\ndependencies, ng-planetaryjs still looks for global object planetaryjs\n(such as in `var globe = planetaryjs.planet();`). Thus use the UMD\npattern \"AMD with gl... | javascript | chosen |
[
{
"from": "system",
"value": "Fix exports so module.exports is defined\n"
},
{
"from": "human",
"value": "'use strict'\n\nimport validateKey from 'firebase-validate-key'\nimport extend from 'xtend'\nimport find from 'babel-runtime/core-js/array/find'\nimport * as serverValue from 'firebase-serve... | javascript | chosen |
[
{
"from": "system",
"value": "feat(types): Edit validation and transformation process in Number type\n"
},
{
"from": "human",
"value": "import ConfigFieldBaseType from './base';\n\nclass NumberType extends ConfigFieldBaseType {\n constructor(min, max) {\n super();\n\n this.validators.push... | javascript | chosen |
[
{
"from": "system",
"value": "Move images preloading and background cycling start to the \"window.load\"\n\nAlso trigger initial \"window.hashchange\" event immediately.\n"
},
{
"from": "human",
"value": "$(function() {\n\n // menu initialization\n var $menu = $('#menu');\n var $menuEnt... | javascript | chosen |
[
{
"from": "system",
"value": "Add fancy commas to member and guild counts\n"
},
{
"from": "human",
"value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozil... | javascript | chosen |
[
{
"from": "system",
"value": "Use ES6 export syntax in App\n"
},
{
"from": "human",
"value": "import React from 'react';\nimport {Decorator as Cerebral} from 'cerebral-view-react';\nimport NewTodoForm from '../NewTodo';\nimport TodosList from '../List';\nimport TodosFooter from '../Footer';\nimp... | javascript | chosen |
[
{
"from": "system",
"value": ":hammer: Fix Travis CI build error\n"
},
{
"from": "human",
"value": "// Karma configuration\n// Generated on Wed Aug 30 2017 09:45:21 GMT+0800 (中国标准时间)\nconst karmaConfig = require('./karma.conf.common.js')\n\nmodule.exports = function(config) {\n config.set(\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Tidy up the book details caching\n"
},
{
"from": "human",
"value": "\"use strict\";\n\nvar redis = require(\"redis\"),\n client = redis.createClient(),\n _ = require(\"underscore\"),\n Fetcher = require(\"l2b-price-fetchers\");\n\n\nfunction getBoo... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.