Skip to content

Instantly share code, notes, and snippets.

View haykerman's full-sized avatar
🎯
Focusing

Hayk Baghdasaryan haykerman

🎯
Focusing
  • Tidepool Labs Europe
  • Yerevan, Armenia
View GitHub Profile
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active March 13, 2025 12:57
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.

@NigelEarle
NigelEarle / Knex-Setup.md
Last active February 16, 2025 19:06
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@kocisov
kocisov / next_nginx.md
Last active February 3, 2025 07:27
How to setup next.js app on nginx with letsencrypt
@srdjan
srdjan / 100+ different counter apps...
Last active May 6, 2024 05:13
100+ different js counter apps...
100+ different js counter apps...
@plentz
plentz / nginx.conf
Last active March 11, 2025 08:37
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@tbarbugli
tbarbugli / reset.sql
Created May 1, 2013 13:10
reset all sequences on a postgres db
SELECT 'SELECT SETVAL(' ||quote_literal(S.relname)|| ', MAX(' ||quote_ident(C.attname)|| ') ) FROM ' ||quote_ident(T.relname)|| ';'
FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C
WHERE S.relkind = 'S'
AND S.oid = D.objid
AND D.refobjid = T.oid
AND D.refobjid = C.attrelid
AND D.refobjsubid = C.attnum
ORDER BY S.relname;