Cam McVey: Web, Electronics, Music, Stuff

My plot of online goodness.


Cam McVeyHaving been online since the mid-Nineties, this is probably the 13th attempt at a personal website. And, as always, I have high hopes that this one will be the one. At any rate, please have a wander around here and get in touch if you so wish.

Blessings, Cam

Useful tools and apps

Picture of toolsI thought I’d write a quick post to talk about some of the wee tools and apps that I use pretty much every day to make life a little easier. Some were particularly useful in my transition from Windows to OS X. Hope you find this useful!

Alfred 2


This is a nice launcher app that you can quickly pop up, type anything, and it sort of knows what you’re getting at and gives you a quick list of files, apps, web seach, etc. to get the info you’re looking for. Saves a couple of keypresses when doing a new Google search.



When I first moved over to a Mac from Windows, I couldn’t believe OS X splatted these .DS_Store files in EVERY folder. What a pain! It took me about half a day to get sick of that, so I found Asepsis which cleverly deals with these files. Yay.



I hated the fact that the screensaver would kick in while watching videos (but appreciated it at other times). If you want to keep your screensaver but want more temporary control, Caffeine is for you.



When moving from Windows to OS X, I struggled to get my head around the differences and conventions of keyboard shortcuts. CheatSheet is nice in that, when you’re in an app, holding down the CMD key will pop up a ‘cheat sheet’ of all available Keyboard Shortcuts available in that app.



I’m a big user of clipboard apps — they are a time saver (and, occasionally a life saver) — so finding a good one was a priority. This was the best of the several I tried.



Nice wee app that sits in your menu bar and can grab a colour from anywhere on the screen. When you click to select the colour, it sticks it in your clipboard ready to be pasted into whatever you’re working on.



Cowboy, aka Ben Alman (of Grunt and others fame), created this as his personal bash environment setup, so it’s a nice way of setting up your prompt in Terminal and gives you some nice defaults, some useful aliases, and good integration with Git through a nifty prompt.



Eve is great for new OS X users that want to learn keyboard shortcuts because any time you use your mouse to select a menu item, Eve pops up to show you the shortcut you could have used. Forced myself to use it for two weeks before feeling like I could legitimately turn it off.



Useful app that changes the tone of the colour of your screen after sunset. Warms up the colour tone to rest your eyes. Nice wee feature to temporarily disable which is useful when dealing with graphics/video production/manipulation.



Great app to help anyone transitioning from Windows (or anyone looking to customise their keyboad). Lets you reassign what a key does. Very stable and very configurable.



Sister app to KeyRemap4MacBook, I use this to remap my Caps Lock key to something more useful. I wrote about this.

Sequel Pro


Brilliant app used to manage a local (or remote) MySQL server. Really nice interface, powerful helper features to manipulate the data, including a nice query window with exporting of results.



If you need total control over your app windows including size, shape and location, and you have the time and drive to learn it, there’s nothing better out there.



SizeUp is a nifty app that allows you to move and resize your app windows. Quick to learn and quite configurable. Great for overcoming the insanity that is OS X full size vs full screen. Full size doesn’t mean all–of–the–screen, and full screen means you–may–not–work–on–anything–else. Nonsense. SizeUp sorts this out.



I use the terminal a lot (one of the reasons for moving to a Mac was to get a ‘real’ command line). TotalTerminal gives some nice configuration options and makes a terminal a shortcut away. Used many multiple times a day.

Doing something useful with your Caps Lock key (on a mac)

Ever not used your Caps Lock key? Yeah, me too — all the time. So, that’s a waste, right? Let’s do something about it.

Picture of a part of a mac keyboard, focussed on the CapsLock key

Mac Keyboard, CapsLock Key

My frustrations with Mac keyboards was something I wrote about in a previous blog post. I mentioned that I had remapped the Caps Lock key, so I thought I would expand on it a bit, in case it would be useful to you.

You’ll need to download two small (very useful) programs and configure some settings, but it’s easy and this will take maybe 10 minutes tops.

