Category Archives: Quick Tips

Gmail Alias Emails for Sorting and Filtering Before Your Inbox

“I use gmail for Enterprise, and I have the option to create quick e-mail aliases in my admin account. I love this feature, and was curious about it’s availability in standard, tradition gmail accounts. Turns out, you don’t actually have to create or setup anything for an alias. Just enter an email address in this format:
[email protected]

Any e-mail sent to [email protected] is actually being sent to [email protected]

This becomes super-useful when you then create a simple filter in your gMail inbox to move any message sent to [email protected] to a specific folder, likely called Notes. Or just apply a specific label to these messages, whatever you prefer.

Here is the official Google article – https://support.google.com/mail/answer/12096?hl=en

Hope some of you find this useful & effective.”

Source – _aP

Track Outbound Links – Google Analytics

Goal: Use JS to automatically track outbound links that do not have a target=”_blank” attribute – in a dynamic and informative way.

Earlier in the week I was tasked with implementing Google’s Analytics system onto a fleet of websites that have different hostnames. This created many outbound links that weren’t tracked because they lacked a target=”_blank” attribute. This is a solution for websites using tools such as WordPress – and a plugin will be available eventually.  I’ve created a small snippet of Javascript/JQuery to run through a page, checking for external links – and modifying them to be tracked by Google’s servers with an onClick event. In using jQuery to solve this problem, you need to ensure you load jQuery into your page before running any of my script.

Step 1: Google’s Launch Pad – trackOutboundLink

Google has provided a function for converting a given URL into an event name for use in Analytics found here : https://support.google.com/analytics/answer/1136920?hl=en. This is standard Javascript and does not need to live within a jQuery wrapper. This function needs to be placed in the head of the document and not restricted in it’s runtime by a jQuery document.load() call.

<script type="text/javascript">// <![CDATA[
/*
* Function that tracks a click on an outbound link in Google Analytics.
* This function takes a valid URL string as an argument, and uses that URL string
* as the event label.
*/
var trackOutboundLink = function(url) {
   ga('send', 'event', 'outbound', 'click', url, {'hitCallback':
     function () {
     document.location = url;
     }
   });
}
// ]]></script>

Step 2: Checking URL Against the Hostname

Below we create a new function for comparing if a hostname is within a URL. The function takes ‘a’ and ‘b’ as variables, if unset return false, otherwise return the index position of our ‘b’ variable and check if it’s greater than or equal to index position 0. Greater than 0 means the string was found in our tested URL and will return true. Returning true implies the URL is internal, and can be left as is.

	function urlInternal(a, b) {
			if (!a || !b) {
				return false;
			} else {
			    return a.indexOf(b)&gt;= 0;
			};
	};

Step 3: Checking and Appending Anchors

For each anchor tag on the page, we get the href attribute and run it through our urlInternal function. Note the ! before my function call, if this weren’t here we would be evaluating all of the true statements where we want false (URL is NOT internal) results only. If the URL is external, using Google’s function and some concatenation – we write the new onclick attribute.

	var $hostBaseUrl = window.location.hostname;

	jQuery('a').each(function() {
			var $this = jQuery(this);
			var $url = $this.attr('href'); 

			//console.log($url,$hostBaseUrl,$linkBaseUrl);

			if(!urlInternal($url,$hostBaseUrl)){
				var $linkBaseUrl = $this.prop('hostname');
				var	$linkBaseLocation = "trackOutboundLink('http://" + $linkBaseUrl + "'); return false;";
				$this.attr('onclick',$linkBaseLocation);
				return;
			}
		});

Summary

Somewhere in the head of your page (that you want to change the link onClick of) include this function that we can call each time we find an external link.

	/**
	* Function that tracks a click on an outbound link in Google Analytics.
	* This function takes a valid URL string as an argument, and uses that URL string
	* as the event label.
	*/

	var trackOutboundLink = function(url) {
	   ga('send', 'event', 'outbound', 'click', url, {'hitCallback':
	     function () {
	     document.location = url;
	     }
	   });
	}

