Skip to content

Instantly share code, notes, and snippets.

@SimplyKyra
SimplyKyra / compress_my_images.sh
Created March 29, 2023 23:12
Takes all the images within a single directory and uses image magick to compress them and rename them. Skips some particular ones. You can learn more about it here: https://www.simplykyra.com/use-a-simple-bash-script-to-resize-your-images-quickly-and-easily/
#!/bin/bash
# Confirm the proper argument was given; otherwise a blank argument would send you to the home directory
if [ $# -ne 1 ]; then
echo "Please call this script with a single argument giving me the path of the directory you want to run this in. If it has spaces please put it in double quotes."
exit 1
elif [ ! -e "$1" ]; then
echo "Directory doesn't exist. Please pass in a valid directory you want the program to run in for the first argument."
exit 1
elif [ ! -d "$1" ]; then
#!/bin/bash
##### Variables Used #####
# How do you connect to your reMarkable? I created a shortcut so I connect with "ssh remarkable". Another way might be
# with "ssh root@IPaddress". Here I left off the "ssh" so it's just "remarkable". In the second case it would be "root@IPaddress"
declare sshReMarkable="remarkable"
# Name of the temporary tar ball that's created
declare archiveName="archivedTemplates.tgz"
@SimplyKyra
SimplyKyra / backupRemarkable.sh
Created March 28, 2023 23:36
**You need to replace the value on line 5.** This is a Bash script that creates a directory based on the current date run, and backs up all your reMarkable files into it. Read more about it here: https://www.simplykyra.com/simple-script-to-help-backup-your-remarkable/
#!/bin/bash
# For more information about connecting to your reMarkable check out: https://www.simplykyra.com/2021/02/03/learn-how-to-access-your-remarkable-through-the-command-line/
myConnect="YOUR IP ADDRESS"
myDate=`date +%Y-%m-%d`
echo "Using \"$myConnect\" I'm about to back up your reMarkable to the file \"$myDate\". If this doesn't work you may need to (1) enter your IP Address above, (2) use a public key so you don't need to enter your password or (3) turn on your reMarkable. "
mkdir $myDate
@SimplyKyra
SimplyKyra / createAppIcons.sh
Last active April 30, 2023 16:51
Bash script that takes in an image, confirms its square, and creates seven resized images matching what Apple needs for its app icons. Names each to reflect its new size. Blog post to come.
#!/bin/bash
# Run as: ./createAppIcons.sh filename
# Assumes you are running the script where you want it to execute.
# If you want a different size you just need to add a line, or edit one, at the bottom of the file.
if [ $# -ne 1 ]; then
echo "Please call this script with one argument - the image file you want to resize."
exit 1
fi
@SimplyKyra
SimplyKyra / CustomMultiSelectionExampleWithImages.swift
Created March 27, 2023 16:30
Custom SwiftUI multipicker that allows custom list with image and multiple selection. Learn more about it here: https://www.simplykyra.com/update-to-my-custom-picker-with-multi-selection-in-swiftui-now-with-images/
//
// ContentView.swift
// Shared
//
// Created by Kyra on 2/2/22.
//
import SwiftUI
struct myItem: Hashable, Identifiable {
@SimplyKyra
SimplyKyra / CustomMultiSelectionPicker.swift
Created March 27, 2023 16:29
Custom SwiftUI multipicker that allows text list with multiple selection. Learn more about it here: https://www.simplykyra.com/how-to-make-a-custom-picker-with-multi-selection-in-swiftui/
//
// ContentView.swift
// Shared
//
// Created by Kyra on 2/2/22.
//
import SwiftUI
struct ContentView: View {