- Běžně používané HTML tagy, jejich attributy a jejich použití
- Běžně používané meta tagy
- Vědět proč a kam vkládat link a script tagy
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
https://www.instagram.com/web/search/topsearch/?context=blended&query=avengers |
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 Apify = require('apify'); | |
const { PuppeteerCrawler } = Apify; | |
const saveScreen = async (page, key = 'debug-screen') => { | |
const screenshotBuffer = await page.screenshot({ fullPage: true }); | |
await Apify.setValue(key, screenshotBuffer, { contentType: 'image/png' }); | |
}; | |
Apify.main(async () => { |
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
# Image is based on Node.js 8.X | |
FROM node:8-alpine | |
LABEL maintainer="[email protected]" Description="Image is used to run basic Apify acts" | |
# Remove yarn, it's not needed | |
RUN rm -rf /opt/yarn /usr/local/bin/yarn /usr/local/bin/yarnpkg | |
# Create app directory | |
RUN mkdir -p /usr/src/app |
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 { createTunnel, closeTunnel } = require('proxy-chain'); | |
// This is how connection strings usually look like | |
const serviceConnectionString = '<protocol>://<auth>@<service-hostname>:<service port>'; | |
// Create tunnel for the service, this call will start local tunnel and | |
// return string in format localhost:<selected-free-port> which is address | |
// of the local tunnel. | |
const tunnelInfo = await createTunnel( | |
'http://<username>:<password>@<proxy-server-hostname>:<proxy-server-port>', |
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
setup database | |
setup reporting with injected database | |
setup s3 client | |
setup sequential store with injected client and reporting | |
init routes | |
GET /sequential-stores | |
return all stores owned by the user from database | |
POST /sequential-stores | |
Create new store in database | |
return the store |
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
class Reporting { | |
# DI of database connection | |
constructor(db) {} | |
getStore(store) { | |
find document with id of store | |
return the document | |
} | |
afterPush(store) { |
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
SequentialStore = { | |
id: Unique ID, | |
owner: Owners ID, | |
itemsCount: Number, | |
persistedItemsCount: Number, | |
keys: Set, | |
fields: Set, | |
uploadedBytes: Number, | |
downloadedBytes: Number, | |
s3GetCount: Number, |
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
createKey(store, new count, count of added items) { | |
start = new count - count of added items + 1 | |
end = new count | |
return key in format '<store>/<padded start>-<padded end>' | |
} | |
class SequentialStore { | |
# DI of s3 client and reporting | |
constructor(s3, reporting){ | |
setup buffer, s3 client and reporting |
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
class Buffer { | |
push(store, record){ | |
in a single transaction | |
add record to buffer - RPUSH | |
if this is first write into this store then save timestamp - SETNX | |
extract keys from the object and add them to set - SADD | |
increment size of the data in buffer - INCRBY | |
get size, number of records, unique keys - GET, LLEN, SMEMBERS | |
get timestamp of frist write - GET | |
return size, count, keys and timestamp |
NewerOlder