conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Make browse happy slide up cleaner"
},
{
"from": "human",
"value": "// http://unheap.com\n\n$(function() {\n $('.browsehappy').on('click', function() {\n $(this).slideUp('fast');\n });\n});\n"
},
{
"from": "gpt",
"value": "// http://unheap.com\n\n$(... | javascript | chosen |
[
{
"from": "system",
"value": "Remove untested files from karma\n"
},
{
"from": "human",
"value": "// Karma configuration\n\nmodule.exports = function (config) {\n config.set({\n\n // base path that will be used to resolve all patterns (eg. files, exclude)\n basePath: './',\n\n // testi... | javascript | chosen |
[
{
"from": "system",
"value": "Update test: Add `ACME_API_BASE_URL` constant\n"
},
{
"from": "human",
"value": "var ACME = require( '..' )\nvar assert = require( 'assert' )\nvar nock = require( 'nock' )\n\nsuite( 'ACME', function() {\n\n var client = new ACME({\n baseUrl: 'https://api.example... | javascript | chosen |
[
{
"from": "system",
"value": "Add tests around requestToContext for get and post requests\n"
},
{
"from": "human",
"value": "var chai = require('chai');\nvar expect = chai.expect;\n// var sinon = require('sinon');\nvar requestToContext = require('../src/requestToContext');\n\ndescribe('requestTo... | javascript | chosen |
[
{
"from": "system",
"value": "Add option to select database by index.\n"
},
{
"from": "human",
"value": "/**\n * Module dependencies.\n */\nvar redis = require('redis');\n\n\nexports = module.exports = function(settings, logger) {\n\tvar config = settings.toObject();\n\tif (!config.host) { throw... | javascript | chosen |
[
{
"from": "system",
"value": "Append domItem to event data.\n"
},
{
"from": "human",
"value": "/**\n * Setup the user (DOM) event flow.\n *\n * @private\n * @param {object} The moule instnace.\n*/\nmodule.exports = function (instance, template, options, dom, data) {\n for (var event in templa... | javascript | chosen |
[
{
"from": "system",
"value": "Add a test for lineBreak command\n"
},
{
"from": "human",
"value": "var logit = require('./main');\n\nvar logger = logit({\n prefix: 'my app',\n date: true\n});\n\nlogger.info(\"Test 1\");\nlogger.debug(\"Test 2\");\nlogger.warn(\"Test 3\");\nlogger.error(\"Test 4... | javascript | chosen |
[
{
"from": "system",
"value": "Comment on custom transform registration"
},
{
"from": "human",
"value": "import { displayOrder, transforms } from 'transformime-react';\n\n/**\n * Thus begins our path for custom mimetypes and future extensions\n */\n\nimport PlotlyTransform from './plotly';\nimpor... | javascript | chosen |
[
{
"from": "system",
"value": "Allow environment variable NTERACT_DESKTOP_DISABLE_AUTO_UPDATE to disable auto-update.\n\nFixes #3517\n"
},
{
"from": "human",
"value": "/* @flow strict */\nimport { autoUpdater } from \"electron-updater\";\n\nexport function initAutoUpdater() {\n const log = requi... | javascript | chosen |
[
{
"from": "system",
"value": "Allow using subst variables in layer attributes\n"
},
{
"from": "human",
"value": "Ext.define('App.model.Query', {\n extend: 'Ext.data.Model',\n\n config: {\n fields: [\n {\n name: 'detail',\n mapping: 'propertie... | javascript | chosen |
[
{
"from": "system",
"value": "Fix new JS for old node\n"
},
{
"from": "human",
"value": "const {playwrightLauncher} = require('@web/test-runner-playwright');\n\nconst defaultBrowsers = [\n playwrightLauncher({product: 'chromium'}),\n playwrightLauncher({product: 'webkit'}),\n playwrightLaunch... | javascript | chosen |
[
{
"from": "system",
"value": "Rename \"init:settings\" event to \"init:__settings\".\n"
},
{
"from": "human",
"value": "// Register 'usergroups' special setting values fetcher.\n// Allows to use `values: usergroups` in setting definitions.\n\n\n'use strict';\n\n\nvar _ = require('lodash');\n\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Change spec test code away from true/false; provides ping, pong, and ping pong returns instead\n"
},
{
"from": "human",
"value": "var pingPong = function(i) {\n if ((i % 3 === 0) || (i % 5 === 0)) {\n return true;\n } else {\n return false;\n }\n};\n\n$(fun... | javascript | chosen |
[
{
"from": "system",
"value": "Allow karma to load plugins automatically\n"
},
{
"from": "human",
"value": "var webpack = require('webpack');\n// TODO: use BowerWebpackPlugin\n// var BowerWebpackPlugin = require('bower-webpack-plugin');\nvar webpackCommon = require('./webpack.common.config.js');\... | javascript | chosen |
[
{
"from": "system",
"value": "enhance(test): Drop pessimistic printing of logs that shouldn't be there\n\nThis test code is unnecessary in the common case and can be revived if the test\nfails.\n"
},
{
"from": "human",
"value": "import { Application } from 'spectron'\nimport electronPath from 'e... | javascript | chosen |
[
{
"from": "system",
"value": "Clear the city autocomplete when unselecting the country in countrycity widget\n"
},
{
"from": "human",
"value": "$(document).ready(function() {\n // autocomplete widget javascript initialization for bootstrap=countrycity\n $('.autocomplete_light_widget[data-b... | javascript | chosen |
[
{
"from": "system",
"value": "Delete state and add form.\n"
},
{
"from": "human",
"value": "import React, { Component } from 'react';\nimport TextField from 'material-ui/TextField';\nimport Card, { CardActions, CardContent } from 'material-ui/Card';\nimport Button from 'material-ui/Button';\n\ni... | javascript | chosen |
[
{
"from": "system",
"value": "Disable minimize for Catalog serialization\n"
},
{
"from": "human",
"value": "const mongoose = require('mongoose');\nconst { omit } = require('lodash');\n\nconst Catalog = mongoose.model('Catalog');\n\nfunction formatCatalog(catalog) {\n return omit(catalog.toObjec... | javascript | chosen |
[
{
"from": "system",
"value": "Append supports multiple content args.\n"
},
{
"from": "human",
"value": "/**\n * Insert content, specified by the parameter, to the end of each\n * element in the set of matched elements.\n */\nfunction append(el) {\n var l = this.length, clone = false;\n // wr... | javascript | chosen |
[
{
"from": "system",
"value": "Update entry point to use queue\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n'use strict';\n\n// Load base requirements\nconst program = require('commander'),\n dotenv = require('dotenv').config(),\n path = require('path');\n\n// Load our librar... | javascript | chosen |
[
{
"from": "system",
"value": "Use Grunt API to write file\n\nThis way it guarantees that all the intermediate directories are created."
},
{
"from": "human",
"value": "var doxdox = require('doxdox'),\n utils = require('doxdox/lib/utils'),\n fs = require('fs'),\n path = require('path'),\... | javascript | chosen |
[
{
"from": "system",
"value": "Set scrolling=\"no\" to make iframe responsive\n\nthe fiddle iframe is not responsive in iOS safari and Chrome. By setting `scrolling=\"no\"` makes it possible to fix this issue, by setting `width=1px; min-width=100%` in CSS. [See StackOverflow](http://stackoverflow.com/questio... | javascript | chosen |
[
{
"from": "system",
"value": "Remove useless check on `loaded`\n\n"
},
{
"from": "human",
"value": "import React from 'react'\nimport { sparqlConnect } from '../sparql/configure-sparql'\nimport { LOADED } from 'sparql-connect'\nimport ServiceList from './service-list'\n\nfunction ServicesByGSBPM... | javascript | chosen |
[
{
"from": "system",
"value": "Make findOne reactive for ride owners subscription.\n\nfix #9\n"
},
{
"from": "human",
"value": "Router.configure({\n layoutTemplate: 'layout'\n});\n\nRouter.route('/', {\n name: 'home',\n waitOn: function () {\n return Meteor.subscribe('verifiedUsersCount');\... | javascript | chosen |
[
{
"from": "system",
"value": "Create logs for each environment\n"
},
{
"from": "human",
"value": "'use strict';\n\nconst fs = require('fs');\n\nconst express = require('express');\nconst send = require('send');\nconst morgan = require('morgan');\nconst errorHandler = require('errorhandler');\nco... | javascript | chosen |
[
{
"from": "system",
"value": "Fix gulp live reload for less\n"
},
{
"from": "human",
"value": "var dest = './public/dist';\nvar src = './client';\nvar bowerComponents = './bower_components';\n\nmodule.exports = {\n adminAssets: {\n src: src + '/admin/**',\n dest: dest + '/admin/assets'\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Fix galley close on esc\n"
},
{
"from": "human",
"value": "\n(function () {\n\n \n var addImageGallery = function(post) {\n\n if(post.length && !post.hasClass('smi-img-gallery')) {\n console.log('POST: ', post);\n post.addClass('smi-img-gallery');\n\n... | javascript | chosen |
[
{
"from": "system",
"value": "Set color on all newly-added labels\n"
},
{
"from": "human",
"value": "chrome.extension.sendMessage({}, function(response) {\n\tvar readyStateCheckInterval = setInterval(function() {\n\t\tif (document.readyState === \"complete\") {\n\t\t\tclearInterval(readyStateChe... | javascript | chosen |
[
{
"from": "system",
"value": "Add tumblr->yahoo info for server"
},
{
"from": "human",
"value": "'use strict';\n\nvar hosts = {\n 'bbc.co.uk': 'bbc',\n 'm.bbc.co.uk': 'bbc',\n 'reddit.com': 'reddit',\n 'www.reddit.com': 'reddit',\n 'condenast.co.uk': 'condenast'\n};\n\nvar organisations = {... | javascript | chosen |
[
{
"from": "system",
"value": "Update base view w/convenience function for rendering subviews\n\nSee:\nhttp://ianstormtaylor.com/rendering-views-in-backbonejs-isnt-always-simp\nle/\n"
},
{
"from": "human",
"value": "import * as _ from 'underscore';\nimport * as Backbone from 'backbone';\n\nclass ... | javascript | chosen |
[
{
"from": "system",
"value": "Add all settings to populateStorage\n"
},
{
"from": "human",
"value": "'use strict'\n\n// Code thanks to MDN\nexport function storageAvailable (type) {\n try {\n let storage = window[type]\n let x = '__storage_test__'\n storage.setItem(x, x)\n storage.r... | javascript | chosen |
[
{
"from": "system",
"value": "Fix dev server redirection bug\n\nWhen running `npm run dev` and opening the browser, newer version\nof WDS would redirect to the proxied server instead of proxying. Changed\nproxy syntax to match `**` instead of `*`\n"
},
{
"from": "human",
"value": "import base fr... | javascript | chosen |
[
{
"from": "system",
"value": "Fix extremely stupid bug in idle display!\n"
},
{
"from": "human",
"value": "\nconst Marionette = require('backbone.marionette');\nconst moment = require('moment');\n\nmodule.exports = class IdleView extends Marionette.View {\n template = Templates['idle'];\n\n cl... | javascript | chosen |
[
{
"from": "system",
"value": "Connect to redis on route\n"
},
{
"from": "human",
"value": "var express = require('express');\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/', function(req, res) {\n res.render('index', { title: 'VoteAnon' });\n});\n\nrouter.route('/create'... | javascript | chosen |
[
{
"from": "system",
"value": "Allow event date to be overridden.\n"
},
{
"from": "human",
"value": "'use strict';\n\nlet fs = require('fs');\nlet moment = require('moment');\nlet parseDate = require('./parse-date');\n\nfunction maybeParse(value) {\n if(value[0] === '@') {\n return mome... | javascript | chosen |
[
{
"from": "system",
"value": "tests/page-not-found: Use Polly.js instead of Pretender\n"
},
{
"from": "human",
"value": "import { module, test } from 'qunit';\nimport { setupApplicationTest } from 'ember-qunit';\nimport { visit, currentURL } from '@ember/test-helpers';\n\nimport { setupPretender... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"Revert \"style(webpack_config/server): rewrite prod conf in functional style\"\"\n\nThis reverts commit e9de3d6da5e3cfc03b6d5e39fe92ede9c110d712.\n"
},
{
"from": "human",
"value": "import webpack from 'webpack'\nimport baseWebpackConfig from './webpack.base... | javascript | chosen |
[
{
"from": "system",
"value": "Add mockstream to mock hot collection\n"
},
{
"from": "human",
"value": "define([\n 'inherits',\n 'streamhub-hot-collections/streams/hot-collections',\n 'streamhub-hot-collections-tests/mocks/clients/mock-hot-collections-client'],\nfunction (inherits, HotCo... | javascript | chosen |
[
{
"from": "system",
"value": "Make debug log handle multiple arguments\n\nEx: console.log('delivery receipt', phone_number, timestamp)\n\n// FREEBIE\n"
},
{
"from": "human",
"value": "/*\n * vim: ts=4:sw=4:expandtab\n */\n(function () {\n 'use strict';\n var MAX_MESSAGES = 1000;\n var P... | javascript | chosen |
[
{
"from": "system",
"value": "Fix wrong handling of paste event that would result in streaming from a magnet if pasting into input for download for eg\n"
},
{
"from": "human",
"value": "export default {\n mounted () {\n document.addEventListener('paste', this.handlePaste)\n },\n\n beforeDe... | javascript | chosen |
[
{
"from": "system",
"value": "Add tangelo.ensurePlugin() function, to replace tangelo.getPlugin() (which is deprecated)\n"
},
{
"from": "human",
"value": "// Export a global module.\nwindow.tangelo = {};\n\n(function (tangelo) {\n \"use strict\";\n\n // Tangelo version number.\n tangelo... | javascript | chosen |
[
{
"from": "system",
"value": "Add error trap for tooltip handler.\n"
},
{
"from": "human",
"value": "import {offset} from './render-size';\n\nexport default function(view, prevHandler, el, constructor) {\n var handler = new constructor(view.loader(), view.tooltip())\n .scene(view.scenegraph(... | javascript | chosen |
[
{
"from": "system",
"value": "Declare TargetFileAlreadyExist in service index\n"
},
{
"from": "human",
"value": "const { FileService } = require('./file/file.service')\nconst { BadScriptPermission } = require('./file/bad-script-permission.error')\nconst { ScriptNotExist } = require('./file/scrip... | javascript | chosen |
[
{
"from": "system",
"value": "Adjust epoch estimation time for Homestead\n"
},
{
"from": "human",
"value": "HandlebarsIntl.registerWith(Handlebars);\n\n$(function() {\n\twindow.state = {};\n\tvar source = $(\"#stats-template\").html();\n\tvar template = Handlebars.compile(source);\n\trefreshStat... | javascript | chosen |
[
{
"from": "system",
"value": "Make weak map props non-enumerable preventing circular references when traversing props.\n"
},
{
"from": "human",
"value": "export default window.WeakMap || (function () {\n let index = 0;\n function Wm () {\n this.key = `____weak_map_${index++}`;\n }\n Wm.pr... | javascript | chosen |
[
{
"from": "system",
"value": "Tidy up indentation of UMD loader\n"
},
{
"from": "human",
"value": "(function (name, definition) {\n\n // AMD\n if (typeof define === 'function') {\n define(definition);\n }\n\n // Node.js\n else if (typeof module !== 'undefined' && module.exp... | javascript | chosen |
[
{
"from": "system",
"value": "Make test error more useful\n"
},
{
"from": "human",
"value": "var common = require('../common');\nvar connection = common.createConnection({password: 'INVALID PASSWORD'});\nvar assert = require('assert');\n\nvar err;\nconnection.connect(function(_err) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Use STM instead GLS as ecc_config.address_prefix\n"
},
{
"from": "human",
"value": "import { ecc_config, hash } from \"../ecc\"\n\necc_config.address_prefix = \"GLS\";\n\nlet chain_id = \"\"\nfor(let i = 0; i < 32; i++) chain_id += \"00\"\n\nmodule.exports = {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Update aplus test adapter to use when.promise\n"
},
{
"from": "human",
"value": "(function() {\n\t'use strict';\n\n\tif(typeof exports === 'object') {\n\n\t\tvar when = require('../when');\n\n\t\texports.fulfilled = when.resolve;\n\t\texports.rejected = when.reject;... | javascript | chosen |
[
{
"from": "system",
"value": "Add JSDoc documentation to string/startsWith\n"
},
{
"from": "human",
"value": "module.exports = function (str, query, position) {\n return str.substr(position, query.length) === query;\n};\n"
},
{
"from": "gpt",
"value": "/**\nDoes a string start with ... | javascript | chosen |
[
{
"from": "system",
"value": "Update to handle modal window submits.\n"
},
{
"from": "human",
"value": "/* ajax_windows.js. Support for modal popup windows in Umlaut items. */\njQuery(document).ready(function($) {\n var populate_modal = function(data, textStatus, jqXHR) {\n data = $(data);\... | javascript | chosen |
[
{
"from": "system",
"value": "Return object, not string from Cordova plugin calls\n"
},
{
"from": "human",
"value": "var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\nvar ReactNative = require('react-native');\n\nfunction CordovaPluginAdapter() {\n this.nativeInterface = ReactNat... | javascript | chosen |
[
{
"from": "system",
"value": "Increase waitforTimeout to 30 seconds\n"
},
{
"from": "human",
"value": "exports.config = {\n specs: [ './test/**/*.js' ],\n exclude: [ ],\n\n sync: true,\n logLevel: 'silent',\n coloredLogs: true,\n bail: 0,\n\n screenshotPath: 'screenshots',\n baseUrl: 'ht... | javascript | chosen |
[
{
"from": "system",
"value": "Use es5 for node.js code, to make phantom happy\n"
},
{
"from": "human",
"value": "(function() {\n /* globals define, Intercom */\n\n function generateModule(name, values) {\n define(name, [], function() {\n 'use strict';\n\n return values;\n });\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add random key to generated nodes to simple get same it or not\n"
},
{
"from": "human",
"value": "beforeEach(function() {\n\n function genViewHTML(id, view) {\n\n var html = '';\n var clazz = 'ns-view-' + id;\n if (view.async) {\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Handle errs when asserting server success\n"
},
{
"from": "human",
"value": "var request = require('request');\r\nvar localRoot = 'http://localhost:' + process.env.PORT || 3000;\r\nvar assert = require('assert');\r\n\r\nexports.get = function localGet(url, cb) {\r\n... | javascript | chosen |
[
{
"from": "system",
"value": "Add partial application plugin for babel.\n"
},
{
"from": "human",
"value": "const {join} = require(\"path\")\n\nmodule.exports = {\n plugins: [\n [\"module-resolver\", {\n cwd: __dirname,\n root: [\"src\"],\n alias: {\n \"package.json\": j... | javascript | chosen |
[
{
"from": "system",
"value": "Add encrypt key list item styles\n"
},
{
"from": "human",
"value": "'use strict';\n\nimport React, { Component } from 'react';\nimport ReactCSS from 'reactcss';\n\nclass EncryptKeyListItem extends Component {\n classes() {\n return {\n 'default': {\n\n ... | javascript | chosen |
[
{
"from": "system",
"value": "Update to use Universal Tracking\n"
},
{
"from": "human",
"value": "var _gaq = _gaq || [];\n_gaq.push(['_setAccount', '{ANALYTICS_CODE}']);\n_gaq.push(['_trackPageview']);\n\n(function() {\n\tvar ga = document.createElement('script');\n\tga.type = 'text/javascript';... | javascript | chosen |
[
{
"from": "system",
"value": "CSRA-547: Add JSON option to automatically parse to JSON from request\n"
},
{
"from": "human",
"value": "import debugModule from 'debug';\nimport Joi from 'joi';\nimport xhr from 'xhr';\n\nconst debug = debugModule('csra');\n\nconst schema = Joi.array().items(\n Jo... | javascript | chosen |
[
{
"from": "system",
"value": "Remove useless ACME tab from UI.\n\n"
},
{
"from": "human",
"value": "'use strict';\nvar angular = require('angular');\n\nvar traefikCoreProvider = 'traefik.core.provider';\nmodule.exports = traefikCoreProvider;\n\nangular\n .module(traefikCoreProvider, ['ngResourc... | javascript | chosen |
[
{
"from": "system",
"value": "Fix linting issue. Source formatting.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env node\n\n/*\n * Copyright 2013-2015, All Rights Reserved.\n *\n * Code licensed under the BSD License:\n * https://github.com/node-gh/gh/blob/master/LICENSE.md\n *\n * @author Edu... | javascript | chosen |
[
{
"from": "system",
"value": "Make sure some results were returned to avoid error.\n\nChange-Id: Ic788bd1be6711e8c9475909562514d66c6a26d4c\n"
},
{
"from": "human",
"value": "$( function() {\n\tif ( !mw.pageTriage ) {\n\t\tmw.pageTriage = {};\n\t}\n\tmw.pageTriage.viewUtil = {\n\t\t// fetch and c... | javascript | chosen |
[
{
"from": "system",
"value": "Fix refresh bug by ensuring the correct dropdown choice is selected\n"
},
{
"from": "human",
"value": "var AppRouter = Backbone.Router.extend({\n routes: {\n 'topics/:topicId': 'showResults',\n\n '*actions': 'defaultAction'\n },\n\n\n showResults: function(... | javascript | chosen |
[
{
"from": "system",
"value": "Add data for national avrages\n"
},
{
"from": "human",
"value": "$(function () {\n $('#spending-averages').highcharts({\n chart: {\n type: 'bar'\n },\n title: {\n text: 'Historic World Population by Region'\n },\n... | javascript | chosen |
[
{
"from": "system",
"value": "Rename anonymous to make the styling more like others\n"
},
{
"from": "human",
"value": "/**\n * Helper functions that are used in the other modules to reduce the number of times\n * that code for common tasks is rewritten\n *\n * (c) 2013, Greg Malysa <gmalysa@stan... | javascript | chosen |
[
{
"from": "system",
"value": "Set mangle to false in babel-preset-minify for polymer to fix static build\n"
},
{
"from": "human",
"value": "module.exports = {\n // Don't try to find .babelrc because we want to force this configuration.\n babelrc: false,\n presets: [\n [\n require.reso... | javascript | chosen |
[
{
"from": "system",
"value": "Indent and deindent selected block of text - gemo style\n"
},
{
"from": "human",
"value": "jQuery(function($) {\n\n /* tab insertion handling */\n $('#code').keydown(function(e) {\n if (e.keyCode == 9 && !e.ctrlKey && !e.altKey) {\n if (this.setSele... | javascript | chosen |
[
{
"from": "system",
"value": "Use hashmap's O(1) look up time to check if an element in second array exists in the hash (i.e. first array), iterating through entire second array\n"
},
{
"from": "human",
"value": "// Program that identifies common element(s) that exist within both two arrays\n\nf... | javascript | chosen |
[
{
"from": "system",
"value": "Use ES module of react-redux-firebase\n"
},
{
"from": "human",
"value": "module.exports = {\n resolve: {\n alias: {\n // Use non-compiled version of the following libraries\n 'reselect': 'reselect/src/index.js',\n\n // Use non-compiled version of ... | javascript | chosen |
[
{
"from": "system",
"value": "Update script for the beauty of it\n"
},
{
"from": "human",
"value": "\nrequirejs.config({\n\tpaths: {\n\t\t'jquery': './lib/components/jquery/dist/jquery.min'\n\t}\n});\n\nrequire( [ 'src/graph' ] , function( Graph ) {\n\n\tvar functions = [\n\nfunction( domGraph, ... | javascript | chosen |
[
{
"from": "system",
"value": "Load js on turbolink refresh\n"
},
{
"from": "human",
"value": "$(function(){\n $(\".tablesorter\").tablesorter();\n $(\"tr[data-link]\").click(function() {\n window.location = $(this).data(\"link\")\n });\n console.log('Scripts loaded.');\n});\n"
},
{
... | javascript | chosen |
[
{
"from": "system",
"value": "Add dateCreated to file version model\n"
},
{
"from": "human",
"value": "import DS from 'ember-data';\n\nimport OsfModel from './osf-model';\n\n/**\n * @module ember-osf\n * @submodule models\n */\n\n/**\n * Model for OSF APIv2 file versions. Primarily used in relat... | javascript | chosen |
[
{
"from": "system",
"value": "Update MetaMachine directive to add a metaImage tag and metaUrl tag (OG tags for Facebook). Directive now also sets page defaults. "
},
{
"from": "human",
"value": "angular\n .module('app')\n .factory('MetaMachine', function($rootScope) {\n var MetaMachine = {\... | javascript | chosen |
[
{
"from": "system",
"value": "Change default section to Home\n"
},
{
"from": "human",
"value": "// @flow\n\nimport type { SectionType } from \"../enums/Section.js\";\n\nimport { ReduceStore } from \"flux/utils\";\nimport UniversalDispatcher from \"./UniversalDispatcher.js\";\nimport { Record } f... | javascript | chosen |
[
{
"from": "system",
"value": "Fix for stalling acceptance tests.\n"
},
{
"from": "human",
"value": "// Based on \"Continous Redrawing of Objects\"\n// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/\n//\n// #pulse is updated every ~15-seconds\n//\nvar Clock... | javascript | chosen |
[
{
"from": "system",
"value": "Add ability to define more complex breakpoints.\n"
},
{
"from": "human",
"value": "import _ from 'lodash'\nimport postcss from 'postcss'\n\nfunction buildMediaQuery(breakpoint) {\n if (_.isString(breakpoint)) {\n breakpoint = {min: breakpoint}\n }\n return _(b... | javascript | chosen |
[
{
"from": "system",
"value": "Add pass timestamp rather than date object\n"
},
{
"from": "human",
"value": "/* eslint-disable import/prefer-default-export */\nimport React from 'react';\n\n/**\n * Hook to simplify the use of the native date picker component by unwrapping\n * the callback event a... | javascript | chosen |
[
{
"from": "system",
"value": "Reset response errors when a new tactic is created\n"
},
{
"from": "human",
"value": "import { createSelector } from 'reselect';\nimport { denormalize } from 'normalizr';\nimport mapValues from 'lodash/mapValues';\n\nimport teamSchema from './schema';\n\nconst selec... | javascript | chosen |
[
{
"from": "system",
"value": "Update comment to point to node library install"
},
{
"from": "human",
"value": "// Download the helper library from https://www.twilio.com/docs/python/install\n\n// Your Account Sid and Auth Token from twilio.com/console\nconst accountSid = 'ACXXXXXXXXXXXXXXXXXXXXX... | javascript | chosen |
[
{
"from": "system",
"value": "Drop header to avoid auth browser popup\n"
},
{
"from": "human",
"value": "var log4js = require('log4js');\nvar logger = log4js.getLogger();\nvar express = require('express');\nvar favicon = require('serve-favicon');\nvar bodyParser = require('body-parser');\nvar po... | javascript | chosen |
[
{
"from": "system",
"value": "Revert \"[WV][000000] Allow trailing comma\"\n"
},
{
"from": "human",
"value": "module.exports = {\n rules: {\n // require trailing comma in multilines\n 'comma-dangle': [2, 'always-multiline'],\n // require function expressions to have a name\n 'func-n... | javascript | chosen |
[
{
"from": "system",
"value": "Fix bug where icons are not sorted properly\n"
},
{
"from": "human",
"value": "function sortIconsBySize(icons) {\n return icons.sort((a, b) => {\n if (a.data.size < b.data.size) {\n return 1;\n } else {\n return -1;\n }\... | javascript | chosen |
[
{
"from": "system",
"value": "Load sane settings if there are none\n"
},
{
"from": "human",
"value": "browser.storage.local.get( [ 'bgcolor', 'textcolor', 'messages' ] ).then( function ( r ) {\n\tvar m = r.messages.split( '\\n' );\n\tm = m[ Math.floor( Math.random() * m.length ) ];\n\n\tdocumen... | javascript | chosen |
[
{
"from": "system",
"value": "[native] Use hook instead of connect functions and HOC in ListLoadingIndicator\n\nTest Plan: Flow\n\nReviewers: ashoat, palys-swm\n\nReviewed By: ashoat\n\nSubscribers: zrebcu411, Adrian\n\nDifferential Revision: https://phabricator.ashoat.com/D483\n"
},
{
"from": "huma... | javascript | chosen |
[
{
"from": "system",
"value": "Edit parent selection, update gamemanager to Senna's version\n"
},
{
"from": "human",
"value": "function Population(size) {\n\tvar agents = new Array(size);\n\tvar genomes = new Array(size);\n\tfor (i = 0; i < size; i++) {\n\t\tvar prob = Math.random();\n\t\tif (pro... | javascript | chosen |
[
{
"from": "system",
"value": "Remove useless events that don't exist\n"
},
{
"from": "human",
"value": "import Ember from 'ember';\nimport jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget';\n\nexport default Ember.TextField.extend(jquiWidget, {\n uiType: 'datepicker',\n uiOptions: [\"al... | javascript | chosen |
[
{
"from": "system",
"value": "Add dataContext to postsLimit route\n"
},
{
"from": "human",
"value": "Router.configure({\n layoutTemplate: 'layout',\n loadingTemplate: 'loading',\n notFoundTemplate: 'notFound',\n waitOn: function() {\n return Meteor.subscribe('notifications');\n }\n});\n\... | javascript | chosen |
[
{
"from": "system",
"value": "Add data for ranking route\n"
},
{
"from": "human",
"value": "var subscriptions = new SubsManager();\n\nRouter.configure({\n\tlayoutTemplate: 'layout',\n\tloadingTemplate: 'loading',\n\tnotFoundTemplate: 'notFound'\n});\n\nRouter.route('/', {\n\tname: 'home',\n\twai... | javascript | chosen |
[
{
"from": "system",
"value": "Update to new (unburned) webhook.site URL\n"
},
{
"from": "human",
"value": "/*\n * Copyright (c) 2014-2020 Bjoern Kimminich.\n * SPDX-License-Identifier: MIT\n */\n\nconst chai = require('chai')\nconst expect = chai.expect\n\ndescribe('webhook', () => {\n const we... | javascript | chosen |
[
{
"from": "system",
"value": "Verify if leafbird global variable has a Leafbird object instance.\n"
},
{
"from": "human",
"value": "/*\n Copyright 2015 Leafbird\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the Li... | javascript | chosen |
[
{
"from": "system",
"value": "test(Effects): Fix fade test with RAF\n\nBecause of wrong mock implementation\n"
},
{
"from": "human",
"value": "import * as effects from 'src/effects'\n/**\n * @jest-environment jsdom\n */\njest.useFakeTimers()\n\ndescribe('Effects', () => {\n let element\n befor... | javascript | chosen |
[
{
"from": "system",
"value": "Clean up parse-comments utilis file\n"
},
{
"from": "human",
"value": "/*!\n * parse-comments <https://github.com/jonschlinkert/parse-comments>\n *\n * Copyright (c) 2014-2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\n'use strict';\n\nvar utils = ... | javascript | chosen |
[
{
"from": "system",
"value": "Modify and add another question\n"
},
{
"from": "human",
"value": "var questions = [\n Q1 = {\n question: \"What do HTML means?\",\n answer: \"HyperText Markup Language\"\n },\n Q2 = {\n question: \"What do CSS means?\",\n answer: \"Cascading Style Sh... | javascript | chosen |
[
{
"from": "system",
"value": "Check that init is a function\n"
},
{
"from": "human",
"value": "var i = (function() {\n 'use strict';\n return {\n c: function(obj, args) {\n if (arguments.length > 0) {\n var newObj = Object.create(arguments[0]);\n if ('init' in newObj) {\n... | javascript | chosen |
[
{
"from": "system",
"value": "Remove duplicated device token for multiple users\n"
},
{
"from": "human",
"value": "\n\nmodule.exports = function(sequelize, DataTypes) {\n\n\tvar UserDevice = sequelize.define('UserDevice', {\n\t\t\ttype: {\n\t\t\t\ttype: DataTypes.ENUM('IOS', 'ANDROID'),\n\t\t\t\... | javascript | chosen |
[
{
"from": "system",
"value": "Use call() rather than apply() to improve performance.\n"
},
{
"from": "human",
"value": "var ArgumentError = require('./ArgumentError');\nvar topiarist = require('topiarist');\n\nfunction verifierMethod(verifier, methodName) {\n return function() {\n if(!this.s... | javascript | chosen |
[
{
"from": "system",
"value": "Test that ads appear in date order latest first\n"
},
{
"from": "human",
"value": "/* global describe, beforeEach, afterEach, it */\nconst knex_config = require('../../knexfile');\nconst knex = require('knex')(knex_config['test']);\n\nconst chai = require('chai');\n... | javascript | chosen |
[
{
"from": "system",
"value": "Use queryString.stringify instead of by-hand gluing\n\nFixes STCOM-112\n"
},
{
"from": "human",
"value": "import queryString from 'query-string';\n\nfunction transitionToParams(params) {\n const location = this.props.location;\n let query = location.query;\n if (... | javascript | chosen |
[
{
"from": "system",
"value": "Remove superfluous and redundant code\n"
},
{
"from": "human",
"value": "var pingPong = function(userNumber) {\n if ((userNumber % 3 === 0) || (userNumber % 5 === 0)) {\n return true;\n } else {\n return false;\n }\n}\n"
},
{
"from": "gpt",
"val... | javascript | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.