Boy van Amstel

Boy's nifty stuff, or whatever..

Fiddling With NeXTSTEP

I bought my first Mac just 3 or 4 years ago. Before that I used to alternate between Windows and Linux, mostly sticking to Linux. The flexibility and complexity was something I liked most about Linux. Compiling a new kernel each time I inserted a new piece of hardware into my computer and fixing errors until a game or application would compile and install successfully used to keep me entertained for days and nights on end. The absence of these exact things is what made me buy an Apple later; it just works.

This week I realised that while I’m quite familiar with the history of DOS, Windows, Linux, Amiga, C64, BeOS and so on, Mac OSX’s predecessors are a mystery to me. A few brief experiences with NeXT workstations and iMacs in public places aside, I’ve never used the system before OSX. Obviously exploring this makes for a perfect spare time project. I managed to install NeXTSTEP in Parallels and tried to get past greyscale graphics, which proved to be difficult. After reading some experiences by others I swithed to VirtualBox, which allows you to customize hardware properties, like ethernet cards and sound devices. VirtualBox with OPENSTEP (NeXTSTEP with OpenStep) and the latest update almost provides a plug and play experience due to much improved driver support. I took some screenshots running OPENSTEP 4.2 at 1024x768 pixels with 32bit colors (a setup that cost about $ 15,000 when it was released).

A screenshot of DangerCove.com. OmniWeb (like all browsers at the time) lacked support for stylesheets, or almost any of the features we’re used to today. Enabling javascript caused every site I tried to crash.

This screenshot shows Facebook, looking rather broken, and DOOM in the front. id Software used NeXT systems to create the famous first person shooter. Relying on the Objective-C based development environment to create most of the tools, like the level editor. Speaking of which..

While Xcode 4.2 and InterfaceBuilder 4.2 were released almost two decades apart, they feel strikingly similar; dragging and dropping components and attaching their outlets to ‘First Responders’, it’s all there.

EDIT: Over at Hacker News, Zev provided a link to a video of Gene Backlin giving a talk at SecondConf last year, titled ‘NeXT to X’. About 21 minutes into the video Gene walks through a screenshot supported comparison of creating the exact same app using development environments that were created 20 years apart.

YouTube has some pretty cool videos that show Steve Jobs demoing NeXTSTEP. Like this one, where Steve talks about what he calls ‘interpersonal computing’:

Or this ‘secret’ video, supposedly only for the eyes of fresh NeXT employees:

Fiddling around with NeXTSTEP has been fun. It reminded me that I tried, but never really liked, the Linux window manager called WindowMaker, which I did knew was based on NeXTSTEP. WindowMaker to me felt out of place on Linux and inferior to Gnome, KDE, Enlightenment and other window mangers at the time. Like OSX today, the NeXTSTEP interface feels a lot more comfortable on the system that it’s been designed for.

Some sites to help install OPENSTEP yourself:

Apps for the Planet Talk

I gave a talk a the Apps for the Planet event. It’s about doing rapid creative projects and contains a couple of examples of projects I did, a more extensive walkthrough of a particular project and a rundown of tools and principles I like to use.

Html5-boilerplate Gem and No More Posting/deleting Etc.

For no apparent reason all the post/delete/put requests I was doing in my brand new Rails project where failing… Forms would not create anything. The problem only appeared occurred on my live server running Phussion Passenger. No issues on WEBrick.

After a little searching I found the issue in the .htaccess files. Created by the html5-boilerplate gem in /public/.htaccess.

Comment the following lines on line 348 and the problem goes away:

<IfModule mod_rewrite.c>
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
  RewriteRule ^(.*)$ /$1/ [R=301,L]
</IfModule>

I’m guessing the other rewrite rules are problematic as well. A better fix would be to only rewrite when using GET.

TTResponds Update

I’ve updated TTResponds to include some requests people have made.

  • You can now specify if you want to send HTML emails.
  • You can set the sheet being used for the form (defaults to the first one).
  • You can limit the amount of emails being sent. Just the first 10 entries for example (-1 is unlimited).

The script has been submitted to the Apps Script Gallery, but may take a while to appear. You can grab it right now from Github.

Notice: if you’re already using a previous version of the script. Remove the config sheet. Open the scripts editor, copy-paste the new script over the old one. Run the createMenu method. And then select Create config from the TTResponds menu item. This will make sure the new configuration options appear on your configuration screen.

Omniauth Strategy for Google OpenID+OAuth Hybrid Protocol Login

Quite the title and quite cool to use. The Hybrid Protocol combines OpenID and OAuth in such a way that with one flow you can ask for authentication (and get someones account information, like name and email) and authorization (a token) for a set of services specified in a scope

Apart from providing a much cleaner user experience, it’ll save you a bunch of code. Especially via Omniauth.

I’ve created a fork (read update) that contains the google_hybrid strategy and an example project that implements it.

UPDATE: My strategy just got merged into Omniauth’s master branch. So just use Omniauth instead of my fork.

