
Do you train Kung Fu?
Or know someone who does?
Then check out KungFuPeople.com
Mobile version of this page
Previous:
LastGraph - visualizing your Last.fm usage
Next:
Tip: creating a Xapian database in Python
ReCSS a tool to reload the CSS without reloading the whole page
Welcome to the world: DoneCal.com
Integrate BrowserID in a Tornado web app
My first Twitter app - KungFuPeople.com
iPhone push notifications for Twitter with Prowl
OpenID, Attribute Exchange, SReg, python-openid and Google
Git + Twitter = Friedcode
LastGraph - visualizing your Last.fm usage
Next:
Tip: creating a Xapian database in Python
Related blogs
Too Cool For Me?ReCSS a tool to reload the CSS without reloading the whole page
Welcome to the world: DoneCal.com
Integrate BrowserID in a Tornado web app
My first Twitter app - KungFuPeople.com
iPhone push notifications for Twitter with Prowl
OpenID, Attribute Exchange, SReg, python-openid and Google
Git + Twitter = Friedcode
Related by category

Bookmarklet to replace the current domain with localhost:8000
16th of January 2010
If you, like me, have various projects that do things like OAuth on Twitter or Google or you have a development site that goes to PayPal. So you're doing some Django development on http://localhost:8000/foo and click, for example, to do an OAuth on Twitter with an app you have there. Then Twitter will redirect you back to the live site with which you've set it up. But you're doing local development so you want to go back to http://localhost:8080/... instead.
Add this bookmarklet: to localhost:8000 to your browser Bookmarks toolbar and it does exactly that.
Here's its code in more verbose form:
(function() {
a = function(){
location.href = window.location.href.replace(/http:\/\/[^\/]+\//,
'http://localhost:8000/')
};
if (/Firefox/.test(navigator.userAgent)) {
setTimeout(a,0)
} else {
a()
}
})()
a = function(){
location.href = window.location.href.replace(/http:\/\/[^\/]+\//,
'http://localhost:8000/')
};
if (/Firefox/.test(navigator.userAgent)) {
setTimeout(a,0)
} else {
a()
}
})()


Any way to get this working in Chrome?