April 2009
1 post
Logging the domain with Apache wildcard virtual...
If you have an Apache virtual host set up to respond to a number of different domains, the two typical access log configurations (common and combined) do not include domain information. So you can see what resource is being accessed, but not for which domain. This becomes significant if you are serving different content based on the domain, as we do with Blueprint.
We use the NCSA combined log...
February 2009
3 posts
Prototype.js Function#wrap →
A little gem I only found just now in the prototype.js library.
htop - an advanced command-line process monitor →
" Show spaces at the end of lines
hi RedundantSpaces ctermbg=DarkGrey...
– Pop it in your .vimrc.
September 2008
1 post
dpkg-reconfigure tzdata
– Change the timezone in Ubuntu.
June 2008
2 posts
New in Rails 2.1.0 →
New in Ruby 1.8.7 →
May 2008
7 posts
Alarming events in the life of your Rails project #1: you’ve just written a Rake task labelled :armageddon. True story. Actually, some theologians posit that the event in question has already occurred, when (unrelatedly) I dropped down to SQL this morning and executed DELETE FROM users WHERE god IS NULL.
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.
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' }
}
}
Processing.js →
Labnotes » Git forking for fun and profit →
April 2008
8 posts
Using Visor →
Nice and neat for the part-time Terminal user (ie, me).
It is good to know the truth, but it is better to speak of palm trees.
– Arab Proverb
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...
The player itself is as stripped back as we could make it. We though carefully...
– cityofsound: Monocle: design notes
.searchbar-engine-image {
margin-left: -11px !important;
margin-right: 2px...
– How to use a Firefox3 GrApple theme and still see search engine icons (if you happen to be a Cmd-K, Cmd-Down type)
Let my People Have Root →
I am at times wary of Joyent, but on this subject I agree with them. We’re looking forward to trying out some Google Apps here at the Labs, but our inclination to create one is born of merely mild curiousity, which we probably won’t indulge. Certainly nothing serious, for the reasons given in the link.
March 2008
6 posts
There’s a pretty simple way to place a losing bet in the technology game. Try to...
– Living with the Trojan iBrain - Times Online
Hypertextopia →
Somewhat related to this and to something we’ve got in the pipeline.
Forgiving BlueCloth
class BlueCloth < String
def transform_code_spans_with_forgiveness(str, rs)
begin
str = transform_code_spans_without_forgiveness(str, rs)
rescue BlueCloth::FormatError
# Forgive unmatched backticks
end
str
end
alias_method_chain :transform_code_spans, :forgiveness
end
Now when your users have unmatched backticks in their marked-down text, BlueCloth will...
iphone-haptics →
Haptics is where the device buzzes when you tap stuff. Not convinced. Still, interesting.
Home — gitnub — GitHub →
Some web developers are like the old and vaguely racist notion of domesticated savages — at the slightest opportunity, they revert to native.
Penguin Classics →
A really clever Tumblr theme by friend o’ the Labs, Max Wheeler.
February 2008
17 posts
SFUCKEN →
Virginia pointed out that Is your new bicycle has a bit in common with this expletive generator I made a few years ago. I’m slowly coming around to the IYNB meme. Probably get there by the time it’s passe.
Ebb →
Another entrant in this madcap race.
Constructing email newsletters from RSS feeds →
This is a clever solution to something I’d (of course) imagined something much more complicated for.
ExpanDrive →
Anything that would enable me to use that copious amount of Dreamhost space seamlessly would be a Good Thing.
Multi-Safari →
This does not mean that Joseph excited about doing legacy testing for a browser that, in his opinion, should not exist at all. Still, nice.
castanaut at master — GitHub →
GitHub seems like a solid piece of work. Certainly getting castanaut on board was painless.
Castanaut: Automate your screencasts with a Ruby... →
(Made by us!)
rush, the Ruby Shell →
I probably have too much invested in bash to switch shells just now, but this might be worth keeping an eye on. See also: fish.
AirPort Disk Agent for Leopard →
If you want Airport Disks to connect automatically on start-up — if, for example, you have a remote iTunes Library stored on an Airport Disk, and you don’t want to it sprout an exclamation mark for every track — then you need this archive. More info here.
It took me two months of tracking and hunting to capture this elusive little beast. It was taken from...
Mr Bones →
A successor to Hoe, which was unnecessarily viral. (In fact, I’m actively weeding out dependencies on any Ryan Davis code here at the Labs.)
Labnotes » Gem RDoc on Leopard →
Of course, remembering port numbers is not everyone’s thing.
So after doing this you could create /etc/apache2/apps/rdoc.conf:
<VirtualHost *:80>
ServerName gem.docs
ProxyPass / http://localhost:8808/
ProxyPassReverse / http://localhost:8808/
</VirtualHost>
Make sure /etc/apache/httpd.conf has these lines near the end:
NameVirtualHost *:80
Include...
X.V and your ~/.irbrc
By the way, in Leopard if you want your own ~/.irbrc, you can still use the system-wide one (which has persistent history, tab-completion and other stuff). Just put this line at the top of your ~/.irbrc:
load '/etc/irbrc'
A little something for your irbrc
class Object
def specific_methods
(self.methods - Object.instance_methods).sort
end
def self.specific_class_methods
(self.methods - Object.methods).sort
end
end
Use it like so:
>> "foo".specific_methods
=> ["%", "*", "+", "", ">", ">=", "[]", "[]=", "all?", "any?", "between?", "capitalize", "capitalize!", "casecmp", "center", "chomp", "chomp!", "chop", "chop!",...
Lots of computer scientists had been chiseling away at the problem for years,...
– ongoing · XML People
Wisdom is a river, not a pool.