Wisdom

The erudition of Inventive Labs, collected.

Archive / RSS
May 14

MacVim vs YAML

Recent builds of MacVim (23 to 26, at least) contain a broken YAML syntax file. You need to replace it with this one: yaml.vim.

It goes in $VIMRUNTIME/syntax, which normally resolves to /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax — but you can run :echo $VIMRUNTIME in MacVim to be sure.


May 12

Protecting the auto-migrating schema

If you’re using Err’s Auto Migrations, you’ll want to eradicate a default Rails task that clobbers your carefully-crafted schema file. Add this to your Rakefile:

Rake.application.instance_variable_get(:@tasks).delete(
  'db:schema:dump'
)
namespace(:db) {
  namespace(:schema) {
    task(:dump) { puts 'Schema dump disabled' }
  }
}


May 10

May 1

Apr 27

Apr 22
“It is good to know the truth, but it is better to speak of palm trees.” Arab Proverb

Apr 21

Tempfiles and very large multipart forms

Ignore the fact that problems with very large forms suggest a user interface refactoring is on the cards. When a form is multipart, the Ruby CGI module creates a Tempfile for many or all of the fields, which on some systems causes the process to die horribly emitting Last Words like:

Errno::EMFILE: Too many open files
This is a workaround that verges on a hack. Adding it to config/environment.rb in a Rails app at least allows one to proceed.
Process.setrlimit(Process::RLIMIT_NOFILE, 1024)
Brought to you by the Dept of Tuesday Morning Frustrations.


Apr 14
“The player itself is as stripped back as we could make it. We though carefully about what buttons we needed - why have a stop button, if you have play and pause? Why have FF or REW if you can drag the play head anyway. We added duration a while later, as it seemed useful, and the double-size icon is discreet, but works. And that’s it.” cityofsound: Monocle: design notes

Apr 9
.searchbar-engine-image {
  margin-left: -11px !important;
  margin-right: 2px !important;
  display: -moz-box !important;
  background-color: #fff !important;
}
How to use a Firefox3 GrApple theme and still see search engine icons (if you happen to be a Cmd-K, Cmd-Down type)

Apr 9