text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_prefix|>// repo: seanmay/voluntold path: /src/lib/redux-helpers.js export const buildStrategy = (emptyState, options) => (state = emptyState, action, global) => { return ac<|fim_suffix|>]) => { newState[node] = reducer(state[node], action, state, node); return newState; }, {});<|fim_middle|>tio...
code_fim
hard
{ "lang": "javascript", "repo": "seanmay/voluntold", "path": "/src/lib/redux-helpers.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>]) => { newState[node] = reducer(state[node], action, state, node); return newState; }, {});<|fim_prefix|>// repo: seanmay/voluntold path: /src/lib/redux-helpers.js export const buildStrategy = (emptyState, options) => (state = emptyState, action, global) => { return action.type in opti...
code_fim
medium
{ "lang": "javascript", "repo": "seanmay/voluntold", "path": "/src/lib/redux-helpers.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: baiyalong/pub_web path: /server/interface/rest/www.js /** * Created by bai on 2015/8/21. */ //���ɻ��������ӿ� Api.addRoute('cityDetail/:id', { get: function () { return BLL.www.cityDetail(this.urlParams.id); } }) Api.addRoute('area', { get: function () { ...
code_fim
hard
{ "lang": "javascript", "repo": "baiyalong/pub_web", "path": "/server/interface/rest/www.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> Api.addRoute('downloadApp/:deviceType', { get: function () { return { url: Meteor.call('downloadApp', this.urlParams.deviceType) } } })<|fim_prefix|>// repo: baiyalong/pub_web path: /server/interface/rest/www.js /** * Created by bai on 2015/8/21. */ //���ɻ��������ӿ� Api....
code_fim
hard
{ "lang": "javascript", "repo": "baiyalong/pub_web", "path": "/server/interface/rest/www.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> app.delete('/api/users/:user_id', function (req, res) { User.remove({ _id: req.params.user_id }, function (err, user) { if (err) res.send(err); getUsers(res); }); }); app.delete('/api/wishes/:wish_id', fun...
code_fim
hard
{ "lang": "javascript", "repo": "BotaoZou/CloudComputation", "path": "/Cloud-Native-Workloads-on-LinuxONE/files/mean-docker/express-server/app/routes.js", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> getUsers(res); }); }); app.delete('/api/wishes/:wish_id', function (req, res) { Wish.remove({ _id: req.params.wish_id }, function (err, wish) { if (err) res.send(err); getWishes(res); }); ...
code_fim
hard
{ "lang": "javascript", "repo": "BotaoZou/CloudComputation", "path": "/Cloud-Native-Workloads-on-LinuxONE/files/mean-docker/express-server/app/routes.js", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> const ProductComment = (props) => { const itemsComment = props.dataComments.map(function(item, index){ return( <ProductCommentItem key={item.id} {...item} /> ); }); return( <Grid.Column width={12}> <Di...
code_fim
medium
{ "lang": "javascript", "repo": "niyogakiza/shop-online", "path": "/src/components/product/ProductComment.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>const ProductComment = (props) => { const itemsComment = props.dataComments.map(function(item, index){ return( <ProductCommentItem key={item.id} {...item} /> ); }); return( <Grid.Column width={12}> <Div...
code_fim
medium
{ "lang": "javascript", "repo": "niyogakiza/shop-online", "path": "/src/components/product/ProductComment.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: niyogakiza/shop-online path: /src/components/product/ProductComment.js import React from 'react'; import { Grid, Divider, Comment } from 'semantic-ui-react'; import ProductCommentItem from './ProductCommentItem'; import '../../util/mockComment'; <|fim_suffix|> const ProductComment = (props) =>...
code_fim
medium
{ "lang": "javascript", "repo": "niyogakiza/shop-online", "path": "/src/components/product/ProductComment.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: fononever/front-znjy path: /src/public/plugins/progressbar/index.js /* * @Author: tfq * @Date: 2018-07-25 11:04:16 * @Last Modified by: tfq * @Last Modified time: 2019-04-23 17:10:48 * @功能: * @简介: * @RAP: */ <|fim_suffix|>export default { install(vue) { VueProgressBar.install.call...
code_fim
medium
{ "lang": "javascript", "repo": "fononever/front-znjy", "path": "/src/public/plugins/progressbar/index.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>export default { install(vue) { VueProgressBar.install.call(null, vue, OPTIONS) }, }<|fim_prefix|>// repo: fononever/front-znjy path: /src/public/plugins/progressbar/index.js /* * @Author: tfq * @Date: 2018-07-25 11:04:16 * @Last Modified by: tfq * @Last Modified time: 2019-04-23 17:10:48 * ...
code_fim
medium
{ "lang": "javascript", "repo": "fononever/front-znjy", "path": "/src/public/plugins/progressbar/index.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>const OPTIONS = { color: '#66bb6a', failedColor: '#874b4b', thickness: '2px', } export default { install(vue) { VueProgressBar.install.call(null, vue, OPTIONS) }, }<|fim_prefix|>// repo: fononever/front-znjy path: /src/public/plugins/progressbar/index.js /* * @Author: tfq * @Date: 2018-0...
code_fim
easy
{ "lang": "javascript", "repo": "fononever/front-znjy", "path": "/src/public/plugins/progressbar/index.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>const generateClassName = createGenerateClassName(); const jss = create({ ...jssPreset(), insertionPoint: 'insertion-point-jss' }); const App = ({history}) => { return ( <JssProvider jss={ jss } generateClassName={ generateClassName }> <ConnectedRouter history={ history }> {routes...
code_fim
medium
{ "lang": "javascript", "repo": "mamokin/peerplays-monitor", "path": "/src/App.js", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> } else { alert("A new account was created. Click Log in and sign in for the first time!"); } } else { // TODO: on failure to create new user, show error alert("An acount already exists for this email address."); } } render() { return ( <div id="sign-...
code_fim
hard
{ "lang": "javascript", "repo": "mmagdy2020/blitz-studio-React", "path": "/src/components/user/signup/signup.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: mmagdy2020/blitz-studio-React path: /src/components/user/signup/signup.js import React from 'react'; import User from '../../../models/user'; import UserForm from '../userForm/userForm'; import { Link, withRouter } from 'react-router-dom' // has props: onUserLoggedIn(user) class SignUp exte...
code_fim
hard
{ "lang": "javascript", "repo": "mmagdy2020/blitz-studio-React", "path": "/src/components/user/signup/signup.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> async onClickSignUp(formUser) { // send post request to create user console.log("formUser:", formUser); let user = await User.AddNewUser(formUser); if (user) { // on successful creation, try to log in user // console.log("user was created.") const authUser = await User....
code_fim
medium
{ "lang": "javascript", "repo": "mmagdy2020/blitz-studio-React", "path": "/src/components/user/signup/signup.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>ksize)); } console.log(res1); // console.log(dataChunk); res.render('home', {title : 'Footballkik-home', data: dataChunk}); }) } } }<|fim_prefix|>// repo: arkajit817/footballkik path: /controllers/home.js module.exports...
code_fim
hard
{ "lang": "javascript", "repo": "arkajit817/footballkik", "path": "/controllers/home.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: arkajit817/footballkik path: /controllers/home.js module.exports = function(async,Club,_){ return { SetRouting : function(router){ router.get('/home',this.homePage); }, homePage : function(req,res){ async.parallel(<|fim_suffix|> const res1 ...
code_fim
hard
{ "lang": "javascript", "repo": "arkajit817/footballkik", "path": "/controllers/home.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: fawazbadranii/soundboard-react-native path: /app/screens/AudioList.js //import liraries rnfc SHORTCUT import React, { Component,useState } from 'react'; import { View, Text, StyleSheet,TouchableOpacity, SafeAreaView,TouchableHighlight,ImageBackground } from 'react-native'; import { Audio } from ...
code_fim
hard
{ "lang": "javascript", "repo": "fawazbadranii/soundboard-react-native", "path": "/app/screens/AudioList.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> <TouchableOpacity style = {styles.row} onPress={() => alert("Hey there!")}> <Text style = {styles.text}> Mehdi </Text> <Entypo name ="instagram" size={20} color='white' /> </TouchableOpacity> ...
code_fim
hard
{ "lang": "javascript", "repo": "fawazbadranii/soundboard-react-native", "path": "/app/screens/AudioList.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: hugolesta/torrent-stream path: /app.js var express = require('express') , http = require('http') var app = express(); app.listen(5050); app.configure(function() { app.use(express.static(__dirname + '/public')); app.use(express.logger('dev')); app.use(express.bodyParser()); }); <...
code_fim
medium
{ "lang": "javascript", "repo": "hugolesta/torrent-stream", "path": "/app.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> res.render('index'); }); http.createServer(app).listen(app.get('port'), function(){ console.log("Express server listening on port 5050"); });<|fim_prefix|>// repo: hugolesta/torrent-stream path: /app.js var express = require('express') , http = require('http') var app = express(); app.listen(50...
code_fim
medium
{ "lang": "javascript", "repo": "hugolesta/torrent-stream", "path": "/app.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>/** * Plander middleware */ exports.planderByID = function (req, res, next, id) { if (!mongoose.Types.ObjectId.isValid(id)) { return res.status(400).send({ message: 'Plander is invalid' }); } Plander.findById(id).populate('user', 'displayName').exec(function (err, plander) { if...
code_fim
hard
{ "lang": "javascript", "repo": "StevenLequient/FoxTrotters", "path": "/meanjs/modules/planders/server/controllers/planders.server.controller.js", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> var itl = 'http://' + req.headers.host + plander.image; //var itl = 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Leucanthemum_vulgare_qtl1.jpg/220px-Leucanthemum_vulgare_qtl1.jpg'; var host = 'http://identify.plantnet-project.org'; var pathAP = '/api/project/useful/identify?imgs...
code_fim
hard
{ "lang": "javascript", "repo": "StevenLequient/FoxTrotters", "path": "/meanjs/modules/planders/server/controllers/planders.server.controller.js", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|>// repo: geraluisch/football-app-project path: /src/App.js import React, { Suspense, lazy } from 'react'; import {BrowserRouter, Switch, Route } from 'react-router-dom'; import HomeContextProvider from './contexts/HomeContext'; import LeagueContextProvider from './contexts/LeagueContext'; import Fixtures...
code_fim
hard
{ "lang": "javascript", "repo": "geraluisch/football-app-project", "path": "/src/App.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>gueContextProvider> </Route> <Route path='/search/fixturex'> <FixturesProvider > <Fixtures /> </FixturesProvider> </Route> <Route path='/leagues/league/:id'> <LeagueContextProvider> <LeaguesInfo /> ...
code_fim
hard
{ "lang": "javascript", "repo": "geraluisch/football-app-project", "path": "/src/App.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return ( <Segment padded='very' style={{backgroundColor: '#528FBB'}}> <Form onSubmit={(e) => handleSubmit(e)}> <Form.Group> <Form.Select required search options inline ...
code_fim
hard
{ "lang": "javascript", "repo": "jwkuchta/mundoville-client", "path": "/src/components/NewExchangeForm.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> const handleRecipient = e => { let firstName = e.target.innerText.split(' ')[0] let lastName = e.target.innerText.split(' ')[1] let recipient = allUsers.find(u => u.first_name === firstName && u.last_name === lastName) if(recipient !== undefined) { setRecipi...
code_fim
hard
{ "lang": "javascript", "repo": "jwkuchta/mundoville-client", "path": "/src/components/NewExchangeForm.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: jwkuchta/mundoville-client path: /src/components/NewExchangeForm.js import React, { useState, useEffect } from 'react' import { Segment, Form, Button, Header } from 'semantic-ui-react' import { connect } from 'react-redux' import { placeholder } from '../photos/round_placeholder.png' // import {...
code_fim
hard
{ "lang": "javascript", "repo": "jwkuchta/mundoville-client", "path": "/src/components/NewExchangeForm.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: krystine-xie/Data-Structures-and-Algos path: /multiplePointers/3Sum.js function threeSum(nums) { let results = []; if (nums.length < 3) { return results; } // sort the array of integers from low to high nums.sort((a, b) => a - b); <|fim_suffix|> //...
code_fim
hard
{ "lang": "javascript", "repo": "krystine-xie/Data-Structures-and-Algos", "path": "/multiplePointers/3Sum.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> // if sum === 0 we push the triplets into the result array results.push([nums[i], nums[j], nums[k]]); // ensure there's no repeat numbers while (nums[j] === nums[j+1]) { j++; } ...
code_fim
hard
{ "lang": "javascript", "repo": "krystine-xie/Data-Structures-and-Algos", "path": "/multiplePointers/3Sum.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> {/* <a href={section}>Profile</a> */} </div> </li> ) })} </> ) } export default Test2;<|fim_prefix|>// repo: meraj687/Joke_api_greeting_wish path: /src/test2.js import React, { useEffect, useState } from 'react'; import { Button,Overlay,Tooltip,O...
code_fim
hard
{ "lang": "javascript", "repo": "meraj687/Joke_api_greeting_wish", "path": "/src/test2.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: meraj687/Joke_api_greeting_wish path: /src/test2.js import React, { useEffect, useState } from 'react'; import { Button,Overlay,Tooltip,OverlayTrigger } from 'react-bootstrap'; import 'bootstrap/dist/css/bootstrap.min.css'; const url = 'https://official-joke-api.appspot.com/jokes/random'; <|f...
code_fim
hard
{ "lang": "javascript", "repo": "meraj687/Joke_api_greeting_wish", "path": "/src/test2.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: SergeiKSS/React-mentoring-program path: /src/components/search/Search.jsx import React from 'react'; import './search.scss'; const Search = () => ( <div className="search"> <h2 className="search__title"> Find your movie </h2> <div className="search__panel"> <|fim_suffix|>...
code_fim
medium
{ "lang": "javascript", "repo": "SergeiKSS/React-mentoring-program", "path": "/src/components/search/Search.jsx", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> <input className="search__field" type="text" placeholder="What do you want to watch?" /> <button className="search__button" type="button">Search</button> </div> </div> ); export default Search;<|fim_prefix|>// repo: SergeiKSS/React-mentoring-program path: /src/components/search/Search.jsx...
code_fim
medium
{ "lang": "javascript", "repo": "SergeiKSS/React-mentoring-program", "path": "/src/components/search/Search.jsx", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>n className="search__button" type="button">Search</button> </div> </div> ); export default Search;<|fim_prefix|>// repo: SergeiKSS/React-mentoring-program path: /src/components/search/Search.jsx import React from 'react'; import './search.scss'; const Search = () => ( <div className="search"> ...
code_fim
hard
{ "lang": "javascript", "repo": "SergeiKSS/React-mentoring-program", "path": "/src/components/search/Search.jsx", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Carson21/Notes-App path: /main.js // main.js // Getting all of the elements needed const deleteIcon = document.querySelector("#delete") const newNote = document.querySelector("#new-note") const notesElement = document.querySelector("#notes") const noteArea = document.querySelector("#note") cons...
code_fim
hard
{ "lang": "javascript", "repo": "Carson21/Notes-App", "path": "/main.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>// Will get the notes that are saved in LocalStorage const getNotes = () => { let notes = JSON.parse(localStorage.getItem("notes")) if (notes === null) { localStorage.setItem("notes", JSON.stringify([])) return [] } else { return notes } } // Gets the count from LocalStorage used to c...
code_fim
hard
{ "lang": "javascript", "repo": "Carson21/Notes-App", "path": "/main.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>.NotificationCenter.ignore(cc.wwx.EventType.ACTION_BALL_DEMOLITION_BOMB,this.demolitionBomb,this); }, demolitionEndCallBack() { cc.wwx.NotificationCenter.trigger(cc.wwx.EventType.ACTION_BALL_DEMOLITION_BOMB_END); }, demolitionBomb() { cc.wwx.AudioManager.playItem1(...
code_fim
medium
{ "lang": "javascript", "repo": "usernameli/Childhood", "path": "/BBBall/assets/script/Animation/DemolitionBomb.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: usernameli/Childhood path: /BBBall/assets/script/Animation/DemolitionBomb.js cc.Class({ extends:cc.Component, properties:{ _anim:null, _tag:"DemolitionBomb" }, onLoad() { this._anim = this.getComponent(cc.Animation); <|fim_suffix|>.wwx.EventType.ACTIO...
code_fim
hard
{ "lang": "javascript", "repo": "usernameli/Childhood", "path": "/BBBall/assets/script/Animation/DemolitionBomb.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> db = client.db("fullerton_health"); }); }, getDB: function () { return db } }<|fim_prefix|>// repo: LEMINHMAN1/wellness-booking-server path: /src/utils/DBConnectUtils.js const mongodb = require('mongodb'); const winston = require('winston'); // Database connection...
code_fim
medium
{ "lang": "javascript", "repo": "LEMINHMAN1/wellness-booking-server", "path": "/src/utils/DBConnectUtils.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: LEMINHMAN1/wellness-booking-server path: /src/utils/DBConnectUtils.js const mongodb = require('mongodb'); const winston = require('winston'); // Database connection var db; module.expor<|fim_suffix|> db = client.db("fullerton_health"); }); }, getDB: function () { ...
code_fim
hard
{ "lang": "javascript", "repo": "LEMINHMAN1/wellness-booking-server", "path": "/src/utils/DBConnectUtils.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: guptswayam/ec2-management-system path: /backend/server.js const mongoose = require("mongoose"); require("dotenv").config({ path: `${__dirname}/config.env` }) <|fim_suffix|>mongoose.connect(DB,{ useNewUrlParser: true, useCreateIndex: true, useFindAndModify: ...
code_fim
medium
{ "lang": "javascript", "repo": "guptswayam/ec2-management-system", "path": "/backend/server.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> app.listen(PORT, ()=>{ console.log("server started at port "+ PORT); }) }) .catch(err=>console.log(err));<|fim_prefix|>// repo: guptswayam/ec2-management-system path: /backend/server.js const mongoose = require("mongoose"); require("dotenv").config({ path: `${__dirname}/config.env` })...
code_fim
hard
{ "lang": "javascript", "repo": "guptswayam/ec2-management-system", "path": "/backend/server.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>f":"RS","estado":"Rio Grande do Sul"});<|fim_prefix|>// repo: lfreneda/cepdb path: /api/v1/90035225.jsonp.js jsonp({"cep":"90035225","logradouro":"Largo Padre Marcelino Champagnat","bairr<|fim_middle|>o":"Bom Fim","cidade":"Porto Alegre","u
code_fim
easy
{ "lang": "javascript", "repo": "lfreneda/cepdb", "path": "/api/v1/90035225.jsonp.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: lfreneda/cepdb path: /api/v1/90035225.jsonp.js jsonp({"cep":"90035225","logradouro":"L<|fim_suffix|>o":"Bom Fim","cidade":"Porto Alegre","uf":"RS","estado":"Rio Grande do Sul"});<|fim_middle|>argo Padre Marcelino Champagnat","bairr
code_fim
easy
{ "lang": "javascript", "repo": "lfreneda/cepdb", "path": "/api/v1/90035225.jsonp.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: afiorenza/react-express path: /server.js const bodyParser = require('body-parser'); const express = require('express'); const fs = require('fs'); const path = require('path'); const app = express(); const http = require('http').Server(app); <|fim_suffix|>app.use(bodyParser.json()); app.use(bod...
code_fim
medium
{ "lang": "javascript", "repo": "afiorenza/react-express", "path": "/server.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(express.static(__dirname)); app.get('*', (req, res) => res.sendFile(path.join(__dirname, 'dist', 'index.html'))); http.listen(app.get('port'), '127.0.0.1', () => { console.log(`App running on port ${app.get('por...
code_fim
medium
{ "lang": "javascript", "repo": "afiorenza/react-express", "path": "/server.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: alfrid12/stories-ui path: /src/pages/StoryFinderPage.js import React from 'react'; import Table from 'react-bootstrap/Table'; // Local files import StoriesApiService from '../services/StoriesApiService'; <|fim_suffix|> redirectToStorySummaryPage(story){ const redirectUrl = '/...
code_fim
hard
{ "lang": "javascript", "repo": "alfrid12/stories-ui", "path": "/src/pages/StoryFinderPage.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return ( <Table striped bordered hover> <thead> <tr> <th>Name</th> <th>Title</th> <th>Status</th> <th>Story Points</th> </tr> ...
code_fim
hard
{ "lang": "javascript", "repo": "alfrid12/stories-ui", "path": "/src/pages/StoryFinderPage.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>约猜到这上面应该刻着此前主人的名字。他拧动光剑的手柄,发出一声清脆的咔啪声,不过,光剑内并无光刃射出,连续旋动了几下依然毫无反应,看来因为经年日久光剑内部所储存的能量已经消耗殆尽,当然也不排除光剑本身损坏的缘故,胡小天将光剑收好,又检查了一遍敬德皇的遗体。<br \/>  敬德皇应该不是光剑的主人,如果他生前拥有这样厉害的武器,一定会拿着这柄光剑大杀四方,或许这柄光剑从他得到就已经损坏了。<br \/>  胡小天又在棺椁内搜索了一会儿,确信再也没有其他特别的殉葬品,这才捧起敬德皇的脑袋,准备重新安放在尸体的脖子上,可是他又发现一件奇怪的事情,头颅断裂的地方竟然和颈部对不上,两道骨骼的裂痕相差甚多,他将自己...
code_fim
hard
{ "lang": "javascript", "repo": "biqugeniubi/resource", "path": "/books/1766/895059.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: biqugeniubi/resource path: /books/1766/895059.js renderContent({"book":{"id":1766,"name":"医统江山","keywords":"医统江山,医统江山最新章节","description":"医统江山最新章节由网友提供,《医统江山》情节跌宕起伏、扣人心弦,是一本情节与文笔俱佳的玄幻小说,爱看小说免费提供医统江山最新清爽干净的文字章节在线阅读。","author":"石章鱼","brief":"前世过劳而死的医生转世大康第一奸臣之家,附身在聋哑十六年的白痴少年身上,究竟是他的幸运还是不幸,上辈子太累,这辈...
code_fim
hard
{ "lang": "javascript", "repo": "biqugeniubi/resource", "path": "/books/1766/895059.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>r \/>  胡小天心中暗忖,这敬德皇和蒋太后背后的皮肤上一定藏有秘密,不然因何会在他们死后被人扒皮?扒走他们皮肤的人或许是同一个。<br \/>  宗唐叹息道:“我本以为还可以从蒋太后的身上找到秘密,却想不到有人已经捷足先登了。”<br \/>  胡小天的目光投向敬德皇的棺椁,因为刚才看到的一幕,他对敬德皇的棺椁也产生了强烈的好奇心。更何况前来大雍皇陵地宫的机会这辈子可能只有这一次,既然来了就索性看个究竟,亲眼见证一下这敬德皇究竟变成了什么样子。<br \/>  宗唐看到胡小天走向敬德皇的棺椁,忍不住提醒他道:“只是一具被扒皮的尸体罢了。”他虽然认为再开棺验尸并无必要,可是也没有阻止胡小天的好奇心。<b...
code_fim
hard
{ "lang": "javascript", "repo": "biqugeniubi/resource", "path": "/books/1766/895059.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: buiduclong0511/tiktokk path: /src/containers/PostDetail/PostDetail.js import { useState, useEffect, useRef } from 'react' import { useParams } from 'react-router-dom' import axios from 'axios' import PostDetailComponent from '~/components/PostDetail' import Post from '~/containers/entities/Post...
code_fim
hard
{ "lang": "javascript", "repo": "buiduclong0511/tiktokk", "path": "/src/containers/PostDetail/PostDetail.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return ( <PostDetailComponent post={post} onEnter={handleEnter} onVideoRef={handleVideoRef} onLeave={handleLeave} isLoading={isLoading} /> ) }<|fim_prefix|>// repo: buiduclong0511/tiktokk path: /src/containers/PostDetail...
code_fim
medium
{ "lang": "javascript", "repo": "buiduclong0511/tiktokk", "path": "/src/containers/PostDetail/PostDetail.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Alikosina/react-vk-example path: /src/containers/Auth.js import React from "react"; export default class Auth extends React.Component { constructor(props) { super(props); this.state = { loaded: false, token: "", clientId: 6683807 }; } componentDidMount() { ...
code_fim
hard
{ "lang": "javascript", "repo": "Alikosina/react-vk-example", "path": "/src/containers/Auth.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>vk.com/authorize?client_id=${clientId}&display=page&redirect_uri=http://localhost:8080&scope=friends,photos&response_type=token&v=5.52`} > Получить токен </a> </div> ); } else { return children; } } }<|fim_prefix|>// repo: Alikosina/react-vk-ex...
code_fim
hard
{ "lang": "javascript", "repo": "Alikosina/react-vk-example", "path": "/src/containers/Auth.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> const renderMovies = () => { if(!movies) { return ''; } if(!movies.length) { return <div data-testid="no-result">No Results Found</div> } return movies.map((movie, index) => <li key={movie.imdbID}>{movie.Title}</li>); }; const renderContent = () => { if(loading) ...
code_fim
hard
{ "lang": "javascript", "repo": "danielspatacean/react-test", "path": "/src/components/movie-list/index.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: danielspatacean/react-test path: /src/components/movie-list/index.js import React, {useState} from "react"; import fetch from 'node-fetch'; import "./index.css"; const moviesApi = `https://jsonmock.hackerrank.com/api/movies`; function MovieList() { <|fim_suffix|> const handleOnSearchClick = ...
code_fim
medium
{ "lang": "javascript", "repo": "danielspatacean/react-test", "path": "/src/components/movie-list/index.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> const renderContent = () => { if(loading) { return <div className='loader' /> } if(error) { return <div data-testid="error">Error getting the result: {error}</div>; } return ( <ul className="mt-50 styled" data-testid="movieList"> {renderMovies()} </ul> )...
code_fim
hard
{ "lang": "javascript", "repo": "danielspatacean/react-test", "path": "/src/components/movie-list/index.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Horvathzsanett95/GithubJobsEnterpriseProject path: /GithubJobsEnterpriseProject/GithubJobs-main/src/components/Home.js import React, { useState, useEffect } from 'react' import axios from 'axios'; import Job from './Job'; <|fim_suffix|> return console.log(jobs), jobs.map(job => <Job job={job...
code_fim
hard
{ "lang": "javascript", "repo": "Horvathzsanett95/GithubJobsEnterpriseProject", "path": "/GithubJobsEnterpriseProject/GithubJobs-main/src/components/Home.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return console.log(jobs), jobs.map(job => <Job job={job} />); }<|fim_prefix|>// repo: Horvathzsanett95/GithubJobsEnterpriseProject path: /GithubJobsEnterpriseProject/GithubJobs-main/src/components/Home.js import React, { useState, useEffect } from 'react' import axios from 'axios'; import Job from '....
code_fim
hard
{ "lang": "javascript", "repo": "Horvathzsanett95/GithubJobsEnterpriseProject", "path": "/GithubJobsEnterpriseProject/GithubJobs-main/src/components/Home.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>export default UserDashboardPage;<|fim_prefix|>// repo: Srikark-17/FitBud path: /frontend/src/pages/UserDashboardPage.js import React from "react"; import UserDashboard from "../components/UserDashboard"; <|fim_middle|>const UserDashboardPage = () => { return <UserDashboard />; };
code_fim
medium
{ "lang": "javascript", "repo": "Srikark-17/FitBud", "path": "/frontend/src/pages/UserDashboardPage.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Srikark-17/FitBud path: /frontend/src/pages/UserDashboardPage.js import React from "react"; import UserDashboard from "../components/UserDashboard"; <|fim_suffix|>export default UserDashboardPage;<|fim_middle|>const UserDashboardPage = () => { return <UserDashboard />; };
code_fim
medium
{ "lang": "javascript", "repo": "Srikark-17/FitBud", "path": "/frontend/src/pages/UserDashboardPage.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>gulp.task('sounds', () => { return gulp.src('./src/sounds/**/*') .pipe(gulp.dest('./dist/sounds')); }); gulp.task('sass', () => { return gulp.src("./src/sass/styles.sass") .pipe(plugins.sourcemaps.init()) .pipe(plugins.sass({ outputStyle: 'compressed', ...
code_fim
hard
{ "lang": "javascript", "repo": "jaysalvat/buzz-demo", "path": "/Gulpfile.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: jaysalvat/buzz-demo path: /Gulpfile.js var gulp = require('gulp'), plugins = require('gulp-load-plugins')(), del = require('del'); gulp.task('html', () => { return gulp.src('./src/**/*') .pipe(gulp.dest('./dist')); }); gulp.task('js', () => { return gulp.src('./s...
code_fim
hard
{ "lang": "javascript", "repo": "jaysalvat/buzz-demo", "path": "/Gulpfile.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> app.get('/about', (req, res) => { res.render('about.hbs', { pageTitle: 'About Page', currentYear: new Date().getFullYear() }); }); app.listen(port, () => { console.log('Server Running'); });<|fim_prefix|>// repo: Ajkamat/heroku path: /server4second.js const express = require('express');...
code_fim
hard
{ "lang": "javascript", "repo": "Ajkamat/heroku", "path": "/server4second.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Ajkamat/heroku path: /server4second.js const express = require('express'); const hbs = require('hbs'); const fs = require('fs'); var app = express(); var port = 3000; hbs.registerPartials(__dirname + '/views/partials'); app.set('view engine', 'hbs'); hbs.registerPartials(__dirname + '/views...
code_fim
hard
{ "lang": "javascript", "repo": "Ajkamat/heroku", "path": "/server4second.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: RustaLenin/Todo-List-on-web-components path: /themes/css.js export function regular() { return ` <style id="colorTheme"> :root { --body_background: #f1f1f1; --content_background: #ffffff; --important_background: #ff3838; ...
code_fim
hard
{ "lang": "javascript", "repo": "RustaLenin/Todo-List-on-web-components", "path": "/themes/css.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> --button_background_submit: rgba( 255, 152, 43, 1); --block_shadow: 0 0 20px rgba(0, 0, 0, 0.1); --icon_switch_theme: #ffffff; --divider_color: #EFEFEF; --border_accent_color: rgba( 255, 152, ...
code_fim
hard
{ "lang": "javascript", "repo": "RustaLenin/Todo-List-on-web-components", "path": "/themes/css.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: dilancirkin/react-native-car-app path: /baslangicProje/src/components/CarDetail.js import React from 'react'; import {View,Text, Image,Linking} from 'react-native'; import Item from './Item'; import ItemSection from './ItemSection'; import Button from './Button'; //Itemı view tagi yerine kullanı...
code_fim
hard
{ "lang": "javascript", "repo": "dilancirkin/react-native-car-app", "path": "/baslangicProje/src/components/CarDetail.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> <ItemSection> <Button buttonPress={()=>{ Linking.openURL(brand.model[0].url); }}/> </ItemSection> </Item> ); }; const styles={ headerContainer:{ flexDirection:'column', justifyContent: 'space-between' }, h...
code_fim
medium
{ "lang": "javascript", "repo": "dilancirkin/react-native-car-app", "path": "/baslangicProje/src/components/CarDetail.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Negis58/gps-task path: /routes/gpsRoute.js const express = require('express'); const router = express.Router(); const gpsController = require('../controllers/gpsController'); const {check} = require("express-validator"); // Маршруты конечных эндпоинтов <|fim_suffix|>// Маршрут для создания к...
code_fim
hard
{ "lang": "javascript", "repo": "Negis58/gps-task", "path": "/routes/gpsRoute.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>// Маршрут для получения списка координат пользователя router.get('/:user_id', [ check('user_id').isInt(), check('firstDate').optional().isString(), check('lastDate').optional().isString() ], gpsController.getGpsCord); // Маршрут для создания координат пользователя router.post('/', [ check(...
code_fim
medium
{ "lang": "javascript", "repo": "Negis58/gps-task", "path": "/routes/gpsRoute.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>t combineReducers({ messages, chats, routes, });<|fim_prefix|>// repo: mrniktarasov/2019-2-Atom-Frontend-N-Tarasov path: /src/reducers/index.js import { combineReducers } from 'redux'; import messages from './messages'; import chats from './cha<|fim_middle|>ts'; import routes from './routes'; export ...
code_fim
easy
{ "lang": "javascript", "repo": "mrniktarasov/2019-2-Atom-Frontend-N-Tarasov", "path": "/src/reducers/index.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: mrniktarasov/2019-2-Atom-Frontend-N-Tarasov path: /src/reducers/index.js import { combineReducers } from 'redux'; import me<|fim_suffix|>ts'; import routes from './routes'; export default combineReducers({ messages, chats, routes, });<|fim_middle|>ssages from './messages'; import chats from ...
code_fim
easy
{ "lang": "javascript", "repo": "mrniktarasov/2019-2-Atom-Frontend-N-Tarasov", "path": "/src/reducers/index.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>1f3b70406845e26ea010e9428", null ], [ "getObjectTextureCoords", "classSoPickedPoint.html#a577937388387bb3b7c615f818ad995c7", null ], [ "setObjectNormal", "classSoPickedPoint.html#a7f84dfc0ccea4f4e7681fa5e60a93515", null ], [ "setObjectTextureCoords", "classSoPickedPoint.html#a211ab4a4a2eba8119...
code_fim
hard
{ "lang": "javascript", "repo": "CoinInventor/doc", "path": "/classSoPickedPoint.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>tToWorld", "classSoPickedPoint.html#a0850692322b5ca23c2bd0a1e69d5bbb6", null ], [ "getWorldToObject", "classSoPickedPoint.html#ac3b539af9d3a7ef9046f63cdb23213b3", null ], [ "getObjectToImage", "classSoPickedPoint.html#a615d72ccc25a3b7684ffc2933b7703f6", null ], [ "getImageToObject", "classSoPi...
code_fim
hard
{ "lang": "javascript", "repo": "CoinInventor/doc", "path": "/classSoPickedPoint.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: CoinInventor/doc path: /classSoPickedPoint.js var classSoPickedPoint = [ [ "SoPickedPoint", "classSoPickedPoint.html#adae5a2b092425ca7138d4fb0a94d9918", null ], [ "SoPickedPoint", "classSoPickedPoint.html#a1becb15a2e466624d2d8a115a5d0eb72", null ], [ "~SoPickedPoint", "classSoPickedP...
code_fim
hard
{ "lang": "javascript", "repo": "CoinInventor/doc", "path": "/classSoPickedPoint.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>ext.drawImage(this.floor, 0, 450, 800, 50); } }<|fim_prefix|>// repo: Palistha17/palistha17.github.io path: /bubbletrouble/js/GameObjects/floor.js class Floor { constructor() { this.flo<|fim_middle|>or = new Image(); this.floor.src = "images/floor.jpg"; } draw(context) { ...
code_fim
medium
{ "lang": "javascript", "repo": "Palistha17/palistha17.github.io", "path": "/bubbletrouble/js/GameObjects/floor.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Palistha17/palistha17.github.io path: /bubbletrouble/js/GameObjects/floor.js class Floor { constructor() { this.flo<|fim_suffix|>floor.jpg"; } draw(context) { context.drawImage(this.floor, 0, 450, 800, 50); } }<|fim_middle|>or = new Image(); this.floor.sr...
code_fim
easy
{ "lang": "javascript", "repo": "Palistha17/palistha17.github.io", "path": "/bubbletrouble/js/GameObjects/floor.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: codeaholicguy/exchange-bot path: /src/services/poloniex.js import HttpStatusCodes from 'http-status-codes' import {request, HttpMethods} from './request' const POLONIEX_API_URL = 'https://poloniex.com/public' async function _query(command, params) { const {statusCode, body} = await request(...
code_fim
hard
{ "lang": "javascript", "repo": "codeaholicguy/exchange-bot", "path": "/src/services/poloniex.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>async function returnTradeHistory(currencyPair) {} async function buy(currencyPair, rate, amount) {} async function sell(currencyPair, rate, amount) {} async function cancel(currencyPair, orderNumber) {} export default { returnTicker, return24Volume, returnOrderBook, returnMarketTradeHistory, ...
code_fim
hard
{ "lang": "javascript", "repo": "codeaholicguy/exchange-bot", "path": "/src/services/poloniex.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>async function returnOpenOrders(currencyPair) {} async function returnTradeHistory(currencyPair) {} async function buy(currencyPair, rate, amount) {} async function sell(currencyPair, rate, amount) {} async function cancel(currencyPair, orderNumber) {} export default { returnTicker, return24Volum...
code_fim
hard
{ "lang": "javascript", "repo": "codeaholicguy/exchange-bot", "path": "/src/services/poloniex.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: anekix/GistSearchApp path: /src/services/gist.js import axios from 'axios'; /** * Takes a username & returns a promise for gists belo<|fim_suffix|>s(username){ return axios.get('https://api.github.com/users/'+username+'/gists') }<|fim_middle|>nging to the user * @param {String} username ...
code_fim
medium
{ "lang": "javascript", "repo": "anekix/GistSearchApp", "path": "/src/services/gist.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>Promise object whhich later evaluates to gist Data * */ export function getUserGists(username){ return axios.get('https://api.github.com/users/'+username+'/gists') }<|fim_prefix|>// repo: anekix/GistSearchApp path: /src/services/gist.js import axios from 'axios'; /** * Takes a username & returns ...
code_fim
medium
{ "lang": "javascript", "repo": "anekix/GistSearchApp", "path": "/src/services/gist.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: arunKumarRapolu/project-react-backend path: /products/products.controller.js const express = require('express'); const router = express.Router(); const productService = require('./products.service'); router.post('/addProduct', addProduct); router.get('/getProducts', getProducts); router.post('/...
code_fim
medium
{ "lang": "javascript", "repo": "arunKumarRapolu/project-react-backend", "path": "/products/products.controller.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>function getProducts(req, res, next) { req.body.status = 'Active'; productService.getProducts() .then((data) => res.json(data)) .catch(err => next(err)); } function getProductDetails(req, res, next) { productService.getProductDetails(req.body.id) .then((data) => res.js...
code_fim
hard
{ "lang": "javascript", "repo": "arunKumarRapolu/project-react-backend", "path": "/products/products.controller.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: DawidCwiek/quizTEMP path: /app/src/App.js import React from 'react'; import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom"; import ApolloClient from "apollo-boost"; import {ApolloProvider} from "react-apollo"; import NotFound from "./views/404" impor...
code_fim
medium
{ "lang": "javascript", "repo": "DawidCwiek/quizTEMP", "path": "/app/src/App.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return ( <ApolloProvider client={client}> <Router> <Switch> <Route exact path="/" component={QuizComponent}/> <Route exact path="/404" component={NotFound}/> <Redirect to="/404"/> </Switch> ...
code_fim
medium
{ "lang": "javascript", "repo": "DawidCwiek/quizTEMP", "path": "/app/src/App.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>y be used for showcasing Born Gosu merchandise!\n\"" + discordMsg.content + "\"") discordMsg.delete() } }<|fim_prefix|>// repo: AshenKyle/bg-ctl-helper path: /ashley/discord/roomHandlers/sellout.js module.exports = async ({ discordInterface, discordMsg }) => { if (discordMsg.attachments.size === ...
code_fim
hard
{ "lang": "javascript", "repo": "AshenKyle/bg-ctl-helper", "path": "/ashley/discord/roomHandlers/sellout.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: AshenKyle/bg-ctl-helper path: /ashley/discord/roomHandlers/sellout.js module.exports = async ({ discordInterface, discordMsg }) => { if (discordMsg.attachments.size === 0) { <|fim_suffix|>5000)) discordMsg.author.send("Your message in #s-e-l-l-o-u-t got deleted, because that channel sh...
code_fim
medium
{ "lang": "javascript", "repo": "AshenKyle/bg-ctl-helper", "path": "/ashley/discord/roomHandlers/sellout.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> function populate(data) { // we have a list of arrays of dicts // one for each item id // we convert them to options selected = false; store = $('select#storefront'); store.html(''); $.each(data, function(key, item) { if(item!== undefined){ option = $("<option value='"+item['id']...
code_fim
hard
{ "lang": "javascript", "repo": "derenrich/Limbo3", "path": "/public/javascript/auction.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: derenrich/Limbo3 path: /public/javascript/auction.js // list of stock ids we are buying var min_length = 0; var purchases = []; var last_query = ""; var last_selected = ""; var timeout; var KEY = { UP: 38, DOWN: 40, DEL: 46, TAB: 9, RETURN: 13, ESC: 27, COMMA: 188, PAGEUP: 33, PAGEDOWN...
code_fim
hard
{ "lang": "javascript", "repo": "derenrich/Limbo3", "path": "/public/javascript/auction.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>function screen(data) { screened_data = {}; // this basically runs the auction $.each(data, function(key, item) { in_stock = true; if (item['id'] in cart) { // we have to check if it is still in stock if (item['quantity'] - cart[item['id']] <= 0) { in_stock = false; } ...
code_fim
hard
{ "lang": "javascript", "repo": "derenrich/Limbo3", "path": "/public/javascript/auction.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: kitebear/Programming-a-diary path: /前端笔记/优化性能篇/throttle节流.js function throttle (func, wait) { let lastTime = 0 let timer = null <|fim_suffix|> const remainWaitTime = wait - (nowTime - lastTime) // 如果 if (remainWaitTime <= 0) { lastTime = nowTime ...
code_fim
hard
{ "lang": "javascript", "repo": "kitebear/Programming-a-diary", "path": "/前端笔记/优化性能篇/throttle节流.js", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> let self = this let args = arguments let nowTime = +new Date() const remainWaitTime = wait - (nowTime - lastTime) // 如果 if (remainWaitTime <= 0) { lastTime = nowTime func.apply(self, args) } else { // 如果在w...
code_fim
hard
{ "lang": "javascript", "repo": "kitebear/Programming-a-diary", "path": "/前端笔记/优化性能篇/throttle节流.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> const remainWaitTime = wait - (nowTime - lastTime) // 如果 if (remainWaitTime <= 0) { lastTime = nowTime func.apply(self, args) } else { // 如果在wait时间段内,再次触发了函数 timer = setTimeout(function () { lastTime = +new Dat...
code_fim
hard
{ "lang": "javascript", "repo": "kitebear/Programming-a-diary", "path": "/前端笔记/优化性能篇/throttle节流.js", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return [nw, nh]; } //stop required to prevent memory leak function animateCloud(image){ $(image).stop(true).animate({ top: newPos()[1], left: newPos()[0] }, 10000, function(){ animateCloud(image); }); } animateClo...
code_fim
hard
{ "lang": "javascript", "repo": "matt16749-zz/matt16749.github.io", "path": "/blog-posts/scripts/blog_template.js", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> config = getConfig(); console.log('address', address); config.instances[name] = address; configs.saveConfiguration(config); return address; } module.exports = { execute };<|fim_prefix|>// repo: ajlopez/rskclitools path: /lib/commands/setinstance.js const rskapi = ...
code_fim
hard
{ "lang": "javascript", "repo": "ajlopez/rskclitools", "path": "/lib/commands/setinstance.js", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }