Malicious enjoyment derived from observing someone else’s misfortune
 

Tag Archives: programming

More Madness converting to Mephisto

I changed all my typo:code tags to filter:code today: Article.find(:all).each {|a|a.body.gsub!(‘typo:code’, ‘filter:code’);a.save};

Cheating on ERB with HAML

Flash!! Zoom!! !!! %html %head %link{ :rel => “shortcut icon”, :href => “/favicon.ico”, :type => “image/x-icon”}/ %title= “Wallpaper Love Factory :: “+controller.controller_name.capitalize = stylesheet_link_tag ‘wallpaper’ %body .header#header = render :partial => ‘layouts/header’ .menu#menu= render :partial => ‘layouts/menu’ .content#content= yield It’s so easy! Anyone can do it. HAML is sweeping the rails world like a wildfire of chicken, and everyone wants the biggest piece. I decided to try it last night on my new wallpaper site, and found that it’s extremely [...]

Fighting Spam on Typo with Logic

I realized that spam bots are stupid, and spammers are generally not the best programmers, so a while back I made a system to fight the intolerable spam plaguing us. I noted today that Robby on Rails was having this same problem, and I figured I might as well share what has worked for me. First, I added this line to my views/articles/_comment_box.rhtml: # <td><p><label for="comment_body">Your message</label></p></td> # <td valign="top" colspan="2"> # <%= text_area "comment", "body" %> # </td> # [...]

Route Resource Magic Pants

Apparently, you can make things like users_path and groups_path work if you do this in routes: map.resources :group Finally. Now I can continue adding groups to Beast.

My Timeline

So today I started a timeline using some really cool software. It’s going to catalog my life as accurately as possible. I think I might add some authentication to it for private events, and make a separate event file for those. Giving away too much is not usually a good idea. It is now available here, and I will try to make a sweet bit of Camping/Rails/PHP to control the data. Maybe I’ll make a full-fledged MySQL backend for it, [...]