27 November 2012

X Clipboard Cleaner

Ever copy/paste from a web page and have the web page's style mess up the document you are pasting into?

That's pretty common for me.

Chrome/Firefox both preserve HTML style when copying text to the clipboard, and the following are common targets:

  • email
  • HTML-enabled editor widget
  • word processor document
My old process was:
  1. copy text/link from web page
  2. open up a text editor
  3. paste inside the text editor
  4. copy the same text again, this time without the style
  5. paste into the target location
I finally got sick of doing this manually all the time, so I wrote a script and put it in my app launcher bar.

Here is a gist with a script you can download:

04 October 2012

Rewriting Git History for Fun

For starters, if you're looking for a good JDBC connection pool, look no farther than c3p0 [github, doc].

Back a few years commons-dbcp wasn't very stable under load, so I went looking for an alternative and landed on c3p0.  Ever since then, Steve Waldman has been making it better and better.  Except for a 2-year hiatus when he wasn't working on it, he's been very responsive and willing to accept feedback and make improvements.  I'm seriously impressed by the project.

Anyway, since I've been a long-time user and fan, when I saw Steve put his software on GitHub, I went for a look.

Here is what I saw:

But what about all those prior releases in source snapshot form, that I was used to seeing from SourceForge?

I realized that perhaps I could contribute a little to the project, so I went and grabbed all the source release zips from SourceForge, created a local git repo, created a commit for each release, tagged it, and spliced Steve's recent work on the top.

Then I submitted a GitHub issue to ask Steve what he thought -- wasn't really a pull request because it was a completely disconnected history.

Here is the top of the new history:

And here is the earliest part of that history:

The tools used were:
- git config author.name - to give credit where credit was due
- git config author.email
- curl - to download all the releases
- unzip | sed - to figure out what the commit date should be
- git commit --date "[release date]" - to create the commits
- vi .git/info/grafts - to temporarily splice the new history on the old
- git filter-branch --tag-name-filter - to rewrite the new history permanently on top
- git tag -f - to replace the existing release tags to point to the new rewritten history
- git push --tags - to push it up to github

If I could consult for projects / companies to do this kind of VCS conversion work and actually get paid for it -- wouldn't that be awesome!

22 August 2012

Modular Apps

In the last 12 months, it seems like apps are getting a lot more modular.

I discovered news.me before Christmas last year -- which felt modular at an app level -- RSS => social, and the reciprocal daily digest.  In fact, I've been reading their daily Twitter summary basically ever since, even though I am effectively a read-only non-citizen on Twitter.

It's old news to a lot of people, but when I saw IFTTT and Wappwolf, my mind was blown.  This is modularity at an app level, not just a code level.

Here is a good outline of what kind of things are possible with this new breed of app-level integrator apps:


Minus the fairly major hole of lack of HTTPS support from IFTTT, it looks awesome.  When that's fixed I'll be investing a fair amount of time/automation into it.

10 January 2012

Awesome CLI gem: Commandable

Ever wanted to drive your ruby code with a CLI?  Well, the commandable gem makes it easy.

At first, I struggled with OptionParser in the stdlib, but I had to duplicate my option handling across CLI code and method invocation.  Then OptionParser didn't handle required parameters at all, requiring me to do required parameters in a non-DRY way.   Also, OptionParse doesn't do sub-commands, git-style, which I needed for the new git plugin I'm working on.

When I saw the pickled_optparse gem (from Mike Bethany), it appeared to solve the missing 'required parameter' feature.  And the subcommand gem seemed to allow for subcommands with their own options, git-style.  However, the duplication across option definition and method invocation was still present.  And even subcommand required you to hook up the command to the class/method that needed to be called.

Finally I found that the author of pickled_optparse had totally rethought CLI in ruby with his commandable gem.  And I really like what he did.

Now there is no real additional logic AT ALL in order to hook your ruby class up to the command line.  Now my option handling code will be in the place it belongs, in the code that is doing the command that I invoked from the command line.

