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
import React, { FC, useCallback, useEffect, useMemo, useState } from "react"; | |
type UserListProps = { | |
title: string; | |
}; | |
type User = { | |
firstName: string; | |
lastName: string; | |
}; |
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
import React from "react"; | |
class UserList extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
isVisible: true, | |
users: [], | |
}; | |
this.toggleVisibility = this.toggleVisibility.bind(this); |
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 puppeteer = require('puppeteer'); | |
const { Storage } = require('@google-cloud/storage'); | |
const storage = new Storage({ | |
projectId: 'your-gcp-project-id', | |
keyFilename: 'keyfile.json', | |
}); | |
const BUCKET_NAME = 'your-gcp-bucket-name'; | |
const BucketInstance = storage.bucket(BUCKET_NAME); |
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
{ | |
"name": "scrapingProject", | |
"version": "1.0.0", | |
"dependencies": { | |
"puppeteer": "^1.8.0" | |
}, | |
"scripts": { | |
"deploy": "gcloud functions deploy scrapingExample --trigger-http --runtime nodejs8 --memory 1024MB --region europe-west1", | |
"start": "functions start && functions deploy --source=. scrapingExample --trigger-http" | |
} |
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 puppeteer = require('puppeteer'); | |
const PUPPETEER_OPTIONS = { | |
headless: true, | |
args: [ | |
'--disable-gpu', | |
'--disable-dev-shm-usage', | |
'--disable-setuid-sandbox', | |
'--timeout=30000', | |
'--no-first-run', |