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.

Why Programming For Kids

This is a guest post by Peter Armstrong. Peter is the Co-Founder of Leanpub and the author of 4 books, all of which were published in-progress. One of them was titled Programming for Kids. This post is about why Peter wrote that book.

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.

We Make the Web. Let’s Make It Accessible.

Building an accessible product sounds so obvious, yet it is very often overlooked or perceived as a separate entity of the product. Only after having worked on several accessibility-related projects did version 3.4 of pickadate.js come out with ARIA support. I didn’t implement it sooner due to a lack of time, but also partly due to me expecting it to be a daunting task. This was not the case.

Members: Get 50% off Codeship for 12 months

Our members save between $294 and $2,994 on their first year of continuous integration and deployment with Codeship. Become a member today for just $20 and get access to this and many more member benefits.

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.

Increase Productivity by Building Your Muscle Memory

If you’re learning Git, Vim, the infamous command-line, or a new syntax — the early stages of learning can seem frustrating. Typically, the challenge is not having an understanding of the core concepts of what you’re learning. End that frustration and learn to grow your muscle memory.

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.