i guess it’s time to look at the source code once again. i used to be excited every time WP have an update. now, i loathe them. seriously thinking of giving up on sideblog. anybody still using this thing?
Author: Kates Gasis
WP 2.8
upgraded my wordpress to 2.8. let’s see if something is broken.
four years of blogging
Wow. I’ve been blogging here for 4 years now and I’m still a nobody. Oh well…
url shortener using base 62
Trying to scratch an itch one weekend, I tried to write my own URL shortener service. After all, bit.ly got $2M funding for offering such service so I went ahead and see how hard it is to create one. If you've been doing web development for sometime, this activity is trivial. The only hurdle I have was how to generate those random looking string appended at the end of the domain url. For the lazy there's always Base36 that look like the one tinyurl is using. I wanted mine to resemble is.gd so I wrote my own. Here's one I quickly wrote in ruby.
-
class B62
-
CHARS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split('')
-
BASE = 62
-
def self.encode(value)
-
s = []
-
while value > BASE
-
value, rem = value.divmod(BASE)
-
s << CHARS[rem]
-
end
-
s << CHARS[value]
-
s.reverse.to_s
-
end
-
-
def self.decode(str)
-
str = str.split('').reverse
-
total = 0
-
str.each_with_index do |v,k|
-
total += (CHARS.index(v) * (BASE ** k))
-
end
-
total
-
end
-
end
Hope that helps.
Photos from the Red Dot Museum
I lost my DSLR last christmas vacation in the Philippines so I have to make do with my film cameras. These photo was taken on a lazy sunday afternoon at Red Dot Design Museum. They’re having their once a month art market where they sell art-sy stuff. After developing these and the other rolls of film from mid last year, I feel like I won’t miss much of my DSLR. I’ve been shooting on the widest angle most of the time.