May 172013
 

I’ve spoken with several web designers lately that may have heard about the various CSS pre-processors out there (Sass, Less, etc) but aren’t currently using one. There are tons of arguments for which is better, or even if one is necessary/beneficial, but I’ll let you search those out on your own. I personally prefer Sass. I find it fits my development style well, and any time I can avoid dealing with JavaScript libraries I prefer to do so.

Now that I’ve gotten that out of the way, here are some basic instructions for setting up your Mac. I post these because there is lots of good documentation out there on using Sass, but I struggled a while back to figure out how to get Ruby installed on my Mac without causing conflicts with the version already installed and required by the system.

1. Install Ruby

There are lots of ways to do this. The easiest way I found was to use RVM. The instructions on their site are SUPER easy and I’ve never had a problem with them. To save you some trouble, I’m grabbing some basic snippets from their site assuming you want Ruby to get Sass/Compass running and nothing else.

  • Open Terminal on your mac
    • At the command prompt, copy/paste the code below (from “sudo” onward).
      sudo \curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby
    • If prompted (you should be), enter the computer’s admin password. If you aren’t sure, use the password for your user account. If that doesn’t work and your company/church owns the computer, you may need to talk with them.

2. Install Sass and Compass

Simply type the following two commands and everything should “just work” =]

sudo gem install sass
sudo gem install compass

 

If you get any errors, use Google or Bing to troubleshoot. There are usually lots of responses, and I find that Stack Overflow posts typically give great solutions. At this point, the instructions on the Sass web site should get you up and running!

 Posted by at 9:08 am
Apr 012013
 

*This application comes as-is. I’m happy to address bugs or enhancement requests if you e-mail them to me, but I cannot be responsible for any unexpected occurrences. Thanks for understanding and for testing this in a non-production environment first :).

MinistryPlatform offers an Address Validation tool that handles CASS validation and NCOA lookups. However, the service doesn’t return latitude/longitude coordinates. I’ve heard a couple churches ask about getting lat/long attached to their addresses so I decided to check into various free services out there. Ultimately I chose Bing’s geocoding service. Here’s the app that I was able to put together.

Stored Procedure

First off I wrote a stored procedure that grabs all addresses in MP that meet the following criteria. All of these were necessary to make sure that we don’t try to geocode addresses that are either incomplete, already geocoded, etc. Here are some other criteria used in the SP:

  • Max of 5,000 addresses (Bing’s 24-hour rolling cap)
  • Do Not Geocode = false
  • Lat & Long are both empty (or 0)
  • The Address has some value in Address_Line_1, City, State, and Postal Code

Application Logic

The next piece was looking at the addresses submitted to Bing and at Bing’s response. I found three general scenarios that I’ve handled in the application. A “*” indicates a newly created field (included in the SQL script).

Address: 123 Main Street, Atlanta, GA 30001

  • Bing standardizes the full address format and also provides the County, Country Name, Latitude, and Longitude.
  • The app updates Lat, Long, County, Country, Date_Geocoded*, and Geocoded* in MinistryPlatform. It also sets Do_Not_Geocode* to “false”.

Address: PO BOX 1234, Atlanta, GA 30001

  • Bing does not map PO Boxes, so they return no value for Address Line 1. The County and Country are correct, but the Lat/Long provided mapped to the zip code centroid.
  • The app updates Lat, Long, Country, Date_Geocoded*, and Geocoded* in MinistryPlatform. It also sets Do_Not_Geocode* to “false”. I also don’t set the County since some Zip Codes in America have multiple Counties represented and I don’t want to contribuite to inaccurate data.

Address: 123 Main Street, Toronto, ON, Canada ABC-123

  • Bing rejected these addresses and they came back as failed.
  • The app sets Do_Not_Geocode to “true”, Geocoded to “false”, and the Date_Geocoded is updated.

Summary

I decided against updating the primary address fields. My thought is that some churches will already be using the Cass/NCOA validation and I don’t want to muck that up. However, since they don’t provide some of these additional fields I wanted to capture them. What do you think?

Download/Installation/Requirements

  • PHP 5+
  • MinistryPlatform API Credentials
  • Bing Maps API key (sign up for one here)
  • SQL Script (run this in your MinistryPlatform DB)
  • PHP Application
  1. Download and run the SQL script in your MinistryPlatform database. Since this updates data, it’s probably not a bad idea to test/run the app against your sandbox first.
  2. Download and drop the PHP application (see above) and install it on your web server (PHP 5+ required, no other dependencies should be needed).
  3. Sign up for a Bing Maps Portal API key
  4. In the PHP application, open /application/config/mp_config.php
    • update the config values for your MinistryPlatform server path, API Domain GUID, password, etc.
    • add your Bing Maps key

 

To run the script, go to <yoururl.com>/phpapp/geocode. It may take a long time to complete the call since the Stored Proc returns up to 5,000 addresses. Feel free to adjust the SP to return the top 10 records or something small to do a test run.

 Posted by at 11:32 am