First download PCKeyboardHack and follow Steps 1, 2, and 3 detailed on that page. In step two, in the “Setting” tab, look for the entry for Caps Lock, click the little arrow to the left to open it up, and enter “110” in the keycode column. Close PCKeyboardHack.

Now download KeyRemap4MacBook and follow Steps 1, 2, and 3 on that page. After Step 3, in the “Change Key” tab, scroll down until you see the entry “For PC Users”. Open that entry up (click on the little arrow again) then open out the entry for “Change PC Application Key”. Now you can change the behaviour of the Caps Lock Key to any of these entries. I set mine to “Forward Delete” as I missed that functionality when moving from a PC keyboard. Once you’ve selected your chosen remapping, close KeyRemap4MacBook.

Well done, you just made that key more useful!




The wee man.

Finding the WordPress root folder from outside WP

Have you ever needed to locate the root folder for a WordPress installation? If you’re checking from a page that is loaded up as part of WP, it’s easy; just use the ABSPATH constant, which is set up at the top of your wp-load.php file.

wpcodeHowever, if you need the root folder from within a page that is outside of WP, it’s a little more tricky. You don’t have access to the ABSPATH constant, and you don’t have built in access to the database to check for ‘wp_dir’ in the options table. [Of course, you could query the db if you have access details: something like “select option_value from wp_options where option_name ='wp_dir';” would do it.]

If the page is in a folder that is below the WP root folder though, there’s a nicer way. I wrote a little recursive function that checks a folder for the existence of a named file and, if it’s not there, moves to the parent folder and checks again. If it’s found, it returns the path to the file. So, if the file is below the root folder, this function will eventually find the root WP folder if you search for something like ‘wp-load.php’ or something else that generally lives in that folder.

Here’s the function with some code to demo how it’s used:

