Skip to content

Instantly share code, notes, and snippets.

@nachocab
nachocab / instructions.sh
Last active February 13, 2022 15:45
How to make git diff work perfectly with .docx files in Mac OS X (it even colors by word)
# download docx2txt by Sandeep Kumar
wget -O docx2txt.pl http://www.cs.indiana.edu/~kinzler/home/binp/docx2txt
# make a wrapper
echo '#!/bin/bash
docx2txt.pl $1 -' > docx2txt
chmod +x docx2txt
# make sure docx2txt.pl and docx2txt are your current PATH. Here's a guide
http://shapeshed.com/using_custom_shell_scripts_on_osx_or_linux/
@FredLoney
FredLoney / logging_helper.py
Last active January 30, 2025 01:00
Prints the current stack to a logger.
import inspect
import logging
HEADER_FMT = "Call stack at %s, line %d in function %s, frames %d to %d of %d:"
"""The log header message formatter."""
STACK_FMT = "%s, line %d in function %s."
"""The log stack message formatter."""
def log_stack(logger=None, limit=None, start=0):
@richardcornish
richardcornish / git.md
Last active August 11, 2023 08:44
Enough Git for your résumé in 100ish lines
@nieboe
nieboe / find_missing_docs.py
Created August 31, 2012 12:38
display list of missing files after updating DMSF
#!/usr/bin/env python
import os
from sys import exit
from getpass import getpass
try:
import pymysql
except ImportError:
sys.exit('FATAL: Python package "pymysql" is required - run "pip install pymysql"')
@dupuy
dupuy / README.rst
Last active June 4, 2025 14:19
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.