Oct 122012
 

One year ago today was the hardest day of my life. I held my 3 week old son for the first and last time just an hour before he died. Today I’ve had a number of friends reach out to me to voice their support, comforting my wife and I that we are not alone. We are doing very well, and have healed in many ways. We continue to heal in others. Today is a day to celebrate our lives and to live in obedience, walking in faith.

I thought I’d share a few things I’ve learned over the past year.

  • No one dies too soon – not even Carson. Ps. 139:16 says that God has already written every day of each of our lives.
  • There is no denying the tragedy of losing a loved one, even a child. The grieving process takes a long time, and there’s no way to quantify that.
  • No one can ever remind us of losing Carson by asking us how we’re doing. The question will always be a warm comfort as we’re reminded that others still remember.
  • This is a single chapter in each of our lives. If this were the final chapter we would also be dead. As we move forward with life Carson will never be forgotten, but if we stopped living now it would be a shame. Our lives aren’t over, and we must move on in every healthy way.

Thanks again for your love and friendships, we appreciate them so much!

 Posted by at 9:55 am
Apr 012012
 

I got the latest version of Mac OS X – Lion – last year on the day it was released. I was pretty excited for the continued progression towards a unified OS (computer, iPad, iPhone having similar feature-sets). However, my upgrade experience was less than stellar. Boot and shut down times were 2-3x longer, apps took longer to load, and it seemed more buggy in general. In fact, my upgrade from 10.7.2 to 10.7.3 ended up with me doing a full Time Machine restore because the update hosed my computer.

Yesterday I decided that enough was enough. I took my mid-2010 MBP’s original “factory settings” disks and began a complete rebuild of my OS. I had tried doing a full Time Machine backup/restore previously, but Time Machine is so good (to my chagrin in this case) that it restored all the crap that slowed down my machine too. This time I was determined to re-install any applications I was still using, and only use Time Machine to restore my home folder/user profile. I thought it would be fun to write down my steps and overall impression of how successful my efforts were. Here goes:

 

Prep Work:

  • Full Time Machine backup
  • Make a list of all apps that I know I still use. Make sure I have serial #s for all of them and know where I can download them

 

Doing the restore:

  • Boot from the restore disk that came w/ my MBP
  • Load Disk Utility and wipe my HD clean (hold breath…)
  • Install Snow Leopard (10.6.3 came w/ my MBP)
  • **important** used a temp username to boot into Snow Leopard. Otherwise I might run into issues when restoring my real user account via Time Machine / Data Migration Assistant
  • Run software updates to get the App Store (10.6.8+)
  • Log into the App Store and re-download Lion
  • Run the Lion update (and watch it fail once before succeeding.. geez Apple, seriously?)
    • Note: Downloading Lion from the App Store gives you the current version of Lion – 10.7.3 in my case. That was a *really* nice perk. I’m used to getting a new version of Windows, then spending 4 hours running updates that are inexplicably not combined. Well done, Apple.
  • Use Migration Assistant to import my full user profile from my Time Machine Backup
  • Re-download/install all applications I want to use


Results:

  • ~30 GB of additional free space on my HD – O_o – (~63 GB -> ~92 GB free)
  • Shut Down and Boot sequences are much quicker. Not as fast as Snow Leopard, but MUCH better than what they were
  • Apps load much quicker, as do most other processes

It was worth the 6-8 hours (mostly passive time) that it took to do the full wipe. The computer is noticeably faster with the same specs. It was not without frustrations (the user import from the Migration Assistant took ~3 hours.. my FULL time machine restores don’t usually take that long).

 Posted by at 6:53 pm
Jan 102012
 

View and download on Github

 

I’ve worked with a company named Think Ministry, Inc. for coming up on a year. We provide enterprise-class church management solutions via a robust database/platform and several other applications. Our main application (MinistryPlatform) comes with its own API as well. Since my main role is Support/QA, I thought it would be good to dabble with our API to understand firsthand how it functions.

I chose to make a “group check-in” application designed for mobile devices. Our churches often ask if we have a mobile check-in application, so I thought it would make some sense to see if I could come up with a good starting point, maybe even an app that would be used by someone. After trying a few mobile frameworks, I landed with jQuery Mobile. It’s basic enough for me to quickly understand, and it did most of what I wanted.

Here were my goals:

  • Authenticate and create a user session based on a MinistryPlatform user ID/password
  • Restrict log-in to a specific security role
  • When a user authenticates successfully, display a list of available events (within x hours of starting, customizable)
  • Display all groups assigned to each event, including people who registered via our public portal but were not a part of an existing group.
  • Display the count of leaders : participants for each group, and how many are currently checked in.
  • Allow the user to tap individual people’s names and check them in to the event immediately.

By the time the application was built, it did all of these (and a few more tweaks/features). It’s now available for download for our current churches, and I’m hoping it will serve as a great example of integrating PHP with our API, and maybe even be useful to some of our churches!