Bluetooth, FreeBSD 9.1, MacBook

In another post, I described how I got FreeBSD 9.1 running on my EOL’d 1st generation MacBook. It was quite a mouthful so I decided to put bluetooth setup instructions in their own post.

Continue reading

Posted in freebsd, hardware, macbook | 1 Comment

FreeBSD 9.1 by itself on a 1st gen MacBook

Apple thinks this laptop is obsolete. I think Apple gave up on it too soon.

If you’re like me and you felt “stuck” with an orphaned 1st generation MacBook, it’s time to get unstuck. If you can give up on the idea of running a solid installation of Mac OS (Snow Leopard is as new as it gets, and at 32 bits, it’s losing applications by the hour), a bright and only slightly labor-intensive future awaits with freely available flavors of *NIX.

Continue reading

Posted in freebsd, hardware, macbook | 2 Comments

Note to self: getting going with Amazon S3 on Mac OS

Like many posts on this blog, this one is meant more to help me remember than anything else. If others benefit, huzzah.

I’m in the process of dropping Dropbox. Amazon S3 is a fraction of the cost and is less limited. It’s cryptic as hell, though, so I anticipate a lot of hair-tearing while I figure it out.

Continue reading

Posted in S3 | Leave a comment

Back to Vim…with NERDTree? Nope, netrw.

It happens every few years: I get tired of Vim, I try another editor, I get proficient in said editor, then for no reason at all I go back to Vim. Familiarity? Comfort? Masochistic? Don’t know. But like a dog returns to its vomit, I return to Vim. And I love it all over again.

This round with Vim has been accompanied by lots of customization. Things like a custom status bar that changes colors depending on whether I’m in insert or command mode and an emacs-like “scratch” buffer that I can call up whenever I want with a few keys. Lame-o, I know, but I felt like each was quite an accomplishment. I haven’t customized Vim like this ever in the 17 years I’ve been using it so pfffthththtthh.

My latest effort, again for no particular reason other than “why not”: ditch NERDTree, the file explorer plugin favored by recent Vim converts, and use the built-in netrw functionality instead.

I never thought it could be possible to do this, but hey, turns out it works.

Tonight, I stumbled upon a StackOverflow webpage that details how to mimic a lot of NERDTree’s functionality (at least the stuff I used in NERDTree) using netrw. It mostly boils down to including the following code in your ~/.vimrc file:

" Toggle Vexplore with Ctrl-E
function! ToggleVExplorer()
  if exists("t:expl_buf_num")
      let expl_win_num = bufwinnr(t:expl_buf_num)
      if expl_win_num != -1
          let cur_win_nr = winnr()
          exec expl_win_num . 'wincmd w'
          close
          exec cur_win_nr . 'wincmd w'
          unlet t:expl_buf_num
      else
          unlet t:expl_buf_num
      endif
  else
      exec '1wincmd w'
      Vexplore
      let t:expl_buf_num = bufnr("%")
  endif
endfunction
map <silent> <C-E> :call ToggleVExplorer()<CR>

" Hit enter in the file browser to open the selected
" file with :vsplit to the right of the browser.
let g:netrw_browse_split = 4
let g:netrw_altv = 1

" Default to tree mode
let g:netrw_liststyle=3

" Change directory to the current buffer when opening files.
set autochdir

The “Default to tree mode” bit near the bottom was added by Yours Truly. It’s important to me for no reason other than I like collapsible trees better than netrw’s default mode.

As the code above says, hitting CTRL-E opens/closes the netrw tree. Highlight a file and hit ENTER and the file will be loaded in a window to the right of the netrw window. Hit CTRL-E again and netrw goes away. Lather, rinse, repeat.

So, so cool. I love ditching plugins, and NERDTree was always a bit of a pain in the ass. It never installed cleanly, it doesn’t work at all with Pathogen (a Vim plugin manager) in spite of claims to the contrary…goodbye. I’m a happy hippo again.

Posted in Vim | 7 Comments

When a client requests an “HTML5 website”

I may ruffle a few feathers with this one.

Continue reading

Posted in freelance, opinion, webdev | Leave a comment

Why I un-followed you on Twitter

