pbrisbin dot com
Live Search
Jan 29, 2012
Note: this post describes a system for searching posts which once appeared on this site. It was removed in a fit of simplification. Please see Google’s site: keyword for any searching needs.
I’ve had some fun recently, adding full-text search support to the posts on the site to try and make a simple-but-still-useful archive.
I’d like to post a bit about the feature and how it works. It’s got a few moving parts so I’m going to break it up a bit.
UI Refresh
Jan 27, 2012
Astute readers may have noticed, the site looks a little bit different today. I know, it’s tough to discern, but if you look closely you might see… It’s now dark on light!
This is actually a small, tangential change that I made as part of a sweeping upgrade and cleanup effort. In moving to Yesod 0.10 (the 1.0 release candidate), I decided to take an axe to some of the bloatier areas of the site.
Static Refactor
Nov 22, 2011
Just a quick heads-up post about a recent site refactoring.
I decided to switch to nginx from lighttpd, let it do the static file serving, and at the same time drop all the complicated redirects I’d been carrying since going live on yesod. I also cleaned out the /static directory a little bit and streamlined its folder structure.
Below please find info about the deprecated routes that I’ve finally dropped (and some that were dropped a while ago).
Implicit Scope
Oct 28, 2011
No one can deny that rails likes to do things for you. The term “auto-magically” comes to mind. This can be a blessing and a curse.
For the most part, rails tries to give you “outs” – a few hoops here and there that, if jumped though, will let you do things in different or more manual ways. Sometimes though, it doesn’t.
Find In Batches 🔗One of the many ORM helpers provided by rails is find_in_batches. It will repeatedly query the database with a limit and offset, handing you chunks of records to work through in sequence. Perfect for processing a very large result set in constant memory.
Ruby Eval
Oct 25, 2011
Ruby’s intance_eval and class_eval are awesome tricks of the language that can really cut down on redundant code or let you do truly dynamic things that you’d have never thought possible.
There’s one piece of confusion around these methods that each book I’ve read goes about explaining in a slightly different way. None of them really clicked for me, so why not write my own?
The two entirely accurate but seemingly paradoxical statements are this:
Developing In OS X
Oct 13, 2011
As everyone who happens upon this site probably knows, I prefer to develop software in linux. The toolset is just better. Having and being proficient with a good shell is an invaluable tool for working with files. And regardless of what windows-ey, gui-IDE-ey developers like to say – software development is working with plain text files.
My work computer is now a Macbook. It’s about a million steps in the right direction from my last work-provided computer, but it’s still not linux.
Test Driven Development
Oct 2, 2011
With my recent job shift, I’ve found myself in a much more sophisticated environment than I’m used to with respect to Software Engineering.
At my last position, there wasn’t much existing work in the X++ realm; We were breaking new ground, no one cared about elegance; if you got the thing working – more power to you.
Here, it’s slightly different.
People here are working in a sane, documented, open-source world; and they’re good. Everyone is acutely aware of what’s good design and what’s not. There’s a focus on elegant code, industry standards, solid OOP principles, and most importantly, we practice Test Driven Development.
Lighttpd Reverse Proxy
Sep 10, 2011
This site was previously served via lighttpd using fastcgi. My haskell source was compiled using Network.Wai.Handler.FastCGI and the binary was placed at /srv/http/app.cgi to be handled by lighttpd’s mod_fastcgi.
I decided to switch it up and let Warp serve the haskell app directly, then proxy certain urls through to it via lighttpd.
This how-to will outline the steps needed to get this setup and comment a little bit on what all the moving parts do.
Comments
Jul 8, 2011
Note: this page describes a custom system for commenting once present on this site. As you can see, it no longer is. Please provide any comments via twitter or email. Thanks.
Recently I decided I no longer like disqus. It was a great hands-off commenting system, but it had its downsides. I decided to make a change.
I have my own commenting system which I wrote as a yesod module. The initial reason I didn’t go with this when I first moved to yesod (and lost my existing homebrew php commenting system) was because it didn’t support authentication. I knew that an unauthenticated “enter comments” box had like a 100 to 1 ratio of spam to real comments.
Mairix
Jul 3, 2011
Mairix is a nice little utility for indexing and searching your emails. Its smooth integration with mutt is also a plus.
I used to use native mutt search, but it’s pretty slow. So far, mairix is giving me a good approximation of the google-powered search available in the web interface and it’s damn fast.
As I go through this setup, keep in mind the example config files are designed to work with my overall mutt setup; one which is described in two other posts here and here.