Wednesday, August 25, 2010

What the fuck is a sloth?

Today I got bored and I made this.



It all started when I told my wife, Sarah, that she was a sloth (for no particular reason that I can remember), and we both realized that we had no idea what the fuck a sloth was. So, I figured I'd help other people who were in a similar situation, and thus whatthefuckisasloth.com was born.

Sunday, December 20, 2009

TweetAtCongress - An API Created By Yours Truly

I just launched a new Web site I've been working on for a couple of months now, http://tweetatcongress.com.


TweetAtCongress.com: Find Congress Members on Twitter


TweetAtCongress offers an API for looking up Congress members on Twitter, and was created so that public advocacy organizations can give their supporters a way to communicate with elected officials with a tweet. Right now the API includes data on federal legislators, and state legislators will be added soon!


This was my first attempt at writing my own API, and it was quite neat actually. A big change from my day job of front-end, client-side Web development. I got the idea for the project earlier this year, when an advocacy org I was speaking with said, "Hey, we saw this thing on Obama's Web site where users are able to post a tweet to their Congressperson, how can we do that?" I responded that I could not find a suitable API out there, and they sort of forgot about the idea, but I was intrigued enough to create my own database and write a little code, and here we are.

Friday, May 22, 2009

Embedding YouTube Videos on Secure Web Sites.

Currently YouTube doesn't offer an option of embedding its videos via https, so if you try to add a video to a secure page browsers will display a security warning. If you use swfobject.js instead of the code provided by YouTube (as you should!), you'll find the security warning goes away ... in some browsers; IE is fooled and doesn't display a warning, while FireFox will still show its little red exclamation mark in the status bar indicating that not all elements on the page are secure:



The same issue occurs in Opera, as well as Flock and other Mozilla browsers.


And obviously, since swfobject is a JavaScript file, if JavaScript is disabled in the browser the only option for showing the video is a plain ol' Flash object inside noscript tags, and in that case the security warning is displayed for all browsers.


