Skip to content

Instantly share code, notes, and snippets.

View WoodyWoodsta's full-sized avatar
🏄‍♂️
🇿🇦🇬🇧

Sean Wood WoodyWoodsta

🏄‍♂️
🇿🇦🇬🇧
View GitHub Profile
@lawndoc
lawndoc / cloc-gh
Last active May 9, 2024 20:53
Count the total lines of code for a user or organization in GitHub (excludes forks)
#!/usr/bin/env bash
# Author: C.J. May @lawndoc
# Usage: cloc-gh <username>
# Prereqs: cloc gh
cloc_repo () {
gh repo clone "$1" temp-linecount-repo -- --depth 1 > /dev/null 2>&1 &&
cloc temp-linecount-repo | grep SUM | awk '{ print $5 }' >> line_count.txt &&
rm -rf temp-linecount-repo
@leonderijke
leonderijke / svgfixer.js
Last active May 26, 2023 11:22
Fixes references to inline SVG elements when the <base> tag is in use.
/**
* SVG Fixer
*
* Fixes references to inline SVG elements when the <base> tag is in use.
* Firefox won't display SVG icons referenced with
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page.
*
* More info:
* - http://stackoverflow.com/a/18265336/796152
* - http://www.w3.org/TR/SVG/linking.html