Articles tagged 'ruby'

Blog Projects

Facebook POST for Canvas fix

Latest usage and examples can be found from Rack::Facebook::MethodFix project page.

In early 2011 Facebook started to send all iframe application requests as POST. Because of this most REST based applications broke. Lets say you have object called User. To get list of users in RESTful application you would issue the following request:

GET /users/

New user is created with POST request:

POST /users/

I’m sure you can spot the problem here. You try to retrieve list of users. That does not work. Instead you end up creating new object because your request was converted to POST.

Continue reading >>


Using Goo.gl With Ruby and HTTParty

I had totally missed that Google recently opened the API of their URL shortening service. I love short and clean APIs. Accessing it using HTTParty is just few lines of code.

require "rubygems"
require "httparty"
require "json"

class Googl
  include...

Continue reading >>


iPhone Controlled HTML5 Logo and Color Cube

When Apple released iOS 4.2 end of last year I was on a boat trip to Finland. For me the most interesting features were added to Safari browser. I wanted to learn about WebSockets. New DeviceOrientation API just begged to be abused. I had an idea to control the content of laptop browser by tilting and rotating the phone. I had working but ugly code before ship arrived to Helsinki.

If you have short attention span go straight to the HTML5 logo demo.

Code has been sitting on my hard drive since. I cleaned it up during last couple of days. Also added additional eye candy by using the oh-so-hot-at-the-moment HTML5 logo.

Continue reading >>


Using Bit.ly With HTTParty

I have been playing around with different shortener APIs for Google Analytics URL shortener. HTTParty makes this all easy and gives warm fuzzy feeling. Bit.ly API requires free registration to get an API key. Other than that it is pretty straight forward...

Continue reading >>


Rake Tasks For Easier Facebook Development

Lets face it. Facebook development is tedious. You do not want to waste more time in endless commit-push-pull-restart loop for smallest code changes. Common development setup is to tunnel traffic from development server to your laptop using ssh tunnel. Here are my Rake tasks for switching between production and development mode.

Facebook Application Stack

I use Sinatra, Thin, Sinbook and DataMapper for all my Facebook development. All static assets are served by Apache. Apache also proxies other requests to Sinatra using mod_rewrite. Proxying is easiest to setup using the following rule in .htaccess file:

  RewriteEngine On
  RewriteBase /

  # Everything not found goes to Sinatra / Rack
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule (.*) http://127.0.0.1:4567%{REQUEST_URI} [L,P,QSA]

Continue reading >>


Using Shrt.st With HTTParty

I recently evaluated bunch of Ruby libraries for consuming webservices. One I liked most is is HTTParty. Love the syntax and elegance. Here is how you would shorten an URL with my favourite URL shortener shrt.st:

require 'rubygems'
require 'httparty...

Continue reading >>


Running on Nesta

My Mephisto installation finally went fubar. I had to search for new blog engine. It needed to be simple, easy to customize, support Textile and preferably be built on Sinatra. I ended up choosing Nesta. It did not have Textile support so I wrote a patch. This proved Nesta is really easy to customize. Nesta also provided ready made scripts for importing from Mephisto. This made converting from one system to another a breeze.

Continue reading >>


Mephisto Sitemap Plugin With Engines Support

I made quick fix to Mephisto Sitemap plugin. Now it works with lates Mephisto 0.8 (Drax). All old plugins got broken when Mephisto changed to Rails Engines based plugin system.

Install by issuing the following command in your Mephisto root.

script...

Continue reading >>


Why Fortumo Will Be Success?

HEADS UP! This article was written in 2007. Information provided might not be valid anymore and should be taken with a grain of salt.

Fortumo has good change to be next Estonian success. It does not provide anything new. Instead it provides something old but in brilliant package.

Fortumo is web application for easily creating SMS services. It is built with Ruby on Rails.

Easy way

For technically challenged Fortumo provides three ready made applications. Simplest one replies back with predefined text. Slightly more advanced version forwards sent message to email address of your choice. Third one is JavaScript shoutbox widget which you can embed to any webpage. Shouts in this case are sent with text message.

Continue reading >>


Mephisto Google Sitemaps Plugin

HEADS UP! This article was written in 2007. Information provided might not be valid anymore and should be taken with a grain of salt.

Since I recently restructured my site I wanted to make changes quickly visible to Google. Sitemaps can help with...

Continue reading >>


ThickBox Macro For Mephisto - jQuery and Rails

HEADS UP! This article was written in 2007. Information provided might not be valid anymore and should be taken with a grain of salt.

Some people consider it to be heretic to use jQuery with Ruby on Rails. Since I am big fan of jQuery I decided to do it anyway.

With filtered_column_thickbox_macro you can display single or multiple images with Lightbox effect. Macro uses Cody Linley’s ThickBox plugin. Code is based on Based on Christian Lim’s Lightbox Image Gallery Filter.

Installation

Install by issuing command (in one line):

 script/plugin install
 http://svn.appelsiini.net/svn/rails/plugins/filtered_column_thickbox_macro/

Script will copy needed Javascript, CSS and image files into your public folder. It does not overwrite any existing files. So if you rely in specific version of jQuery library it will be safe.

Continue reading >>


CATEGORIES
Built using the awesome Flat UI Pro framework by Designmodo.

© 2013 Mika Tuupola.