The main awesomeness here is that commandable pushes the CLI code into the appropriate place in your ruby class -- it makes it hard to scatter CLI code all over the place.

My only beef with the gem are the following points:

  • it comes with colors enabled by default (unusual for a CLI)
  • it clears the screen by default when displaying help (when colors are enabled, very unusual and annoying for a CLI)
  • it appears to be hard to do global options like: "cmd --global subcommand [args]"
  • there is no support for parsing command CLI-style options into ruby hashes, but this is a minor nit, because that's what OptionParser is for, and it's easy to use inside the method

I fixed a problem where the screen was cleared even if you disabled colors, and I've pushed it up to my fork.

Here is my hello world that shows commandable in action:

And here's the output for a few representative cases:

04 January 2012

Open Genealogy Alliance

The manifesto posted at opengenalliance.org is something that I can very much support.

As part of RootsTech 2012, I'm going to sign up for an open hour to talk about open content licenses.  Anyone who has an interest in this topic, please get in touch with me and we can collaborate on the presentation.

I wonder what it will take to get some more visible & material signs of support from archives, libraries, societies, museums, or genealogical content companies on that site.

Something like the contributors listed on opencontentalliance.org.

Perhaps a link to the Better Than Free article is in order.  My personal resources are small, but if there is any kind of material support I can give to the opengenalliance.org effort, I want to do so.

Here are a few examples I could find of license information on open content sites (some related to genealogy, some not):

03 January 2012

Wish TwitterFeed supported auto-hashtags

After using TwitterFeed for a while, it's really cool!  Props to betaworks for an awesome tool!

All I want now is auto-hashtag support.

Just look for the last line of a post that is only hashtags, and #dont #take #arbitrary hashtags from the #body of the #post.

Don't bother with trying to convert blog post tags into hashtags -- I want a different vocabulary of hashtags on twitter vs. tags on my blog.

#twfeed #hashtags

02 January 2012

Open Geneological Research Vision

At its core, every sustained genealogical research effort turns into a global, loosely-connected, semi-structured distributed edits problem.

Open genealogical research needs a few conditions to thrive, I think.
  • significant stable corpus of research
  • everyone publishing under compatible open data licenses (CC-BY[-SA], CC0, or others)
  • agreed-upon standard data formats
  • ability to self-publish and curate your own research, independent of anyone else
  • ability to make corrections, and publish those corrections, independent of anyone else
  • ability to follow others' self-published research/corrections and pull it into your own research if you agree
  • mechanisms that encourage convergence of separate research efforts on the same research topics
Significant advances have been made in the last decade to enable certain aspects of online genealogical research.  The contributions of Ancestry and FamilySearch to providing indexed original records should not be underestimated.

The global family tree databases of Ancestry, Geni, FamilySearch, One Great Family, and others are also very significant.  The efforts of TNG and PHPgedview are especially significant in the control and latitude that they give to individual contributors in their efforts to self-publish.

However, online is not the same as open.  Open means more than just letting the general public search or get a login, it means that the dataset is licensed under an open license, and that this open licensing is adequately encouraged for subsequent contributions.

The ability for collaborative self-publishing is a primary concern that seems only partially implemented at this point in existing tools.

I have had this picture in my head for a while, and it seems the right time to start writing about it and doing something about it.

Seen, Persuaded, Embraced, Confessed

One verse in Paul's description of the fathers of faith stood out to me:
Heb. 11:13 These all died in faith, not having received the promises, but having seen them afar off, and were persuaded of them, and embraced them, and confessed that they were strangers and pilgrims on the earth.
I've watched true followers of Jesus Christ demonstrate their devotion to Him in ways that involve all four elements of conversion.  In fact, I'd be willing to take this verse as a starting point for describing what true conversion is like.

It seems to me that this pattern of increasing commitment and devotion is tightly involved in the process of understanding what one's personal mission in this life is.  When it finally gels, there isn't anything else but just to go do your life's work, and give your whole self for your Lord Jesus Christ and what He's called you to do here.