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

Subversion Mac fix

Subversion is great for more than just simple backups.. it’ll let me know when files were edited, and which files were changed in each sync.

But Subversion was written for the land of *nix/Windows, where these obnoxious things called resource forks don’t exist, where Finder doesn’t auto-create files.

Hear ye, hear ye, I have created the solution.
Mac OS’ .DS_Store files: killed.
Mac OS’ ._blah files: killed.
KDE’s .directory files: killed.

Furthermore, this bash script will auto-update & commit too. Handy for an all-in-one’er. Now, I know, many of you out there are more subversion-knowledgeable, and use hooks for this, but this little beasty will solve already-present crap-files in a repository.

Hope it works for y’all. I’ve tested it against all my repos with lots of crazy characters.. all the quotes out there, etc.

Future improvements: I’m willing to hear about. (like perl regEx’ing svn’s errors to stop the script.. or one-control+c script-stopping)

[sourcecode language='cpp']
#/bin/sh
####################################################
## Usage:
## sh thisscriptfilename.sh folder
##
## Config: change the value of ‘export loc’.
##
## Issues handled:
## quotes in filenames: -print0 / xargs -0
## spaces in filenames: -print0 / xargs -0
## svn can’t delete files not added: –force
## svn can’t –force delete files in un-added folders: rm -f after svn –force delete
####################################################

export loc=”/Volumes/storage/”

cd “$loc/$1″

echo “Displaying status: $loc/$1″
svn status .

echo “Updating changes from server”
svn update .

echo “Cleaning up”
## no MacOS Resource forks!
find “$loc/$1″ \( ! -name .svn -o -prune \) -type f -iname “._*” -print0 | xargs -0 svn –force delete
find “$loc/$1″ \( ! -name .svn -o -prune \) -type f -iname “._*” -print0 | xargs -0 rm -f

## no KDE .directory!
find “$loc/$1″ \( ! -name .svn -o -prune \) -type f -iname “.directory” -print0 | xargs -0 svn –force delete
find “$loc/$1″ \( ! -name .svn -o -prune \) -type f -iname “.directory” -print0 | xargs -0 rm -f

## no .DS_Stores!
find “$loc/$1″ \( ! -name .svn -o -prune \) -type f -iname “.DS_Store” -print0 | xargs -0 svn –force delete
find “$loc/$1″ \( ! -name .svn -o -prune \) -type f -iname “.DS_Store” -print0 | xargs -0 rm -f

### test:
## find “$loc/$1″ \( ! -name .svn -o -prune \) -type f -iname “._*” -print0 | xargs -0 ls -lsa

echo “Adding..”
svn –force add .

echo “Status to send:”
svn status .

echo “Sending..”
svn commit -m ” .

echo “Final status:”
svn status .
[/sourcecode]

Share and Enjoy

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

Comments are closed.