To see how it works, try this demo.

Dropbox Chat

Have you ever wondered how well Dropbox would work as a chat application? I did and I finally created a client for it. The concept of having Dropbox handle all the complicated server side stuff is very appealing and actually works quite wel.

The use case I can imagine happening is that you want to share and store quick conversations you have with co-workers/friends while working on a project. Instead of navigating to Basecamp, emailing (which is less direct) or copy-pasting chat logs, you can just open the Dropbox chat client and have a short conversation. The chat log is right there in the same folder and the only thing you have to do to get it to work, is drop the application in the Dropbox project folder you’re working on.

The experiment is really easy to setup. Just clone/download the repository on GitHub. Put the folder in your Dropbox folder and share the folder with your friends.

To run the application open a terminal window and navigate to the folder you just shared. Like this for instance (don’t type the $ sign):

$ cd ~/Dropbox/Projects/DropboxChat

Now run the application.

$ ruby chat.rb

If it throws an error, this means it might need to install some additional libraries called gems.

$ gem install [gem name]

After it starts it’ll prompt you for a nickname, pick something original and that’s it. Just start typing .

Maintenance Page While Deploying With Capistrano

I got tired pretty fast of staring at Passenger’s 500 errors while Capistrano and Rails are busy setting up a new release of a project.

Of course other people got tired as well and came up with numerous fixes. The one I like best is where you first put up a maintenance page, deploy and after all went well, remove the maintenance page. Kind of like how Apple disables the store when they’re adding new stuff, but less flashy I suppose..

It’s pretty easy to do this and I’m just going to provide two links that explain it very well. One for Apache and one for Nginx. They’re both very similar and you can easily pick either of the deploy.rb parts.

That’s about it. It’s very easy to do and probably something a lot of people know already, but definitely something that’ll make you feel more comfortable while deploying.

Instalike

We had a Saturday Night of Awesome this weekend and came up with the idea to create an iPhone and Android app that allows you to share images to Facebook very quickly. A few hours later both apps were done and the Android app is already live.

The iPhone App will be released as soon as Apple approves it.

Description:

With InstaLike you can ‘like’ everything you see, instantly!

Just start the app, point your camera and shoot. The image will be uploaded to Facebook directly, for all your friends to see .

InstaLike allows you to share your pictures as fast and easy as possible.

Download it and let me know what you think!

Google Apps Script: TTResponds

Introduction

TTResponds is a Google Apps Script that allows you to automatically send a confirmation to people who’ve filled out a Google Form.

It’s been available for a while in the Script Gallery, but I haven’t gotten around to write about it. The reason I’m doing so right now, is because I’ve received a couple of returning questions that I can probably better answer right here.

Installing

First login to your Google Docs environment, docs.google.com and Google Apps both work fine. After that, choose to create a new Form.

This will present you with a pop-up that allows you to customize the fields. For basis functionality it should at least contain a name field first and an email address second. After that you can add anything you want.

Clicking save will send you to the Spreadsheet, setup to receive form submissions. The next step is to add TTResponds. You can do so by clicking ‘Tools’ and then ‘Script gallery…’.

Search for ‘TTResponds’ and click install.

Authorize the script to read your Spreadsheet and send out emails.

A new menu item called ‘TTResponds’ just appeared. Click it and select ‘Create config’. This should add an extra sheet called ‘TTRespondsConfig’, you can change the properties to provide a more relevant response. After you’re done, make sure all ‘Triggers’ are setup correctly by clicking ‘Tools’ and after that ‘Script editor…’.

In the pop-up select ‘Triggers’ and then ‘All your triggers…’.

Make sure your setup looks like the image above. If it doesn’t, click ‘Add a new trigger’ and set it to ‘onFormSubmit’, ‘From spreadsheet’ and ‘On form submit’. That’s it! Fill out your own form and you’ll receive a confirmation automatically!

HTML Email

Per default the script sends text-only emails. You can change this to HTML email pretty easily (I’ll probably add it as an option in an update). First open the script editor again and navigate to line 119.

You’ll see that is says:

{ name: _config.from }

Change it to this:

{ name: _config.from, htmlBody: _config.body }

The script will now send the confirmation as HTML, allowing you to send a fancier response .

Collaborating

I’ve created a GitHub repo for TTResponds. If you’re adding features, or fixing bugs, please fork the project and send me a pull request.

Let me know

It would be awesome if you let me know if you use and/or like the script through the comments, thanks!

Omniauth + Facebook = OpenSSL::SSL::SSLError

I’ve run into this issue twice and now I’m writing down the solution. When authenticating with Facebook via Omniauth, my server always fails with the following error:

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed):

This is easily fixed by adding the following to one of the initializers:

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

It’s probably not the best solution, as this turns off SSL peer verification..

A better solution:

http://stackoverflow.com/questions/5711190/how-to-get-rid-of-opensslsslsslerror