On the first day of Kirby Week, Four Island gave to me: A tutorial on how to get Rails 3.

Oh my god, it's Kirby Week. That. Was. Fast. I just remembered yesterday (which was the first day of Kirby Week, but I didn't have to post on Sunday anyway) that I usually post once a weekday for Kirby Week (except Friday, which I have traditionally failed at life on :P ). Right. Anyway, since I have been doing a lot of work with Ruby on Rails recently with Four Island 3, I think I should focus this year's Kirby Week on Rails! :D

Now, I have been using Rails 3 to develop Four Island 3 (OH MY GOD THE THREES! RUN AWAY!!!!!) and it's quite nice. It doesn't seem beta-ish at all, and do you know why? Because it isn't beta-ish at all! :P Today, I'm going to show you how to install Rails 3 (as well as some other stuff) onto your computer because Rails 3 is pretty awesome yo dawg business. O_O

Now, as you may know, Rails 3 requires Ruby 1.9. Ruby 1.9 is pretty awesome, but it breaks a lot of old Ruby programs, so we're going to install it alongside your system Ruby installation by using something called "rvm", or the Ruby Version Manager. Note that this will only work on UNIX-based OSes, that means Linux and OS X (no Windows! :P ). First, ensure that you have "git" installed. Second, open a terminal and run this command:

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

It seems pretty mysterious, but all it does is download rvm. You're not quite done yet--you have to inject rvm into your bash session. To do this, follow the instructions that the above command showed you, or just add this line to your ~/.bash_profile file:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

Next, open a new bash session or just source the profile (source ~/.bash_profile) to load rvm into your session. Finally, just ensure that everything worked by running the following command:

type rvm | head -1

If it replies with rvm is a function, then congratulations! You've successfully installed rvm, and not much else yet! :P Just to keep things safe, run rvm notes to see if there's anything special you have to do for your particular operating system (for instance, I believe you need to have Xcode installed for OS X).

Great! Now, let's install Ruby 1.9.2. It's fairly simple--just run the following commands:

rvm install 1.9.2
rvm --default use 1.9.2
rvm default

The first line is the one that will take a while, but it's a fairly simple process overall--it just installs Ruby 1.9.2, sets it as the default ruby and then chooses it to be the interpreter for the current session.

Finally, let's install Rails 3. Run the following command:

gem install rails

Note that you should never use sudo when installing gems when you are using rvm. Anyway, yes, it really was that easy. Now that you have Rails 3 installed, you should explore the great wondernesses of its wonderness! :P You should read that page. Yes. Anyway, I'm going to be writing about some cool tips and tricks of this you can do with Rails this week and it's going to be great. :D And, now that you have Rails 3 like I do, you can be sure they'll work! :P

Oh, and if you ever want to switch back to your system's default Ruby, run this command:

rvm use system
Hatkirby on
πŸ‘ 0 πŸ‘Ž

Okay, so, wow! It's December already! Please allow me to say:

WHAT THE AMANDA FRIBBING PALMER?!?!!?

Yes, this year has gone by incredibly quickly, though if you notice, we had a much better year this year than 2009. 2009 was just plain... bad. But 2010 isn't quite over yet, so let's keep things going semi-well!

Anyway, first of all, I just realized that 24 Ways started again! IT REALLY IS THE CHRISTMAS SEASON! :P It really is quite a good blog, so if you're not subscribed to it yet, make sure you do so before the letter self-destructs!

Next, I want to apologize to yet another person who commented on the Annetenna post and whose comment was deleted. My blog software majorly sucks and I'm working very hard at rewriting it. If the author of the comment is reading this (the comment mentioned something about the author's versions of the MP3s getting ruined and contained a link to the Internet Archive), please resubmit your comment and I'll ensure it gets through.

Do you know what else is fun? NONSENSE! I've been playing with it a lot recently and it's come up with some humorous quotes:

