Entries Tagged 'hacks' ↓

How To: Speed Up The MacRumorsLive Ajax Refresh

title_macrumors.gifBy default, MacRumorsLive polls the server for updates only every 60 seconds. I know, I know.. <enter sad puppy face here> If you're like me, you probably want that action with a touch more zip to it! And thus...

To poke the server every 10 seconds for a new update, drop this badboy into the location bar on your MacRumorsLive tab and hit enter:

javascript:(function(){var booyah=10,str='ro[0].firstChild.nodeValue',countdown='document.getElementById("ti").innerHTML  = (rr-x) + " seconds till next update..."; setTimeout';rr=booyah;eval('d = '+d.toString().replace(str,booyah));eval('ppd = '+ppd.toString().replace(str,booyah));eval("l = "+l.toString().replace('setTimeout',countdown));x=5;})();

btw- this doesn't work in IE. Deal with it.

Update (11:41am): It now has a countdown till next update. countdown.PNG

Quick internationalized sort in javascript

Let's take a list of countries that was originally alphabetized in English, but is now translated to French.

var arr = ["Argentine", "Australie", "Autriche", "Belgique", "Brésil", "Canada", "Chili", 
"Chine", "Costa Rica ", "République Tchèque", "Danemark", "Équateur", "El Salvador ", 
"Finlande", "France", "Allemagne", "Guatemala", "Hong Kong", "Hongrie", "Inde", "Irlande", 
"Italie", "Japon", "Corée du Sud", "Luxembourg", "Mexique", "Pays-Bas", "Nouvelle-Zélande", 
"Norvège", "Panama", "Pologne", "Portugal", "Russie", "Slovaquie", "Espagne", 
"la Suède", "Suisse", "Turquie", "Royaume-Uni", "Uruguay", "États-Unis"]

You can see the incorrect sort order for Germany ("Allemagne") and the US ("États-Unis").
Running the standard javascript Array.sort() will sort it according to the American English language:

arr.sort();
/*==>
["Allemagne", "Argentine", "Australie", "Autriche", "Belgique", "Brésil", "Canada", "Chili", 
"Chine", "Corée du Sud", "Costa Rica ", "Danemark", "El Salvador ", "Espagne", "Finlande", 
"France", "Guatemala", "Hong Kong", "Hongrie", "Inde", "Irlande", "Italie", "Japon", 
"Luxembourg", "Mexique", "Norvège", "Nouvelle-Zélande", "Panama", "Pays-Bas", "Pologne", 
"Portugal", "Royaume-Uni", "Russie", "République Tchèque", "Slovaquie", "Suisse", "Turquie",
 "Uruguay", "la Suède", "Équateur", "États-Unis"] */

Note the misplacement of the last three entries. A real internationalized sort of this would be a huge motherbitch to implement, but here is a quick and hacky way to get your ducks in order:

  arr.sort(function(a,b){
 
    function normalize(str){
       return str
               .toLowerCase()
               .replace(/è|é|ê|ë/,'e').replace(/ò|ó|ô|õ|ö/,'o').replace(/ì|í|î|ï/,'i')
               .replace(/à|á|â|ã|ä|å|æ/,'a').replace(/ù|ú|û|ü/,'u');
    }
 
    a = normalize(a);
    b = normalize(b);
 
    return ((a < b) ? -1 : ((a > b) ? 1 : 0));
  });
/*==>
["Allemagne", "Argentine", "Australie", "Autriche", "Belgique", "Brésil", "Canada", "Chili", 
"Chine", "Corée du Sud", "Costa Rica ", "Danemark", "El Salvador ", "Équateur", "Espagne",
 "États-Unis", "Finlande", "France", "Guatemala", "Hong Kong", "Hongrie", "Inde", "Irlande", 
"Italie", "Japon", "la Suède", "Luxembourg", "Mexique", "Norvège", "Nouvelle-Zélande", 
"Panama", "Pays-Bas", "Pologne", "Portugal", "République Tchèque", "Royaume-Uni", 
"Russie", "Slovaquie", "Suisse", "Turquie", "Uruguay"] */

It's not perfect (I bet that "la Suède" should actually be in the S's), but it'll get you a bit closer without too much effort.

