Skip to content

Instantly share code, notes, and snippets.

View AhiyaHiya's full-sized avatar

Jaime AhiyaHiya

View GitHub Profile
@AhiyaHiya
AhiyaHiya / organize_assets.sh
Created February 9, 2020 19:02
A script to organize photos and movies by date.
#!/usr/bin/env bash
# 2020-02-09
# Brief: A script to organize photos and movies by date.
# Execute this script in the folder with the images to organize.
# Organize images into a Pictures directory
find . -type f -iregex ".*\.[PNG|JPG|jpeg|NEF]*" -exec sh -c '
for file in "$@"; do
folder="$(stat -f '%Sm' -t '%Y/%m-%d' "$file")"
#!/usr/bin/env bash
# Brief:
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
on_script_exit(){
@AhiyaHiya
AhiyaHiya / setup_visual_studio_code.sh
Created November 19, 2019 04:40
Extensions to use for editing C++ projects in VSC
#!/usr/bin/env bash
set -o errexit
# Example of installing and uninstalling extension
# code --install-extension ms-vscode.cpptools
# code --uninstall-extension ms-vscode.cpptools
# C/C++
code --install-extension ms-vscode.cpptools
@AhiyaHiya
AhiyaHiya / shell_helpers_git.sh
Last active March 31, 2020 14:54
git functions to make life easier
#!/usr/bin/env bash
# 2019-2020 AhiyaHiya
# git functions to make life easier
# Edit shell helper
alias eshg="code $HOME/Development/Tools/Scripts/shell_helpers_git.sh"
#####################
# aliases first; if it requires a description, then it is just made into a function.
@AhiyaHiya
AhiyaHiya / git_difftool_prev_version.sh
Created October 1, 2019 18:16
Diff previous revision of file, against current version, with Git
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace
# The purpose of this script is to show the previous revision of a file, using git difftool
# Get the file in question.
@AhiyaHiya
AhiyaHiya / create_opencv_macos_make.sh
Created June 23, 2019 18:57
Creates makefile for OpenCV, macOS, using CMake at the command line. Also builds project using make with j option.
#!/usr/bin/env bash
# 2019-06-23
# Jaime O. Rios
# Script modeled after Homebrew Formula for OpenCV
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/opencv.rb
set -o errexit
set -o nounset
set -o pipefail
@AhiyaHiya
AhiyaHiya / setup_catch2.sh
Created June 5, 2019 18:16
Downloads the catch2 unit testing header file
#!/usr/bin/env bash
# 2019-06-5
# Jaime O. Rios
# Brief: Downloads the Catch2 unit testing header file
# Script is expected to be called from base of project path, like ./scripts/setup_catch2.sh
set -o errexit
set -o nounset
# set -o xtrace
@AhiyaHiya
AhiyaHiya / SendKeystrokeToFMP.cpp
Created June 1, 2019 17:11
Older code, showing how to send keystrokes to FileMaker Pro
CGPoint curpos;
CGEventRef evntRef;
ProcessSerialNumber procSerialNo;
ProcessInfoRec procInfoStruc;
OSStatus err;
procSerialNo.highLongOfPSN = 0;
procSerialNo.lowLongOfPSN = kNoProcess;
procInfoStruc.processInfoLength = sizeof(ProcessInfoRec);
@AhiyaHiya
AhiyaHiya / .swiftformat
Last active April 20, 2019 06:20
Config file for swiftformat
--allman true
--binarygrouping none
--closingparen balanced
--commas inline
--conflictmarkers reject
--decimalgrouping none
--empty void
--exponentcase lowercase
--exponentgrouping disabled
--fractiongrouping disabled
@AhiyaHiya
AhiyaHiya / .clang-format-objc
Last active April 12, 2019 02:32
Clang format file used for Obj-C
AccessModifierOffset: -2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false