This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get() { | |
if [[ $# -eq 0 ]]; then | |
echo "No file name provided." | |
echo "documents/forclipboard" | |
else | |
file_path="/Users/username/documents/forclipboard/${1}.txt" | |
if [ -f "$file_path" ]; then | |
cat "$file_path" | pbcopy | |
echo "File content copied to clipboard." | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function study() { | |
if [[ $# -eq 0 ]]; then | |
if [ -e study.txt ]; then | |
#If there are no arguments, the function checks whether a file named "study.txt" exists in the current directory. | |
#If it exists, it writes the current working directory to a file named "study_dir.txt" on the user's desktop | |
#and displays the contents of "study.txt" with line numbers. | |
echo $PWD > /Users/username/desktop/macbook_pro_scripts/echo_files/study_dir.txt | |
cat -n study.txt | |
else | |
hello_var=$(cat /Users/username/desktop/macbook_pro_scripts/echo_files/study_dir.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<title>SQL Inner Join</title> | |
</head> | |
<body> | |
<header class="header"> | |
<p></p><div class="select"> | |
<i class="material-icons">palette</i> | |
<select class="select__input" id="selTheme"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
import random | |
sourcepath = "/Users/name/screenshots" | |
destpath = "/Users/name/" | |
file_names = os.listdir(sourcepath) | |
file_dict = { |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
NewerOlder