pbrisbin dot com
Vim Registers
Nov 7, 2010
When you use an extremely powerful text editor such as vi, vim, or emacs, there are often times where you’ll discover a feature or command that literally changes the way you write text. It’s not a very large leap to say that, for a developer, that can be life-changing.
I’ve recently made one such discovery via vim’s :help registers command. So I’d like to boil it down a bit and share it here.
Site Migration
Oct 10, 2010
20:24 rson: if there is anything i could ever suggest that you'd listen to, let it be this. do it. Wise words from someone who’s been there before. That’s rson telling me that I should move my site to some sort of framework. Make things cleaner, easier to maintain, and get away from that goddamn php I seem to be so fond of.
I had been thinking about doing this myself for quite some time. As silly as it sounds, I was unhappy with my urls. The whole site (from a purely url-appearance standpoint) was inconsistent. I dreamed for /feed/ and /posts/my_post/.
PHP Authentication
Oct 2, 2010
Recently I had the opportunity to write some php pages (some mine, some others) that required simple authentication. Nothing worthy of social security or credit card numbers; but just enough to keep something from being public.
In my case it was an admin script for the comments left on this site. I could view all of the most recent comments and click a link to mark any as spam. Doing this would remove all comments made with that IP address as well as blacklist it from any future additions.
XMonad Modules
Aug 31, 2010
This page is to serve as both an apology and an announcement. I’ve recently modularized my xmonad.hs. I’m sorry.
This is no longer true. I’ve since gone through a bit of a config cleanse, deciding it makes my life easier to live closer to defaults and not carry around a lot of extra configuration or features (that I don’t actively use).
As part of this cleanse, I’ve stripped my config back down to a very lean xmonad.hs that can easily live within the confines of a single file.
Haskell RSS Reader
Aug 15, 2010
I’ve been looking for a good Haskell project for a while now. The language is just awesome, and I’ve been getting more and more comfortable with it lately thanks to reading Real World Haskell. I even got the opportunity to write some haskell for a project at work (I’m a consultant on a Microsoft product, crazy).
I wanted something challenging but doable; something to keep me interested but still stretch my abilities. I had made some smaller utilities to manage the pages on my site, so I was getting familiar with parsing XML using some haskell libraries as well as starting to wrap my head around the IO Monad a bit more. Well, I just completed (what I think is) a slick little RSS reader using just haskell and dzen.
Web Preview
Jul 26, 2010
Recently, I made the switch (again) away from Uzbl as my main browser. Jumanji is a really nice browser in that it’s as light as Uzbl but feels more polished. It provides almost all of the features I had to build into Uzbl myself right out of the box. The tab-completion on the commands and urls is incredibly useful and negates the need for all the external history and bookmark scripts that I was using with Uzbl. The only part I really miss is (obviously) the controllability and configurability.
Scratchpad Everything
Jun 14, 2010
If you’ve read my recent post on using a scratchpad in XMonad, and if you’ve actually implemented this in your own setup, you probably know how useful it is. For those that don’t know what I’m talking about, you basically setup a simple keybinding that calls up a terminal (usually floated, but managed by its own specific manageHook) to be used briefly before being banished away by the same keybinding.
Raw Audio
May 28, 2010
I am not an android developer. I am not even a Java developer. What appears below is my attempt to share what I’ve learned using the android documentation, google, and copious amounts of trial and/or error. I apologize for mistakes; please offer corrections via twitter or email. I was upset when I first got my Droid Eris that the media player couldn’t load a url by default. I stream my mpd out to the world so that I can pick it up away from home. I had read that the built-in MediaPlayer object in android supports any uri that offered progressive download of media in a format supported by the device (both ogg and mp3 are supported). So why not expose this feature in the UI?
MapToggle
May 9, 2010
This snippet, when added to one’s ~/.vimrc, allows the toggling of commonly used options (i.e. things like hls or wrap) with a single keypress.
First, you’ll have to define the actual function:
function! MapToggle(key, opt) let cmd = ':set '.a:opt.'! \| set '.a:opt."?\<CR>" exec 'nnoremap '.a:key.' '.cmd exec 'inoremap '.a:key." \<C-O>".cmd endfunction command! -nargs=+ MapToggle call MapToggle(<f-args>) Then, map keys to that function:
MapToggle <F4> foldenable MapToggle <F5> number MapToggle <F6> spell MapToggle <F7> paste MapToggle <F8> hlsearch MapToggle <F9> wrap You’ll even get a nice notification in your vim command prompt when you toggle the setting
HTPC
May 1, 2010
I’ve recently finished work on an HTPC. The goal was to run a media center WM on a box that looked appropriate in my cabinet by my TV using a remote. That much I’ve done; all that’s left is tweaking the remote functions and adding to the collection.
Hardware 🔗The first thing I got was the case; I wanted one with a built in remote and a low enough profile to fit in my TV cabinet and not look out of place.