Skip to content

Instantly share code, notes, and snippets.

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

Chandu chandujr

🏠
Working from home
View GitHub Profile
@chandujr
chandujr / 2-column-separator.lua
Created September 12, 2026 07:43
A KOReader patch that draws a vertical separator line between the two columns in two-column mode.
-- patches/2-column-separator.lua
-- Draws a vertical separator line between the two columns in two-column mode.
--
-- INSTALL: place this file in "<koreader_dir>/patches/" folder and restart KOReader.
-- CONFIGURE: change SEP_WIDTH and SEP_COLOR below to your taste.
-- LICENSE: AGPL-3.0
-- ─────────────────────────────────────────────────────────────────────────────
local SEP_WIDTH = 2 -- line thickness in pixels (1, 2, 3 etc)
@chandujr
chandujr / 2-header-separator-line.lua
Created September 12, 2026 07:39
A KOReader patch that draws a horizontal separator line below the top header area, matching the length of the bottom status bar separator line.
--[[
Draws a horizontal separator line below the top header area,
matching the length of the bottom status bar separator line.
INSTALLATION:
Place this in your "koreader/patches/" folder and restart KOReader.
CONFIGURATION:
Set "header_height" below to match the height of your header.
Something like (your current top-margin value + 10) should work good.
@chandujr
chandujr / psxhash.py
Last active August 29, 2025 15:55
Calculate RetroAchievements hash for PlayStation games.
#!/usr/bin/env python3
"""
psxhash.py - Calculate RetroAchievements hash for PlayStation games.
Make it executable if needed:
chmod +x psxhash.py
Usage:
./psxhash.py game.cue
@chandujr
chandujr / pcecdhash.py
Created August 26, 2025 12:12
Calculate RetroAchievements hash for PC Engine CD / TurboGrafx-CD games.
#!/usr/bin/env python3
"""
pcecdhash.py - Calculate RetroAchievements hash for PC Engine CD / TurboGrafx-CD games.
Make it executable if needed:
chmod +x pcecdhash.py
Usage:
./pcecdhash.py game.cue
import java.nio.ByteBuffer;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Pixmap.Blending;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.utils.BufferUtils;
import com.badlogic.gdx.utils.GdxRuntimeException;
@chandujr
chandujr / RadialSprite.java
Created August 2, 2016 10:21
This class helps to create a circular progress indicator. This is an updated version of the code by forum user Xoppa. You can see the original code here: https://github.com/xoppa/world/blob/master/src/com/xoppa/android/misc/RadialSprite.java
/**
* An updated version of the code by forum user Xoppa.
* You can see the original code here: https://github.com/xoppa/world/blob/master/src/com/xoppa/android/misc/RadialSprite.java
**/
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;