* JAL is melting Hatkirby's pants
Smiley: What the fsck
Bluemonkey: Good day fine sir or madam
Drifty: I am useless when I am sawing a Douglas.
Tamasys: THE CHEESE GATE IS OPENING!
Bluemonkey: Do you want a nicely skinny Smiley's Bender?
Tamasys: I'm sitting on Ozzyfrog in bathroom
Bluemonkey: ....bie
* Drifty is asking "Do you want a mindnumbingly immense protein bar?"
Bluemonkey: ....bie
Drifty: I hate Pyro because she's so fat!
* Ozzyfrog is eating Mary Poppins
JAL: GAH
JAL: I desire JAL!
* Tamasys is being square
* Bluemonkey thinks Tamasys is round
Pyro: I love Bluemonkey because he's so Oklahoman!
Sammi9494: My computer is going to a toilet because it is so white!
Hatkirby: I collect bootleg drugs.
Pyro: WHERE IS MY CAT????
Gryphic: It's in a fireplace!
Pyro: YOU PHONE! I PUT YOU THROUGH A FIREPLACE, AND THIS IS HOW YOU TREAT ME?
* Gryphic is found ugly 253 days later at The Land Of Coincidence with a printer in her mouth
Pyro: I despise Gryphic!
Drifty: Your mom is mushy?!?!?!! 
* Drifty is found dead 32 days later at a salad bowl with a Cooaso in her mouth
* Pyro is listening to Grace Kelly with her Illinoisan Jolly Ranchers 
* Pyro thinks Pyro is great
* Pyro is about to sing 
* JAL runs far away

Yes. Lolwhut? :P Anyway, that was a pretty random post to start a pretty random month. Yes. Here's your cookie. steals a house

Hatkirby on
πŸ‘ 0 πŸ‘Ž

I know, I know, it may not be the best of titles as one of OS X's most criticized elements is how bad it is at window management, but hear me out. Okay, so Snow Leopard has been the latest version of Mac OS X for quite a while now and it's the OS X I fell in love with and the OS X I currently use. I really do enjoy Snow Leopard. Then, about a month ago, I sat around on October 20th, waiting to hear what Apple was going to announce because we all knew it would be a new version of Mac OS X. Yes, we were right. But, no, I was not satisfied at all with the news of Mac OS X Lion, and here I am, finally about to explain it. :P

Macs have always been criticized (quite frequently by me) as being too different, but since discovering that I love Macs, I've realized that it's not supposed to be the same as anything. And why should it? There's no reason that Mac OS X should be the same as Windows or Linux, and there's no reason it should have the same paradigms. One huge paradigm difference I've noticed between Windows and OS X is window management.

In Windows, it's not only easy to do, but it's practically expected of you that you will pretty much have your windows maximized at all times, unless you're doing something that requires you to see two windows at once. Windows is a huge fan of the MDI (Multiple Document Interface) paradigm which allows you to have one window maximized, but able to see and interact with a lot of information.

Image

By contrast, OS X's window management paradigm is centered around SDI (Single Document Interface) windows, and a lot of them. In OS X, it's not fashionable to have a window filling your screen--you can do many things at once and the windows are all there! In fact, one of the biggest annoyances that people switching to the Mac find is that they expect the three stoplights in the top left of every window to act similarly to the window control buttons in the top right of every window in Windows, probably because they look similar. And yes, for the most part, they do act similarly, but the green stoplight does not do the same thing as the maximize button--it simply resizes the window to best fit its contents.

Image

Now, as I'm sure you'll notice, the SDI paradigm doesn't really work out too well on my laptop with its tiny 1280x800 screen. While I totally agree with the Mac's SDI paradigm, I believe it only really works well on desktop computers because they have much larger screens. On computers like my laptop, the screen is so small that I normally have to keep certain apps' windows maximized all the time like Mail, Safari and NetNewsWire. But on desktop computers and laptops that are hooked up to larger screens (which I totally plan to do some day! :D ), SDI works fine and is so awesome.

