9 Commits

Author SHA1 Message Date
Dave Kerr
be78a7bf41 Merge pull request #447 from dwmkerr/release-please--branches--main
chore(main): release 0.3.1
2025-03-31 16:25:58 +01:00
github-actions[bot]
a80670cb8b chore(main): release 0.3.1 2025-03-31 12:32:29 +00:00
Dave Kerr
6353fe4b8f fix: effective shell links 2025-03-31 13:31:50 +01:00
Dave Kerr
1225053274 Merge pull request #445 from dwmkerr/release-please--branches--main
chore(main): release 0.3.0
2025-03-31 09:40:38 +01:00
github-actions[bot]
f65bb28e58 chore(main): release 0.3.0 2025-03-31 08:40:21 +00:00
Dave Kerr
dcdcfdfc25 feat: add Koomey's Law
Adds Koomey's Law, including its definition, history, and relationship to Moore's Law and Dennard Scaling.
2025-03-31 09:39:34 +01:00
Dave Kerr
7cd48102cb Merge pull request #443 from dwmkerr/release-please--branches--main
chore(main): release 0.2.1
2025-03-31 08:30:31 +01:00
github-actions[bot]
46148724e2 chore(main): release 0.2.1 2025-03-31 07:28:31 +00:00
Dave Kerr
2140429b95 fix: remove frontmatter 2025-03-31 08:27:42 +01:00
8 changed files with 89 additions and 129 deletions

21
.github/CHANGELOG.md vendored
View File

