Skip to content

Instantly share code, notes, and snippets.

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

Simon Bullado simbld

🏠
Working from home
  • Châlons-en-Champagne
  • 00:01 (UTC +01:00)
View GitHub Profile
@simbld
simbld / 00-README-NEXT-SPA.md
Created December 2, 2023 01:12 — forked from gaearon/00-README-NEXT-SPA.md
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.

@simbld
simbld / java
Created April 23, 2024 03:40
Senpai
class Senpai {
public static void main(String[] args) {
System.out.println("Notice me Senpai");
}
}
// Notice me Senpai
package com.wildcodeschool;
public class Movies {
public static void main(String[] args) {
String[] movieTitles = {
"Indiana Jones and the Kingdom of the Crystal Skull", "Indiana Jones and the Last Crusade", "Indiana Jones et le Temple maudit"};
String[][] movieActors = {
{"Harrison Ford", "Karen Allen", "Paul Freeman"},
{"Harrison Ford", "Kate Capshaw", "Amrish Puri"},
import assert from 'assert';
class BankCustomer {
constructor(name, pin) {
this.name = name;
this.pin = pin;
}
getName() {
return this.name;
}