Skip to content

Instantly share code, notes, and snippets.

View pythongod's full-sized avatar
🌴
On vacation

pythongod

🌴
On vacation
View GitHub Profile
@jermainee
jermainee / emoji_favicon.html
Created August 2, 2023 19:33
Use an emoji as favicon in html websites
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='1em' font-size='100'>📝</text></svg>">
@tigt
tigt / git-branch-to-favicon.js
Created March 18, 2020 21:10
Creates an SVG string that can be used as a favicon across different Git branches. Actually getting this into the browser is sadly project-specific.
const { execSync } = require('child_process')
const { createHash } = require('crypto')
const invertColor = require('invert-color')
const branchName = execSync('git rev-parse --abbrev-ref HEAD')
const hash = createHash('sha256')
hash.update(branchName)
const color = '#' + hash.digest().toString('hex').substring(0, 6)
const invertedColor = invertColor(color, true)