Skip to content

Instantly share code, notes, and snippets.

@ziggahunhow
ziggahunhow / extractImgs.sh
Created May 11, 2019 14:15
Get Images from all pptx files in a directory
#!/bin/bash
#change ./test/* to your desired path
for file in ./test/*;
do
mv "$file" "${file%.pptx}.zip"
unzip "${file%.pptx}.zip"
cp -rf ppt/media "${file%.pptx}" &&
rm -rf _rels/ docProps ppt
rm "[Content_Types].xml"
@ziggahunhow
ziggahunhow / git_remove_origin.sh
Last active July 8, 2019 09:02
Remove old git remote branches
#!/bin/bash
# run with caution! Change the date on line 4
for k in $(git branch -r | sed /\*/d); do
if [ -z "$(git log -1 --since='2 month ago' -s $k)" ]; then
branch_name_with_no_origin=$(echo $k | sed -e "s/origin\///")
echo deleting branch: $branch_name_with_no_origin
git push origin --delete $branch_name_with_no_origin
fi
done
@ziggahunhow
ziggahunhow / docker-compose.yml
Created May 19, 2020 05:03
DefiMint Docker Compose
version: "3.7"
services:
web:
build: ./client
ports:
- "3100:3000"
server:
build:
context: ./backend
args:
@ziggahunhow
ziggahunhow / translations.sh
Last active October 21, 2022 06:04
The purpose of this script is to facilitate the drudging work of copying and pasting translation data in frontend applications
#! /bin/bash
# This script copies the first (json key) column and the user specified column
# of a csv file, appends it to an existing json file to create a new temp file.
# Caveat
# If you have the same key, jq will overwrite the value instead of appending it.
# Inputs:
# $1 = path of csv file to read from