Igor's Blog

21-Mar-2017
Google DFP with AdSense fallback is causing infinite scroll pages to go haywire
I've written an article last year about using Google DFP with AdSense on infinite scroll pages which worked very well and was the basis for a number of my own sites and projects. In the past week however I noticed that GPT, which is the JavaScript library used to create DFP ad slots, started behaving erratically.
20-Mar-2017
Workaround for Mobile Safari scrollTop() not updating during scroll
I've recently discovered that on Mobile Safari the $(window).scrollTop() would not update during the scroll event animation. It appeared to only update after the scroll (the elastic scroll) had finished its animation. This was a rather annoying 'feature' for me because I needed to update my UI during the animation, so I went looking for a workaround and here's what I've come up with.
18-Feb-2017
Detecting print requests to print contents of a DIV with JavaScript
Printing a page with JavaScript is easy but if you want to print the contents of a specific DIV, it gets a little trickier. If you want to do something more complex like intercept the page print request and then print only certain contents of that page there's even more work involved. This article will show you how I did just that over at travelblog.ws.
15-Feb-2017
Using Google DFP with AdSense on responsive pages
I've been using Google DFP instead of AdSense on a number of sites that I run because it relaxes some of the AdSense rules and more importantly gives you fuller control of your ad placement. For example you can easily place AdSense ads on infinite scroll pages using DFP, which can't be done with standard AdSense code. One place that DFP falls short however is the ability to use responsive ads. This example shows how with a bit of extra code it is possible to make DFP ads somewhat more responsive friendly.
16-Jan-2017
Adding an email subscribe feature to your Blog with Blogtrottr
I've been thinking of adding an email subscribe feature to my Blog for a while now. Originally I thought that I'd build this functionality myself but after a lot of deliberation and research I decided that there really wasn't any need to reinvent the wheel and looked for an alternative. That's when I came across Blogtrottr.
13-Oct-2016
Playing with JavaScript variable obfuscation to hide Google Analytics and AdSense IDs
Recently I've become interested in whether it wcould be possible to hide the Google Analytics or Google AdSense publisher IDs from online tools like SpyOnWeb.com and any lay people who may be looking at your site's code. This is when I came across this article that talked about de-obfuscating JavaScript encoded with JJencodep. After reading that article I had a few ideas and over a number of iterations came up with something that fit the bill.
10-Aug-2016
How to configure the Minify Maven Plugin
If you know anything about JavaScript and haven't been living under a rock, you will know about minification. There are tools like Google's Closure Compiler and Yahoo's YUI Compressor available to make minified versions of your JavaScript and CSS files. Using those tools is easy but what's even easier is having a Maven wrapper around them. This is where the Minify Maven Plugin comes in.
09-Aug-2016
Why "Browser API keys cannot have referer restrictions when used with this API" error happens
After Google started to force developers to use API keys I changed my code accordingly and for a while everything was working fine. It wasn't until I tested my application on a real server that I started to get the 'Browser API keys cannot have referer restrictions when used with this API.' error. It didn't take too long to figure out why this happens and how to fix it so read on to find out.
07-Aug-2016
Introducing the jQuery UI Photoboxr Plugin
After going away on a trip to the mountains and testing out my Travel µBlog software for the first time it was clear that some improvements were needed in terms of how photos are displayed. The main issue I noticed was that photos taken on a Galaxy S6 were 1080p and hence wide screen. This didn't play well with the 4:3 aspect ratio sized photo boxes used on the blog.
03-Aug-2016
Caveats of inserting a new Image into the DOM with jQuery
While I was working on a jQuery UI plugin I'm writing, in my haste to get it going I made a simple mistake, which was forgetting the fundamental principle of how jQuery works with it's selectors. My aim was to create a new Image instance, apply my jQuery UI plugin to it, which wraps that image in a DIV and then add the DIV to the DOM.
01-Aug-2016
Amazingly simple to implement code highlighter for your blog
I was looking for an easy to implement code highlighter for my Blog and after searching around and trying out various different ones I settled on highlight.js. My requirements were simple, it had to work with the BBcode used in Flatpress and ideally to not require much code change.
15-Jul-2016
How to use Google AdSense on infinite scroll web pages
If you want to use Google's AdSense on your page that has an infinite scroll set up (like I do on travelblog.ws) you could be out of luck both because AdSense T&Cs forbid more than 3 of the same ad unit being shown on the same page and secondly because the AdSense code is simply not set up for that. However this article is about getting AdSense working on infinite scroll pages so there is a way to do it, read on to find out how.
04-Jul-2016
Getting jQuery and iOS playing nicely to programatically select input field contents
Something as simple as the jQuery .select() should just work across all browsers and platforms but it doesn't. I know jQuery Mobile attempts to solve the deficiencies that the multi-platform/device ecosystem creates, however not everyone wants to use jQM and sometimes it's easier to create a small workaround. This is exactly what I did to get input field text selection working for my Travel Microblog project.
24-Jun-2016
Google Maps now forcing developers to use an API Key, returning MissingKeyMapError
I've noticed that whenever I was using the Google Maps API recently it was displaying an error in the JavaScript console and the API was not functional. This seems to be due to Google forcing developers to use an API Key whenever they access their Maps API now. This change is not huge and is easy to implement so read on.
22-Jun-2016
A good way of passing around latitude/longitude when using Google Places Autocomplete API
Google Places Autocomplete is an excellent addition to a web application that needs to have its users enter a location. I've been using this API quite a bit on my travelblog.ws project and have written about ways of implementing it with jQuery. This article shows how I am passing around the latitude/longitude coordinates that Autocomplete returns so that I can make use of them in other parts of my code.
11-May-2016
Getting the selected text value in a drop-down list using JQuery
Sometimes a need arises to get the text of the selected option in a drop-down list. Using some jQuery selectors this is possible, but first lets see what doesn't work.
01-Apr-2016
A better way to initialise Google Maps Places AutoComplete API
Not long ago I've written about how to use Google's Map AutoComplete API. Now I've been going through my code and refactoring it. The new method is more flexible and easier to use.
16-Feb-2016
JQuery Timepicker Addon not rendering time zone correctly and how to fix it
The Timepicker jQuery addon is a great modification to the standard jQuery UI Datepicker, however the 1.6.1 release from its GitHub page has a glaring problem when rendering the time zone input select.
14-Feb-2016
Get user's location with HTML 5 Geolocation and Google Maps Reverse Geocoding API
Facebook does it, so you can do it too. I'm talking about getting the user's location when they are interacting with your website. Whereas previously you had to rely on IP address based solutions, now the modern web browsers that support HTML 5 allow you to get this information easily. Combine that with the Google Maps API and you can get some very detailed location data. Here's how.
02-Feb-2016
Use Google Maps Places auto complete API without displaying a map
Here's a bit of code that I'm using on a personal project of mine. This code uses the Google Maps Places API auto complete feature without having to display a map. This means you get a text input box where you can start typing in Google Maps locations and fit it into your standard HTML forms.
18-Jan-2016
Use Bootstrap and FontAwesome to beautify the JQuery UI DatePicker icon trigger
I've been using the jQuery UI Date Picker for a project of mine and decided to combine it with a some Bootstrap form controls, specifically the input field that has a group add-on showing an icon from Font Awesome appended to the control.
03-Dec-2015
Show/hide HTML elements with this simple CSS trick without using JavaScript
Recently I had a need to add a very simple bit of functionality to my blog that would show/hide some bbcode examples. I didn't want to use Bootstrap/jQuery for such a simple task so I looked around and found this simple CSS trick that does exactly what I need by using a checkbox to trigger showing/hiding a pre element, effectively simulating a Bootstrap Accordion.
29-Jul-2015
Scroll Bootstrap 3 Accordion with dynamically loaded content to top of page
I've recently discovered a problem in a website I've built where clicking a Bootstrap 3 accordion panel to expand it and show the content would erroneously scroll that panel off screen. This was happening because the content was being loaded dynamically via the show.bs.collapse event. After a bit of playing around with the implementation I found a way to scroll the panel, including its heading correctly to the top of the screen.
10-Jun-2015
What to do when the Google Plus Moments API is no longer supported
I've noticed a couple of weeks ago that my Google+ auto-posting on my blog stopped working and was giving me a 500 server error. At first I ignored this thinking it's just a temporary outage, but when it persisted for days I decided to investigate it. Turns out Google stopped supporting the Moments API and all of a sudden it stopped working too!
19-Aug-2014
Adding Google search to a FlatPress theme
Although FlatPress includes a search feature, I found it to be quite limited, so I had a look at adding Google search to a theme in FlatPress and found that to be quite easy to do. There is some tinkering with the FlatPress code itself, however the end result is a fully working search for FlatPress that is backed by the power of Google.
06-Oct-2013
Implementing Thingiverse OAuth2 with Google App Engine
I've been working on the next version of Extrudifier that will have integration to Thingiverse for direct uploads and Thing creations right from the Extrudifier app. This needed a bit of work to get the OAuth2 workflow set up, this is what I describe in this post. I chose to go with Google App Engine and Servlets because this was the easy and free and could be up and running quite quickly. All that's needed to implement this integration is a bit of JavaScript, a Java Servlet and some App Engine magic.
14-Jun-2013
Playing with Hexagons and CAAT
I've been going through my options in picking a new graphics library to use for my HTML5 game that would be fast enough to draw at 60FPS and one that could provide robust functionality, not many of the existing APIs do this and I was almost ready to give up until I found CAAT. In a matter of hours I was able to get this demo up and running that draws a hexagonal grid, which is scrollable (by dragging it) and maps clicks on the canvas to grid cells.
13-May-2013
Generate a nice looking star field with EaselJS and HTML5 canvas
I've been playing around with star field generation quite a bit lately for my game, so I've made a jsFiddle to test it out.
30-Apr-2013
Creating large high performing hexagonal grids for HTML5 apps using KineticJS
When I first started looking into the HTML5 side of things for my game one of the key requirements for me was the ability to work with hexagonal grids and to be able to interact with the cells in this grid. KineticJS seemed to have the right features to do this, but I soon discovered that large grids simply did not perform, so after playing around a bit I found another solution.

