The Quick & Dirty:

  • 9+ years in the biz, 10 messing around
  • All the latest in HTML, CSS, JS & PHP (Sorry, no .net or Ruby skills yet)
  • Cross-browser compatible code from Photoshop or Illustrator files.. or napkins!
  • Custom Specialities in Wordpress theming & plugins, Twitter & jQuery
  • Subversion, server-log analysis, and blocking hack-attempts (of late).
  • Data/Project Geek. I ♥ timelines.

I’ve compiled some handy PHP functions I’ve had to whip up. More extensive code-samples are also available.

Wordpress-from-Photoshop/Illustrator

Wordpress-from-static HTML

Wordpress-from-Photoshop

Mac Finder meets Subversion

There’s a few scripts out there for colorizing subversion checkouts in Terminal. And there’s a few good Subversion clients for Mac. (and a few bad free ones). The major feature for svn’ers though – especially newbies – is using Mac’s color-labels for what’s in the repo, what’s not, & what will be committed.

Here’s the morning’s work for free, if you know bash (various path-adding and chmod +x-ing is needed of course). I’m tempted to put this on an hourly cron job too, perhaps with find -mtime‘s if-files-changed-in-the-last-hour bit.

  First bash script: svncolor

#!/bin/bash

# mac10.7 colors: 0=none, 1=red, 2=orange, 3=yellow, 4=green, 5=blue, 6=purple, 7=grey
# suggested by others - however not followed in this script
# none......? Not in repository / Unversioned......0
# orange....C In conflict..........................1
# red.......M Modified.............................2
# yellow.... Working file is merged...............3
# green.....U Working file is up-to-date...........4
# blue......A File is added........................5
# purple....I File is ignored......................6
# grey......D File is marked for deletion..........7

#cd ~/my/subversion/checkout

while read -r st fil; do
if [[ $st == 'M' ]]
then
#echo "modified"
colorlabel 3 $fil
fi

if [[ $st == 'C' ]]
then
#echo "conflict"
colorlabel 1 $fil
fi

if [[ $st == '?' ]]
then
#echo "coloring"
colorlabel 7 $fil
fi

done < <(/usr/bin/svn st)

Second bash script: colorlabel

#!/bin/bash
if [[ $# -le 1 || ! "$1" =~ ^[0-7]$ ]]; then
echo "usage: colorlabel 01234567 FILE..." 1>&2
exit 1
fi
colors=( 0 2 1 3 6 4 5 7 )
n=${colors[$1]}
shift
osascript - "[email protected]" < /dev/null 2>&1
on run arguments
tell app "Finder"
repeat with f in arguments
set f to (posix file (contents of f) as alias)
set label index of f to $n
end
end
end
END

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
Posted in bash, code, codeRelease, coding, ShellScripts, svn Comments Off

Comments are closed.