Skip to content

Instantly share code, notes, and snippets.

View dev0T's full-sized avatar
🥔
potato

T dev0T

🥔
potato
View GitHub Profile
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active February 21, 2025 12:35
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@pjobson
pjobson / setup_cypress_wsl2.md
Last active February 12, 2025 13:54
Setting Up Cypress on Ubuntu WSL2
@mmazzarolo
mmazzarolo / service-workers.md
Last active April 22, 2024 03:40
Service Workers Tips

Service Workers Tips

Reloading a service worker

Reloading a page won't update/remove the previous version of its service worker. To make sure you're using the latest version of your service worker, make sure to check the "Update on reload" toggle in the "Application" ⭢ "Service Workers" section of the Chrome DevTools.

Simulate a network condition

To simulate a network condition (e.g.: offline, 3g, etc...) in a service worker on Chrome, uncheck the "Update on reload" toggle.

@ab9rf
ab9rf / tradeassist.rb
Last active December 21, 2022 08:42
DFHack Ruby script to mark items for purchase in trade screen
def is_tree_seed? (item)
if (!item.instance_of? DFHack::ItemSeedsst)
return false
end
if (item.mat_type < 419 || item.mat_type > 618)
return false
end
mat = df.world.raws.plants.all[item.mat_index]