Created
September 20, 2012 05:49
-
-
Save lucifr/3754170 to your computer and use it in GitHub Desktop.
Revisions
-
lucifr revised this gist
Sep 20, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/bin/bash # # requirements: # - ImageMagick: http://www.imagemagick.org/script/binary-releases.php#macosx # - image_optim: https://github.com/toy/image_optim # - a scp supported host with ssh key paired -
lucifr revised this gist
Sep 20, 2012 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ #!/bin/bash # # requirements: # - ImageMagick: http://www.imagemagick.org/script/binary-releases.php#macosx # - image_optim: https://github.com/toy/image_optim # - a scp supported host with ssh key paired # setting up the enviroment export PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH -
lucifr revised this gist
Sep 20, 2012 . 1 changed file with 0 additions and 46 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,46 +0,0 @@ -
lucifr revised this gist
Sep 20, 2012 . 1 changed file with 46 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ #!/bin/bash # # requirements: # - ImageMagick: http://www.imagemagick.org/script/binary-releases.php#macosx # - image_optim: https://github.com/toy/image_optim # - a scp supported host with ssh key paired # setting up the enviroment export PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH # please change the following variable to your own: # folder: local dir for the image, default ~/Desktop/ # server: your scp server, e.g. 123.456.789.0 # username: your username for the server, e.g. root # dir: remote dir for the image, e.g. /public/www/uploads/ # url: url for the image, e.g. http://yourwebsite.com/uploads/ folder=/Users/$(whoami)/Desktop/ server=123.456.789.0 username=root dir=/public/www/uploads/ url=http://yourwebsite.com/uploads/ filename=`echo "{query}" | tr 'A-Z' 'a-z' | tr -s ' ' | tr ' ' '_'`_`date +%s`.png path=$folder$filename screencapture -i $path while [ ! -f $path ] do sleep 1 done width=`/usr/bin/osascript << EOT tell application "System Events" activate set theWidth to (display dialog "Enter the width" default answer "650") end tell set theWidth to the text returned of theWidth as integer return theWidth EOT` while [ -z "$width" ] do sleep 1 done convert $path -resize "`echo $width`x>" $path image_optim --no-pngout $path echo \![{query}]\($url$filename\) | pbcopy scp $path $username@$server:$dir echo $filename uploaded! -
lucifr renamed this gist
Sep 20, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
lucifr created this gist
Sep 20, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ #!/bin/bash # # requirements: # - ImageMagick: http://www.imagemagick.org/script/binary-releases.php#macosx # - image_optim: https://github.com/toy/image_optim # - a scp supported host with ssh key paired # setting up the enviroment export PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH # please change the following variable to your own: # folder: local dir for the image, default ~/Desktop/ # server: your scp server, e.g. 123.456.789.0 # username: your username for the server, e.g. root # dir: remote dir for the image, e.g. /public/www/uploads/ # url: url for the image, e.g. http://yourwebsite.com/uploads/ folder=/Users/$(whoami)/Desktop/ server=123.456.789.0 username=root dir=/public/www/uploads/ url=http://yourwebsite.com/uploads/ filename=`echo "{query}" | tr 'A-Z' 'a-z' | tr -s ' ' | tr ' ' '_'`_`date +%s`.png path=$folder$filename screencapture -i $path while [ ! -f $path ] do sleep 1 done width=`/usr/bin/osascript << EOT tell application "System Events" activate set theWidth to (display dialog "Enter the width" default answer "650") end tell set theWidth to the text returned of theWidth as integer return theWidth EOT` while [ -z "$width" ] do sleep 1 done convert $path -resize "`echo $width`x>" $path image_optim --no-pngout $path echo \![{query}]\($url$filename\) | pbcopy scp $path $username@$server:$dir echo $filename uploaded!