I invented Twitter. Maybe you did, too.

Back in 2005 I had this idea for a web site. Here’s how it was supposed to work: You would use your mobile phone to send messages to a web site that would then re-broadcast that message to your “friends”. You could also use small desktop app. You’d “friend” people, and then the site would send you anything they posted.
Fake Twitter?
Sound familiar? For the uninitiated, that’s basically Twitter. But about two years early.

I started work on it, but never finished it because I started to feel like there was no market for something like that. I got sidetracked and let it die.

Then, around 2007, I heard about this “tweet” thing and I was like:

Fuck, really? What a rip-off of my idea! Twitter STOLE my idea!

Continue Reading

Ruby for the Perl tourist: Part 2, Object and Symbols

Ruby is from objects, Perl is from procedures

Perl has had objects for quite a while now, decades even, but you can’t get away from the fact that OO is really just a bag-on-the-side of Perl 5.  This can be a Good Thing sometimes, actually, because it means that well-written code can be used objectively or functionally.

Still, though, Perl 5 is fundamentally not OO at it’s core and all the magic exists in bless().  Ruby (and many others, too many to mention) are object oriented from the ground up.  But what does that really mean?

Continue Reading

Ruby for the Perl tourist: Part 1, Syntax, Grammer, Parenthesis are for the weak

This is the first part of what I hope will be a pretty useful set of tutorials for those moving from the world of Perl in to Ruby. For the overview of topic I hope to cover in this series you can go back and look at the “Overview” page. In this first part I want first to talk about how Perl and Ruby are similar and then go over some of the most visible differences.

Continue Reading

Ruby for the Perl tourist: Overview

I originally gave a presentation with this same title at the February 2012 ut.rb meeting.  Although it was focused at the Perl programmers that were present at that meeting it was so well received I’ve decided to spend more time on it an develop it in to a series of blog posts.

Of course this is meant to give Perl programmers a foothold in a new language but it is also useful for anyone coming in to the language from somewhere else.

My Perl credentials

I started developing in Perl in 2000 and was a full-time Perlista from 2000-’07 using versions 5.005 to 5.6, but I’ve never used the Perl 6 series.  My first gig was doing financial code for a credit-card processing company, then I moved on to start a web site (Quizilla.com) that eventually went to many tens-of-millions of daily page views on Perl code I wrote.

Overview of what’s on tap

In this series I plan on covering:

  • Part 1: basic similarities and shared conventions. Differences between use of semicolons, and parenthesis.
  • Part 2: Bagging on Perl’s OO system.  Objects and methods under Ruby.  Symbols.
  • Part 3: Perl sigils counterparts in Ruby.  New meaning of $, @ and @@.  Constants in Ruby.
  • Part 4: String interpolation, deliberate/implicit returns on methods.
  • Part 5: Bang (!) and Boolean (?) methods.
  • Part 6: blocks (very basically).
  • Part 7: bonus Rails-specific content: method_missing() and “magic methods”.
Leave the first comment

NETWORK_ERR: XmlHttpRequest Exception 101 on PhoneGap

Check to see that you’re not trying to do a synchronous call cross-site. And if you’re doing PhoneGap chances are the majority of calls you’re doing are cross-site.

$.ajax({
...
"async": false,
...
});

..probably needs to be changed to “true” or removed altogether. If you really need cross-site async JS you may look in to <a href=”http://code.google.com/p/jquery-jsonp/”>Google JSONP</a>.

Leave the first comment

Introducing MailPing

At my day job we have reports that are emailed out at 3AM every day, and the people who get them need them by, like, 9AM. Usually they work but for a number of reasons they occasionally will belch and I wouldn’t know until after the fact.

When that happened I would “hear about it”, and I generally just sucked it up and promised to fix whatever problem it was. One day, about 9 months ago, I had the brainwave that “I wish there was a site that would tell me when email didn’t get sent.” It was an awesome idea that was so cool I promptly forgot about it for almost a whole year..

A few weeks ago after having no problems, I once again “heard about” an email not going out decided to be proactive and build the system I had thought of 3 quarters before, and that system is Mailping.

So what is it? In a basic sense it is a incoming mailbox with filters and rules and if those filters/rules are or are not satisfied you will receive a notification.

So in my case it’s like this: I set it up to watch for an email with the subject line “X” between the hours of “Y” and “Z”. If that email comes through then great, but if not I have the system alert me that something is not right. It could also work the other way, where it can send you an email if if DOES receive a certain email. Whatever you want.

It can also ping a web site with a webhook sort of thing. Bitches love webhooks.

You can start using it now on your own project, anywhere you want to check if email is being sent. I’m already using it daily to make sure the automated email at my day job is working.

Plus, if you wanted to “think out of box” you could use the webhook functionality to trigger actions via an email.

Leave the first comment

Generate easy, up-to-date Rails API docs with Cucumber

For the last few days I’ve been use Rails’ built in JSON facilities to build API capabilities in to an existing app. Rails makes this easy so kudos, etc, blah blah. Seeing as how I need to test these features I was following a Test First approach and since a JSON API is basically a web-request in drag I decided to use Cucumber and Rack::Test. I wrote a lot of tests like:

Continue Reading

ActiveRecord magically changing Decimal columns to Integers?

Are you having an issue where ActiveRecord is insisting a column in an integer even when MySQL says it is a decimal?

Check the definition of the table in Mysql, chances are you have a decimal column with no decimal “scale” set.

By default, if you don’t tell Mysql ho many decimal places to use it will have none, and ActiveRecord will then simply interpret that as an Integer.

Update you column with a migration like this:

change_column('table_name', 'colun_name', :decimal, { :scale => 2, :precision => 10 } )

Leave the first comment

RubyProof.org Lightning talk text

The text of my ill-prepared lightning talk. Note I only presented up item 4 in the “testing” section before I ran out of time.

This has been edited a bit since I presented.

Continue Reading

Reloading the page in cucumber with capybara and selenium/culerity/racktest

When /^I reload the page$/ do
# puts "DEBUG - The page for #{current_path}"
case Capybara::current_driver
when :selenium
visit page.driver.browser.current_url
when :racktest
visit [ current_path, page.driver.last_request.env['QUERY_STRING'] ].reject(&:blank?).join('?')
when :culerity
page.driver.browser.refresh
else
raise "unsupported driver, use rack::test or selenium/webdriver"
end
end

One comment so far, add another