Skip to content

Instantly share code, notes, and snippets.

View hsynercn's full-sized avatar
🏠
Working from home

Huseyin Can Ercan hsynercn

🏠
Working from home
View GitHub Profile
@leegilmorecode
leegilmorecode / aws-block-stack.ts
Created December 31, 2021 13:49
Example of API Gateway caching on AWS using the CDK
// create the rest API for accessing our lambdas
const api: apigw.RestApi = new apigw.RestApi(this, "blogs-api", {
description: "blogs api gateway",
deploy: true,
deployOptions: {
// this enables caching on our api gateway, with a ttl of five minutes (unless overridden per method)
cachingEnabled: true,
cacheClusterEnabled: true,
cacheDataEncrypted: true,
stageName: "prod",
@HipHopHuman
HipHopHuman / incremental-game-loop.md
Last active November 4, 2024 21:00
How to make a game loop for your idle game

How do I make a game loop for my Idle Game?

Interval-Based Resource Generators

So, you want to build an idle/incremental game in JavaScript and you’ve read on the internet that setInterval is the way to go when it comes to handling resources that automatically generate over time.

You get started, you write down your setInterval function, you set it to trigger once every 1000 milliseconds, and every time it triggers, you add 1 to the player’s total resource count. Perfect. It works.

Uh-oh.