border: solid 1px red; RSS

development and other things,
by tiegz

Archive

Recommended…
muviluv
wherewedowhatwedo
trey
timocracy
linode
adagio tea
rmbr me

Feb
16th
Tue
permalink

Kynetx App Contest: Similar News Stories

NAME: Similar News Stories

DESCRIPTION

When the user is on a major news site, this app will attempt to provide up to 20 links to similar news stories from other sources.

BACKGROUND:

This is a contest entry for the Kynetx App Contest. Go check out Kynetx if you haven’t yet— it’s a really nice platform for building context-based applications. Sort of like what hoodwink.d was for commenting, but you can do a lot more than just comments.

USE CASE

User reads a news article; User wants to see how other news sources are reporting the same story; User clicks the “Similar News Stories” bookmarklet and they’re given a list of links to matching news stories.

WORKING?

This is mostly working for me, although I have a few kinks to iron out. The current news sources it is targeted for are: CNN, NYtimes, LATimes, WSJ, DailyKos, FOXNews, Yahoo, Reuters, HuffingtonPost, and MSNBC (I’m having issues with a few of these currently).

When I have time I’d like to iron out the search algorithm, try to weed out links that point back to the same article, etc.

HOW TO INSTALL

EXAMPLE ARTICLES

Once you’ve installed, here is a sample NYTimes article, here’s one for WSJ, and here’s one for HuffingtonPost.

Sample article used with Similiar News Stories

Jan
24th
Sun
permalink
Finally finished my PC festival mashup… and it’s at pc.muviluv.com
It has the screening dates, event dates and venue information for Sundance, Slamdance and X-DANCE (an “action sports film festival”).
There are a couple bugs I’d like to fix, but I’m also looking for some feedback for anyone who uses it ^_^

Finally finished my PC festival mashup… and it’s at pc.muviluv.com

It has the screening dates, event dates and venue information for Sundance, Slamdance and X-DANCE (an “action sports film festival”).

There are a couple bugs I’d like to fix, but I’m also looking for some feedback for anyone who uses it ^_^

Nov
18th
Wed
permalink

Testing ye olde “querystring cache busting” trick.

When setting your site’s file cache settings, there are 2 common ways to properly save bandwidth with HTTP headers.

First method: compare the browser cache’s current versions

Set an http header such as ETag or Last-Modified that allows a client (browser) to compare its cached version of a file with the one on the server. With ETag, for example, the client checks the ETag of its cached file against the server’s version of the file, and a 304 Not Modified is sent back to the client without the actual file contents.

This method saves bandwidth, but it also requires a GET or HEAD request to the server to find out if the browser needs a new version of the file.

Second method: give the file a lifetime in the cache

To avoid the lightweight GET/HEAD request, we can also set the Expires or Cache-Control: max-age headers. Expires will tell the browser the date that the file expires (so it can make a new request to the server), and max-age will tell the browser how long the file is good for (compared to the Date header returned in the response).

Read More

Nov
4th
Wed
permalink

Logfile art? Yeah I did.

Here’s a script that takes a filename, parses the file for IP addresses, maps each IP to an RGBA pixel, and creates a PNG (thanks seattle.rb!).

For example, the following would map 192.168.1.1 in reverse (i.e. 1.1.168.192)…

ruby ip_colorsquare.rb production.log 4,3,2,1

Here’s one example I created with a 24-hour chunk of logs from WhereWeDoWhatWeDo (disclaimer: I mixed up the octet order when I created it)

production.log PNG

Interesting to see patterns emerge, although the streaks of the same shade are probably just search bots or spammers.

Grab the script here.

Oct
14th
Wed
permalink

Troubles with JRuby and SoyLatte on OS X Snow Leopard

I was trying to install JRuby on a new install of OS X Snow Leopard today, but got this error when trying to run stuff like “jruby -S gem”:

Trace/BPT trap

I’m using SoyLatte for Java development on my machine, and was able to fix the JRuby error by switching back to the Java 1.6 with which Snow Leopard ships.

So what’s the quick fix — so we don’t have to debug JRuby/SoyLatte — in order to do Java development with SoyLatte, but use JRuby with OSX’s Java 1.6? Add this to the top of your “bin/jruby” file (wherever it lives):

export JAVA_HOME=/Library/Java/Home

やすい!

Jul
21st
Tue
permalink
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!