kmarekspartz

Expanding our capacity to respond to unforeseen changes

What if there were a startup to find your lost keys?


Losing keys is an ordeal, but thankfully I'm not going through it presently.

What if each set of keys had a unique identifier on it? It turns out, they nearly already do. They keyhole and the teeth of each key provide us with the information we need.

If the average person had a way of cataloging this information, they could get replacements from a locksmith. Perhaps there should be an app which takes pictures of your keys and stores this information for you. There are already methods for reconstructing keys using pictures from afar. I am assuming it would be even easier to get good photos when the photographer and the key owner are the same person.

Reconstructing existing keys may be easier than switching out all of your locks, but since the original keys are still out in the world somewhere, you may need to switch out all of your locks anyway. What if we could get our original keys back?

Perhaps there needs to be a service where you can upload information about a set of keys and your contact information. Then when someone finds your keys, they would upload images of your keys and get your contact information.

In order for someone to know to go to this service, either everyone would need to know about it and use it, or there would need to be a key tag advertising this service, and providing a bar-code identifier for the set of keys. However, a key tag could simply have the phone number or some other contact information, so this service would be unnecessary. Perhaps someone should sell low-quantity key tag printing for contact information.

How I use Widely to deploy Hakyll sites


I've been using widely and Hakyll together for a little while now for a few different sites.

The quickest setup is to cd into _site and widely sites:create <SITENAME>. However this setup involves a lot of cd-ing for deployment. In order to minimize cd-ing, I added a deployCommand to my Hakyll configuration as follows:

config = defaultConfiguration
    { deployCommand = "pushd _site && widely push && popd"
    }

This makes building and deploying:

./site build && ./site deploy

However, widely creates a .widely file in its source directory, which in this case is Hakyll's _site, and I wouldn't store _site in a version control repository for the site. Ideally, the .widely file would be stored in the root of the repository. We can put the .widely there and have Hakyll move the .widely into _site.

To do this, I initially added ".widely*" to the list of file identifiers going into the idRoute and the copyFileCompiler. This doesn't work, and for a few reasons.

First, the globs don't work the way I thought they do. I changed it to (fromRegex "\\.widely.*")) instead.

Second, Hakyll ignores dotfiles by default, so we need to change the ignoreFile function in the configuration:

config = defaultConfiguration
         { deployCommand = "pushd _site && widely push && popd"
         , ignoreFile = ignoreFile'
         }
  where
    ignoreFile' path
        | ".widely"    `isPrefixOf` fileName = False
        | "."    `isPrefixOf` fileName = True
        | "#"    `isPrefixOf` fileName = True
        | "~"    `isSuffixOf` fileName = True
        | ".swp" `isSuffixOf` fileName = True
        | otherwise                    = False
      where
        fileName = takeFileName path

I've been very happy with this setup, though there remains one issue: With the .widely file in multiple locations, occasionally I'll accidentally call widely push in the root of the repository. This isn't a huge issue as widely asks before making changes. When I make this mistake, widely detects quite a few files that shouldn't be included. I think it'll just take getting used to calling ./site deploy instead.

Welcome to Kyle Marek-Spartz's blog!


Hello!

This blog is to provide a venue for a variety of ideas that have been bouncing around for a while, with no real place to share them with the world. I hope you enjoy it.

I'm not sure exactly what the breadth of content will be, so stay tuned.

At this point, I don't have a comments system set up, so please contact me with comments.

Enter your email to subscribe to updates.