Add a Rate Limit to Your Website

Suppose you have a ressource on the web (for example an API) that either generates a lot of load, or that is prone to be abused by excessive use, you want to rate-limit it. That is, only a certain number of requests is allowed per time-period. A possible way to do this is to use […]

Thinkery API launched

Just a quick note, we made the Thinkery API public. If you don't know thinkery.me, it is a simple yet powerful tool for storing both notes and bookmarks. The contents of the saved page is stored in your Thinkery which you can keep even if the webpage goes down. With #hashtags you can easily categorize […]

Veröffentlicht unter web

Genial Daneben Analyse

Zur Abwechslung mal ein Post auf deutsch. Ich bin Fan der (inzwischen abgesetzten) Fernsehsendung Genial daneben. Es gibt da eine Genial Daneben Datenbank mit (nahezu) allen Fragen, die in den Sendungen vorkamen. Ohne konkreten Nutzen habe ich diese Daten aus der Text-Form in eine echte Datenbank konviertiert (Script hier) und bin zu folgender Tabelle gekommen. […]

Veröffentlicht unter web

Android WebView: Web page not available

Just a quick note in order to save someone else searching for a solution to this problem. When you want to display HTML content in an Android WebView do it like this: String html = „my >b<HTML content>/b<. 100% cool."; WebView webView = (WebView) findViewById(R.id.myWebView); webView.loadData(„>?xml version=\"1.0\" encoding=\"UTF-8\" ?<" + html.replace(„%","%25"), „text/html", „UTF-8"); If you […]

Veröffentlicht unter web

hckr news

Just wanted to point you all to Wayne Larsen's alternate interface to Hackernews, called hckr news. I really like the clean and fast interface, compared to the everlasting old interface on the original page (even though you can of course use User CSS to pep it up a little). Wayne also created browser extensions that […]

Veröffentlicht unter web

Use an authenticated feed in Google Reader

You currently can't subscribe to an authenticated feed (for example in Basecamp) in Google Reader. If you want to do it nonetheless you can use this script of mine which will talk to the server that needs authentication, passing through all the headers (so that also cookies and „not modified" requests will come through): download […]

Veröffentlicht unter web

preg_match, UTF-8 and whitespace

Just a quick note, be careful when using the whitespace character \s in preg_match when operating with UTF-8 strings. Suppose you have a string containing a dagger symbol. When you try to strip all whitespace from the string like this, you will end up with an invalid UTF-8 character: $ php -r ‚echo preg_replace(„#\s#", „", […]

Restoring single objects in mongodb

Today I had the need to restore single objects from a mongodb installation. mongodb offers two tools for this mongodump and mongorestore, both of which seem to be designed to only dump and restore whole collections. So I'll demonstrate the workflow just to restore a bunch of objects. Maybe it's a clumsy way, but we'll […]

Safari Extension: Clean URLs

I have been picking up and developing a fork of Grant Heaslip's Safari extension URL clenser which removes all sorts of un-necessary junk for the URL so that you can easily pass on a clean URL to someone else. Things being removed include: Google Analytics parameters (utm_source=, utm_medium, etc.) Youtube related parameters (feature=) Partner tracking […]

Veröffentlicht unter web