mirror of
https://github.com/dwmkerr/hacker-laws.git
synced 2025-12-17 12:45:20 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1225053274 | ||
|
|
f65bb28e58 | ||
|
|
dcdcfdfc25 | ||
|
|
7cd48102cb | ||
|
|
46148724e2 | ||
|
|
2140429b95 |
14
.github/CHANGELOG.md
vendored
14
.github/CHANGELOG.md
vendored
@@ -1,5 +1,19 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
0
makefile → .github/makefile
vendored
0
makefile → .github/makefile
vendored
2
.github/release-please-manifest.json
vendored
2
.github/release-please-manifest.json
vendored
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
".": "0.2.0"
|
".": "0.3.0"
|
||||||
}
|
}
|
||||||
|
|||||||
32
.github/workflows/cicd.yaml
vendored
32
.github/workflows/cicd.yaml
vendored
@@ -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
|
||||||
|
|||||||
46
.github/workflows/pages.yaml
vendored
46
.github/workflows/pages.yaml
vendored
@@ -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
|
|
||||||
69
.github/workflows/release-on-tag.yaml
vendored
69
.github/workflows/release-on-tag.yaml
vendored
@@ -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
|
|
||||||
29
README.md
29
README.md
@@ -1,10 +1,3 @@
|
|||||||
---
|
|
||||||
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>
|
||||||
|
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -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."
|
||||||
|
|||||||
Reference in New Issue
Block a user