Monday, June 26, 2017

What Are Dictionary Comprehensions in Python?

Tim Van Damme

Tim Van Damme

Fun redesign in this personal One Pager for Abstract head-of-design, Tim Van Damme. Did you know his original One Pager was among the very first I featured back in 2008!

by Rob Hope via One Page Love

There’s a Gender Extension for PHP

Unlike in our "mainstream" paid course about exploring PHP, I like to explore the weird and forgotten areas of the language.

Recently, I ventured into a section of the PHP manual which lists extensions that are used to help with Human Language and Character Encoding. I had never looked at them as a whole - while dealing with gettext, for example, I always kind of landed directly on it and ignored the rest. Well, of those others, there's one that caught my eye - especially in this day and age given the various controversies - the Gender extension.

Pink and green elephant symbolizing gender roles

This extension, in short, tries to guess the gender of first names. As its introduction says:

Gender PHP extension is a port of the gender.c program originally written by Joerg Michael. The main purpose is to find out the gender of firstnames. The current database contains >40000 firstnames from 54 countries.

This is interesting beyond the fact that the author is kinda called George Michael. In fact, there are many aspects of this extension that are quite baffling.

While its last stable release was in 2015, the extension uses namespaces which clearly indicates that it's not some kind of long lost remnant of the past - a relatively recent effort was made to make it conform to modern coding standards. Even the example code uses namespaces:

<?php

namespace Gender;

$gender = new Gender;

$name = "Milene";
$country = Gender::FRANCE;

$result = $gender->get($name, $country);
$data = $gender->country($country);

switch($result) {
    case Gender::IS_FEMALE:
        printf("The name %s is female in %s\n", $name, $data['country']);
    break;

    case Gender::IS_MOSTLY_FEMALE:
        printf("The name %s is mostly female in %s\n", $name, $data['country']);
    break;

    case Gender::IS_MALE:
        printf("The name %s is male in %s\n", $name, $data['country']);
    break;

    case Gender::IS_MOSTLY_MALE:
        printf("The name %s is mostly male in %s\n", $name, $data['country']);
    break;

    case Gender::IS_UNISEX_NAME:
        printf("The name %s is unisex in %s\n", $name, $data['country']);
    break;

    case Gender::IS_A_COUPLE:
        printf("The name %s is both male and female in %s\n", $name, $data['country']);
    break;

    case Gender::NAME_NOT_FOUND:
        printf("The name %s was not found for %s\n", $name, $data['country']);
    break;

    case Gender::ERROR_IN_NAME:
        echo "There is an error in the given name!\n";
    break;

    default:
        echo "An error occurred!\n";
    break;

}

While we have this code here, let's take a look at it.

Continue reading %There’s a Gender Extension for PHP%


by Bruno Skvorc via SitePoint

WebRes

WebRes Resume Template

'WebRes' is a free One Page WordPress theme in the style of an modern online résumé. All the standard CV sections apply but it's got added flavor with color bursts and unique styled drop-shadow boxes. Features include fixed header navigation, experience section, portfolio with big image pop-up gallery (plus category filter), testimonial slider, services, contact form and a neat added feature with a newsletter sign up modal. Thanks for another freebie UiPasta🙏

by Rob Hope via One Page Love

Matt Morris Wines

Matt Morris Wines

Long-scrolling One Pager telling the story of how a winemaker and filmmaker teamed up to create 'Charbono'. Would have loved the Shopify purchase page integrated into the main Landing Page but want to feature for an excellent reference to storytelling. The site features good whitespace, clear typography and spectacular video production. Nice touch with the website footer styled as film credits.

by Rob Hope via One Page Love

How to Deploy a WordPress Plugin From TravisCI to WordPress.org

Currl

Minimal redesign for theme shop Currl now led by my good friend Manuel Moreale. Love the new range of One Page themes, experimental pricing and cheeky tone in the copy😝

by Rob Hope via One Page Love