Skip to content

Instantly share code, notes, and snippets.

@fly49
fly49 / rename_jpgs.sh
Created June 16, 2024 18:08
Rename JPG files by shooting timestamp
#!/bin/bash
for file in *.JPG; do
if [[ -f "$file" ]]; then
echo "Processing file: $file"
datetime=$(exiftool -s -s -s -"DateTimeOriginal" -d "%Y-%m-%d %H.%M.%S" "$file")
if [[ -n "$datetime" ]]; then
new_filename="${datetime}.JPG"
if [[ -f "$new_filename" ]]; then
i=1

Setup Elixir History:

  1. touch ~/.iex_history
  2. Set the ERL_AFLAGS env var: bash: echo "export ERL_AFLAGS='-kernel shell_history enabled'" >> ~/.bashrc zsh: echo "export ERL_AFLAGS='-kernel shell_history enabled'" >> ~/.zshrc fish: set -Ux ERL_AFLAGS '-kernel shell_history enabled'
  3. Add some history:
    $  iex                                                                                                                                                                 (/f/s/2/s/script_drop) 12:09:25
    Erlang/OTP 22 [erts-10.4.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
    
@fly49
fly49 / application_finder.rb
Created January 12, 2019 14:50
ApplicationFInder
class ApplicationFinder
def self.method_missing(name, *args, &block)
new(model.all).send(name, *args, &block)
end
def self.model(klass = nil)
if klass
@model = klass
else
@model