Trello Bookmarklet

Trello

Prefer the previous linear layout of Trello cards over the new layout? You can use a bookmarklet to inject styles into the DOM, reverting the layout to one wide column. Just create a new bookmark in your favorite browser’s bookmark bar and paste the following code for the link.

javascript:(function(){var style = document.createElement('style'); style.innerHTML = 'header ~ div[class] { display: block; overflow-y: auto !important; } header ~ div[class] main, header ~ div[class] main div, header ~ div[class] aside, header ~ div aside div { max-width: 100% !important; width: auto !important}'; document.head.appendChild(style);})();

 

Clean URL Bookmarklet

Remove UTM tracking parameters from Chrome addresses before sharing.

Sick of manually removing the UTM tracking parameters from links you copy and paste in Chrome? Here’s a nifty little trick to automate the process.

In your Bookmarks bar, click “Add Page” and enter the Name (e.g., “CLEAN”). Then paste the following code into the URL:

javascript:(function(){let u=new URL(location.href);['utm_placement','user_id','utm_source','utm_medium','utm_campaign','utm_term','utm_content'].forEach(k=>u.searchParams.delete(k));prompt('Clean URL:', u.toString());})();

This will copy the URL and strip out the UTM parameters and present a prompt of the cleaned URL for you to copy and paste into messages, emails, or social media without the tracking data.

Pretty cool, eh?

WPNewsman Full Text Newsletters

WPNewsman

If you’re looking for a free newsletter tool for your installation of WordPress and have less than 2,000 subscribers, the WPNewsman plug-in is fairly nice. They allow you to style your newsletters, entering shortcodes for post-specific content, as well as the post entries and separators. Once finished, you have the option of selecting by author, category, and date range, and creating a newsletter to use excerpts, fancy excerpts (which includes html), and full post content. Unfortunately, the full post content turns HTML into text and removes paragraph breaks, leaving one giant mass of text and html code, commingled. Read more

Twitter Cards

[d]online - Twitter Card Example

[d]online - Twitter Card Example

If you’re an avid user of Twitter, you’ve probably noticed the new links that show up on the bottom of certain tweets in your feed. The links say “View Summary” and allow you to read the title and excerpt of an article, along with a thumbnail of the article’s featured image. Those links are called Twitter Cards, come in three different varieties: summaries, photos, and play, and have two different layouts:  web and mobile.

Twitter Cards help increase your visibility and ensourage users to click to your site by providing more information beyond Twitter’s 140 character limit. Furthermore, design and development studios with Twitter Card functionality built into their site can provide a working example for clients to see how the same functionality can be implemented into their sites.

As with most of Twitter’s APIs, Twitter cards are fairly quick to implement. All you need to do is insert some metadata, test, and apply to participate. To make things even easier, Niall Kennedy has created a WordPress plug-in to automatically scrape your post’s title, permalink, description and image URL for summary Twitter cards. After installing and activating the plug-in, preview your Twitter card by pasting the post’s URL into their preview page.Lastly, you’ll need to apply to participate. Simply enter your site and contact information here and Twitter will reply within 5-10 business days.

Sightsmap

Using geo data from photos uploaded by users to Google’s Panoramio, Sightsmap generates an interactive heatmap of the most frequently photographed spots around the world. It reminds me a little of the Heat Map I made back in 2006, which could be applied to any geolocational data (including photos).

Window Focus and Blur

In working on the new Pantone Moods this week, I needed to add a listener to the widget to halt the realtime updates if a user no longer had the page active (meaning, they switched to another browser tab or application) to prevent unnecessary traffic to the server.

The application cycles through the ten most recent Moods posts and, upon nearing the end of its cache, queried the server for a new supply. However, if someone’s focus wasn’t on the page, it makes no sense to keep collecting and displaying results.

With ActionScript 3, this task is quite easy:

stage.addEventListener(Event.DEACTIVATE, onDeactivate);
stage.addEventListener(Event.ACTIVATE, onActivate);

And it’s just as easy when programming for Mobile Applications:

NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onActivate);
NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onDeactivate);

With JQuery, we can now accomplish the same thing for AJAX/PHP browser applications to no longer commit resources to updating a page that isn’t being viewed:

$(function(){
	$(window).bind('blur', function(){
		onDeactivate();
	});
 
	$(window).bind('focus', function(){
		onActivate();
	});
	// IE EVENTS
	$(document).bind('focusout', function(){
		onDeactivate();
	});
	$(document).bind('focusin', function(){
		onActivate();
	});
});

Note that the second two methods must be added because Internet Explorer uses focusin/focusout rather than simply focus/blur.