Henry Weismann’s Personal Blog

Web Development

Adwords API Oauth

by on Jul.25, 2016, under Web Development

I recently implemented the following guides to integrate the Adwords API Oauth login and offline conversions to be able to send WHMCS conversions to the Adwords:

http://www.ewanheming.com/adwords-api-offline-conversion-import

http://www.ewanheming.com/adwords-api-oauth-tutorial

It all worked well except for the Oauth portion which has some changes.  The changes are below.

We now have GetOAuth2Handler() instead of the conveinance functions on $user…..

For example my auth code:

Notice I also put in some code for &prompt=consent to be appended to make sure I get a refresh token when I don’t have one.

Saving Auth:

 

and Refreshing now looks like this:

 

Leave a Comment more...

SVN Out of memory – terminating application.

by on Sep.15, 2012, under Web Development

I recently tried using SVN on my clients server using a cpanel SSH account. SVN would only work on the root account but it was quite annoying because using it from root would set ownership and the group of the updated files to root instead of the cpanel account. This caused issues with “disappearing” files. I could not get SVN to work for the cpanel account SSH login and kept getting the following error:
(continue reading…)

Leave a Comment more...

Url Segment Validation Helper Function For CodeIgniter

by on Feb.22, 2011, under Web Development

Here is a snippet for validating url segments.  I wanted something similar to form validation for validating url segments.  Basically to be able to use any form validation function, helper, php or callback functions to validate passed data.  I have seen countless programmers not check data passed via the url and leading to broken CI pages…for example if they don’t check that they actually got a database result when using an id passed via the url that is not what was expected or they don’t check a passed argument is non zero number.  For example it’s also handy for things like checking that a passed user id is the current logged in user too.  Any function you want to use you can…you can even use the 2nd argument like match[1].  You can also pass FALSE as the site url and it will return the FALSE or TRUE result if fails or passes validation.
(continue reading…)

Leave a Comment more...

A recursive method to storing hierarchical data without multiple calls to the database

by on Feb.22, 2011, under Web Development

So here goes my first code snippet post.  I recently needed to create a hierarchical list of categories.  Since I am no genius and I don’t want to recreate the wheel I looked at all the methods I could find in a google search.  This brought me to Evolt.org which mentioned:

  1. Recursion
  2. Stack
  3. Flat Table
  4. Modified Preorder Tree Traversal Algorithm

Then I found an article on sitepoint.om which got me stoked cause sitepoint always has the best articles.  All these articles and numerous other results left me wanting to use the data structure I see most apps using with a parent_id and recursion but all the examples, even on sitepoint, used a database call inside the recursive function which I thought was a really big no no.  I couldn’t believe all these sites were discarding recursion as too much overhead because of the database call when they just needed to rework it a bit to get rid of that overhead.

So here is the recursive method, named the adjacency list model by sitepoint, to storing hierarchical data without multiple calls to the database.
(continue reading…)

Leave a Comment :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...

    Archives

    All entries, chronologically...