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 August 4, 2025 03:02
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.

@dennisslimmers
dennisslimmers / ReactNativePaperMenuExample.js
Last active July 25, 2025 21:16
This is an example how to properly use the 'Menu' element from React Native Paper
import React, { useState } from 'react';
import Icon from 'react-native-vector-icons/FontAwesome5';
import {
View,
StyleSheet,
} from 'react-native';
import {
Title,
@NigelEarle
NigelEarle / Knex-Setup.md
Last active March 15, 2025 16:49
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 August 28, 2025 18:36
100+ different js counter apps...
100+ different js counter apps...
@plentz
plentz / nginx.conf
Last active September 13, 2025 14:08
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;