The Ellen DeGeneres Show Ticket Tracker

20 December 2012 Ported from Old Blog, side-project

It’s here! It’s here! The one and only the Ellen DeGeneres Show ticket tracker.

screenshoot

I started this project a few days before final exam. I had been checking Ellen’s ticket page almost every other hour till I realized that it was time to make a script do it for me. The idea is simple - check that page every 10 minutes and send me an email when new tickets become available.

Throughout this winter break, I continue adding more features and it has evolved from a simple script (rake task, to be exact) to a nearly-done web app that other people can use. If I find my own app super useful, there probably are other people who will use it right?

Choose ticket dates to track:

screenshoot

Email notification isn’t ugly too!

screenshoot

Built with Ruby on Rails, Twitter Bootstrap and a lot of love for Ellen.

Notable gems:

  1. Nokogiri - scrape http://ellentv.com/tickets
  2. Gon - pass rails variable to javascript
  3. Devise - admin authentication
  4. twitter-bootstrap-rails

First Try at Mozilla Popcorn Maker

18 December 2012 Ported from Old Blog, mozilla

Popcorn Maker is an in-browser video mashup maker by Mozilla. You can do cool stuff like remixing videos from youtube with Google map and wikipedia article. It’s really easy to use and the end product is more of a playable website than a video! Entirely free and open-source. The only catch? Doesn’t work on Firefox (for me) and it crashes Chrome so often I had to click save after almost every new actions. Nevertheless, I love how I don’t have to install any bloated program in my 5-year-old laptop.

My very first Popcorn-made production, a birthday rap lyrics video for my lovely sister:

// Video no longer unavailble

2017 Update: Popcorn Maker has been deprecated. The video I made is gone forever.

Extracting Text From Corrupted DOCX Without Installing Additional Program

1 December 2012 Ported from Old Blog

Note: Only work on Mac and *nix.

This afternoon I received a call from my best friend. Her 100-page thesis file is corrupted. She has spent the last 2 months in Nepal and North-east India doing research. The backup copy of that file is in an SD card which is currently malfunctioning. She doesn’t have access to the internet. Panic ensued.

This makes for a very challenging problem for the following reason:

  1. Lack of access to the internet - She can’t send me the file to fix or download file recovery applications.
  2. Mac OS - No “Open and recover” option in Microsoft Words for Mac (at least according to her). No pre-installed GCC so writing a C program is out of the question. I’m far from proficient at unix command besides the basics like “cd”, “rm”, and “cat”.

I vaguely remember reading an article saying that Docx file is in xml format. That turned out to be partially true. Docx is more like a zip file containing many xml files. Combine that fact with googling unix commands and fiddling with regular expression, I came up with the following steps that I sent to her over sms:

Step 1

Make a back-up of your corrupted docx file.

Step 2

Change the file extension to .zip. Eg. from my_paper.docx to my_paper.zip

Step 3

Extract the zip file into another folder. Now go inside that folder. You should see a word folder. Go inside word and check that there’s a file called document.xml

Step 4

Fire up your Terminal. Navigate to the folder containing document.xml. Use cd, cd .., and ls for this step. (See? I know some unix commands too.)

Step 5

Copy and paste these 2 lines

sed -r 's/<(\/?)w:p(\s*)(\w*)>/&\n/g' <document.xml >temp.txt
sed -r 's/<(\/?)(\w+)[^>]*(\/?)>//g' <temp.txt >recover.txt

The extracted text will be in recover.txt.

The first line replaces <w:p blahblah> and </w:p> in document.xml with a new line character. <w:p> denotes a paragraph in docx. The second line removes all other xml tags in the file, leaving just the text.

There you have it:) Fully recovered text without resorting to installing any other program.

Solarized Light in Octopress

23 November 2012 Ported from Old Blog

Octopress applies Solarized with dark background to all code block on default and I just found out that Octopress ships with Solarized Light too! To change to a light background, go to sass/base/_solarized.scss and change $solarized: dark !default; to $solarized: light !default;

MozCamp Asia 2012 Day 2

18 November 2012 Ported from Old Blog, mozilla