Previous Post

Next Post

Programming, DIY, Games, Hacks, Tech and more.
Follow me on...
Current and Past Projects
See my Resume

Subscribe


RSS Feed

My Other Web Sites

Igor and Elise's Travels
Riverside Expressway Cam
300 George St Blogumentary

My Online Tools

UUID to OID Converter
Guru JSON-RPC Tester
Extrudifier Object Designer

Recent Blog Posts

Handling visibility of mobile only pop-over DIVs on a responsive web site

WebLogic package-name element classpath generator script

Using Jersey 2.x as a shared library on WebLogic 12.1.2

Google DFP with AdSense fallback is causing infinite scroll pages to go haywire

Workaround for Mobile Safari scrollTop() not updating during scroll

Skipping execution of Maven plugins that do not have a native skip option

Unmarshalling an XML fragment representing a JAXB object without XmlRootElement

Injecting a ContainerRequestContext into a Jersey entity provider class

Obfuscating PHP source code with Maven and YAK Pro PO

Making use of corner shelves with easy to make slide out draws

Recent Galleries

Space Food - Chocolate Ice Cream with Chocolate Chips

Legeod Star Wars AT-DP kit

DIY spare parts computer build with a RAIDMAX Anura case

Fake 'Lepin' brand Lego packaging

Hardwood garden bench with clear resin void filler

Fixing a 3D printer extruder that stopped heating up

Easily increase disk space in a Lenovo Ideapad 100S 14" laptop with an M.2 SSD

Making a multi-piece 3D printed solder spool holder stand

DIY indoor apartment grow light wiring

Good Friday Electronics fun Easter Bunny LED PCB Kit IBEABU-01.0

Top Categories

Blogs I follow

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth

Friends

RAWS Parts Online
Alpha Dimensions Hosting
Kristensen Photography
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity
Follow me on... 
     
...or subscribe for updates!

Don't show this again