Skip to content

Instantly share code, notes, and snippets.

View Kaleidosium's full-sized avatar

Dania Rifki Kaleidosium

View GitHub Profile
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active June 9, 2025 05:45
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.

@daisyUniverse
daisyUniverse / fx.md
Last active February 18, 2022 10:47
The FX Standard Outline

FX Standard

A basic outline of my proposal for the FX Standard

0. FX Sites fix embeds from one platform to one or more platforms

This can be seen with my other projects, fxdeviantart, and fxtwitter they try to, as simply as possible, fix or try to greatly improve the quality of embeds from one site (DeviantArt and Twitter) to Discord clients, along with any other platform I can extend that support to.

@mapehe
mapehe / immutability.md
Created December 6, 2021 11:12
Immutable data without a blockchain

Immutable data without a blockchain

A careful read of the Nakamoto paper reveals that the original purpose of the blockchain is extremely specialized: A completely decentralized consensus among unreliable actors. I'd like to highlight the often overlooked fact that this is exactly what the blockchain is suitable for. Any change in the conditions and you are probably doing extra work. Data immutability is a good example. Recently, especially in the mainstream media, data immutability has been presented as something that has been pioneered by blockchain technology, though it's easier to achieve similar

@raysan5
raysan5 / open_source_and_videogames.md
Last active June 3, 2025 04:25
Open Source and Videogames - Resources

open_source_and_videogames

Open Source and Videogames - Resources

This git include a list of programs, tools, engines and libraries free and open source intended to make videogames.

NOTE: This gist is a support material for the talk "Open Source and Videogames" given by me, Ramon Santamaria, on October 26th 2021 in Canòdrom, Barcelona. All the materials listed here were explained in detail in a +2 hours talk.

Contents

@rg089
rg089 / stopwords.txt
Created July 15, 2021 14:48
A List of English Stopwords
0o
0s
3a
3b
3d
6b
6o
a
a1
a2

Interrupts

This guide assumes you have a short project to test code on. ISSOtm's "Hello World!" tutorial should work fine as a base.

Interrupts are used to call a given function when certain conditions are met. On the Game Boy, these conditions are:

  • The beginning of the VBlank period
  • A Joypad input
  • A serial data transfer from the link cable
  • The tick of a configurable timer
  • A configurable LCD Status interrupt
@miglen
miglen / packagejson.py
Created February 10, 2021 11:55
Dirty check for non existing public npm dependencies
#!/bin/env python3
# https://www.bleepingcomputer.com/news/security/researcher-hacks-over-35-tech-firms-in-novel-supply-chain-attack/
# The following script finds all package.json files in the current dir and checks if there are referenced any
# dependencies that no public package is available for, making your application vulnerable to supply-chain attack.
# Simply run ./packagejson.py in your root repository direcotory.
import json
import requests
from pathlib import Path
import urllib.parse
@ityonemo
ityonemo / test.md
Last active June 30, 2025 08:53
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@gullyn
gullyn / flappy.html
Last active January 24, 2025 00:41
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
<body onload="d=m=document;n=Math.random;c=z.getContext`2d`;f=g=>c.fillStyle=g;r=(...y)=>c.fillRect(...y);L=_=>{clearInterval(m);v=i=X=m=s=0;h=71;P=[1,2,3].map(k=>({x:X+=150,y:n()*86}))};L();R=_=>{f`gold`;r(0,0,X,X);f`red`;for({x,y} of P){r(x,0,16,y);r(x,y+48,16,102-y)}r(0,h,8,8);c.fillText(s,0,8)};R();d.onclick=_=>{v=-5;m=m||setInterval('h=h*(h>0);h>=142&&L();h+=v+=0.5;for(p of P){p.x-=2;if(p.x<-31){p.x+=450;p.y=n(s++)*86}p.x<8&&(h<p.y||h>p.y+48)&&L()}R()',35)}"><canvas id=z>