I used to love Twitter. Now I kind of hate it.

A few Fridays ago I decided we did not need each other anymore and quit using it. I figured that was that, but in my time away I gave this hate thing a bit of thought and came to the following conclusion: Twitter in general is probably fine and I should start using it again, but my usage needs to be adjusted or I’ll be back at square one.

So here we are about two weeks later, and I’m back on Twitter. All is not rosy but there is hope for a better experience, starting with some major changes to my feed.

I can’t control what other people do with Twitter, but I sure as hell can control what parts I see.

This means it’s time to revamp the follow list. Again.

Unfortunately, this also means some of you have to go.

Continue reading

Posted in Twitter | Leave a comment

Regarding independence from web behemoths

Today, this website imploded. It didn’t kind of implode, it IMPLODED. Somehow the database went all screwy and content either disappeared from the site or was added to the site, depending on which page you were viewing.

It all started when I wanted to add an image to a blog post. Seemingly easy to do, in practice not so easy, at least on WordPress 3.5.1.

Continue reading

Posted in Modal, webdev | Tagged | Leave a comment

Edit posts and upload files in CodeIgniter sites

I’ve been having an absolutely SPLENDID time playing with Rails, but after a while away from PHP the urge to “go home” overwhelms. I guess it’s hard to warm up to web frameworks that are so…so…alien. Rails is great, but holy shiz, it’s…Rails.

I have more history with CodeIgniter. I like it, and I suspect if you’re reading this you either like it too or you’re stuck building a site with it. Either way, hi.

So, yeah. Editing and uploading. I’m going to assume your editing and uploading will be for posts (news, blog posts, etc.) and the files will be images for the posts. The ol’ 80/20 rule, right? I think I’m safe with this assumption.

Still with me? Read on.

Continue reading

Posted in webdev | 3 Comments

Highlighting multiple levels of navigation in Rails

Have you ever worked on a website that had a navigation menu in a sidebar? Sure, we all have. And did any of the menu items have a submenu? I’m guessing that’s affirmative. And did submenus need to appear only when their parent menu item was selected? And did the current submenu item and its parent menu item need to be highlighted simultaneously? Gonna throw the affirmative switch two more times.

I’ve done this a bazillion times in PHP sites, but recently I got to do it in a Rails site. And let me tell you, the solutions aren’t obvious in Rails. Luckily there’s no shortage of gems that will install over-engineered systems to handle this (IMO) simple task. Not being a fan of over-engineered systems unless I authored them, I turned to Google for help.

You know what? No one in the entire Milky Way Galaxy has ever done this before without installing a pointless gem! Shocking! Free Internet help strikes again!

So a-hacking I went. And I figured it out. And I didn’t have to install any bloatware to do it.

Boiled down to its essentials, I accomplished what I needed with four things:

  1. Named routes
  2. A helper that executes exactly one line of code
  3. A menu built with link_to anchors (no raw HTML, please)
  4. Absolute-positioned submenus (CSS)

Interested? Read on.

Continue reading

Posted in css, rails, ruby, webdev | Leave a comment

HDMI audio volume control on Mac OS Lion

When I got my new MacBook Pro, I decided to make the switch to HDMI for audio and video. It’s great, but there’s one irritant: HDMI’s digital audio is “normalized” so the system’s built-in volume control won’t work. Apps like iTunes offer their own volume controls but at a system level I was screwed.

That is, until I found Soundflower.

Simply put, if you are in the same predicament, do the following:

  • download and install Soundflower
  • reboot
  • start System Preferences and set your Sound output to Soundflower (2ch)
  • run Applications/Soundflower/Soundflowerbed and choose HDMI as your output

Voila, the system volume control will control HDMI audio.

Note that this bypasses some inner-digital-audio shenanigans so your audio output won’t be like buttuh anymore, but if you’re an audio neanderthal like me you may not care (my external speakers are in my monitor. That shows how much I care about computer audio).

(You may need to set up Applications/Soundflower/Soundflowerbed to start when you log in. Maybe not. I set it up because I want the Soundflower menu item available in the menu bar. Experiment if you’re curious.)

Posted in hardware | Tagged , | 15 Comments