Skip to content

Instantly share code, notes, and snippets.

View firedynasty's full-sized avatar

StanT_ firedynasty

View GitHub Profile
@firedynasty
firedynasty / convert_images.bash
Last active March 12, 2022 22:40
convert multiple images, reduce transparency
convert 1.jpg -alpha set -background none -channel A -evaluate multiply 0.5 +channel 1.png
Using ImageMagick to do the convert, to make an image have 50% transparency (less ink during printing). https://imagemagick.org/index.php
----------------------------------------
for i in *.jpg; do echo $i; done
Looping through files
@firedynasty
firedynasty / writing_csv_tracking.bash
Last active April 27, 2022 00:05
using bash to keep track of your work / time
#create a csv file where you can track your files
#template file:
#>> cat task-tracking-template.csv
# ,3/00/22
# 8am,
# 9am,
# 10am,
@firedynasty
firedynasty / sendtodropbox.bash
Created April 23, 2022 16:02
how to use mac as a second screen
function sendtodropbox() {
if [[ $# -eq 0 ]]; then
variable_1=$(cat sendtodropbox.txt)
rclone purge $variable_1
rclone copy . $variable_1
else
fi
}
function u() {
if [[ $# -eq 0 ]]; then
hello_var=$(cat /Users/home/desktop/macbook_pro_scripts/count_open.txt)
#first create a text file in this directory
#write a number into the file
#then will read the number from this file as a variable
second=$hello_var
let second++
# every time u is pressed will increase the count
@firedynasty
firedynasty / clipboard_dropbox_text.bash
Created June 28, 2022 22:13
copy_dropbox_contents_to_clipboard
function clipboard() {
rclone copy dropbox:ok.txt /Users/home/desktop/test_folder/
# copy file to your desktop
tail -10 /Users/home/Desktop/test_folder/ok.txt
# read the file to make sure the contents have been updated that you are copying
cat /Users/home/Desktop/test_folder/ok.txt | pbcopy
# copy the contents
}
set text item delimiters to "."
tell application "Finder"
set all_files to every item of (choose file with prompt "Choose the Files you'd like to rename:" with multiple selections allowed) as list
--now we start looping through all selected files. 'index' is our counter that we initially set to 1 and then count up with every file.
--the 'index' number is of course required for the sequential renaming of our files!
set thefileList to {}
repeat with index from 1 to the count of all_files
--using our index, we select the appropriate file from our list
--this variables below are getting the name of files
set this_file to item index of all_files
@firedynasty
firedynasty / tracking_time_worked.bash
Created September 4, 2022 04:07
Tracking Time Worked with Bash
# use website copy and paste start and stop work in succession to get the calculated time
# at https://cdpn.io/pen/debug/xxjxyZa
function timelist() {
cat /Users/desktop/macbook_pro_scripts/echo_files/timelist.txt
echo '->deletetimelist'
echo '->opentimelist'
}
function deletetimelist() {
@firedynasty
firedynasty / convert_images_to_pdf.scpt
Last active January 1, 2023 05:30
batch convert individual images to individual pdf files (applescript)
tell application "Finder"
set all_files to every item of (choose file with prompt "Choose the Files you'd like to rename:" with multiple selections allowed) as list
end tell
set oldDelims to AppleScript's text item delimiters -- save their current state
set text item delimiters to "."
tell application "Finder"
set thefileList to {}
set new_name to "g"
--now we start looping through all selected files. 'index' is our counter that we initially set to 1 and then count up with every file.
@firedynasty
firedynasty / applescript_make_rtf.md
Last active January 28, 2023 00:13
applescript to make small app to make Textedit file in front Finder window

In this applescript, you can select an app in your Finder window which will create a new Textedit file into the folder that is open in your front Finder window. It will use Terminal to copy a Textedit file from a specific directory that you specify to your front Finder window. In this script, I have the Textedit file in a folder called dont_delete in my home folder.

When you run this script for the first time need to set up the Textedit file and need to change "username" to your home folder name. Save this script as an app in Script Editor and drag the app to a shortcut slot in the Finder window.

@firedynasty
firedynasty / file_mover_sorter.py
Created February 22, 2023 06:15
file mover with Python
import os
import shutil
import random
sourcepath = "/Users/name/screenshots"
destpath = "/Users/name/"
file_names = os.listdir(sourcepath)
file_dict = {