what makes you sustainably happy?

i wonder about the personal fulfillment of:

  • doing what we think we should be doing
  • doing what we want to be doing
  • doing what we think makes us happy

because those three are certainly different..

How to keep friend requests out of your inbox

If you're incredibly popular on the internet, like me, then I can hear you crying for help. :)

Friend requests littering your inbox can get annoying. They certainly don't need your attention right now, so why not through them to a more passive information consumption area: RSS. That way you can process them en masse, when you're ready to.

First, we use the filters in Gmail to identify all friend request emails.

  • Set up a new filter.
  • In the subject area put in this text:
    {"friend request" "is now following you" "newest contact" "friends on yelp" "added you as a" "has requested your trust" "wants to be your friend" "invited you to connect" "would like to be added"}
  • Click next, then select Skip the Inbox
  • Check Forward it to and in the box put in a unique-email-address @ mailbucket.org. (For example: paulsfriendrequests@mailbucket.org) This will be a public feed, so... yeah.
  • Click Create Filter

friendrequestfilter.PNG

Your newly created RSS feed will be at http://mailbucket.org/unique-email-address.xml.

This filter will catch all friend requests from: Myspace, Facebook, LinkedIn, Flickr, Spokeo, Twitter, Yelp, and Plaxo Pulse. (And should be pretty trivial to add new ones. :)

Best greasemonkey scripts ever!

Included in this package:

  • Greased Lightbox
  • Amazon Wishlist ajax delete
  • autopagerize
  • cleaning up google reader (my style fixes)
  • delicious reorganized (a nicer skin for del.icio.us)
  • flickr auto-page
  • gmail spam count hide
  • google reader preview (load destination link into google reader)
  • paul's myspace fixes (bunch of stuff that makes myspace suck less)
  • textarea resize (ctrl-enter to make a multi-line text input taller)

Paulsfavoritegreasemonkeyscripts.zip

Open the zip and open the files in firefox. say yes when it prompts you to install.

How to make an RSS feed where one never was

Update: Feed43, mentioned in my post, has now lost data and I'd consider an unreliable pick. You can now use Yahoo Pipes and Dapper to do the same. I recommend both.

deliciouslogo.gifDel.icio.us is has social networking, but doesn't really make those features very prominent, so you may not have noticed.
The network page is the most helpful piece of aggregation. After you friend people, their bookmarks will be aggregated there: paul.irish's network page on del.icio.us.
One feature that hasn't been implemented is notification of new people adding you to their network. I wanted to be kept aware, but I couldn't use a service like ChangeDetection (mentioned in my post here), because the entire page was changing all the time. I needed to isolate a small part of the page.

I used a service called Feed43. It takes a while to get the filtering right. Basically you have to tell the parser how to identify news items. Here's some photos that should help show how to do it:

feed43-1.jpg
feed43-2.jpg
feed43-3.jpg

In the end, I came out with a good looking RSS feed of my del.icio.us network fans: http://feed43.com/paulirish-network-newfriends.xml
Now whenever anyone adds me to their network, a new RSS item will be created and I'll see!
Score.

Automator fights Automator!

Every 60 days I get an email that tells me my free custom DNS entry (yes-ip.no-ip.org) is expiring. (Yes, I chose a very clever prefix..)
Here's the email:
expiringdns.PNG

Getting an email every 60 days and clicking a link doesn't kill me, but it'd be super nice to not have to.

So I'm using another free service to preemptively renew this host. ChangeDetection will email you any time a page changes. (So you can assume it's visiting a site regularly to check its content.)
changedetection.PNG

But what to use for the email? I don't really want it emailing me about changes to the site's footer or whatever, so I'm going to use a throwaway account. But at the same time, I know there's an email confirmation step on this site.

2Prong to the rescue!
Visit 2prong and it copies a temporary email address to your clipboard automatically.
Then the site will check (via ajax) for new email to that address and automatically display it when it comes in.

2prong.PNG

Then I just click that confirmation link and I'm all set! WOO!

How to get iTunes to rip to mp3

Itunes
Edit / Preferences

itunesriptomp3-640.jpg