Skip to main content
 

If your blog is more of a reference than a diary, why do you organise your posts in a timeline? Instead group them by category.<p>#status </p>

 

My entry for the <em>Danny Darko - Hurricane ft Julien Kelland</em> remix contest is now available on SoundCloud: https://soundcloud.com/freefalling/hurricane-freefall-remix Feedback welcome!<p>#status </p>

 

Hide Trackbacks works with WordPress 4.2

Hide Trackbacks is a WordPress plugin that hides pingbacks and trackbacks from your website comments.

I've updated the plugin to indicate it works correctly with WordPress 4.2.

 

Let's all turn off on-site commenting, and allow replies via moderated trackback. Anyone can start a blog and participate with increased civility and ownership. DONE.<p>#status </p>

 

Enum label lookup

In your datamodel you might have a Enum field such as this date-based dropdown:

public static $db = array(
    "Year"        => "Enum('2013, 2014, 2015')"
}

Internally, SilverStripe stores the index, so that when you retrieve the value in methods such as onBeforeWrite, instead of 2013 you will receive 1. Use the function below to retrieve the label of the Enum:

public function EnumLabel($field_name) {
    $enumValues = $this->dbObject($field_name)->enumValues();
    $label    = $enumValues[$this->$field_name];
    return $label;
}

// $year = $this->EnumLabel('Year');

 

LessThanOrEqual in SilverStripe 3.0

When adding a filter on a DataList sometimes you need to do a <= rather than a <. Unfortunately the LessThanOrEqual and GreatherThanOrEqual search filters do not exist in SilverStripe 3.0.x, they were added in 3.1.

Therefore we have to write our own where clause like the following example:

// Return all the sessions on or before the $date
$sessions = new DataList('AcademicSession');
$sessions = $sessions->where('"SessionStartDate" <= \'' . $date . '\'');

 

Ad tech is killing the online experience

Apple blogger John Gruber started off a new debate about these issues recently, when he noted that a 537-word text post on the website iMore.com weighed in at 14 megabytes. (Fourteen megabytes of text should correspond to about 7m words, or about 10 times the combined length of the Old and New Testaments.)

Gruber blamed iMore.com, but really it’s not the website’s fault, since to a very large degree the owner of the website you’re visiting doesn’t actually control what you see, when you see it, how you see it, or even whether you see it. Instead, there are dozens of links in the advertising-technology chain, and every single one of them is optimising for financial value, rather than low-bandwidth user experience. Many pages, if you’re on a slow connection, simply time out; they never load at all.

When you are a website owner, you are responsible for all the content on your site. If you don't have any control over the ads, then that's a process issue that should be addressed.

Why not band together with a few large sites and create a standardised ad submission and review system that advertisers can integrate into their content tools and websites can set criteria about ads on their sites.

Maybe the bigger problem is that those websites cannot afford to reject ads.

 

App.net is now receiving snippets from my site. ?<p>#status </p>

 

"the best of the year of high quality of life and the other hand is the only thing that would have to go back."<p>#status </p>

 

Open a new note, enter the first word, then keep pressing the text suggestions button and see what stream of consciousness erupts.<p>#status </p>

 

Tip: keep a list of domains covered by security certificates and their expiry dates.<p>#status </p>

 

BugzScoutLogWriter 1.0

I've released another SilverStripe add-on called BugzScoutLogWriter that I have been using for several months on some of the sites at work.It supports SS 3.0 and 3.1.

BugzScoutLogWriter is a LogWriter that integrates logs with FogBugz, an integrated web-based project management system featuring bug/issue tracking made by FogCreek.

A LogWriter is attached to errors, warnings and notices that occur in a website due to programming errors or runtime errors and then sends / saves a log of this event. SilverStripe comes with built-in functionality to e-mail or save the logs to a file, however if you use a third party bug reporting system then it's nice to have all the issues collected there instead.

I've used FogBugz for years now and one of the nice features is that multiple occurrences of the same issue get collected in the same ticket. This keeps the whole process manageable. Say, in the event that a mistake that affects all pages on a website, FogBugz collects the first 50 occurrences of that error and lets you close the ticket with one click. This is an improvement to a flood of email.

Anyways let me know if you find it useful and feel free to raise issues.

 

Tip: disable IFTT URL shorthening via account > preferences > URL Shorthening to post meaningful URLs to Twitter et al.<p>#status </p>

 

How to provide and manage your own permissions

At some point on your journey through the jungle that is SilverStripe, you will want to create permissions and assign users to them. You might have created a Page Category model admin to categorise your pages, and setup the relations between pages and their category. By default when you create a category as an admin they will not be visible to any content authors and any content authors that can access the model admin can't create any new items.

The solution to this dilemma is to create a new permission (for example PROJECT_CategoryAdmin) and then let people with that permission mange the category items. This is how to go about it:

Create the permission

You will need to tell SilverStripe you are implementing permission by changing the class declaration as follows (changes in bold):

class Category extends DataObject implements PermissionProvider

To create the new permission you will have to write a providePermissions() method for the Category class:

      public function providePermissions() {
        return array(
            "PROJECT_CategoryAdmin" => array(
                'name' => 'Administer categories',
                'category' => 'PROJECT',
                'help' => 'Manage categories.'
            )
        );
    }

Finally, implement the permission by declaring the canCreate, canDelete, canEdit and canView methods to your liking:

    public function canCreate($member = null) {
        return Permission::check('PROJECT_CategoryAdmin');
    }

    public function canDelete($member = null) {
        return Permission::check('PROJECT_CategoryAdmin');
    }

    public function canEdit($member = null) {
        return Permission::check('PROJECT_CategoryAdmin');
    }

    public function canView($member = null) {
        return Permission::check('PROJECT_CategoryAdmin') ;
    }

Don't forget to create a Role and/or assign the permission to the right Group(s), to make sure the right users can manage your categories.

 

Security through insecurity

Schneier explained how, initially, NSA Director General Keith Alexander claimed in 2013 that he had disrupted 54 terrorists plots. A few months later, this was revised down to 13, and then to "one or two." Eventually, the only success that the NSA could point to was the prevention of a San Diego man sending $8,500 to support a Somali militant group.

Doesn't sound like a worthy trade-off.

 

Resolve Conflicted Files That Don't Exist

Download VisualSvn Server, open a command prompt and type svn resolved -R . to resolve all conflicts, then commit again.

 

The more I think about modern blogging; the more I think the out of the box concept WordPress et al presents us is outdated.<p>#status </p>

 

Am totally into CSS backgrounds with partial transparent color overlay in the element above. Nicely ties the palette together.<p>#status </p>

 

Slack users: do you setup channels per project or per content type (build; errors)?<p>#status </p>

 

Interrupting ads are as bad in games as they are on websites.<p>#status </p>