Skip to content

Instantly share code, notes, and snippets.

View npjg's full-sized avatar
🎯
Focusing

Nathanael Gentry npjg

🎯
Focusing
View GitHub Profile
@npjg
npjg / GetCellInTableRowByColumnName.bas
Created December 19, 2023 13:50
GetCellInTableRowByColumnName
' For a given Excel table row, returns the cell in that row corresponding to a given column name.
Function GetCellInTableRowByColumnName(ByRef tableRow As ListRow, columnName As String) As Range
' Since the parent of ListRow is a ListObject (the table that holds the row), we can just use
' the Parent attribute rather than also requiring the ListObject be passed into this method.
Dim columnIndex As Integer
On Error Resume Next
columnIndex = tableRow.Parent.ListColumns(columnName).Index
If Err <> 0 Then
Set GetCellInTableRowByColumnName = Nothing
Else
@npjg
npjg / GetTableColumnByName.bas
Created December 19, 2023 13:45
GetTableColumnByName
' For a given Excel table, returns the column with the given name.
Private Function GetTableColumnByName(ByRef table As ListObject, columnName As String) As ListColumn
Dim columnIndex As Integer
On Error Resume Next
columnIndex = table.ListColumns(columnName).index
If Err <> 0 Then
Set GetTableColumnByName = Nothing
Else
Set GetTableColumnByName = table.ListColumns(columnIndex)
End If
@npjg
npjg / wedding_invitation.tex
Created April 15, 2022 18:39
Our wedding invitation in LaTeX
\documentclass[12pt]{article}
%\usepackage[width=5truein,height=7truein,letter,center,frame]{crop}
\usepackage[paperheight=7in, paperwidth=5in, top=1.75cm, left=0cm, right=0cm, bottom=0cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage{calligra}
\usepackage{setspace}
@npjg
npjg / create_music_video.sh
Created April 15, 2022 18:35
Create a music video in the format I use for YouTube.
#!/bin/zsh
# https://video.stackexchange.com/questions/19867/how-to-fade-in-out-a-video-audio-clip-with-unknown-duration
# https://superuser.com/questions/1041816/combine-one-image-one-audio-file-to-make-one-video-using-ffmpeg
# https://superuser.com/questions/833232/create-video-with-5-images-with-fadein-out-effect-in-ffmpeg/834035#834035
# https://askubuntu.com/questions/1128754/how-do-i-add-a-1-second-fade-out-effect-to-the-end-of-a-video-with-ffmpeg
# $1: Input image file
# $2: Input video/audio file
# $3: Fade-in duration in seconds (audio and video fade)
@npjg
npjg / tapes.sh
Created August 26, 2021 22:13
Convert raw iMovie DV imports to MP4 while preserving folder structure
#!/bin/zsh
NATS_HD=$(pwd)
for folder in $1
do
output=~/tapes/$folder
mkdir -p $output
cd $folder/Media
for f in *.dv; do ffmpeg -i $f -vf yadif $output/$f.mp4 -loglevel panic -stats; done
cd $NATS_HD
done
@npjg
npjg / inodes.sh
Created August 26, 2021 04:06
Ensure there are no filename collisions when running ntfsundelete on a whole volume.
ROOT=/home/npgentry/inodes
while read p; do
outf=$ROOT/$p
mkdir -p $outf
sudo ntfsundelete --undelete /dev/sdc1 --inodes $p --destination $outf
done <inodes.txt
@npjg
npjg / latex-logo.tex
Created March 7, 2021 04:27
LaTeX Logo
\documentclass{standalone}
\usepackage{xcolor}
\begin{document}
%\color{white}
{\fontsize{500}{500}\selectfont \LaTeX{}}
\end{document}
@npjg
npjg / schedule.py
Created January 6, 2021 03:10
5 Day Reading Schedule
#!/usr/bin/python3
import argparse
import logging
from PyPDF2 import PdfFileReader
import tika
tika.initVM()
from tika import parser
@npjg
npjg / sample-concert.tex
Created December 4, 2020 03:01
A classical choir concert program, written in LaTeX
\documentclass[10pt]{article}
\usepackage[top=0.75in,bottom=1in,left=0.5in,right=0.5in,landscape]{geometry}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\usepackage{multicol}
\usepackage{xifthen}
@npjg
npjg / GSoC-2020-final-evaluation.md
Last active January 20, 2021 04:10
GSoC 2020 Final Evaluation
title author date
Google Summer of Code 2020 Final Evaluation
Nathanael Gentry
24 August 2020

Summary

My weekly progress on the Director engine is archived on my ScummVM blog. Here are eight highlights from my time at GSoC: