Skip to content

Instantly share code, notes, and snippets.

View umuthopeyildirim's full-sized avatar

Umut Hope YILDIRIM umuthopeyildirim

View GitHub Profile
@umuthopeyildirim
umuthopeyildirim / index.js
Created November 16, 2022 06:24
The Google Cloud function that can take screenshots of websites.
const puppeteer = require('puppeteer');
const { Storage } = require('@google-cloud/storage');
const GOOGLE_CLOUD_PROJECT_ID = "portfolio-umut-yildirim";
const BUCKET_NAME = "screenshot-jobs-portfolio-umut-yildirim";
exports.run = async (req, res) => {
res.setHeader("content-type", "application/json");
try {
@umuthopeyildirim
umuthopeyildirim / package.json
Created November 16, 2022 06:21
Google Cloud Functions + Puppeteer Screenshot API packages
{
"name": "screenshot-api",
"version": "0.0.1",
"dependencies": {
"puppeteer": "^1.8.0",
"@google-cloud/storage": "^6.7.0"
}
}
@umuthopeyildirim
umuthopeyildirim / netlify.toml
Last active September 23, 2022 21:32
Netlify build code for Obsidian Vault
[build]
command = "rm -rf __obsidian __site && mkdir __obsidian && mv * __obsidian || true && git clone https://github.com/umuthopeyildirim/hopes-mindmap-zola.git __site && __site/run.sh"
publish = "public"
[build.environment]
LANDING_BUTTON = "Explore"
LANDING_DESCRIPTION = "This garden is a collection of notes, ideas and explorations I am currently cultivating. It is a work in progress experiment to push myself to write and learn more."
LANDING_PAGE = "home"
LANDING_TITLE = "Welcome to my Digital Garden!"
PYTHON_VERSION = "3.8"
@umuthopeyildirim
umuthopeyildirim / snake.js
Last active June 6, 2020 15:45
Snake Game in any Website
/* global $*/
jQuery('body').append('<div id="board"></div><style>#board,body{overflow: hidden;z-index:99999999;background-color:#fff}#board{z-index:99999999;color:white; width:440px;height:440px;border:1px solid #000;}#highScore,#score,#timer{z-index:99999999;color:#fff}.apple,.snake{z-index:99999999;display:block;width:20px;height:20px;position:absolute;user-select:none}.snake{z-index:99999999;background-color:green;}#snake-head{z-index:99999999;background-color:#006400}.apple{z-index:99999999;background-color:red;}</style>');
// Set window sessionStorage to keep track of high scores (lowest time)
sessionStorage.setItem("highScore", 0);
// timer variables
var timer = $('#mega_menu_dd_31');
var timeStr;
var time;