Run this script before the function and you should be good to go.

jQuery(document).ready(function(){

	/**$hostBaseUrl saves the current URL's hostname for later use. Eg: on google.ca/happy/two.pdf -&gt; google.ca is our hostname **/
	var $hostBaseUrl = window.location.hostname;

	/**Check if a, b are set variables and then check if b occurs in a - returns true or false because of &gt;= 0**/
	function urlInternal(a, b) {

			if (!a || !b) {
				return false;
			} else {
			    return a.indexOf(b) &gt;= 0;
			};

	};

	/**Scan through all anchor tags on the page and get their href attribute**/
	jQuery('a').each(function() {
			var $this = jQuery(this);
			var $url = $this.attr('href'); 

			/**If the link is NOT internal, get it's hostname and call Google's function to write the onclick attribute**/
			if(!urlInternal($url,$hostBaseUrl)){
				var $linkBaseUrl = $this.prop('hostname');
				var $linkBaseLocation = "trackOutboundLink('http://" + $linkBaseUrl + "'); return false;";
				$this.attr('onclick',$linkBaseLocation);
				return;
			}
	});
});

Constant Contact – “parsererror: SyntaxError: Unexpected token <"

parsererror: SyntaxError: Unexpected token <

I ran into this error earlier today while working with a marketing client and was frustrated for a few minutes before discovering a simple solution.

The error is called when more than one tab of Constant Contact is open in your browser.

The simple solution is to close any other open Constant Contact tabs leaving a single instance running in your browser. A refresh of the page may be necessary to remedy the issue.

Facebook Insights not Available for Community Pages?

There is a simple fix:

  1. Go to the admin panel
  2. Click on “edit page”
  3. Click on “update page info”
  4. Click on the word “Category”
  5. Choose your appropriate new category.

The Resume Carpet Bomb

I have never understood carpet bombing applications, why not go talk to managers and see what thy want to hear before applying? I’ve always had much better success when I go out of my way to see the needs of a company and tailor my applications/resume to their needs.

Fortunately I haven’t had to do this since my teenage years.

Once you have enough industry work under your belt, and a few good connections – you can typically traverse an industry with a good word and strong portfolio.

Stop Youtube from Asking to Use Your Real Name

UPDATE: Unfortunately, this doesn’t quite work anymore.

So you’re sick and tired of Youtube’s popup asking, “Do you want to use your real name with your Youtube channel?” No? How about the part where when you check ‘no’ and are greeted with, “Okay, we’ll ask you again later.

Here’s my quick tip to keeping your Google account separate from your otherwise anonymous Youtube account.

For this you will need a modern browser like Chrome, Firefox, Safari, etc. (which you should have anyways… please?) and the Ad-Block Plus Extension. It’s simple as far as implementation and will only take a minute after you’ve installed the extension.

How To

Going into your Ad Block Plus settings by right clicking on icon will open a dialog.

ad-block_Chrome

Go to the custom filter list in the options panel and select, “Manually edit filters” and add the line: ||s.ytimg.com/yts/jsbin/www-linkgplusdialog*

Click for a larger view.

Click for a larger view.

Don’t forget to add the “||” as they act as a catch all for http://, https://, and www prefix, which saves you from making three or four rules for one blocking.

Bonus: Block Video Annotations

||youtube.com/annotations_invideo*
Adding the line above to your custom filters will hide annotations in all Youtube videos, even while logged out.

Subtle Patterns Plugin – Free

pattern-blog-image

Look at all of those patterns!

 

update: The link in my article still works. Subtle Patterns has changed it’s format to a paid plugin, individual patterns are still available. Due to the pay to play nature of the photoshop plugin, they’ve removed links to the collection download. 

I wanted to share a resource I’m completely infatuated with: Subtle Patterns. This website aggregates free to use subtle patterns, and shares user contributions to the rest of the community.

