sindresorhus/refined-github

The issue has been closed
Add Code Folding #2195
axetroy posted onGitHub
Code folding - the ability to selectively hide and display sections of a code - is an invaluable feature in many text editors and IDEs. Now, developers can utilize that same style code-folding while poring over source code on the web in GitHub. Works for any type of indentation- spaces or tabs.
ref: https://github.com/noam3127/github-code-folding
This extension has not been maintained for a long time. If it can be integrated into refined-github, it is definitely great.