A sample of the power of Vim.

this power … in vim you need to get… :%s/X\([^=]*\)=”blankrow”/Xblankrow=”\1″/g Problem statement: I have a 1000+ line file, with this pattern: Xabc=”blankrow” …. that I need to change to: Xblankrow=”abc“ see the swap? note: abc is dynamic and viariable and unknown with the exception that I know it follows the syntactical rules of being a …

Continue reading ‘A sample of the power of Vim.’ »

WordPress Site Replicator

For WordPress plugin software developers like myself, I often need to be able to replicate a WordPress website quickly for the purpose of doing offline development. To assist in this endeavor, I created a bash script to do the work. The script is interactive and simply executes as follows: $ replicate_site.sh –from=sourcefolder –to=targetfolder –dbsrc=db:username:password –dbtarget=db:sandboxuser:password …

Continue reading ‘WordPress Site Replicator’ »

Combine find with xargs and grep to help locate code snippets.

I wrote this one back in 2006. When you need to find program code snippets, a combination of find, with xargs and grep to the rescue. I call if fin, and Fin. Works like this, say you’re looking for a program code snippet “select from”, you’re not even sure of the case match. fin select …

Continue reading ‘Combine find with xargs and grep to help locate code snippets.’ »