One of OS X Lion's most touted features is the addition of full-screen modes to a whole ton of apps. This worries me. I mean, yes, I can certainly see it being handy on a laptop, but when I get my LED Cinema Display and hook my laptop up to that so I have a bigger screen, what then? I don't want full screen apps with such a large screen--I want my SDI paradigm back! The iPad is the iPad, but the Mac is the Mac--they're two completely separate things and I really don't think OS X needs to take anything from iOS.

Yes. Change is always bad. :P

No, but really, this really bothers me. I have strange dreams of having a large-screen Mac and writing a post on Four Island with MarsEdit while reading an email and surfing the web at the same time as chatting with friends and doing a little programming in TextMate. No, seriously, I'm not weird. :P

This isn't the only problem I have with OS X Lion, but it's a pretty big one. One of the other problems I have is the iOS-ization of some built-in apps, such as Mail and iCal:

Image

Doesn't that look... just... bad? Snow Leopard stole my heart with its colorful, sleek interface and iOS just does not work like that. iOS belongs on the iPhone / iPod touch / iPad / Apple TV / WHATEVER, and Mac OS X belongs on the Mac. Let's keep it that way, shall we?

I'd like to make one last note regarding the criticism of Mac window management, specifically with regards to resizing windows. Sure, you can only resize Mac windows from one corner, and yes, that is fairly annoying, but it's not too bad. On the other hand, Windows programs, when not maximized, have a hideous border around them that allows you to resize in any direction. No. Just.... no. There is no real middle point, though, because GNOME on Linux allows resizing from any direction without a hideous border and it's just impossible to resize a window without either clicking through to the background or clicking in the window. Yay for Macs.

Finally, I'd like to say: Happy Thanksgiving and Happy Birthday To TimTam! :P

Hatkirby on
πŸ‘ 0 πŸ‘Ž