The workaround I came up with is to upload a SWF to the secure site that acts as a proxy and loads the YouTube video (since Flash has its own security model, it doesn't matter that the video is not served via https).


Here is an example from peta2's "Whose Skin Are You In?" Web site:


peta2's "Whose Skin Are You In" video


I've posted the SWF I created to Google Code at http://code.google.com/p/ytplayer.


Here's the ActionScript that makes it all work:


Stage.align="TL";

Stage.scaleMode="noscale";


System.security.allowDomain("http://www.youtube.com");

System.security.loadPolicyFile("http://www.youtube.com/crossdomain.xml");


//create a MovieClip to load the player into

ytplayer=createEmptyMovieClip("ytplayer",1);


//create a listener object for the MovieClipLoader to use

ytPlayerLoaderListener={};

var loadInterval:Number;


//When the player clip first loads, we start an interval to check for when the player is ready

ytPlayerLoaderListener.onLoadInit=function(){

   loadInterval=setInterval(checkPlayerLoaded,250);

}

function checkPlayerLoaded():Void{

   //once the player is ready, we can subscribe to events

   if(ytplayer.isPlayerLoaded()){

      ytplayer.setSize(Stage.width,Stage.height);

      clearInterval(loadInterval);

   }

}


//create a MovieClipLoader to handle the loading of the player

ytPlayerLoader=new MovieClipLoader();

ytPlayerLoader.addListener(ytPlayerLoaderListener);


//load the player

ytPlayerLoader.loadClip("http://www.youtube.com/v/"+vidId+"&hl=en&fs=1",ytplayer);


//adjust size when user clicks full-screen

var listener:Object=new Object();

Stage.addListener(listener);

listener.onFullScreen=respondFunction;

function respondFunction(){

   ytplayer.setSize(Stage.width,Stage.height);

}

Friday, April 03, 2009

Put TwitStream on Your Site!

I tried to find a jQuery plugin I could use with the Twitter Search API to display recent tweets containing a specific keyword or hashtag, but couldn't really find one that fit my needs, so I made one!


I call it TwitStream.


TwitStream: jQuery, AJAX, and the Twitter Search API

Thursday, September 25, 2008

Donate to HRC in honor of Orson Scott Card.


"Hi, I hate freedom."

Inspired by the recent flood of donations to Planned Parenthood in honor of Sarah Palin, I'd like to call on rational human beings who believe in consenting adults' right to marry regardless of their gender to donate to the Human Rights Campaign in honor of Orson Scott Card. Hang on, I'll explain ...

It turns out that the fella who wrote Ender's Game—one of my favorite books in my early teen years—is quite a bigot. Like, a really really crazy bigot.

Here's what OSC thinks about legalizing marriage for all Americans.


"Regardless of law, marriage has only one definition, and any government that attempts to change it is my mortal enemy. I will act to destroy that government and bring it down, so it can be replaced with a government that will respect and support marriage, and help me raise my children in a society where they will expect to marry in their turn. Only when the marriage of heterosexuals has the support of the whole society can we have our best hope of raising each new generation to aspire to continue our civilization...

In the first place, no law in any state in the United States now or ever has forbidden homosexuals to marry. Any homosexual man who can persuade a woman to take him as her husband can avail himself of all the rights of husbandhood under the law. Ditto with lesbian women. To get those civil rights, all homosexuals have to do is find someone of the opposite sex willing to join them in marriage.

However emotionally bonded a pair of homosexual lovers may feel themselves to be, what they are doing is not marriage. they are not turning their relationship into what my wife and I have created, because no court has the power to change what their relationship actually is. They steal from me what I treasure most, and gain for themselves nothing at all. They won't be married. They'll just be playing dress-up in their parents' clothes.

Homosexual 'marriage' won't accomplish what they hope. They will still be just as far outside the reproductive cycle of life. And they will have inflicted real damage on those of us who are inside it. they will make it harder for us to raise children with any confidence that they, in turn, will take their place in the reproductive cycle."

Insane much?

So, join me in stickin' it to Mr. Card. Go to https://secure.ga3.org/03/inhonorof1 to make as generous a donation as you can afford and show your support for equal rights regardless of gender or sexual orientation. Under "Send acknowledgements to", be sure to include the following name and address to be sure ol' Orson knows you made the donation:

Orson Scott Card
P.O. Box 18184
Greensboro, NC 27419

Saturday, June 21, 2008

06.21.08: Last Five Movies I Watched on NetFlix.

I signed up for NetFlix a few months ago, primarily out of frustration with free tv and movie sites linking to slow-loading foreign video servers which don't even work half the time, and torrents that never finish downloading. It's totally worth $8.99 a month to have HD quality video available on demand. The NetFlix "Watch Instantly" selection leaves a little to be desired, but it's improving. Here are the last five movies from my Instant Queue, and my thoughts on each.

Before the Devil Knows You're Dead
1) Before the Devil Knows You're Dead
☆☆☆☆

I'm kind of surprised at how little attention this movie received when it was in theaters. The plot revolves around two brothers' botched jewel store robbery, with the story being told in that out of order film noir kinda way. Philip Seymour Hoffman, Ethan Hawke, Marisa Tomei, and that old guy from Big Fish are all phenomenal. I could have done without the sex scene with Philip Seymour Hoffman, but that's OK.

Tromeo and Juliet
2) Tromeo & Juliet
☆☆☆

I've thoroughly enjoyed every Troma film I've seen. In fact, three out of the next five movies in my Instant Queue are from Troma: Redneck Zombies and Toxic Avenger parts 1 and 2. Tromeo & Juliet was up to par with some of their other films. My only complaints are that there was more gratuitous nudity than there was blood and guts, and the movie's description claims it's a "punk" remake, but aside from a couple piercings and tattoos, there's not really that much "punk" to it. Still, it's a good amount of campy, and the blood and guts that did make it in is great.

Cannibal: The Musical
3) Cannibal: The Musical
☆☆☆

A musical comedy, or "musedy" if you will, from the guys behind South Park. I was pleasantly surprised at how funny it was. I would have expected the comedy to be a bit more crude considering the creators, but instead it was just good ol' fashioned slapstick. The story, which the movie's intro claims to be based on real events, is that of Alfred Packer, a horse-loving guide who leads a group of miners to Colorado in search of gold. Along the way, there's some cannibalism, and some humorous encounters with "Indians." Highly recommended. And don't worry, it's not really all that much of a musical.

