Skip to content

Instantly share code, notes, and snippets.

View sameercharles's full-sized avatar

Sameer Charles sameercharles

  • Australia
View GitHub Profile
View nokia-snake-game.html
.game {
background-color: #f0f0f0;
border-radius: 10px;
padding: 10px;
max-width: 300px;
margin: auto;
#snake {
sameercharles / puppeteer-screenshot-api.txt
Last active May 24, 2022 08:52
API route to capture and send page screenshot with Puppeteer and Express JS
View puppeteer-screenshot-api.txt
const puppeteer = require('puppeteer')
app.get('/api/snapshot', async (req, res) => {
if (!req.query.url || !req.query.width || !req.query.height) {
res.status(400).send({message: 'Invalid input'})
// Create a snapshot and send it back
try {
const browser = await puppeteer.launch({ headless: true })
View markov-the-philosopher.html
<!doctype html>
<html lang="en" class="h-100">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<title>Markov chain philosopher</title>