@@ -1,5 +1,26 @@
# Changelog # Changelog
## [0.3.1](https://github.com/dwmkerr/hacker-laws/compare/v0.3.0...v0.3.1) (2025-03-31)
### Bug Fixes
* effective shell links ([6353fe4](https://github.com/dwmkerr/hacker-laws/commit/6353fe4b8f044456d66dac0af950e41989c56c5a))
## [0.3.0](https://github.com/dwmkerr/hacker-laws/compare/v0.2.1...v0.3.0) (2025-03-31)
### Features
* add Koomey's Law ([dcdcfdf](https://github.com/dwmkerr/hacker-laws/commit/dcdcfdfc25ee121b6bcb931a71e185fa7ffeedcd))
## [0.2.1](https://github.com/dwmkerr/hacker-laws/compare/v0.2.0...v0.2.1) (2025-03-31)
### Bug Fixes
* remove frontmatter ([2140429](https://github.com/dwmkerr/hacker-laws/commit/2140429b959a8284b452c3fa05e1c9fd03e5ebab))
## [0.2.0](https://github.com/dwmkerr/hacker-laws/compare/v0.1.0...v0.2.0) (2025-03-31) ## [0.2.0](https://github.com/dwmkerr/hacker-laws/compare/v0.1.0...v0.2.0) (2025-03-31)

View File

View File

@@ -1,3 +1,3 @@
{ {
".": "0.2.0" ".": "0.3.1"
} }

View File

@@ -6,9 +6,12 @@ on:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
# Permissions to check contents and open PR (release pleases) and update pages.
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
pages: write
id-token: write
jobs: jobs:
test-website-build: test-website-build:
@@ -58,13 +61,13 @@ jobs:
# Set the env vars we use (version set for clarity). # Set the env vars we use (version set for clarity).
export DATE=$(date +%F) export DATE=$(date +%F)
export VERSION="${VERSION}" export VERSION="${VERSION}"
make prepare-markdown make -f .github/makefile prepare-markdown
env: env:
VERSION: ${{ needs.release.outputs.tag }} VERSION: ${{ needs.release.outputs.tag }}
# Create the PDF files. # Create the PDF files.
- name: Create PDF - name: Create PDF
run: make create-pdf run: make -f .github/makefile create-pdf
# Publish the PDF and intermediate markdown as an artifact. # Publish the PDF and intermediate markdown as an artifact.
# - name: Publish PDF Artifact # - name: Publish PDF Artifact
@@ -78,3 +81,28 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
gh release upload "${{ needs.release.outputs.tag }}" --clobber hacker-laws.pdf hacker-laws.md gh release upload "${{ needs.release.outputs.tag }}" --clobber hacker-laws.pdf hacker-laws.md
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build Website
run: |
cd .github/website
make install
make build
cp -r build/. '../pages'
ls -al "../pages"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './.github/pages'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@@ -1,46 +0,0 @@
name: Deploy to Pages
on:
# Runs on pushes targeting the default branch (or runs manually).
push:
branches: [$default-branch]
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build Website
run: |
cd .github/website
make install
make build
cp -r build/. '../pages'
ls -al "../pages"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './.github/pages'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@@ -1,69 +0,0 @@
# This pipeline builds the PDF ebook on any tag starting with 'v'.
name: "Create Release"
on:
push:
tags:
- 'v*'
jobs:
prepare-pdf:
# Focal Fossa. Please don't use 'latest' tags, it's an anti-pattern.
runs-on: ubuntu-20.04
steps:
# Checkout the code.
- name: Checkout
uses: actions/checkout@v2
# Set a descriptive version. For PRs it'll be the short sha.
- name: Set Version
id: set_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
# Prepare the content files.
- name: Prepare Content
run: ./scripts/prepare-markdown-for-ebook.sh ${{ steps.set_version.outputs.VERSION }}
# Create a PDF from the prepared markdown.
- name: Prepare PDF
uses: docker://pandoc/latex:2.9
with:
args: "-V toc-title:\"Table Of Contents\" --toc --pdf-engine=pdflatex --standalone --output hacker-laws.pdf hacker-laws.md"
# Publish the PDF artifact.
- name: Publish PDF Artifacts
uses: actions/upload-artifact@master
with:
name: hacker-laws.pdf
path: hacker-laws.pdf
release:
needs: prepare-pdf
runs-on: ubuntu-20.04
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: hacker-laws.pdf
- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
Hacker Laws E-Book
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./hacker-laws.pdf
asset_name: hacker-laws.pdf
asset_content_type: application/pdf

View File

@@ -1,16 +1,9 @@
---
title: "Hacker Laws"
author: "Dave Kerr, github.com/dwmkerr/hacker-laws"
subtitle: "Laws, Theories, Principles, and Patterns that developers will find useful. ${VERSION}, ${DATE}."
version: ${VERSION}
---
<h1 align="center"><a href="https://hacker-laws.com" target="_blank">hacker-laws</a></h1> <h1 align="center"><a href="https://hacker-laws.com" target="_blank">hacker-laws</a></h1>
<h4 align="center">🧠 Laws, Theories, Principles and Patterns for developers and technologists.</h4> <h4 align="center">🧠 Laws, Theories, Principles and Patterns for developers and technologists.</h4>
--- ---
- 📖 My new book [Effective Shell](https://effective-shell) on [Amazon](https://amzn.to/4ho0F91) - 📖 My new book [Effective Shell (Online Version)](https://effective-shell.com) on [Amazon (Print/Kindle)](https://amzn.to/4ho0F91)
- 🌍 Try [hacker-laws.com](https://hacker-laws.com) - 🌍 Try [hacker-laws.com](https://hacker-laws.com)
- 🧠 Check out my new project [Terminal AI](https://github.com/dwmkerr/terminal-ai) - 🧠 Check out my new project [Terminal AI](https://github.com/dwmkerr/terminal-ai)
- ☕️ Like this project? Consider [buying me a coffee with a one-off donation](https://github.com/sponsors/dwmkerr?frequency=one-time) - ☕️ Like this project? Consider [buying me a coffee with a one-off donation](https://github.com/sponsors/dwmkerr?frequency=one-time)
@@ -46,6 +39,7 @@ version: ${VERSION}
- [Hyrum's Law (The Law of Implicit Interfaces)](#hyrums-law-the-law-of-implicit-interfaces) - [Hyrum's Law (The Law of Implicit Interfaces)](#hyrums-law-the-law-of-implicit-interfaces)
- [Input-Process-Output (IPO)](#input-process-output-ipo) - [Input-Process-Output (IPO)](#input-process-output-ipo)
- [Kernighan's Law](#kernighans-law) - [Kernighan's Law](#kernighans-law)
- [Koomey's Law](#koomeys-law)
- [Linus's Law](#linuss-law) - [Linus's Law](#linuss-law)
- [Metcalfe's Law](#metcalfes-law) - [Metcalfe's Law](#metcalfes-law)
- [Moore's Law](#moores-law) - [Moore's Law](#moores-law)
@@ -464,6 +458,23 @@ See also:
- [The Unix Philosophy](#the-unix-philosophy) - [The Unix Philosophy](#the-unix-philosophy)
- [Occam's Razor](#occams-razor) - [Occam's Razor](#occams-razor)
### Koomey's Law
[Koomey's Law on Wikipedia](https://en.wikipedia.org/wiki/Koomey%27s_law)
> ...at a fixed computing load, the amount of battery you need will fall by a factor of two every year and a half.
>
> (Jonathan Koomey)
In 2010 Professor Jonathan Koomey discovered that the trend in number of computations per joule of energy dissipated had been remarkably stable. This trend became known as Koomey's Law - that the amount of battery needed for a given computing load would half each 2.5 years.
Koomey performed a follow-up analysis in 2010 and found that this trend had slowed, similar to how [Moore's Law](#moores-law) had slowed. This seemed to be related to limitations around how small transistors can be made, as well as [Dennard Scaling](https://en.wikipedia.org/wiki/Dennard_scaling).
See also:
- [Moore's Law](#moores-law)
- [Dennard Scaling](https://en.wikipedia.org/wiki/Dennard_scaling)
### Linus's Law ### Linus's Law
[Linus's Law on Wikipedia](https://en.wikipedia.org/wiki/Linus%27s_law) [Linus's Law on Wikipedia](https://en.wikipedia.org/wiki/Linus%27s_law)
@@ -502,6 +513,10 @@ See also:
Often used to illustrate the sheer speed at which semiconductor and chip technology has improved, Moore's prediction has proven to be highly accurate over from the 1970s to the late 2000s. In more recent years, the trend has changed slightly, partly due to [physical limitations on the degree to which components can be miniaturised](https://en.wikipedia.org/wiki/Quantum_tunnelling). However, advancements in parallelisation, and potentially revolutionary changes in semiconductor technology and quantum computing may mean that Moore's Law could continue to hold true for decades to come. Often used to illustrate the sheer speed at which semiconductor and chip technology has improved, Moore's prediction has proven to be highly accurate over from the 1970s to the late 2000s. In more recent years, the trend has changed slightly, partly due to [physical limitations on the degree to which components can be miniaturised](https://en.wikipedia.org/wiki/Quantum_tunnelling). However, advancements in parallelisation, and potentially revolutionary changes in semiconductor technology and quantum computing may mean that Moore's Law could continue to hold true for decades to come.
See also:
- [Koomey's Law](#koomeys-law)
### Murphy's Law / Sod's Law ### Murphy's Law / Sod's Law
[Murphy's Law on Wikipedia](https://en.wikipedia.org/wiki/Murphy%27s_law) [Murphy's Law on Wikipedia](https://en.wikipedia.org/wiki/Murphy%27s_law)

View File

@@ -17,9 +17,20 @@ fi
export date="${DATE:-$(date +%F)}" export date="${DATE:-$(date +%F)}"
export version="${VERSION?error: VERSION must be set}" export version="${VERSION?error: VERSION must be set}"
# Update the input file to an intermedate. # Update the input file to an intermedate.
intermediate="${input}.temp" intermediate="${input}.temp"
DATE="${date}" VERSION="${version}" envsubst < "${input}" > "${intermediate}" cat <<EOF > "${intermediate}"
---
title: "Hacker Laws"
author: "Dave Kerr, github.com/dwmkerr/hacker-laws"
subtitle: "Laws, Theories, Principles, and Patterns that developers will find useful. ${VERSION}, ${DATE}."
version: ${VERSION}
---
EOF
cat "${input}" >> "${intermediate}"
DATE="${date}" VERSION="${version}" envsubst < "${intermediate}" > "${output}"
# Use a single `sed` command to clean up unwanted lines and emojis in one pass. # Use a single `sed` command to clean up unwanted lines and emojis in one pass.
sed -e '/💻📖.*/d' \ sed -e '/💻📖.*/d' \
@@ -27,7 +38,7 @@ sed -e '/💻📖.*/d' \
-e '/^\[Translations.*/d' \ -e '/^\[Translations.*/d' \
-e '/\*.*/d' \ -e '/\*.*/d' \
-e '/ \*.*/d' \ -e '/ \*.*/d' \
-e '/## Translations/,$d' "${intermediate}" > "${output}" -e '/## Translations/,$d' "${output}" > "${intermediate}"
rm "${intermediate}" mv "${intermediate}" "${output}"
echo "${output} prepared successfully." echo "${output} prepared successfully."