robsite

Screenshot Upload via Drag & Drop from Skitch to Dock with Copy to Clipboard with Platypus for macOS

Damit währen die SEO™ Keywords abgedeckt.

Ich mag Skitch, um Screenshots schnell mit coolen Pfeilen zu verzieren und mit einem Klick auf meinen Server hochzuladen.

Skitch unterstützt leider keinen Upload per SSH-Key.

Ein bash-Script, das Dateien auf den eigenen Server hochlädt und die URL in die Zwischenablage kopiert wäre zwar äußerst cool, hat aber kein Dock-Icon, auf das man das Bild ziehen könnte, ähnlich wie Skitch das ermöglicht.

Die Lösung: Platypus. Nimm ein bash-Script und bau dir daraus eine simple GUI-Anwendung, Dateien per Drag&Drop, lad sie hoch.

Kopieren Sie dieses Script:

#!/bin/bash

# Upload files via SCP, copy URL to clipboard
# For use with Platypus on macOS

# insert yours:
SERVER_HOST="111.222.333.444"
SERVER_PORT="22"
SERVER_USER="user"
SERVER_PATH="/bla/etc/example.com/screenshots/"
SERVER_URL="https://example.com/screenshots/"
SERVER_PERMISSIONS="644"

# thx to Orwellophile https://stackoverflow.com/a/10660730/1191375
rawurlencode() {
  local string="${1}"
  local strlen=${#string}
  local encoded=""
  local pos c o

  for (( pos=0 ; pos<strlen ; pos++ )); do
     c=${string:$pos:1}
     case "$c" in
        [-_.~a-zA-Z0-9] ) o="${c}" ;;
        * )               printf -v o '%%%02x' "'$c"
     esac
     encoded+="${o}"
  done
  echo "${encoded}"    # You can either set a return variable (FASTER) 
  REPLY="${encoded}"   #+or echo the result (EASIER)... or both... :p
}

if [ ! -e "$1" ]
    then
    echo "Drop a file on the icon to upload it."
    exit
fi

FILE_PATH="$1"
FILE_NAME=$(basename "$FILE_PATH")

# skitch hack. expand for your language
if [ "$FILE_NAME" == "Leer.png" ] || [ "$FILE_NAME" == "Empty.png" ] ; then
  FILE_NAME="screenshot.png"
fi
if [ "$FILE_NAME" == "Leer.jpg" ] || [ "$FILE_NAME" == "Empty.jpg" ] ; then
  FILE_NAME="screenshot.jpg"
fi

TIMESTAMP=$(date +"%s")
UPLOAD_FILENAME="${TIMESTAMP}-${FILE_NAME}"
ENCODED_UPLOAD_FILENAME=$(rawurlencode "$UPLOAD_FILENAME")

echo "Uploading ${FILE_NAME} to ${SERVER_HOST}"
scp -P $SERVER_PORT "$FILE_PATH" "$SERVER_USER@$SERVER_HOST:'${SERVER_PATH}${UPLOAD_FILENAME}'"

echo "Setting permissions to ${SERVER_PERMISSIONS}"
ssh -p $SERVER_PORT $SERVER_USER@$SERVER_HOST chmod "'${SERVER_PERMISSIONS} ${SERVER_PATH}${UPLOAD_FILENAME}'"

echo "Done"
echo " "
echo "${SERVER_URL}${ENCODED_UPLOAD_FILENAME}"
echo "${SERVER_URL}${ENCODED_UPLOAD_FILENAME}" | pbcopy

Einfügen Sie es in Platypus mit Accepts dropped files:

Skitch wurde wohl von Evernote gekauft.
Wer eine Alternativen kennt, mit ähnlich coolen Pfeilen, immer her damit.

· bash, cool, macOS, Platypus ·

sub.blue

Tom Beddard baut Fraktale und hat eine sehr schöne Website.

·

“I’ll fix it as it explodes”, he said

Nachdem Trumps Gesetzesvorschlag zur Krankenversicherung erstmal gescheitert ist:

Robert Costa, Washington Post:

President Trump called me on my cellphone Friday afternoon at 3:31 p.m.
“Hello, Bob,” Trump began. “So, we just pulled it.”
My question for the president: Are you really willing to wait to reengage on health care until the Democrats come and ask for your help?

“Sure,” Trump said. “I never said I was going to repeal and replace in the first 61 days” — contradicting his own statements and that of his own adviser, Kellyanne Conway, who told CNN in November that the then-president-elect was contemplating convening a special session on Inauguration Day to begin the process of repealing the Affordable Care Act.
As he waits for Democrats, I asked, what’s next on health care, if anything, policy-wise?

“Time will tell. Obamacare is in for some rough days. You understand that. It’s in for some rough, rough days,” Trump said.

“I’ll fix it as it explodes,” he said. “They’re going to come to ask for help. They’re going to have to. Here’s the good news: Health care is now totally the property of the Democrats.”
Does Trump regret starting his agenda this year with health care?

“No, I don’t,” he said. “But in a way I’m glad I got it out of the way.”
· :D, politik ·

Tonebox - System Error

· futuresynth, music, retro, vaporwave ·
Mastodon