iOS 4.2.1 (not iOS 4.2--that was never released because it had quite a few holes in it) for iPhone, iPod touch and iPad was released today! This brings AirPrint and AirPlay to all devices as well as multitasking and folders to the iPad! While this certainly is a great upgrade (especially if you have a Mac and have used the AirPrint Hactivator which will allow you to AirPrint to any printer that is shared by the hactivated Mac (otherwise you're restricted to a very limited number of HP printers)), we warn you:

IF YOU RELY ON A JAILBREAK OR UNLOCK, DO NOT UPGRADE YET.

Yes, while you may have a pwned-for-life device, if you want an untethered jailbreak, you're going to have to wait a bit. However cool AirPrint is going to be, I don't think it's worth giving up your jailbreak for any period of time. This may be different for the iPad--multitasking is a pretty big feature and it may possibly be worth it to some people to give up their jailbreak for a while so that they can enjoy these iOS 4 features, but if I had an iPad myself, I'd just install Backgrounder and get on with it. Don't upgrade if you want to keep your jailbreak. Just wait, and hopefully the awesome people behind the jailbreaking scene wil release a new tool or a new version of a tool that can jailbreak iOS 4.2.1 in short time.

Hatkirby on
πŸ‘ 0 πŸ‘Ž

The other day, I was searching the web for fantastic applications for Mac OSX because I'm obsessed and they're pretty. Anyway, one website suggested "MarsEdit" as a must-have. "Okay," I thought, "It's probably a text editor. It probably doesn't compare to TextMate, but I might as well give it a look." Yeah, it wasn't a text editor. It was a desktop blogging client, and it looks awesome. :D

Image

Okay, this post isn't (entirely) about how I was taken by some smooth advertising, it's about how my blog sucks. No, really. I'll fully admit it: since realizing that Four Island was ready to be rewritten again, I have found so many thing wrong with it that it's just amazing. Obviously, I can't enumerate all of these to you, but the ones that bothered me into writing this post are:

  • The custom BBcode system is stupid and insane. "Seriously, let's use a half-baked BBcode system that butchers Unicode characters instead of HTML." No, really, the admin panel should be able to use the full spectrum of HTML elements, plus some timesaving shortcodes. Comments should be allowed to use whitelisted HTML elements. This BBcode system is insane and I regret it so much.
  • The current layout is a bit hideous. Yes, it's revolutionary in that it does so many things that the previous layouts didn't, but seriously, it just doesn't look nice. The blog is seriously difficult to read and a nice clean layout would make things much nicer.
  • The admin panel, while much better than the original (which actually still exists on the server somewhere... shivers), is still pretty basic. No autosave, no revisions, no tag suggestions, etc...

The place I'm trying to get with this is that while my website may be completely written by me, and I'm proud of that, it lacks a lot of useful features that a real solution like Wordpress would have. Namely, in this instance, an implementation of the MetaWeblog API allowing me to write and edit posts from a desktop client. It would be so classy! For one, the autosave feature on its own would snag me. In fact, I actually lost this post while writing it the first time due to a kernel panic--if I had been using a desktop client like MarsEdit, I would've had an autosave copy of the post waiting for me when the computer rebooted. What style. Do I even need to mention the number of posts that I've lost due to the fact that it took longer for me to write it than it took for my session to expire? I've now grown the habit of hitting Cmd-A, Cmd-C before I save the post in case the session expired.

This, along with many other reasons, is why I've decided to fully implement the Wordpress XML-RPC API (which means I also have to implement the MetaWeblog and MoveableType APIs) in Four Island 3. It'll let me use MarsEdit on my computer and the Wordpress app on my iPhone to write posts, which will be pretty awesome. It's an arduous task, due to the fact that the relevant documentation is pretty mediocre. But, I'm getting through it. The Wordpress app still crashes every time I reload the posts, but that's development for you! :P However, I bet that when Four Island 3 is done and everything has been released, it'll not only be easier to write posts, it'll be more fun. And when it's more fun, it's more likely that I'll do it! :P

So, I wanted to ask, who else writes from a blogging client rather than from the admin panel of their blog? Sure, the admin panel is usually pretty intuitive and easy to use, but in my opinion, desktop clients are just so much better! What do you think?

And, no, this post wasn't really written in MarsEdit. My evil custom BBcode system prevents that. Someday, though, someday Four Island 3 will be out and I'll be writing from MarsEdit. How fantastic! :P

Hatkirby on
πŸ‘ 0 πŸ‘Ž

Thumbnail2It's time, folks! If you're jailbroken, backup your SHSH blobs! If you're not jailbroken, but want to be, backup your SHSH blobs! Don't know what they are or why you should do it? Well, to make a long story short, since the new bootrom version of the iPhone 3GS, iOS updates have been very controlled. Apple has set it up so that, if they are not currently offering SHSH blobs on their website for the pair of your iDevice and a specific iOS version, you are unable to load that version onto your iDevice (this obviously doesn't apply if the software is already installed). So, ever since then, jailbreakers have had a way of getting around this by backing up the SHSH blobs for their iDevice and iOS version so that if they ever need to downgrade to a specific version of iOS, they can. Note: you can only downgrade if you already have the SHSH blobs for that iOS version, and you can only backup your SHSH blobs while Apple still offers them. So, yeah. If you don't know how to backup your SHSH blobs, perform a Google search on a program called "TinyUmbrella".

Anyway, why am I saying this? Two reasons: first, it's November now, so, if we can believe Steve Jobs, iOS 4.2 should be coming out this month. If you upgrade to iOS 4.2 and are unhappy with your inability to jailbreak, if you have your iOS 4.1 SHSH blobs, you can always just downgrade. Second, there has been some exciting jailbreak news even before iOS 4.2 is out:

Anyone with blobs for 4.1 or earlier should be able to get an untethered 4.2 jailbreak; this is not done but is being actively worked on.

comex

It seems that this may work by pwning an iOS 4.1 IPSW and somehow using that with iOS 4.2; I don't quite know. :P Note, it may not be out very soon because:

However, a 4.2 jailbreak might be delayed because Cydia doesn't work on 4.2 yet. Not sure how close @chpwn is to finishing his fixes.

comex

Regardless, we can expect an untethered jailbreak for iOS 4.2 and until then, I'll be staying on iOS 4.1.

Finally, I think we can expect iOS 4.2 pretty soon because, not only is the iOS 4.2 GM release already out for developers, Apple has responded to the current problem with iOS 4.1 and daylight savings time. They have posted a support document to their website saying that you will need to set your alarms to repeat "Never" until November 7th. Whether the date specified is the release date of iOS 4.2 or it's just specified because that's when daylight savings time starts is unknown.

Hatkirby on
πŸ‘ 0 πŸ‘Ž

Okay, as mentioned previously, I greatly dislike Ubuntu 10.10. You may too! And if you do, I want you to check something out. Does your computer have an Intel-based graphics card? You said "yes", right? Okay, good. Because then I have some good news: apparently the Intel driver for Ubuntu sucks. Oh, wait, that wasn't good news, but this:

How to install an updated Intel graphics card driver for Ubuntu 10.10!

Since installing this new driver, stuff has stopped getting stuck on my screen. I searched for this driver after a particularly annoying incident with a random square on the screen that wouldn't invalidate, so I had to kill X. Note: this won't fix some of the other annoying bugs, like the super slow gnome-terminal, the mouse with a mind of its own and the multiple attempts to unlock the keyring when I log in.

Anyway, yeah, if you've been having troubles with Ubuntu 10.10 and are ready to install Mac OS X illegally but have an Intel graphics card, first, wait: try this. If it doesn't work, then you can illegally install an OS. Not really.

EDIT: After some more annoyed yelling, I discovered that my mouse problems are likely the fault of Ubuntu 10.10's touchpad driver. I found tons of errors like the following in syslog:

[69276.814022] psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 4 bytes away.
[69277.333722] psmouse.c: resync failed, issuing reconnect request
[69293.813324] psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away.
[69294.826388] psmouse.c: resync failed, issuing reconnect request

I found some other people who have the same problem. We're having tea on Tuesday, wanna come? /jokewhat Anyway, I hope this gets resolved soon because December 25th is still like two months away.

Hatkirby on
πŸ‘ 0 πŸ‘Ž

Okay, folks, as I mentioned last week, Ubuntu 10.10 Maverick Meerkat came out. I decided to use it for a week before writing a post about it (9.10's was a bit hasty). And, you know what? It's just getting worse. Kind of makes me happy that I like Macs now because Ubuntu is kind of starting to anger me.

Okay, first of all, the upgrade itself. The upgrade was fantastically easy. I'm telling you, the upgrades are getting easier, but the OS is getting worse. But last time, easy meant "torrent the alternative CD from Windows and install half of the packages from there". This time, easy meant "click Upgrade." Really, I went to Update Manager and I clicked Upgrade. And it worked. Wow.

Anyway, I then had Ubuntu 10.10 and was find that I liked quite a lot of things about it. First of all, as I mentioned earlier, the Ubuntu Font. It's just freaking awesome. It's used pretty much everywhere now and combined with rounder controls and a pastel-ish color scheme, Ubuntu looks prettier than ever. Not prettier than Mac OSX, though, but still, pretty nice.

The second thing I noticed was that the flashing problem had diminished. In Ubuntu 10.04, whenever I closed the lid of my laptop, when I opened it again, EVERYTHING WOULD START FLASHING. For a while. It was UNBEARABLE. Well, in 10.10, the problem is mostly gone. It now only flashes once or twice. Not as annoying.

However, the good things seemed to stop there and the whole experience started to get very, very annoying:

  • I found that, with certain wireless access points, my computer absolutely refused to co-operate. It would (sometimes) let me connect and occasionally allow me to load a page or two, but it would be infinitely slow and it would just stop serving me pages. I eventually found out that blacklisting a bunch of alternate drivers for my wireless card fixed the problem, but still. Very annoying.
  • Slow. SLOW SLOW SLOW. What has happened? For one thing, the mouse occasionally just gets "stuck". And by occasionally, I mean increasingly frequently. And sometimes, the mouse moves as if it had a mind of its own: the other day, the mouse was actually avoiding Drifty's name as I tried to initiate a chat with her (I eventually used the keyboard). Also, when I use the terminal, text appears very slowly.
  • When you start to drag an image, and then let go because you've changed your mind, it gets stuck there until you restart X. Actually, it's not just images, random stuff in general can get stuck on your screen. An autocomplete popup is now stuck on my screen. I am very, very angry.
  • Okay, for some reason, GNOME just went insane. Both the dock and the panel at the top vanished and a Nautilus window filled the screen. I found out that the display was semi-frozen--moving the mouse around changed the cursor and made popups appear and I could click on menus, but I had no clue what was giong on. I had to kill X. With all of this X killing that's going on, I'm losing a ton of work. This is really frustrating.
  • After another week of testing Ubuntu 10.10, I've found that a whole ton of things can get frozen on the screen accidentally. You can usually remove them by repeating whatever trigger caused them to appear in the first place. However, it's still very annoying and argh, Ubuntu 10.10 is just so slow. Today, the mouse suddenly froze for a very long time (about 5 minutes) while the wireless disconnected (though I was in a high-signal area) and refused to reconnect until I restarted the computer.

All in all, Ubuntu 10.10 really annoys me. Really can't wait until I get a Mac. :P

Hatkirby on
πŸ‘ 0 πŸ‘Ž

While working on the rewrite of Four Island (go 3.0! :D) in Ruby on Rails, I hit a roadblock. Four Island, since perhaps Layout 3, has had an old concept of multiple layouts and since the Theme Switcher, has had the concept of being able to switch between them. How was I going to go about this in Ruby on Rails?

Well, actually, it's quite easy with the help of an awesome gem, [themes_for_rails](http://github.com/lucasefe/themes_for_rails). Note that's the Rails 3 version, if you still use Rails 2 (and most people do), you'll need [theme_support](http://github.com/zedalaye/theme_support). theme_support does technically work for Rails 3 as well, but I don't like it because you can only override views; if there's no corresponding view in the app/views hierarchy, it won't work. This annoyed me because my plan is to have the main site layouts in themes and have the admin panel in app/views because the admin panel never changes but, while pre-3.0 layouts share a ton of code, they are rather different.

Anyway, this was going really well, but there were three things I had to know. First, did it support asset hosts? Second, did it support HAML? And third, did it support SASS? Asset hosts allows you to specify that all assets (javascripts, images and stylesheets) be loaded from an alternative, cookie-less subdomain. And yes, it worked. HAML is an awesome alternative to RHTML/ERB that is really elegant and organized. And yes, it worked. SASS, a sub-project of HAML that is used to generate stylesheets, allows you to nest declarations which I believe makes things make so much more sense. And no, it didn't work.

What? Why? Well, the way SASS works is at runtime, it reads your SASS file and converts it to a CSS file. Since my stylesheets were stored in the themes hierarchy, SASS didn't know where to find them and thus the CSS files weren't generated and my layout couldn't find the stylesheet. However, I wrote a small script that you can place into your config/initializers directory to get SASS working with themes_for_rails:

# Adds Sass support to themes_for_rails

themes = Dir.new 'themes'
themes.each do |theme|
  unless theme == ".." or theme == "."
    Sass::Plugin.add_template_location(
      Rails.root.join("themes/#{theme}/stylesheets/sass").to_s,
      Rails.root.join("themes/#{theme}/stylesheets").to_s
    )
  end
end

And there you go! Sassy themes. It'll probably work with theme_support too, but you may need to modify it a bit.

Hatkirby on
πŸ‘ 0 πŸ‘Ž