Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Prerender Your AngularJS Apps To Boost SEO

A Twitter subscriber of mine recently asked me if I knew how to use Prerender with my AngularJS applications to boost SEO when being crawled by search engines. My immediate answer was no, but I offered to help him figure it out and write an article on it.

Prerendering AngularJS web apps is critical for SEO because when web crawlers such as Google crawl a web page, they do not process all the AngularJS source code and curly bracket elements. With prerendering enabled, a web crawler will see the actual value found in curly brackets rather than the variables themselves.

Read More

Understanding Request Signing For Oauth 1.0a Providers

I am very familiar with Oauth 2.0, but recently I had to work with Twitter and it was not as smooth of an experience as other providers such as Google and Facebook. This is because Twitter uses Oauth 1.0a and requires request signing.

Oauth 1.0a requires requests to be signed using HMAC and a secret key. Using this protects communication between the client and the server, but how do we accomplish this task?

Read More

Tracking Pageviews with Google Analytics and Angular JS

Recently I noticed in my Google analytics dashboard that Analytics wasn’t tracking the full url of the page of my Angular JS site. I was tracking individual pageviews using this code in my app.js file:

MyApp.run(function($rootScope, $location, $window){
    $rootScope.$on('$routeChangeSuccess', function() {
        $window._gaq.push(['_trackPageview', $location.path()]);
    })
})
Read More

Use MavensMate with Sublime Text for Apex Development

After attending the Dreamforce conference for Salesforce development, I thought I’d share how to develop in Apex using Sublime Text rather than Eclipse.

If you’re familiar with my development styles, you know that I am very against using IDE applications because of their sluggishness. Everyone will have their own opinions, but I much prefer Sublime Text over Eclipse for all development. Lucky for us, there is an awesome package for us called MavensMate, that lets us do Apex coding directly in Sublime Text.

Read More

Parse An XML Response With PHP

If you’re like me, you find XML a real pain to deal with, but yet it still seems to exist with various web services. If you’re using Android or AngularJS, these frameworks can’t process XML out of the box, but they can JSON.

With the assistance of a PHP powered web server, you can easily transform the nasty XML responses you get into something more usable like JSON.

Read More

Bypass CORS Errors When Testing APIs Locally

Anyone who has worked with a RESTful API using JavaScript knows that testing can be a complete pain if the API owner hasn’t enabled CORS on their server. So what is CORS? According to Wikipedia, it is the following:

Cross-origin resource sharing (CORS) is a mechanism that allows many resources (e.g., fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain the resource originated from.

Often API owners will leave CORS disabled even though their API is open to the public. In my opinion it doesn’t feel public if the API owner is not allowing requests from all angles.

Here are a few tricks I’ve picked up in regards to bypassing the awful CORS errors you receive in your browser when testing.

Read More

Count Records From A hasMany Relationship In Grails

Recently I was tasked with trying to determine a distinct count between two tables with a many-to-many and one-to-many relationship. More specifically I needed to find out how many users were signing into the system on any given day. This is not to be confused with how many logins a particular user had for any given day.

Read More