Severed: Forest of the Dead
4) Severed: Forest of the Dead

I gave this movie one star only because there was a decent amount of head-chopping gore. The plot was ridiculous, the acting was not-so-hot, there were more zombies than logically possible, and the whole thing was waaay too long. To sum it all up in 15 seconds: Sap from an evil corporation's genetically modified trees causes some lumberjacks to turn into zombies, they eat some other lumberjacks and some hippie environmentalists, and the evil corporation leaves them all to die. I don't recommend seeing this, unless ... actually, there's no reason to see this, ever.

The King of Kong
5) The King of Kong
☆☆☆☆

I missed this when it was in theaters (I seem to recall a stomach flu being responsible), so I was excited to see it on the NetFlix "New Arrivals" list. Five words: Billy Mitchell is a prick. This video game documentary tells the story of everyman Steve Wiebe and his quest to beat Mitchell's world record Donkey Kong score. Without spoiling the outcome, Wiebe becomes a certifiable master of the game, but Mitchell and his homoerotic gamer nerd lackeys just won't have it. Even if you don't particularly like video games, I strongly recommend this one. If you do like video games, particularly those of the arcade variety, I really strongly recommend it.

Tuesday, June 17, 2008

06.17.08: My Top Ten FireFox Add-ons.

In celebration of FireFox 3 Download Day, here's a countdown of the top ten FF add-ons I love most:

10) FoxyTunes
Do you listen to Music while surfing the Web?

FoxyTunes lets you control almost any media player and find lyrics, covers, videos, bios and much more with a click right from your browser.


As someone who has 15 different programs open at any given time, this kind of add-on saves me a lot of Alt-Tabs.

9) Domain Details
Displays Server Type, IP/Location Flag, and links to Whois Reports

I frequently use this one to find information on companies via the Web, particularly those who abuse animals, using Whois look-up. It's surprising how much you can find out from a domain registry...

8) TrashMail.net
Create free disposable email addresses and paste them directly in forms. This helps to protect you from spam mails and could be useful when subscribing to forums or newsletters.

If you've ever used services like spambox or dodgit, this is for you.

7) FireFTP
FireFTP is a free, secure, cross-platform FTP client for Mozilla Firefox which provides easy and intuitive access to FTP servers.

If you need to FTP, why not do it right in your browser?

6) Simple Mail
Mail client (POP3/IMAP/SMTP) for Firefox.

I've started using this in place of ThunderBird.

5) FireShot
FireShot is a Firefox extension that creates screenshots of web pages.
Unlike other extensions, this plugin provides a set of editing and annotation tools, which let users quickly modify captures and insert text and graphical annotations. Such functionality will be especially useful for web designers, testers and content reviewers.
It's possible to choose whether entire web page or only visible part of this page should be captured.
Screenshots can be uploaded to server, saved to disk (PNG, GIF, JPEG, BMP), copied to clipboard, e-mailed and sent to external editor for further processing.


No more copy and pasting screenshots into an image editor and cropping out all the stuff you don't want.

4) GSpace
This extension allows you to use your Gmail Space (4.1 GB and growing) for file storage. It acts as an online drive, so you can upload files from your hard drive and access them from every Internet capable system.

What else are you going to use 4 gigs for?

3) IE Tab
IE Tab - an extension from Taiwan, features: Embedding Internet Explorer in tabs of Mozilla/Firefox.

This one's really useful for sites like NetFlix that, for some silly reason, require that other browser.

2) Adblock Plus
Ever been annoyed by all those ads and banners on the internet that often take longer to download than everything else on the page? Install Adblock Plus now and get rid of them.

It's amazing how different the internet is without banner ads!

1) Web Developer
Adds a menu and a toolbar with various web developer tools.

The most valuable tool for anyone who ever works on Web sites.

Kudos to the developers of each of these add-ons for making them FF 3 compatible so quickly!

Firefox 3 Download Day 2008