Skip to content

Instantly share code, notes, and snippets.

View WillPapper's full-sized avatar

Will Papper WillPapper

View GitHub Profile
@WillPapper
WillPapper / concatenate-text-v2.py
Last active September 23, 2024 19:52
Concatenate Text V2 (Additional debug output, better file handling)
import os
import mimetypes
import datetime
def is_text_file(file_path):
# First, try using mimetypes
mime_type, _ = mimetypes.guess_type(file_path)
if mime_type and mime_type.startswith('text/'):
return True
@WillPapper
WillPapper / recursively-concatenate-all-text.py
Created May 7, 2024 16:42
Recursively concatenate all text
import os
import mimetypes
# Specify the folder path containing the text files
folder_path = "./path-goes-here"
# Specify the output file path
output_file = "concatenated_text.txt"
# Open the output file in write mode
@WillPapper
WillPapper / recursively-concatenate-markdown.py
Created May 7, 2024 16:34
Recursively Concatenate Markdown
import os
# Specify the folder path containing the Markdown files
folder_path = "./path-goes-here"
# Specify the output file path
output_file = "concatenated_markdown.md"
# Open the output file in write mode
with open(output_file, "w") as outfile:
@WillPapper
WillPapper / concatenate_markdown.py
Created April 12, 2024 16:39
Concatenate Markdown Files
import os
# Specify the folder path containing the Markdown files
folder_path = "./path-goes-here"
# Specify the output file path
output_file = "concatenated_markdown.md"
# Get a list of Markdown files in the specified folder
markdown_files = [file for file in os.listdir(folder_path) if file.endswith(".md")]
@WillPapper
WillPapper / gh-pages
Created May 1, 2014 13:54
GitHub Pages Update Script
# Useful for when you want to simultaneously store a website in master and GitHub pages
# Copy this into /usr/bin/ with sudo
# Uncomment the cd line if you want to be able to invoke this script on a specific directory from anywhere
# cd /home/user/github-repo
git checkout gh-pages
git rebase master
git push origin gh-pages
git checkout master
@WillPapper
WillPapper / keybase.md
Last active August 29, 2015 13:56
Proof for Keybase

Keybase proof

I hereby claim:

  • I am wpapper on github.
  • I am wp (https://keybase.io/wp) on keybase.
  • I have a public key whose fingerprint is 1F3D 6529 A56E FBAB 88A6 5D5C 3CB9 CC48 AE9B 33D7

To claim this, I am signing this object: