What is Reddit?


CGP Grey is wonderful at explaining things. This is as good an explanation of Reddit as you are likely to find.


Laurie Anderson's Farewell to Lou Reed


Poignant. Beautiful.

For 21 years we tangled our minds and hearts together.


Preparing for Git 2.0


After a recent update to Git I started getting the following message when doing a git push.

warning: push.default is unset; its implicit value is changing in 
Git 2.0 from 'matching' to 'simple'. To squelch this message 
and maintain the current behavior after the default changes, use: 

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use: 

  git config --global push.default simple

The push.default setting controls what happens when you do a git push without specifying a branch. When push.default is set to matching all local branches are pushed to their matching remote pairs.

The new default, simple, means that when you do a git push without specifying a branch, only your current branch will be pushed to the one git pull would normally get your code from.

As the message explains you can configure this setting in your .gitconfig file by using one of the two lines below.

git config --global push.default matching

or

git config --global push.default simple

I’ve gone ahead and set my push.default to be simple.


Hostnames


A wonderful resource to get you started with hostnames. For a time I used locations from “The Lord of the Rings” books. I once worked at a place that used rivers (test machines) and planets (production machines). I think you could make good use of the periodic table of elements too. Maybe use the atomic weight as the final part of the IP address.


Million Lines of Code


I know I’m late to this party, but the apparent size of the healthcare.gov site is astounding.


How to Build an RSS Feed for Jekyll


An RSS feed is nothing more than an XML document following a known format. Adding one to a Jekyll site is relatively easy and straight forward. As with all changes to your site’s structure it’s best to use your version control system to create a branch in case something goes horribly wrong.

Start by creating a new file at the root of your website. It should be a peer to your index.html file. Since the previous version of my site called the feed atom.xml that’s what I called it for the Jekyll version. The XML file has some meta information about the feed and then a loop which creates entries.

{% raw %}
---
layout: nil
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title type="text" xml:lang="en">{% site.rss_desc %}</title>
  <link type="application/atom+xml" href="https://zanshin.net/feed/" rel="self" />
  <link type="text" href="https://zanshin.net" rel="alternate" />
  <updated>{% site.time | date_to_xmlschema %}</updated>
  <id>https://zanshin.net</id>
  <author>
    <name>Mark H. Nichols</name>
  </author>
  <rights>Copyright (c) 1996-2013, Mark H. Nichols; all rights reserved.</rights>

  {% for post in site.posts limit:20 %}
  <entry>
    <title>{% post.title %}</title>
    <link href="https://zanshin.net{% post.url %}" />
    <updated>{% post.date | date_to_xmlschema %}</updated>
    <id>https://zanshin.net{% post.id %}</id>
    <content type="html">{% post.content | xml_escape %}{% include rss_footer.html %}</content>
  </entry>
  {% endfor %}
</feed>
{% endraw %}

You of course will need to change the site references to match your site, along with the author information.

Within the for loop that builds the individual entries this line is worth extra attention.

{% raw %}
    <content type="html">{% post.content | xml_escape %}{% include rss_footer.html %}</content>
{% endraw %}

All content must be escaped for XML. Here the post.content passes through a Liquid filter that properly escapes angle brackets and quotes for XML. I’ve added a footer that appears only in my RSS feed. Since this does not pass through the xml_escape Liquid Filter like post.content does, I had to make sure that it was properly escaped. The rss_footer.html files is in my _includes directory.

{% raw %}
&lt;hr /&gt;
  &lt;p&gt;
    You should follow &lt;a href=&quot;http://twitter.com/zanshin&quot; title=&quot;Follow me on Twitter&quot;&gt;me on Twitter&lt;/a&gt; and on &lt;a href=&quot;http://alpha.app.net/zanshin&quot; title=&quot;Follow me on App.net&quot;&gt;App.net&lt;/a&gt;. You should also subscribe to &lt;a href=&quot;http://twitter.com/zanshinnet&quot; title=&quot;@ZanshinNet on Twitter&quot;&gt;@ZanshinNet&lt;/a&gt; on Twitter for site updates.
  &lt;/p&gt;
{% endraw %}

It looks ugly but it works.

With the atom.xml file in place (and the rss_footer.html file too, if you are using one) simply regenerate your site and the feed will be created.


A Usable Credit Card Form


If your website’s credit card form has the words “no spaces or dashes” on it then you need creditcardjs. Simple, clear, usable, easy. Makes me wish my site had need for a credit card form.


Save Video from Dropbox to iOS Device


In preparation for a presentation she is giving tomorrow my wife wanted to load a short technique video on to her iPad. She had the video in Dropbox but was unable to save it to the device. Clicking on a picture and then on the “save to device” icon works, but for videos this icon is greyed out, it is unavailable.

Videos are sufficiently large that they aren’t saved to the iOS device, they are held in memory. Only by making them a favorite will Dropbox save them so that they reside in local storage.

Here then, is the trick to saving videos to your iOS devices from Dropbox. Select the video in Dropbox and let it synchronize to your device. Now tap the “star” icon to make it a favorite. Next tap the “Favorties” menu.

With the Favorites menu selected, the “save to device” option is now available. Tap it and select “Save to Photo Library”. The video is now available on the iOS device inside the Photos app.


Zero Motorcycles


All-electric motorcycles. Looks like something worth checking out.


Developing iOS7 Apps for iPhone and iPad


Even if you never write and release an iOS app, this Stanford University course is well worth the time and effort. Paul Hegarty is a superb instructor and the course is simply outstanding.