The 12 hours spent with fellow Mozillians have been nothing short of amazing! Regrettably I missed the first day of MozCamp Asia but the experience I’ve got from the second day of MozCamp is an absolute bliss. The atmostphere of the event is one of fun, one of a united community sharing a common goal.

MozCamp Asia, short for Mozilla Camp Asia, is a 2-day summit where core contributors from different parts of Asia are invited (with flight ticket paid for, if i’m not wrong) to attend technical workshops, listen to keynote speeches and brainstorm ideas to promote new Mozilla products to the public.

Gary, the founder of CP3108B Mozillla class in NUS, has kindly extended me and a other CP3108B alumni an invite because we’ve fixed a few bugs in Thunderbird and Firefox. Thanks Gary!

Mozilla goodies. // Photos to be dug up from archive

Ideas presentation // Photos to be dug up from archive

Gangnam Style never gets old. // Photos to be dug up from archive

Brainstorming new app ideas for the community // Photos to be dug up from archive

Mozilla light shone on the wall of Scape Hall. Too cool! // Photos to be dug up from archive

Below are a few things I’ve gathered from today:

Firefox OS - it’s not Chrome OS on Mobile

// Photos to be dug up from archive

When I first heard of Firefox OS a few weeks ago, I thought it’s an OS that is just a browser, similar to Chrome OS. I had a totally wrong idea. Although developers can write native app in HTML5, Javascript and CSS, it doesn’t mean that the OS is a just browser! Firefox OS comprises of 3 components: a linux kernel, Gecko (a C++ layout engine that can read and render HTML, Javascript and other web technologies), and Gaia (a user-interface of Firefox OS written entirely in HTML5, CSS, and Javascript).

Firefox OS is a big-deal because customers and handset makers won’t be locked in one proprietary platform. There would be more choices and controls. Developers can write apps using standard web technologies. Firefox OS also works very well on lower-end phones. Win-win-win-win for everyone except for Google and Apple.

Firefox OS Simulator Add-on

// Photos to be dug up from archive

Instead of compiling your own emulator, you can download a Firefox Add-On that works as a Firefox OS simulator! Hassle-free install. Get the xpi from the readme file. It’s really fast! I was expecting a sluggish slow-ass simulator like an Android simulator but the speed of Firefox OS simulator blew me away. It boot up within 1 second. The file size is about 90MB on Linux and 65MB on Windows. See how it works here.

Facebook Messenger for Firefox

// Photos to be dug up from archive

You can see the real-time ticker, get notification and chat with your friend all the time without switching tab! It’s like Firefox combined with Rockmelt, but with a native Facebook UI.

It’s implemented using Firefox Social API. Facebook engineers use Firefox Social API API to create Facebook Messenger for Firefox so that’s why the UI are the same as what you’d expect to see in facebook.

This is especially good for me because I can chat with my friend on Facebook without going on Facebook and seeing other people’s updates. I can minimize the ticker windows to make sure I don’t see the constant updates. Frankly, spending too much time browsing my friends’ supposed wonderful fun-filled life makes me depressed.

Thai Mozilla Community exists

I’m surprised to see Thais anywhere besides in Thailand (We are a rare breed trust me! Thailand has no history of being severely affected by wars or other extreme hardship so Thai people rarely emigrate.) There are about 20 Thai contributors to the Mozilla project. Most of them are heavily involved in localization, translating UI labels, MDN and SUMO (Mozila suport webpage) from English to Thai. They are a really passionate and lovely bunch. They also showed me a page where all bugs related to Thai localization are located. @P’Noom, @P’Toei, @P’Pit, @P’Cheng, nice meeting you guys ka:)

What I’m hoping to work on this December holidays.

  1. Fix this bug. Double-clicking a word in Thai would select the whole sentence because there is no space that separate one word from another.
  2. Make any app on this list for Firefox OS. I’m thinking of doing a basic epub reader or maybe do a doodle-jump clone on Firefox OS.
  3. Fix B2G bugs. There are so many good bugs to fix!

To wrap this up, MozCampAsia is just plain awesome. It’s so much fun and I learn a ton. Anybody can contribute to Mozilla. Start by searching for “good-first-bug” that interest you and follow this guide which will walk you through the whole process. See you at the next MozCampAsia:)