Skip to content

A must have: Drool Radio for iPhone

26-Aug-09

[youtube]http://www.youtube.com/watch?v=9QDU3GpRNOM[/youtube]

Drool Radio is a High Quality Internet Streaming Radio Player with a Unique design.

More…

CoRD 0.5 Relased

11-Aug-09

MediumCoRDScreenshot

My favorite Remote Desktop for Mac OS X has finally gotten an update. New Features are:

More…

AHP Sitewide Recent Posts Widget for WPMU

04-Mar-09

AHP Sitewide Recent Posts Configuration

AHP Sitewide Recent Posts Widget for WPMU makes it  easy to add and configure the AHP Sitewide Recent Posts plugin.

More…

toksta* chat plugin for BuddyPress

27-Feb-09

The toksta* chat plugin for BuddyPress makes it easy to add toksta* chat and webcam to your BuddyPress site.

More…

Slow

18-Nov-08

slow food, slow cities, slow drives, slow design, L’Arte del Vivere con Lentezza, slow travel, slow sport, slow work

“Slow is not about doing everything at a snail’s pace; it’s about working, playing and living better by doing everything at the right speed.” from www.slowplanet.com

Ex Libris

13-Nov-08

Ex Libris is a “this book I’ve read” application targeting the Norwegian Facebook community. On Ex Libris you can search for books written in and translated to Norwegian. You can add them to your book list, comment, recommend and rate books.

Coding Ex Libris was fun. It’s written in PHP and uses FBML, FBJS, Ajax, PHP MySQL wrapper, CSS The Star Matrix Pre-loaded and Bayesian Rating

As I said, it’s targeting the Norwegian Facebook community and hence in Norwegian. You’ll find it at http://apps.new.facebook.com/exlibris/

Microsoft Hyper-V gotcha

15-Oct-08

..i.e. lack of documentation.

Today I installed Microsoft Hyper-V on our new test server, a HP DL380 with 32GB memory and plenty of disk (800GB in RAID 5 and a hot spare). The install was quick and easy, but getting it on net was not. With a new router/firewall, configuration new to us, we thought it was causing all the “pain” and struggled for hours until we decided enough is enough, let’s continue tomorrow.

Luckily, surfing the net, I stumbled upon the solution to our grieve. Microsoft Hyper-V has its firewall enabled per default (yes, I know, I should have known it was). To managed the hidden features of Microsoft Hyper-V, you have to use netsh from the command prompt, and to disable the firewall (remember I said, we’re using an external firewall, and hence we don’t need the on-board firewall) all you have to do is:

netsh firewall set opmode disable

Hopefully this information will help you when you install your Hyper-V, and hopefully Microsoft will add this to their FAQ.

Facebook ajax rating in php

09-Oct-08

I’ve written an ajax rating snippet, you’ll find a demo at http://apps.new.facebook.com/ajaxrating/

It is based on Paul OB’s CSS Star Matrix Pre-loaded

The source code below, should be self explanatory, but if you need input on how to do fbjs ajax, you’ll find documentation and examples over at the facebook development site

< ?php
// the $callbackroot MUST point to your server, if you point it to your app.new.facebook.com/APPLICATION, ajax will fail.
$callbackroot='http://[PLACE_YOUR_CALLBACK_URL_HERE]'; // do not add a trailing slash e.g.: http://myserver.domain.com
//AJAX Response (should be first php or in a separate php file):
if (isset($_REQUEST['rate'])) {
    //do something and return "ok" if things are fine
    echo "ok";
    exit; //Important! Stops remaining php after AJAX request is processed
} 

//what ever apicall you use to authenticate, this one is from smiley: http://svn.facebook.com/svnroot/platform/samples/packages/smiley.tar.gz
$fb = get_fb();
$user = $fb->require_login();

?>
<!--  see rate.css below -->
<link rel="stylesheet" type="text/css" href="<?=$callbackroot?>/rate.css" />
<script type="text/javascript">
function save_rating(rate) {
    // array with the class names, used when you add the new class
    var ratings = [ "nostar", "onestar", "twostar", "threestar", "fourstar", "fivestar" ];
    var ajax = new Ajax();
    ajax.responseType = Ajax.RAW;
    ajax.ondone = function(data) {
        if (data == "ok") {
            // remove old class names (I don't know which one, so I remove all of them), and add the new
            document.getElementById('rating_1').removeClassName('nostar').removeClassName('onestar').removeClassName('twostar').removeClassName('threestar').removeClassName('fourstar').removeClassName('fivestar').addClassName(ratings[rate]);
        } else {
            new Dialog().showMessage('Dialog', 'set rating failed');
        }
    }
    ajax.onerror = function() {
        new Dialog().showMessage('Dialog', 'set rating failed');
    };
    ajax.requireLogin = 1;
    var params={"rate":rate };
    ajax.post('< ?=$callbackroot?>/rate.php',params);
}
</script>

<ul id="rating_1" class="rating nostar">
<li class="one"><a href="#" title="1" onclick="save_rating(1); return false;">1</a></li>
<li class="two"><a href="#" title="2" onclick="save_rating(2); return false;">2</a></li>
<li class="three"><a href="#" title="3" onclick="save_rating(3); return false;">3</a></li>
<li class="four"><a href="#" title="4" onclick="save_rating(4); return false;">4</a></li>
<li class="five"><a href="#" title="5" onclick="save_rating(5); return false;">5</a></li>
</ul>

A how-to and the rate.css are located at http://forum.developers.facebook.com/viewtopic.php?id=22547

My digital tool chest

04-Oct-08

More…

WP-DenyHost

18-Apr-08

This is a plugin that will block a spammer if he already has been tagged as a spammer. I use it together with the Akismet plugin. Akismet tags the spammer, and wp-denyhost prevents him from adding more comment spam.

Core functionality :

define('PS_DENYHOST_THRESHOLD', 5);
function ps_denyhost() {
    global $wpdb;

    $suspect = $this->get_IP();
    $count = (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_author_IP = '$suspect'");

    if ($count > PS_DENYHOST_THRESHOLD) {
        exit;
    }
}
add_action('init', 'ps_denyhost');

Download / install: http://wordpress.org/extend/plugins/wp-denyhost/

View-sourcehttp://soderlind.no/code/view/ps_wp_denyhost.php

Changelog (updated 28.12.2009):

v1.1.3: Fixed a minor bug
v1.1.2: Added response 403 Forbidden
v1.1.1: Added languages/wp-denyhost.pot
v1.1.0: Major rewrite. Added option page
v1.0.1: Replaced LIKE (‘%$suspect%’) with = ‘$suspect’ i.e. look for exact match
v1.0: Initial release

@soderlind on Twitter:

Powered by Twitter Tools

Rodney's 404 Handler Plugin plugged in.