Skip to content

Instantly share code, notes, and snippets.

View cpeisert's full-sized avatar

Christopher Peisert cpeisert

View GitHub Profile
@cpeisert
cpeisert / fix_indent.sh
Created May 15, 2023 17:57
Format TypeScript files with Prettier from previous git commit
#!/bin/bash
#
# Get list of files from the most recent Git commit and run prettier to reformat using 2 spaces for tab width.
#
changed_files=$(git diff --name-only HEAD~1 HEAD)
for file in $changed_files
do
if [[ $file == *.ts ]]; then
# Change tab size to 2 spaces for TypeScript files
@cpeisert
cpeisert / searchjars
Created September 23, 2012 02:12
Bash script to search Jar files. Each archived file is searched for the specified string.
#!/bin/bash
#Suggested file name: searchjars
if [[ $1 = "-h" || $1 = "--help" ]]
then
echo "Usage: $0 [STRING] [DIRECTORY]..."
echo "Search DIRECTORY(s) for Jar files. For each Jar, search the archived"
echo "files for STRING."
echo ""
echo "Default directory path is the current directory. Multiple directory "
@cpeisert
cpeisert / build.xml
Created September 10, 2012 09:53
plovr Ant build file using ClassFileSet to include transitive deps of org.plovr package in jar file
<?xml version="1.0" encoding="UTF-8"?>
<project name="plovr" basedir="." default="build">
<property file="${basedir}/build.properties" />
<property file="${basedir}/default.build.properties" />
<property name="src.dir" value="${basedir}/src" />
<property name="test.dir" value="${basedir}/test" />
<property name="testdata.dir" value="${basedir}/testdata" />
<property name="www.dir" value="${basedir}/www" />