GitHub Supercharges ‘Gists’ for Quick and Easy Code Sharing

Image: GitHub.

Social coding giant GitHub continues to crank out the hits. The company recently made it easy to create new files through its web interface and now GitHub has launched a completely rewritten version of GitHub Gist.

Gists are a way to dump and share snippets and short pieces of reusable code — too short to bother creating a full-fledged Git repository, but something you’d like to save and share nonetheless — covering roughly the same use case as something like the much older Pastebin. Or at least that used to be the case.

The new gists are considerably more powerful. The rewrite actually turns gists into full Git repositories, so they are automatically versioned, forkable and usable as Git repos, complete with diffs.

Gists are also now searchable — complete with the ability to filter searches by language — and there’s a new Discover page as well.

Like normal GitHub repos, gists now offer the Ace code editor with its syntax highlighting and automatic indenting. While the Ace editor is nice, my favorite way to create gists is through editor plugins like this one for Vim, this one for Emacs or this one for Sublime Text 2.

Flickr Revamps Site Navigation and ‘Explore’ Page

Flickr’s redesigned Explore page. Image: Flickr

Hot on the heels of its awesome new iPhone app, Flickr has rolled out some changes to its web interface, revamping the navigation bar, which Flickr says makes it easier to get around the site. Flickr has also added the popular “justified” view of photos to the Explore landing page.

The Flickr blog says the changes are rolling out to everyone over the next few days, so if you don’t see them yet just be patient.

While Flickr says the new nav bar is “designed to make browsing Flickr faster and easier,” whether or not that’s true depends a little on which features you frequently use. The new navigation definitely simplifies things, but it does so by moving more than a few menu items off to obscure places. For example, options like browsing through your tags or looking at your collections have been moved out of the “You” menu to “More.” Similarly, the link to log out or get to your new mail have been moved to a new menu hidden in your user icon.

Flickr hasn’t outright deleted most menu items; they’ve just moved them to new locations. Sometimes that’s a good thing — for example, removing the “your” from all the options under a menu already named “You” makes sense — and other times it’s annoying, for example if you frequently browse by tags.

Less confusing is the new Explore page, which adopts the “justified” view that Flickr previously introduced for its Contacts, Favorites and Group Pool pages. The new layout tiles images to fit more photos at larger sizes in a smaller space and makes, well, exploring, more interesting.

Forget ‘Do Not Track’ — Protect Your Privacy Today With ‘DoNotTrackMe’ Add-On

The World Wide Web Consortium is currently working to standardize a “Do Not Track” mechanism to stop advertisers from following your every move around the web. Unfortunately, while the DNT tools are already supported in most web browsers, hardly any advertisers actually honor it. In fact, some advertisers seriously proposed an exception be made to DNT to allow web tracking.

If you’re serious about online privacy you’re going to have to do more than hope that advertisers voluntarily stop tracking you, you’re going to have to actively block them.

There are several tools that make it easy to stop the tracking. One of the best, DoNotTrackPlus, was recently renamed DoNotTrackMe (DNTMe). The new name arrives alongside a major upgrade that blocks more trackers, adds some nice analytics and offers per-site tracking reports.

The DNTMe add-on is available for Chrome, IE, Firefox and Safari. You can grab a copy for your browser from Abine’s download page. Once installed you’ll see a new “cross hairs” icon in your browser’s menu bar, which you can use to access DNTMe’s settings and any blocking info about the current page.

The DoNotTrackMe add-on for Chrome. Image: Screenshot/Webmonkey

DNTMe is easy to set up and defaults to blocking nearly everything. You can customize that by going through and allowing sites you don’t mind setting cookies. For example, I generally allow analytics packages like Mint or Piwik. You can also customize tracking on a per-site basis, allowing, for example, a site you trust to run analytics packages, but not every site you visit.

I currently use Ghostery to block online tracking, and it stacks up well next to DNTMe, though DNTMe does have one feature that might be an advantage for some users — blocking suggestions. That is, DNTMe suggests not blocking certain sites if blocking them has a high probability of breaking something on the page — say, Brightcove for example, which sets tracking cookies, but without which the site’s videos won’t work.

If you don’t mind enabling sites by hand and troubleshooting any potential problems yourself then either add-on will work. But if you’re installing a tracking blocker in someone else’s browser (who may not realize why a video suddenly doesn’t work) then DNTMe might be the better choice.

File Under: Browsers, HTML5, Mobile

New Simulator Showcases Mozilla’s Coming Firefox OS

