This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const worker = require('./worker') | |
const data = { | |
// ... | |
} | |
worker.enqueue('send-reports', data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const worker = require('./worker') | |
async function main() { | |
let count = 0 | |
const interval = setInterval(() => { | |
worker.enqueue('jobExample', { | |
message: `Hello from worker ${++count}!` | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendMessage(message){ | |
const mainEl = document.querySelector('#main') | |
const textareaEl = mainEl.querySelector('div[contenteditable="true"]') | |
if(!textareaEl) { | |
throw new Error('There is no opened conversation') | |
} | |
textareaEl.focus() | |
document.execCommand('insertText', false, message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shuffleArray(array) { | |
let currentIndex = array.length | |
let temporaryValue, randomIndex | |
while (currentIndex !== 0) { | |
randomIndex = Math.floor(Math.random() * currentIndex) | |
currentIndex-- | |
temporaryValue = array[currentIndex] | |
array[currentIndex] = array[randomIndex] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function findDocumentIndex({ _id, collection, conditions, sort }) => { | |
const data = await db.collection(collection).aggregate([{ | |
$match: conditions | |
}, { | |
$sort: sort | |
}, { | |
$group: { | |
_id: null, | |
positions: { | |
$push: "$_id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="accordion-group"> | |
<slot /> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'AccordionGroup', | |
props: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<nav aria-label="Page navigation" v-if="paginationTotal > 1"> | |
<ul :class="{ 'pagination': true, 'flex-wrap': true, 'justify-content-center': centered }"> | |
<li :class="{ 'page-item': true, 'disabled' : currentPage <= 1 }"> | |
<a class="page-link" href="#" @click.prevent="pageChanged(currentPage - 1)" aria-label="Previous"> | |
<span aria-hidden="true">«</span> | |
</a> | |
</li> | |
<template v-if="needLeftDots"> | |
<li v-for="n in 2" :key="n" :class="activePage(n)"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[account] | |
first_login_game = 0 | |
[settings] | |
open_music = 1 | |
voice_language = english | |
graphic_lvl_reported = 1 | |
match_type = 100004 | |
[basic_setting] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { parse } = require('rss-to-json') | |
async function fetchPosts() { | |
const rss = await parse('http://rss.uol.com.br/feed/economia.xml') | |
return rss.items | |
} | |
fetchPosts() | |
.then(posts => { |
NewerOlder