function find_file($filename, $path){
	$filepath = $path.'/'.$filename;
	if (!file_exists($filepath)){
		$filepath = find_file($filename, dirname($path));
	return $filepath;
$path_to_wpload = find_file('wp-load.php', __DIR__);

Hopefully that’s useful to someone. If you have an improvement to the function, or another (better) way to do the same thing, please add a comment.

On Mac keyboards and frustration

[Caveat: the following is an opinionated piece that you may or may not agree with. Also, my context is as a web developer: some of the following offenders are, of course, useful in other professions.]

Credit: berrytokyo

Credit: berrytokyo

I got a MacBook Pro recently, primarily because all the cool kids are creating the latest, greatest web tools on Mac systems and, frankly, the Windows guys are lagging behind. I found myself increasingly finding awesome tips/tricks/tools that came with the mac-only caveat which finishes with “I don’t know how you do this on a Windows machine, sorry.” I also got it because they’re so brilliantly designed to be both beautiful and powerful, and I dig that.

However, nobody mentioned the gaping hole of productivity that the non-standard (?) weird (UK) keyboard mapping! Argh!

  • The @ and ” symbols are swapped. Ever write an email? Yeah, me too. So I’ve had to re-learn where the @ symbols is. Annoying!
  • Page Up and Page Down are missing. This is really important to me as I use those keys A LOT to move around documents I’m editing.
  • The # symbol is completely missing! Any time you want to add colo(u)r to a webpage, you need that bad boy. Now it’s gone. This the worst change because, as an added annoyance, it’s been replaced with the never-ever-used-in-my-entire-life § (Section) symbol. What? Not to mention the equally useless ± as its shift+ partner.

Suffice to say, my first few weeks of Mac-ownership were filled with never-ending Google searches starting, “mac os x keyboard shortcut for …”. Now, I do know that all of these things can be overcome with judicious use of modifiers (e.g., Page Up is ?+? [cmd + up-arrow]), but even so, it’s a pain.

Then I stumbled on a superb bit of software called KeyRemap4MacBook. It is free and it is brilliant. I have now re-mapped several keys on this laptop to be more useful to me and I am very grateful to the genius Takayama Fumihiko for it. Though I haven’t gone as far a re-mapping the @ and ” symbols, I’ve made the this machine work better for me, and that’s pretty cool.

Right now, here’s how I have it set up:

  • When I hit the ‘§’, I get a lovely ‘#’.
  • Along with PCKeyboardHack, I’ve remapped the Caps Lock key to be “forward delete”
  • The Eject key now shows the desktop
  • The right-hand ? key is now Home (“Go to start of line”)
  • The right-hand ? key is now End (“Go to end of line”)
  • Also really handy: “Press ?+Q twice to Quit Application”

So, I’ve tamed the beast, somewhat. And I’ve forced myself to use the @ key in the wrong place. And I’m now pretty much up-to-speed with my Mac, and am enjoying playing with all the clever toys the cool kids are creating.

jQuery and JSONP Shenanigans

If you ever catch yourself messing around with jQuery and are trying to make JSONP calls using .getJSON(), just remember that since you’re (probably) making a cross-domain request, the .error() handler is not thrown. Which means, if you have any control over the uri that is being called, DON’T name the response “Error” when there’s a problem as you’ll never see it.

I was making this call:
$.getJSON('//' + someInput + '&callback=?', function(data){…}

and the execution was skipping right over the code in that block, given a response from the server of:
'[{"Error": "Some problem happened"}]'

In the end, the solution was to change the error message from the server from saying “Error” to something else, e.g.:
'[{"Problem": "Some problem happened"}]'

Hope that helps someone out and saves them the 2 hours I just lost. Though I guess I did learn something new!

[Note: this refers to jQuery 1.7.2]

Loopy Deux

A good friend of mine was talking about his guitar pedal board and some issues he was having with a couple of pedals on there. I offered to have a look. Instead of raking around in the guts of his decades-old pedal to make it true bypass, I figured it would be easier to construct something that would allow him to leave his pedal on all the time, but to completely remove it from the audio signal when not needed. I sat down and sketched out an idea that I thought would work and then proceeded to get the parts and assemble it.

THEN I had the bright idea of checking online to see if anyone else had done such a thing and what, if anything, I had missed in my design. Of course, plenty of folks make these type of devices all the time, so no invention here. Ah well!

Well all the stuff arrived and I pulled it together over a week or so — an hour here, an afternoon there — and the Loopy Deux was born. I named “Loopy Deux” because it loops and there’s two of them. I had “Loopy Doo” in my head and realised that “doo” (deux) in French means “two”, so the name stuck! I learned some things through it and had to assemble a number of tools to produce it which will come in handy for the next two projects being born out of this one.

The nice thing about this pedal is that it solves more than one problem. It’s great for removing a particularly noisy or tone-sucking pedal out of the audio signal, but the other nice thing is that it can help you set up several pedals into a particular sound by allowing you to switch them all off or on with a single switch instead of dancing around, trying to get them all switched as fast as possible.

I have some ideas on additional features that would make the pedal even more useful (buffers, blend pots, etc.), but that will have to wait until version deux!

Here’s some photos of the various stages.

By the way, if you are interested in getting something similar made, let me know — I’m always up for a challenge!

Change Changes Things

Buses, they say, take an age to arrive and then all appear in a bunch together. And so it seems with Change in my life. Of course, we all deal with change as a matter of day-to-day living. There’s nothing unusual about that. The Change that I’m referring to here is the big changes in life and, more specifically, when those changes come along together. About four years ago, I had to deal with the arrival of my first-born child, the purchase of my first house, the death of my father, being made redundant, and starting my first business — all in the space of a few months. It was tough, but in a way that you only fully realise after the fact. I got through it, mostly with the aid of faith, friends, prayer and time.

In one way, common sense says spread out the unheaval. Don’t rock the family boat too much at one time. Take the hits one at a time to disperse the pain. I’m not so sure though — I feel all at once is perhaps the best way. Just throw it all at me in a one’r and, “setting my face like flint”, I’ll get through it. Being in a constant state of big change would be a hard way to live. Seasons of constance and short storms of massive change perhaps suit me better.

That’s just theory, of course. I have no way of really knowing as I’ve never really had big changes spread out and, to bring us up to date, it looks like another storm is brewing. Changes in housing, church, job, income and spiritual climate has me wide-eyed. I’m faced with the prospect of all this change like one sitting at the front of a rollercoaster at the initial ratching up. Infact, I’m at the top, faced with the reality of what this all means, and the immediacy of it makes for a big inhale and the gulp and tightened grip before the big fall at the start of the ride.

But I’m learning to lean; I’m learning to trust. I’m getting better at seeing this stuff for what it is. I’m learning to marry up my understanding with my own circumstances. I feel more confident that everything will be alright. In fact, if I navigate in step with Him and remain in Him, I can come out of this much the richer. The opportunity for learning and growth is compelling.

So I say bring it on! All the trouble I see brewing, when viewed from this perspective, just become bigger examples of the “change is good” way-of-life I so espouse. It’s just that there’s more on the line now. But, surely, that means the reward is that much greater.

Help us keep on truckin’!

Since the beginning of August this year, my family and I have been — to use a well-worn phrase — “living by faith” which means, basically, trusting God to meet our every need. Of course, barring creative miracles involving crisp new bank notes, this means He uses the members of His kingdom, asking them to be willing to be “releasers of finance”! Which brings us directly to the purpose of this post which is to draw your attention to the fact that we can now be directly supported (by you, even!) via the good folks over at Stewardship, using the forms available on our “Support Us” page.

Please do consider it. We feel we’re doing what we’re called to do, and that it is very relevant and important work. If you fell led, please pray and see what your Dad has on His heart for you to do.

Thank you!

The Independence Of Scotland

Scotland has a reputation, within Scotland at least, of being an independent nation. And yet, because we’re not, there’s a sense of oppression hanging over us and the nation. And whether that oppression is perceived in the political, cultural, or spiritual realms, there is a common understanding that true freedom does not exist. Perhaps most alarmingly, that sense of oppression is being reinforced as successive generations remain under it. Worst of all, as sons and daughters are raised in that atmosphere, it becomes our identity. It’s what we understand. It’s who we are.

However, I feel that change is coming. Importantly, though, I don’t think it will necessarily come through a coming out from The Union. I believe that, as a people, we are sufficiently different from the rest of the UK that, over time and in conjunction with the work of the Holy Spirit, our differences will start to pull us in a direction that is away from the rest of the UK. There may be many reasons why we should or should not be ‘in union’, but if God is calling this nation to have a more Godly character and value system — and I believe He is — and we move with it, we will automatically have an independence far more important than the political status of this country.

The release of the Lockerbie bomber was so significant. It was a wee nation showing mercy despite great pressure from the UK and US governments. And, while I have sympathy for the families of those affected by the bombing, and the correctness of the decision from a legal position can be forever debated, the importance to building the identity of Scotland is huge. It showed the way we can become independent. I don’t just mean going against the flow for the sake of political gain, but coming into alignment with biblical principals, particularly when that is not the norm.

So, here’s the point: if Scotland is to become independent, I believe it’ll be, at first, through a spiritual shift and then, if ever, a political one. So, Body of Christ in Scotland, now is the time! Start being an influencer. Start praying for your local area and the people in it. Pray for God’s will to be done. Ask Him how you, personally, can bring that change in your area of influence. Stop believing the lie that you have no influence – you have as much as you want. And stop believing the lie that you don’t want influence! You are called to be a light and to do that you need to stand out and not hide. Come on, Church. It’s not ever going to happen by leaving it to the Spiritual Superstars! Imagine how the nation would look, even overnight, if the whole church in Scotland woke up and realised who they are and what power and authority they carry and what they are called to do with it. A nation so transformed, it would be independent!

« Older posts