Blog

  • I digg leet Mac OS X command line stuff

    Hey, did you know you can put your favorite dashboard widget on your desktop without having to hit F12?

    Check out the Top 15 hidden terminal commands for Mac OS X.

    It is eeee-l33t.

  • Dear Lazy Web: How do I Send Emails from Non-Resolvable Servers?

    I’m trying to use php’s mail command to send emails to myself.

    Unfortunately, the logs bring this up:

    553 5.1.8 …

    Domain of sender address jbarcelona@sovrainshrine does not exist

    (at 16 Mar 2007 22:31:09(GMT))

    IP:207.106.84.164

    Which makes sense b/c I’m behind a firewall and the server I’m using is only resolvable from behind my firewall.

    So what information do I need to put in the header to make this work?

    Yes, I’ve read www.php.net/mail but the examples just don’t work.

    UPDATE: 3/21/2007

    I just downloaded PHP Mailer, and it’s been working like a charm.

  • How I Got Into SxSW Parties

    The advice here goes beyond plain ol’ networking skills and a winning smile.

    1) Talk to promoters. I learned this one from Jakob Heuser who talked to a promoter that got us into the Facebook party which was invite only. Jakob also knew how many people he wanted to get into the party in addition to himself, and so he asked for additional invites. SxSW wins notoriety for having way too many female promoters leading to parties with way too many dudes in an already way too many dude market. Well, it helps having my winning smile to sort me out from the rest.

    Facebook Invite Scored by Jakob

    2) Get on the VIP list of every club that you think will be hosting a cool party. You do this by visiting their website, and asking to be put on their VIP list. You also do this by calling the venue.

    3) Once you’ve done step two, you need to show up the evening before. Talk to the folks who work the door. Ask who is working the door tomorrow. I did steps 2 and 3 the day before South by Southwest started. The result: Fun, fun, fun and a stack of business cards that I’ve been entering into my address book for the past 2 hours. Next time I’m at Fry’s, I’m getting a card scanner

    Now go out there and get to some parties.

  • What’s missing? CPAN for JavaScript

    I’ve been messing around with Perl in-between conferences at SxSW. What’s delighted me is how little I have to code because of CPAN, an archive of Perl Modules.

    In order to write a simple RSS aggregator all I had to do was:
    1) Create a class for fetching and saving the RSS.
    2) Use a Perl module with web client functionality. (LWP::Simple)
    3) Use a Perl module that can parse RSS. (XML::RSS::Parser)

    my $lostdogs = Fetcher->new();
    $lostdogs->feed("http://sfbay.craigslist.org/search/ccc/nby?query=lost%20dog&fo
    rmat=rss");
    $lostdogs->getfeed();
    $lostdogs->savefeed('lostdogs.rss');
    

    Now what if there was something like CPAN for JavaScript? Wouldn’t it make building all those AJAX apps easier? You wouldn’t have to be committed to either Dojo or YUI or Prototype.

  • Learning about Microformats

    Jakob Heuser introduced me to Tantek and Matthew Levine. My conversation went something like this:

    Me: How’s it going with hiring PHP guys?
    Tantek: We’re always hiring great talent.
    Me: Really?
    Tantek: Do you know about microformats?
    Me: No.

    At this point Tantek turned away from me and our conversation ended.

    But Matthew Levine jumped in to help out by asking, “Do you have a website?”

    Me: Yes
    Matthew: Let’s add a microformat to it right now.

    In less than half an hour we geeked out the right sort of microformat for my website and put it up on my contacts page.

    It’s because of helpful folks like Matthew that SxSW is so enjoyable.

    If you don’t know about microformats, I will not turn my back to you, and will no doubt help you out in the same way that Matthew did.

  • An easier way to parse JSON

    I’m currently a big fan of this syntax for parsing and writing JSON.

    In the past, you used to have to do eval on your JSON coming in, and that posed a great security risk. Now you can use string.parseJSON and object.toJSONString by using this script:

    http://www.json.org/json.js

    Enjoy!

  • Moguls of the New Media

    I’m wary every time I hear something new. I’m a bit wary of the idea that there’s progress in history. Instead, I like to think like Foucault, and what he said about ruptures in history.

    Here’s a Wall Street Journal article on the Moguls of the New Media.

    The essential idea is that the little guy can be a big player in the media world. But really there is nothing new in this. The success stories in the Wall Street Journal read like a Horatio Alger dime novel.

    It’s great working in the tech industry and being part of this, and seeing outsiders storm in and take the buzz away from older, established forms of media, but we should really be weary, especially those of us who were here in the 90s.

    The old rules, or the rules still apply. Money is still the power du jour, and remember AOL Time Warner? It’s now called just Time Warner.

    What’s actually happening is the same thing that fueled the personal computer “revolution” of the 80s. Cheaper computers went hand in hand with greater demand. Cheaper means of communication qua new media means greater demand in that means of communication, too.

  • Economies of Scale

    When I used to consult, I could work for a few websites, and barely get by. Maybe I didn’t charge enough, or maybe how I worked for these sites didn’t allow me to invest in the site.

    What do I mean? If you work for just a few clients, you run the risk of one project backing your work up. This is true of any professional service company. A great example of this is ICon, a company that works to keep the IRS off other companies’ backs. Because the IRS fails to leverage the advantages of networked computing, ICon cannot work as efficiently, and therefore doesn’t make us much money as it could.

    Many web consultants shy away from hosting responsibilities because it isn’t what they do, or because they’re afraid of the potential financial risks of hosting, but anyone who wants to make serious cash should seriously consider hosting. It’s one of the few areas, where increased charges to clients are easily justified, once a client’s site starts becoming a hit.

    Do web firms that takeover hosting responsibilities make more money than web firms that don’t?

    Share your thoughts.

  • Blog Claiming on Technorati

    WTF? Check out this pic.

    To claim your blog on Technorati you can type in your username and password to your blog. I had a WTF moment when they asked for my username and password! Or you can just post a link to your Technorati Profile .

    I choose the latter.

  • 6 Things You Can Only Do In Ajax

    This article was originally slated to be published in Webmonkey. I opted against having it published in favor of a more technical and useful article on caching in order to improve web server performance. But Webmonkey got bought up by Conde Nast. Here’s the article that was slated to be published, but is now published here:

    Hidden beneath many of the so-called Web 2.0 websites is Ajax.

    What’s Ajax? Ajax stands for Asynchronous Javascript and XML. It’s something of a misnomer since XML isn’t necessary for making a web page with Ajax effects on them. Also, the “asynchronous” in Ajax is misleading. Synchronous systems are controlled by a central clock. It’s really hard to see if there ever really was such a thing as synchronous Javascript.

    Rather than looking at the words in the acronym, it’s best to look at the websites that use Ajax techniques.

    You can check out the demos of Ajax techniques at Scriptaculous.

    Also, if you take a look at GMail, Flickr, GoogleMaps, Ma.gnolia and the 37signals set of web applications, you’ll notice four technologies that stand out to make Ajax:

    1) XMLHttpRequest — the little Javascript hack that makes “asynchronous Javascript” possible. This object will exchange data with a web server so that your web page doesn’t have to reload. Lots of great Javascript jockeys took a lot of time and care to make Javascript libraries so that you don’t have to deal with the internals too much. But for those of you that like the path of pain or hate hearing RTFM, the working draft can be found at the w3c’s.

    A great Javascript library for using Ajax techniques is prototype.

    2) XML — you can use xml to transfer data between your web page and the web server, but if you dig deep into the source code of certain sites that use Ajax techniques you’ll notice that

    3) The DOM — the Document Object Model allows you to uniquely identify different parts of a web page so that you can use javascript to modify those different parts.

    4) CSS – Cascading Style Sheets are a powerful way to apply site wide changes to different (X)HTML tags.

    By combining these four technologies together, you can do pretty cool, neat effects on a web page that you’d be hard pressed to do with any other technology. In fact, I’m so confident that you’d use Ajax instead of any other technology that I’ve come up with a list of 6 things that you can only do in Ajax. You might want to try it using a Java Applet, or Flash. I’d be curious to hear what happens. Flash and Flex is catching up pretty quickly.

    For previous webmonkey articles to get you up to speed on Ajax, I highly recommend “Ajax: It’s Good for what Rails You” by Paul Adams.

    This article will show you 6 things that you can only do with Ajax:

    1. Notifications w/o Reload
    2. Lightbox & Thickbox
    3. AjaxTerm
    4. Livesearch
    5. Edit in place w/Ajax
    6. Flexstore on Rails

    1) Look Ma, No Hands: Notifications without Reload

    By using javascript’s setTimeout function, you can update a web page without having to re-load. A great example of this can be found in GMail, where you’re automatically notified if you’ve got mail without having to reload a page. No more pressing that check mail like a lab rat, unless you want to.

    Also there are an array of chat programs that use Ajax techniques.

    http://ajaxian.com/by/topic/chat/

    If you’re familiar with trying to get a java chat applet to work on your OS X or Linux browser, you’ll be glad that Ajax is around.

    2) Just dim the lights a bit to get us in the mood for… coding: Lightbox Gone Wild & Thickbox

    Lightbox by Lokesh Dhakar allowed you to create a photo gallery where you could click on a thumbnail, pull up a medium to large sized photo, and dim everything else in the background. It’s a pretty cool effect that you can check out on the demo page.

    Now what happens when you Ajax-ify lightbox? You can find out at the Lightbox Gone Wild demo:

    http://particletree.com/examples/lightbox/

    You can also find out at the thickbox demo page, too: http://jquery.com/demo/thickbox/ You can not only bring up pictures, but you can bring up text & forms that were called using the XMLHTTPRequest object, and have those show up brightly in contrast to a dim background. Moreover, you can have the forms post data to a webserver triggering any sort of CRUD (create, read, update, delete) function on your favorite database.

    3) Is Ajax just some shell game?

    Yes, it is when you’ve got a tool like AjaxTerm.

    Don’t you just hate it when you’re at a public terminal and don’t have access to a command-line shell?

    AjaxTerm allows you to turn your browser into a unix command-line shell. In the case of the picture below, I’m using irssi which was invoked in bash:

    Ajax Term Example

    This is definitely the coolest use of Ajax I’ve run into so far.

    You can set up your PC to have the AjaxTerm script written in Python to run over SSL. If you’re at an internet cafe and without your laptop, you can point your browser to the IP address of your PC, and voila, a shell for logging in.

    4) Don’t get nervous all because you’re live.

    With livesearch you can type in letters and get your search results right away without having to hit the submit button.

    You can find an example of livesearch for Amazon products at MyBigRiver.com.

    But if you hate commercialism, you can check out a BitFlux demo. Try typing in ‘php.’

    For a tutorial on how to implement livesearch check out php magazine: http://ajax.phpmagazine.net/2006/02/explore_amazon_web_services_wi.html For the latest news on livesearch, check out Ajaxian.

    5) Flickr’s Ajax based, Edit-in-place functionality is not only cool but it can save a media intern hours when it comes to updating entry names.

    Instead of waiting for the browser to re-load each time you update a picture’s name, you can just move on to the next picture and update it’s name.

    A great tutorial for edit-in-place can be found at 24ways: 24ways.org/advent/edit-in-place-with-ajax

    6) So does all this Ajax mean that Flash is dead? Not really.

    In fact Christoph Coenraets came out with a hybrid of a shopping cart that’s Ajax and Flash. Time to flex those coding muscles. The tutorial is on his website. With Flex on Rails you can use a slider to control which search results come up. You can get realtime results.

    Are there only 6 things that you can only do in Ajax? Or that you’d rather do in Ajax? I hope these 6 great ideas by some great web developers get you brainstorming about more new ideas.

    There’s a fabulous list of Web 2.0 related sites that just might be using Ajax.

    The beauty of the Web is that if you see something that isn’t Ajax’d you can just go out there and code it thanks to the resources on this website as well as the Internet.