Donnerstag, 30. Januar 2014

Git Jira commit Message


It's easy to commit a jira task without entering the complete task title in the command line. Initially I wrote a simple script for my gender detection project that uses the jira api to fetch the required fields from the Jira server to generate a meaningful commit message but this script can simply be used for any other project.

Link to the script: https://github.com/markus-perl/git-jira-commit-message/blob/master/git-jira-commit-message

Edit the script and enter your credentials:
 #!/usr/bin/php
    <?php
    
    $username = 'Jira username';
    $password = 'jira password';
    $api = 'http://my.jira.url/rest/api/2/';

Now add the following line to the alias section in your .gitconfig file which is located in your home dir:

[alias]
  c = !sh -c 'git-jira-commit-message "$0"'


To commit a task just enter the task id. The script the title of the task to the commit message:

$ git c PR-1201

Mittwoch, 29. Januar 2014

PHP get class name without the namespace

This is the easiest way to get the name of the current class without the namespace:

public function getName() {
    $path = explode('\\', __CLASS__);
    return array_pop($path);
}

Dienstag, 28. Januar 2014

Donnerstag, 16. Januar 2014

Gender Detection API


To improve the conversions of our registration form we developed a gender detection api. The gender checker only requires a first name or an e-mail address containing a first name. 1000 requests to the gender api are free every month.

What if a name can be male as well as female?


If a country code is provided, the gender detection can be improved. For example: While Andrea is male in Italy, Andrea is a female name in the US and can even be both in Germany. With every query a accuracy value is provided how sure the api is to match the right gender. Here is a list of supported countries.




Is ssl supported?

Yes, to give you the best possible privacy protection ssl up to TLS 1.2 is supported

Which countries are supported?

The API supports currently 105 countries. If a name is not found in the given country the complete database will be crawled.

An accurate gender predictor needs to have multiple decision paths to determine the best gender. Therefore the api uses every data provided by the browser to fetch the best possible result. The API is under heavy development and we try to improve it's quality every month.