The best part of this website? They don’t make you jump through hoops to get their files! No sign-up, emails, or other crap no one really wants to deal with (why do you think my comments are registration free?). Even better, they have every pattern available for free, in a master pattern file. The default photoshop patterns suck (pardon me), and loading up this free subtle patterns download  really gives you a great choice of patterns to integrate into your design work.

I had a user email me with some questions on installing subtle patterns into Photoshop. It’s really simple, just follow these steps:

  1. Follow the link above and download the subtle-patterns SubtlePatterns.pat.zip file
  2. Open the archive (zip) and extract (drag/drop) the SubtlePatterns.pat file into your file system
    • Note: C:\Program Files\Adobe\Adobe Photoshop CSX\Presets\Patterns is ideal
  3. Open Photoshop and click ‘S’ to open your stamp tool
  4. Switch to the pattern stamp tool if Clone Stamp is active by holding your mouse button down on the Stamp tool icon
  5. Activate the pattern dropdown in the top ribbon, usually below the help menu
  6. In the top right corner of the window, there is a gear icon – clicky clicky
  7. Pressing load patterns will open one final dialog
  8. Locate your pattern files and load them through this dialog
  9. Enjoy the Subtle Patterns Plugin – Free Download

Backup Link In case the github link goes down.

Following RSS Feeds with Mozilla Thunderbird

So I know many people see the RSS feed logo on a daily basis and have no idea what it does, or why it exists. RSS stands for rich site summary,  and does exactly what the name implies – provides a detailed summary of what is happening with a blog, news feed, or website in general. Most people use RSS because it can streamline a user’s daily news. Instead of visiting all of the blogs I enjoy to check for new content, or signing up for newsletters, I can have news and posts piped right into my RSS client. In this case I’ll be using Mozilla’s discontinued Thunderbird mail and feed client. I love the program as a free offline mail program, for it’s scheduling ability, and feed following, did I mention it was free? Get it here.

This is an RSS icon, you've undoubtedly seen it before.

This is an RSS icon, you’ve undoubtedly seen it before.

  1. Start by launching Mozilla Thunderbird
  2. Press alt to bring up your menu bar
  3. Navigate to File > New > Other Accounts…
  4. Select ‘Blog & News Feeds”
  5. Next
  6. Name your feed, I choose names based on how it will help me sort the feeds
  7. Next and finish
  8. In your left bar you should now see your new account, click on it
  9. Center top of your screen, click on “manage subscriptions”
  10. Paste or type in your feed URL
  11. Finish by clicking add
  12. Browse your new feed by clicking on it’s name in the left panel
  13. Double click a post title in the center window to open it in Mozilla Thunderbird

A Tool for Remapping Your Keyboard

I needed to rename hundreds of files individually, with underscores instead of spaces. I could have named all of my files using spaces, and used str_replace among other PHP tricks to change them to underscores. Instead I turned to the powers that be (read: Google) and discovered a handy tool, AutoHotkey. This tool allows you to do anything from re-mapping a key, to completely automating tasks via it’s native scripting language and macros.

51374bc4d535cf19f9000084

Direct from the AutoHotkey website:

AutoHotkey is a free, open-source utility for Windows. With it, you can:

  • Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or keyboard macro by hand or use the macro recorder.
  • Create hotkeys for keyboard, joystick, and mouse. Virtually any key, button, or combination can become a hotkey.
  • Expand abbreviations as you type them. For example, typing “btw” can automatically produce “by the way”.
  • Create custom data-entry forms, user interfaces, and menu bars. See GUI for details.
  • Remap keys and buttons on your keyboard, joystick, and mouse.
  • Respond to signals from hand-held remote controls via the WinLIRC client script.
  • Run existing AutoIt v2 scripts and enhance them with new capabilities.
  • Convert any script into an EXE file that can be run on computers that don’t have AutoHotkey installed.

This thing already saved me two hours of shift clicking by allowing me to remap my underscore to the spacebar. Totally a five-star piece of software and my open source recommendation of the month.