Skip to content

Instantly share code, notes, and snippets.

@mrtrkmn
Last active November 17, 2024 14:55
Show Gist options
  • Save mrtrkmn/b6f366c48af70a60cdb89d273ed84910 to your computer and use it in GitHub Desktop.
Save mrtrkmn/b6f366c48af70a60cdb89d273ed84910 to your computer and use it in GitHub Desktop.
Practical notes

Converting MD files to PDF

This is useful in particular for repositories which explains some concepts on bunch of markdown files, in order to decrease back, forth navigation. A single PDF file can be generated through following steps:

$ for file in $(find . -name "*.md" | sort); do     echo -e "\n\n# $(basename "$file" .md)\n\n" >> combined.md;     cat "$file" >> combined.md; done
$ pandoc combined.md -o Grokking_System_Design.pdf

Cleaning up past large files from Git History

(retrieved: https://stackoverflow.com/questions/2100907/how-can-i-remove-delete-a-large-file-from-the-commit-history-in-the-git-reposito )

Any files over 100 MB in size (that aren't in your latest commit) will be removed from your Git repository's history. You can then use git gc to clean away the dead data:

git reflog expire --expire=now --all && git gc --prune=now --aggressive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment