border: solid 1px red; RSS

development and other things,
by tiegz

Archive

Recommended…
muviluv
wherewedowhatwedo
trey
timocracy
linode
adagio tea
rmbr me

Jun
27th
Sat
permalink
Jun
22nd
Mon
permalink

vijo doesn't overheat my cpu! (yet)

Here’s what I came up with during the Hack Day portion of the incredible Open Video Conference 2009 this weekend. It’s a VJ’ing tool written purely in HTML5 and JS.

Bear with me if it’s glitchy! It’s just a prototype.

go to vijo


Jun
17th
Wed
permalink

Deprecating 'www' from Rails Requests with Metal

In ‘app/metal/deprecate_w_w_w.rb’:

# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)

class DeprecateWWW
  def self.call(env)
    if env['HTTP_HOST'].slice!(/^www\./)
      location = "#{env['rack.url_scheme']}://#{env['HTTP_HOST']}#{env['REQUEST_URI']}"
      RAILS_DEFAULT_LOGGER.info "DeprecateWWW: Redirecting to #{location}"
      [302, {'Location' => location}, []]
    else
     # A 400 status (Not Found) passes the call on to the next piece in the stack,
     # which can be another metal piece, or your rails application.
     [404, {"Content-Type" => "text/html"}, ["Not Found!"]]
   end
  end
end

For example, ‘http://www.solid1pxred.com/foobar’ would be redirected to ‘http://solid1pxred.com/foobar’

Mar
27th
Fri
permalink

Radial Gradiant in Safari / Webkit (CSS3)

Many of the docs on gradient support in WebKit right now only include examples for “linear” style gradients, while just mentioning the syntax for “radial” styles:

-webkit-gradient(type, inner_center, inner_radius, outer_center, outer_radius, / stop...)

So here’s an example of how to do a “radial” background gradient:

background: -webkit-gradient(radial, left top, 30, left top, 100, color-stop(0.7, #7C95AC), from(#FFF), to(#304B67));

And here it is!

Mar
4th
Wed
permalink

Keep it shortenTweet

Behold… shortenTweet! It’s a wee microapp for Twitter that tries to shorten your tweets using UTF-8, ASCII and some shorthand. It’s a combination of Sinatra + jQuery, and after doing this I’m all aboard this microapp train (esp. with how easy it is to deploy Rack-based apps on Passenger).

And — par for the course — after I “launched” it, I discovered 2 or 3 or services that already did “tweet shortening” (although I don’t think any of them actually employ UTF-8).

Feb
2nd
Mon
permalink

Rails 2.3 : Uninitialized constant CGI::Session

Upgraded to Rails 2.3 today… very nice, but I ran into this

uninitialized constant CGI::Session

To solve, look for anywhere you reference the builtin session stores for rails (ie CookieStore), and change “CGI::Session” to “ActionController::Session”. (ie “CGI::Session::CookieStore” to “ActionController::Session::CookieStore”)

Jan
18th
Sun
permalink

Convention over Configuration'ing my Blog.

I’m pretty close to ditching my 3-year-old Typo/Joyent shared hosting blog setup soon. I might just replace it with this Tumblelog.

(apologies to anyone who was following my old blog feed)