Firefox OS’s lock screen, app screen and Twitter app. Image: Screenshot/Webmonkey

Mozilla has released version 1.0 of its Firefox OS Simulator, a new add-on for Firefox that makes it easy for web developers to start building apps for Mozilla’s coming mobile Firefox OS.

Despite the 1.0 status, Mozilla’s Hacks blog still refers to the Firefox OS Simulator as a “preview” — largely because Firefox OS itself is still in development. The Simulator, however, is much less buggy than the release I tested last month (and the problems with the Linux and Windows builds have been resolved).

If you’d like to get started building apps for Firefox OS, the Simulator now has an official page on Mozilla’s Add-Ons site. Once it’s installed and running you’ll get a preview of what Firefox OS will be like on a mobile device.

Locked out of Apple’s iOS due to the platform’s developer limitations and only recently beginning to create a truly competitive browser on Android, Mozilla’s long-term mobile plan is to create its own mobile operating system built entirely on open web technologies.

Although the company has since switched to the “Firefox OS” moniker, the original name, Boot2Gecko, neatly captures Mozilla’s take on the mobile operating system — essentially turning the Firefox web browser into an operating system.

That means building apps for Firefox OS is just like building apps for the web. HTML, CSS and JavaScript form the foundation and emerging web standards like WebRTC help bridge the gap between Firefox OS and device hardware.

To run the Simulator in Firefox open up the “Simulator Manager” by selecting the Firefox OS Simulator option in the Web Developer menu. Once the Simulator Manager is running you’ll see controls to start and stop the Simulator and a JS Console option to see any error messages as you build your app. If you need help getting started, this video from Mozilla walks you through the process step by step:

For more on how to get started using the Simulator and building apps for Firefox OS, see our earlier post as well as the Mozilla Hacks blog, especially the very thorough tutorial from Mozilla community member Luca Greco, who walks through nearly the entire process of building and testing an app on Firefox OS.

File Under: HTML, Web Standards

Proposed ‘Main’ Element Would Help Your HTML Get to the Point

Photo: Horia Varlan/Flickr

HTML5 has several new tags designed to make HTML more semantic — there’s <nav> for navigation elements, <header> for headers, <footer> for footers and now there just might be <main> to wrap around, well, the main content on a page.

The W3C’s HTML Working Group, which is charged with creating HTML, has accepted a proposal to add a draft specification for the <main> tag to HTML. The actual HTML spec hasn’t been updated yet, but you can read through the earlier, unofficial <main> docs.

The proposal has been around for some time, but former W3C HTML editor Ian Hickson opposed it on the grounds that its use case was too close to <article>. Since then the mailing list discussion has turned up enough supporters and use cases for a <main> element — including for a “reader” mode like that offered by Apple’s Safari, or to exclude non-main content from a search — that it looks like it will make the cut (Update: check out this W3C wiki page for more use cases).

It’s unlikely that <main> will make it into HTML5, which is about to reach the stable stage after which no new elements can be added, but it could make it to HTML 5.1, due to be finalized by 2016.

As Mozilla WHAT WG member Henri Sivonen writes on that group’s mailing list, “I think it was unfortunate that didn’t make it to the same round of added elements as <header>, <footer>, <nav> and <aside>… but it’s not too late to add it — browsers update faster than they used to.”

The purpose behind <main> is to give web authors a more semantic way to indicate a page’s main content. In many ways it mirrors what WAI-ARIA does with the “main” role.

In fact, because a <main> element would more or less bring the semantic power of ARIA’s role=main to HTML proper, you can get most of the benefits of the proposed <main> tag today, by just adding the “main” role to your primary content wrapper, something like:

<div role="main">
    <article>
        <h1>Top 10 Linkbait Headlines for Hacker News</h1>
        <time datetime="2012-12-11T03:21:22">December 11th, 2012</time>
        <p>... etc </p>
    </article>
    <div id="comments">
        <article>
            <h5>Comment Title</h5>
            <p>Comment body</p>
        </article>
    </div>
</div>

In this bit of pseudocode the main role tells the user agent — a web browser, search engine spider, etc. — that the primary content of the page is the article and the ensuing discussion in the comments.

So if you can do it already with ARIA why add <main>? The simple truth is that hardly any sites use ARIA roles. Because <main> is simple to use, web developers are more likely to use it and use it correctly (try searching for tutorials on how and when to use <article> and <section> to see the opposite effect), which in turn makes it a more reliable indicator for search engine spiders.