Build beautiful programming books with Git and Markdown #

There’s a lot of innovation (and iteration) going on in the online publishing space. GitBook continues that trend by offering a command line tool built specifically for creating programming book and exercises.

You write your book in Markdown and from that GitBook can generate a static website, PDF, eBook, and even JSON. Here’s what the results look like:

GitBook Preview

A tool to check your site for The Heartbleed Bug #

A very nasty OpenSSL bug called Heartbleed was made public yesterday. Millions of websites around the world are leaking private information despite using SSL/TLS.

Is your site vulnerable? Find out with Filippo Valsorda’s Heartbleed Test.

Here’s a link to our test for thechangelog.com. We run on Ubuntu so we followed these update instructions and in 3 minutes we were fixed.

Remediation steps differ depending on operating system, but with Heartbleed Test we can all make sure we’ve patched up properly. Thanks Filippo!

UPDATE: Filippo provides a web-based tool to check your site, but we suggest downloading the source and running the tool from your own trusted host. Here’s a How To if you need help! (Thanks to André Wendt for the suggestion and Jan Lenhardt for the gist)

SVG Loading Indicators! #

Useful and stylish SVG-based loading indicators that are as easy to use as:

<img src="loading-balls.svg" alt="Loading icon" />

Oh, and make sure you spot the Cylon

Clean your HTML with Bleach #

When developing for the web a time will come when you’ll need to sanitize HTML. If you need to do this in Python then you should check out Bleach.

Bleach is an HTML sanitizing library that escapes or strips markup and attributes based on a white list. Bleach can also linkify text safely, applying filters that Django’s urlize filter cannot, and optionally setting rel attributes, even on links already in the text.

Even if all you want to do is apply rel='nofollow' to the links in user generated content, Bleach has you covered. So, check it out the next time you need to clean some HTML.

ngxtop: real-time metrics for nginx server #

ngxtop is shaping up to be one of those tools that I didn’t even know I needed, but now I won’t know how I ever lived without it.

ngxtop parses your nginx access log and outputs useful, top-like, metrics of your nginx server.

Need we say more? Check the readme for some nice examples of what this Python script is capable of.

Easily Build Mac OS X Status Bar Apps With Python #

From time to time, the thought has a occurred to me that it would be cool if I could build simple native apps with Python. So, I was excited when I found rumps.

Ridiculously Uncomplicated Mac os x Python Statusbar apps

You can’t make full blown apps, but if you’ve ever had a status bar app idea you can use rumps to build it.

Metalsmith: a static site generator with lots of potential #

Segment.io’s Metalsmith doesn’t excite me because it’s a static site generator. It excites me because its everything-is-a-plugin philosophy turns it in to a potential swiss army knife for any project that manipulates a directory of files.

It could be a project scaffolder. It could be an e-book generator. It could be a build tool. It could be a documentation tool. It could be something I’ve never even heard of before.

Check out their examples to whet your imagination.

Bunch lets you use a Python dict like it’s an Object #

Sometimes, in Python, I wish I could access dicts as if they are objects. Bunch makes it easy to do that.

A Bunch is a Python dictionary that provides attribute-style access (a la JavaScript objects).

Bunch acts like an object and a dict.

>>> b = Bunch()
>>> b.hello = 'world'
>>> b.hello
'world'
>>> b['hello'] += "!"
>>> b.hello
'world!'

And it even plays nice with serialization.

>>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!')
>>> import json
>>> json.dumps(b)
'{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}'

This approach isn’t for everything, but if you want a dict that acts like an object checkout Bunch.

Add WordPress-style shortcodes to your Ruby blog #

One of WordPress’s strengths is the ability to give non-coders a way to generate custom data with the use of shortcodes. Shortcode elegantly brings that classic feature to the Ruby community.

The gem notes using Parsing expression grammar instead of regular expressions to improve the readability and testability of the code. It supports both block tags and self-closing tags, and adding shortcodes is as easy as adding a partial.

%blockquote
  %p.quotation= @content
  - if @attributes[:author]
    %span.author= @attributes[:author]

Shortcode also supports custom presenters for more complex tasks like image galleries. Take a look at the documentation on GitHub.

Quickly reduce the amount of data your node API returns #

When designing an API, it’s easy to forget that not everyone has a cable modem. What if a client could easily request exactly the data it needed. That is what JSON Mask aims to do.

This is a tiny language and an engine for selecting specific parts of a JS object, hiding/masking the rest.

A code example helps to demonstrate how this works.

var mask = require('json-mask')
mask({p: {a: 1, b: 2}, z: 1}, 'p/a,z')  // {p: {a: 1}, z: 1}

JSON Mask seems like an interesting way to reduce the amount of data we send down the pipes.

Glyphr is a free, html5 based font editor #

Looks like the Glyphr team set out to lower the barrier to get in to font design.

Professional font design programs are very complex, and quite expensive. Glyphr is accessible, streamlined, and made for font design hobbyists… and it’s free!

At first glance, it appears that they’re off to a great start. Check out the sandbox if you want to play around with it.

Dominate HTML in Python #

Have you ever wished that you had a sweet little API to generate HTML in Python? Dominate is probably what you are looking for.

Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API.

Now, I’m a self admitted HTML purist, but look at how the dominate API works.

from dominate.tags import ul, li
list = ul()
for item in range(4):
    list += li('Item #', item)

If done correctly HTML generators can blend in with your code nicely.

Checkout Dominate the next time you’re looking for a nice native HTML generator API for python.

Pickadate. Any date. #

If you have need for a mobile-friendly, responsive, and lightweight jQuery date & time input picker, look no further than pickadate.js. Amsul pinged us to say that he just released version 3.4 of his popular library and is quite proud to say that pickadate.js is now ARIA-enabled. He states:

This is an update I would highly recommend everyone to get because of how crucial accessibility is.

If you’re already using pickadate.js, this is a great time to upgrade. If not, give it a look!

Node mock in-memory file system for testing #

In Node, the fs module provides file system access. Tim Schaub’s mock-fs module allows Node’s built-in fs module to be temporarily backed by an in-memory file system during testing.

From Tim’s post Mocking the file system:

When writing tests, it’s common to run up against code that relies on file system access. People often end up including a bunch of test fixtures along with their code. Tests might create some temporary space, copy fixtures in place, run code, make assertions about what was read or written, and then clean up. The result can be fragile when working across multiple operating systems and leads to long test run times. In cases like this, a mock file system provides an alternative.

Checkout the source on GitHub.

Better Google Web Fonts #

A sim­ple one-off page to browse multi-variant type­faces. Google Web Fonts is full of awesome free, open source fonts. It’s also full of fonts that may not be worth your time. I’ve been using this to mine Google based on his metrics, and start there.

I quickly discovered that a good metric for higher-quality fonts was the presence of four or more alternates. The Google Web Fonts directory does not allow that type of filtering, so I built this simple one-off page that allows you to browse typefaces that are true families. – Matt Wiebe

Would be neat if each font in the index had its own page with Dribbble shots tagged with “PT Serif” and an email with updates on these worthy fonts.

The source is on GitHub if you want to contribute.


Fun fact. We used Yanone Kaffeesatz in our logo.

Proposed Microformat for site’s source code, rel=“source” #

How awesome would it be to use rel="source" to link a document or project to it’s source code?

From Jeremy’s post:

We were talking about how it would be nice to have some machine-readable way of explicitly marking up those kind of links, whether they’re in the head of the document, or visible in the body. A rel attribute describes the relationship of the current document to the linked document. So I’ve proposed rel="source".

If you agree with Jeremy share his post and help spread the word.