A new mathematical equation appears on your GitHub profile every single day. Name, author, year, and purpose. Automatically. No manual work.
V. M. Falkner & Sylvia W. Skan - Falkner-Skan Equation (1931)
Note
An extension of the Blasius equation used to model the boundary layer flow over a wedge. Read more
The project has three layers:
equations.json database of all equations
main.py picks one at random, renders it, writes README.md
README.template.md static skeleton with a DAILY_EQUATION placeholder
Every day at midnight UTC, GitHub Actions runs main.py. The script loads equations.json, picks a random entry, formats it as a Markdown block, injects it into the template placeholder, and commits the result to README.md.
The rendered block looks like this:
$$
\large <latex>
$$
<Author> - **<Name>** (<Year>)
> [!NOTE]
> <Description> [Read more](<URL>)
Each entry in equations.json follows this structure:
{
"name": "Equation Name",
"author": "Mathematician Name",
"year": 1900,
"description": "What the equation means and where it is used.",
"latex": "\\LaTeX source code",
"url": "https://en.wikipedia.org/wiki/..."
}equation-of-the-day/
โโโ .github/
โ โโโ workflows/
โ โโโ update-equation.yml
โโโ equations.json
โโโ main.py
โโโ README.template.md
โโโ README.md
The GitHub Actions workflow triggers in two ways:
| Trigger | When |
|---|---|
| Scheduled | Every day at 00:00 UTC |
workflow_dispatch |
Manually from the Actions tab |
It checks out the repo, runs main.py, then commits and pushes README.md. The workflow requires permissions: contents: write to push without a personal token.
There are two ways depending on what you want.
If you want the full project (equation database, main.py, template):
- Fork this repository
- Go to
Settings > Actions > General > Workflow permissionsand enable Read and write - Trigger the workflow once manually from the Actions tab
- A new equation appears every day automatically
If you already have a profile README (or any other repo) and just want to inject a daily equation into it, without forking anything:
Step 1 - Add the following markers in your README.md where you want the equation to appear:
<!-- EQUATION_START -->
<!-- EQUATION_END -->The workflow injects the equation between these markers every day. The markers stay permanently so the equation updates without any rebuild.
Step 2 - Create .github/workflows/equation.yml in your repo with the following workflow:
name: "๐งฎ Equation of the Day"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
equation:
name: "๐งฎ Equation of the Day"
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: actions/checkout@v4
with:
repository: Thesirix/equation-of-the-day
path: _equation_src
- name: Inject daily equation
run: |
python3 << 'EOF'
import json, random, re
with open('_equation_src/equations.json', 'r', encoding='utf-8') as f:
equations = json.load(f)
eq = random.choice(equations)
d = '$'
block = (
d*2 + "\n"
+ "\\large " + eq['latex'] + "\n"
+ d*2 + "\n\n"
+ eq['author'] + " - **" + eq['name'] + "** (" + str(eq['year']) + ")\n"
+ "> [!NOTE]\n"
+ "> " + eq['description'] + " [Read more](" + eq['url'] + ")\n"
)
START = '<!-- EQUATION_START -->'
END = '<!-- EQUATION_END -->'
with open('README.md', 'r', encoding='utf-8') as f:
readme = f.read()
replacement = START + '\n' + block + END
updated = re.sub(
re.escape(START) + r'.*?' + re.escape(END),
lambda m: replacement,
readme,
flags=re.DOTALL,
)
with open('README.md', 'w', encoding='utf-8') as f:
f.write(updated)
EOF
- name: Commit & push
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add README.md
if git diff --cached --exit-code; then
echo "No changes."
else
git commit -m "๐งฎ Update equation of the day"
git pull --rebase origin main
git push origin main
fiStep 3 - Go to Settings > Actions > General > Workflow permissions in your repo and enable Read and write
Step 4 - Trigger the workflow once manually from the Actions tab
The workflow clones this repo as a data source, picks a random equation, and injects it into your README. No fork needed, no local Python required.
Open equations.json and append a new object to the array:
{
"name": "Your Equation Name",
"author": "Author Full Name",
"year": 2024,
"description": "A short explanation of what the equation does.",
"latex": "E = mc^2",
"url": "https://en.wikipedia.org/wiki/..."
}Use standard LaTeX math syntax. The formula is wrapped in \large and rendered inside a $$ display block, which GitHub renders natively.
- Python 3.x (no third-party packages)
- A GitHub repository with Actions enabled
MIT. Do whatever you want, a star is always appreciated โญ and feel free to add new equations!