Elsewhere

Diego Escalante Urrelo: Link Pack #02

Planet Debian - ven, 09/01/2015 - 20:59

First sequel to my Link Pack “series” (I’ll remove the quotes when it’s LP#05): Link Pack #01.

This time I’m going for fewer articles, to try to keep things less overwhelming. There’s no special theme, and I’m actually leaving out some nice things I read recently. On the plus side, that means I have good material for a Link Pack #03.

Also, I’m gonna stick with Link Pack as a name, because it’s good enough :-).

A Teenager’s View on Social Media: Written by an actual teen
A well thought and realistic take on how social media is being used nowadays by teenagers. I have seen the patterns the author describes, and actually follow many of them. Does that mean I’m still a teenager?

It’s interesting that the messaging and group-messaging part of the article is very US centric, or at least very US centric from my point of view. WhatsApp is the default messenger application south of the states, and fills the role of “somewhere you can chat with people without having to give them your full personal information”, that is, a place where you can chat with someone without running out of SMS and without adding them on Facebook (which would open them to stalk your whole profile and other friends). Some carriers in South América offer unlimited plans for specific applications like WhatsApp.

What Would Jesus Buy? (2007) — Full movie
“Reverend” Billy Talen from the Church of Stop Shopping Gospel is trying to prevent the Shopocalypse from happening. It’s an entertaining story of a group of funny guys and girls trying to share a message with comedy (that means A+ on my list). Simple and independent, a nice film.

13 Nutrition Lies That Made The World Sick And Fat
A pet peeve of mine. Nutrition is not really that complicated, but unfortunately there are a lot of myths that make people take really bad decisions. If you only read one thing in 2014 2015, read this.

Bottom Line: The low-fat, high-carb diet recommended by the mainstream nutrition organizations is a miserable failure and has been repeatedly proven to be ineffective.

(…)

Bottom Line: Low-carb diets are the easiest, healthiest and most effective way to lose weight and reverse metabolic disease. It is pretty much a scientific fact at this point.

GM’s hit and run: How a lawyer, mechanic, and engineer blew open the worst auto scandal in history
Cars are so complex nowadays, and dependent on electronics, that I’m honestly afraid of them. I have made software for many years and I know how hard, impossible, it is to get things “perfect”. I can’t imagine how hard it is for something so critical as brakes, steering wheels, etc. Even cameras can’t get focus right some times, and it’s been many many years.

Countless articles have been written about General Motors and its massive recalls earlier this year. What hasn’t been fully told is how GM might have gotten away with multiple counts of consumercide were it not for the efforts of three men: a Georgia lawyer, a Mississippi mechanic, and a Florida engineer.

(…)

Brooke Melton needn’t have died that night. She was killed by a corporation’s callous disregard for the safety of its customers, made worse by a regulatory agency reluctant to regulate.

The Long Game: Part 1 and The Long Game: Part 2
Two very short (less than 5 minutes) video essays about how notable people in the story of creativity are always celebrated without mentioning the boring years when they were nothing but losers. It’s a fun little video, worth a watch for the idea and the interesting editing. It feels like someone really wanted to create these.

Catégories: Elsewhere

Lullabot: Manage Your Drupal.Org Projects and Sprints with a Kanban Board

Planet Drupal - ven, 09/01/2015 - 20:30

I'm not very good with managing my tasks through a simple list—despite my best efforts, the list always seems to keep growing. I prefer to use a Kanban Board, a popular method of arranging lists that highlights the current status of each task. It's nice to see that I actually do get things done, after all!

Catégories: Elsewhere

Richard Hartmann: Release Critical Bug report for Week 02

Planet Debian - ven, 09/01/2015 - 18:09

The UDD bugs interface currently knows about the following release critical bugs:

  • In Total: 1090 (Including 177 bugs affecting key packages)
    • Affecting Jessie: 157 (key packages: 92) That's the number we need to get down to zero before the release. They can be split in two big categories:
      • Affecting Jessie and unstable: 124 (key packages: 74) Those need someone to find a fix, or to finish the work to upload a fix to unstable:
        • 19 bugs are tagged 'patch'. (key packages: 12) Please help by reviewing the patches, and (if you are a DD) by uploading them.
        • 4 bugs are marked as done, but still affect unstable. (key packages: 0) This can happen due to missing builds on some architectures, for example. Help investigate!
        • 101 bugs are neither tagged patch, nor marked done. (key packages: 62) Help make a first step towards resolution!
      • Affecting Jessie only: 33 (key packages: 18) Those are already fixed in unstable, but the fix still needs to migrate to Jessie. You can help by submitting unblock requests for fixed packages, by investigating why packages do not migrate, or by reviewing submitted unblock requests.
        • 16 bugs are in packages that are unblocked by the release team. (key packages: 7)
        • 17 bugs are in packages that are not unblocked. (key packages: 11)

How do we compare to the Squeeze and Wheezy release cycles?

Week Squeeze Wheezy Jessie 43 284 (213+71) 468 (332+136) 319 (240+79) 44 261 (201+60) 408 (265+143) 274 (224+50) 45 261 (205+56) 425 (291+134) 295 (229+66) 46 271 (200+71) 401 (258+143) 427 (313+114) 47 283 (209+74) 366 (221+145) 342 (260+82) 48 256 (177+79) 378 (230+148) 274 (189+85) 49 256 (180+76) 360 (216+155) 226 (147+79) 50 204 (148+56) 339 (195+144) ??? 51 178 (124+54) 323 (190+133) 189 (134+55) 52 115 (78+37) 289 (190+99) 147 (112+35) 1 93 (60+33) 287 (171+116) 140 (104+36) 2 82 (46+36) 271 (162+109) 157 (124+33) 3 25 (15+10) 249 (165+84) 4 14 (8+6) 244 (176+68) 5 2 (0+2) 224 (132+92) 6 release! 212 (129+83) 7 release+1 194 (128+66) 8 release+2 206 (144+62) 9 release+3 174 (105+69) 10 release+4 120 (72+48) 11 release+5 115 (74+41) 12 release+6 93 (47+46) 13 release+7 50 (24+26) 14 release+8 51 (32+19) 15 release+9 39 (32+7) 16 release+10 20 (12+8) 17 release+11 24 (19+5) 18 release+12 2 (2+0)

Graphical overview of bug stats thanks to azhag:

Catégories: Elsewhere

Uwe Hermann: My GPG key transition to a 4096-bit key

Planet Debian - ven, 09/01/2015 - 17:47

This is long overdue, so here goes:

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1,SHA512 I'm transitioning my GPG key from an old 1024D key to a new 4096R key. The old key will continue to be valid for some time, but I prefer all new correspondance to be encrypted to the new key, and will be making all signatures going forward with the new key. This transition document is signed with both keys to validate the transition. If you have signed my old key, I would appreciate signatures on my new key as well, provided that your signing policy permits that without re-authenticating me. Old key: pub 1024D/0x5DD5685778D621B4 2000-03-07 Key fingerprint = 0F3C 34D1 E4A3 8FC6 435C 01BA 5DD5 6857 78D6 21B4 New key: pub 4096R/0x1D661A372FED8F94 2013-12-30 Key fingerprint = 9A17 578F 8646 055C E19D E309 1D66 1A37 2FED 8F94 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlSwEaIACgkQXdVoV3jWIbQW5QCgoFHVU/D4fKSbvmGv3nNy3MAW S2UAn075ztmxQ8Y9/22crbUug1sEjfh5iQIcBAEBCgAGBQJUsBGiAAoJEB1mGjcv 7Y+U9PgP/29jPvrNcdWsLI8YK9U6+JzS+TMXNyfp6CQXc8O/+zJwqvvxNpqY3rLM 5otRLIEJ2EVdiF8sCWTDGusS9NkMePzumR0AFAR0iltIkekO5O0HbHhK0sXJQv0s EipDpFRO9k4/CBpJEy6Pkkxwd3ndtmwrL1/oKeVmM4E62PJd9ofMpQb/gMUsrA8u F8xoOXY8Os82Rrd759PypSxNecjd6SYaVJTHgFbZ0QIMJkdKaufifzARdw+v5jwg 8Q11BhpYxvUSugZgiciKA6RjRK5bfRnT8VQPFd0zneilsIW13zz/jub9df/vtM5L vY/6jHvXczYXSG8EGpHJQCD3KtQJPWZ0Nz9rAm4emEPmR2qav6KGARatYAm0RBqZ Y81YUEuiWzGli6DH1m9SQe8bqM/J94vQAAX9VqUn2gz0Z0Ey25kVQE7NOGsbbGVS vD/E74FSk1At9/RGpstrfEjsDKPRman2xk/oZe+08sRB22CJl40N4tZV9AkCJNom HHGZKp+VEKaCEiLUIRjKTHt2HTThg39zmxl+OnoTSFYvloxrDJyi9SxZgCAmBhbD 7kLkaSDmdUj6CmoilGU+gd2zmQl2D+RHinYZBxOUf1vi1MDLWNcLIMgrz4mRXgzE YKkG0newf9UbyJw42sXe2ukNQBIqBcL/DmAhG7V+r0RD7MQnMEYy =09bN -----END PGP SIGNATURE-----

The new key is available from keyservers, e.g. pgp.mit.edu or others.

In other news: Yes, I've not been blogging much recently, will try to do updates more often. In the mean time, you can also refer to my Twitter account for random stuff or the new sigrok Twitter account for sigrok-related posts.

Catégories: Elsewhere

Blink Reaction: Part Five: Cleanup and Troubleshooting

Planet Drupal - ven, 09/01/2015 - 17:37

Cleaning up is one of the advantages of working with VMs over a bare metal install. Since everything is in the disk image files, we only need to delete the VM. Vagrant provides two commands for this purpose:

Stopping and Deleting the VM

Change to the directory containing the Vagrantfile, and then stop the VM:

vagrant halt

To delete the VM permanently:

vagrant destroy

That’s it!

Catégories: Elsewhere

Code Karate: Drupal Commerce Course

Planet Drupal - ven, 09/01/2015 - 16:01
Catégories: Elsewhere

Drupal Commerce: Managing D8 module dependencies with the new Composer Manager

Planet Drupal - ven, 09/01/2015 - 15:06

It's not uncommon for a Drupal module to need an external library in order to function.
Historically, modules such as oauth2_server have done this by asking the end-user to download the library manually and extract it into sites/all/libraries. A hook_requirements() implementation would nag the end-user until the library is found.
Nowadays, all libraries are registered on Packagist and expect to be installed via Composer, which also resolves and downloads their dependencies. Thanks to Composer and modern PHP, the number and usage of libraries has skyrocketed, with Packagist recently counting its 500 millionth package install. Because of this thriving ecosystem, it is now more desirable than ever for modules to depend on libraries instead of reinventing the wheel. Furthermore, it is desirable for modules to release their core logic as libraries, bringing in additional users and contributors from the wider ecosystem.

So, how does Composer work, and why do we need Composer Manager?

Read on for more details...

Catégories: Elsewhere

Chris Lamb: Uploading a large number of files to Amazon S3

Planet Debian - ven, 09/01/2015 - 14:31

I recently had to upload a large number (~1 million) of files to Amazon S3.

My first attempts revolved around s3cmd (and subsequently s4cmd) but both projects seem to based around analysing all the files first, rather than blindly uploading them. This not only requires a large amount of memory, non-trivial experimentation, fiddling and patching is also needed to avoid unnecessary stat(2) calls. I even tried a simple find | xargs -P 5 s3cmd put [..] but I just didn't trust the error handling correctly.

I finally alighted on s3-parallel-put, which worked out well. Here's a brief rundown on how to use it:

  1. First, change to your source directory. This is to ensure that the filenames created in your S3 bucket are not prefixed with the directory structure of your local filesystem — whilst s3-parallel-put has a --prefix option, it is ignored if you pass a fully-qualified source, ie. one starting with a /.
  2. Run with --dry-run --limit=1 and check that the resulting filenames will be correct after all:
$ export AWS_ACCESS_KEY_ID=FIXME $ export AWS_SECRET_ACCESS_KEY=FIXME $ /path/to/bin/s3-parallel-put \ --bucket=my-bucket \ --host=s3.amazonaws.com \ --put=stupid \ --insecure \ --dry-run --limit=1 \ . [..] INFO:s3-parallel-put[putter-21714]:./yadt/profile.Profile/image/circle/807.jpeg -> yadt/profile.Profile/image/circle/807.jpeg [..]
  1. Remove --dry-run --limit=1, and let it roll.
Catégories: Elsewhere

LimoenGroen company blog: Automatically generated subdomains in Drupal

Planet Drupal - ven, 09/01/2015 - 14:21

A few weeks ago the new version of MijnStadMijnDorp.nl was launched to the public. Built by LimoenGroen, it offers a rich media platform where historical societies based in the Dutch province of Overijssel showcase their collections.

One of the project challenges was to emphasize the personalized look and feel of each society within the global site structure; every society has its own homepage with an introduction and a collage of curated content. Subdomains (e.g. subdomain.example.com) helped us achieve this. In this article we discuss what we encountered.

The Subdomain module

The core functionality was established using the contrib module Subdomain. In a nutshell, the Subdomain module can be setup to use a unique subdomain for page callbacks related to a specific user, taxonomy term, organic group or content type.

In the case of MijnStadMijnDorp.nl, we used the organic group mode, as each society is an organic group and needed a subdomain. All content of a society lives within its group and has the subdomain applied to it. By default, the name of the subdomain is either based on the name of the organic group or on end user input. We modified this behavior so the subdomain is set to the name of the organic group (society) by default, but can be manually overridden by users with administrative privileges. This comes in handy for societies with long names where an abbreviated subdomain is more suitable.

Automatically set subdomain after node creation:/** * Implements hook_node_insert(). * * Automatically set subdomain after node creation. */ function my_module_node_insert($node) { switch ($node->type) { case 'society': $node->subdomain = subdomain()->clean($node->title, TRUE); subdomain_url_outbound_cache_clear(); // Create unique subdomain. subdomain()->save_record($node->nid, $node->title, TRUE); break; } } Dnsmasq

During local development, testing dynamically generated subdomains can be cumbersome when using a local hosts file, because wildcards cannot be used. Dnsmasq to the rescue! It is a DNS resolver running as a daemon on a local development machine. Dnsmasq was configured to resolve the DNS zone used for local development (e.g. mijnstadmijndorp.dev) to 127.0.0.1. This also resolves any child zones (subdomains) to localhost. Since we use Apache locally, we had ServerAlias *.mijnstadmijndorp.dev added in the virtual host configuration.

Preparations for deployment

Using dynamically generated subdomains in a production environment typically involves configuring the webserver and the DNS zone for the root domain of the website.

For Apache, adding ServerAlias *.mijnstadmijndorp.nl to the virtual host configuration was sufficient. Similar directives were setup for the other servers in our DTAP-environment, with applicable hostnames.

When using HTTPS (which is always a good idea), serving content from dynamically generated subdomains means you need a wildcard certificate. In our case, a public key certificate with *.mijnstadmijndorp.nl as subject name was used.

For DNS, a wildcard (*.mijnstadmijndorp.nl) A-record was created.

Caveats and considerations

The Subdomain module schema has a textfield for the subdomain value, with a maximum length of 255. RFC 1035 states that the maximum length of a DNS label is 63 characters, and the accumulated length of all labels within a FQDN should not exceed 255 characters. The Subdomain module currently does not check the length of the subdomain DNS label or the accumulated length of the FQDN. This can result in URI’s that do not resolve. We submitted a patch for review that fixes this issue.

In terms of SEO, using subdomains should not negatively affect the ranking of a website as a whole. Google has stated they do not treat subdirectories different from subdomains (source), and as such there should be no penalties or split page rank amongst the subdomains. However, discussions on SEO forums indicate ranking was improved for some users when switching from separated subdomains to one shared hostname with subdirectories (source).

Catégories: Elsewhere

Patrick Matthäi: php-redis Wheezy backport

Planet Debian - ven, 09/01/2015 - 14:17

Hello,

I have just backported the php-redis (php5-redis) 2.2.5-1~bpo70+1 package for Debian Wheezy. Thanks to the ftp-masters for their quick ACCEPT :)
Now you can install and use the redis PHP extension from the offical repositories, see:

Instructions: http://backports.debian.org/Instructions/
Package: https://packages.debian.org/wheezy-backports/php5-redis

Catégories: Elsewhere

groups.drupal.org frontpage posts: Curso online de Experto en Drupal 7. Pruébalo gratis!!

Planet Drupal - ven, 09/01/2015 - 13:42

A qué esperas para unirte al curso más completo de Drupal 7? Si tienes dudas, ahora puedes probarlo gratis durante una semana!

Y si quieres continuar con el curso completo, tendrás un 10% de descuento aplicando el cupón CURSOS10.

El curso de Experto en Drupal 7 incluye Site Building y Development y se compone de 60 unidades en 3 niveles: Inicial, Intermedio y Avanzado. Después de completar los tres módulos tendrás que desarrollar un Proyecto Final. La duración total del curso es de 7 meses con 420 horas certificadas, pero puedes acortar este tiempo con mayor esfuerzo y dedicación.

Aunque esta acción formativa requiere un esfuerzo importante, ahorrarás mucho tiempo en comparación con estudiar Drupal por tu cuenta, sin dejarte nada en el camino y ganando muy pronto en solvencia para afrontar cualquier proyecto en Drupal.

Ten cuidado, si lo pruebas querrás continuar!

http://www.forcontu.com/experto-drupal-7

Catégories: Elsewhere

Amazee Labs: Zurich joins the Drupal Global Sprint Weekend 2015

Planet Drupal - ven, 09/01/2015 - 13:35
Zurich joins the Drupal Global Sprint Weekend 2015

On the weekend of 17. & 18.01.2015, dozens of Drupal contribution sprints will be taking place across the globe. Amazee Labs invites all of you interested in learning, hacking and improving Drupal to join us for two days of pure sprinting at our offices in Zurich.

  • Date: 17. & 18.01.2015
  • Time: 9:00 a.m. - open end
  • Location: Amazee Labs, Förrlibuckstrasse 30, 8005 Zürich
  • Food & Drink: provided
  • Registration: RSVP here

What can I expect from sprinting with you?

  • Get up to speed with the Drupal 8 and dive into coding new patterns
  • See how far you can get with the much improved site building tools in Drupal 8
  • Submit your first Drupal patch as a contributor
  • Help out in a Drupal core initiative
  • Discuss hard problems face-to-face with other experienced Drupalistas
  • A sprint place with enough food and drinks to get things done
  • Be your own client and have fun :)

Who can contribute?

Coders, designers, front-end developers, designers, project managers, user experience experts, clients, basically anyone who wants to improve Drupal, are welcome to the sprints.

Regardless of your knowledge level, if you have built a site in Drupal, you can contribute and are warmly welcomed.

What can I work on?

We will split into groups and work on Drupal core issues. Bring your laptop. For new folks: you can get a head start also by making an account on Drupal.org, setting up your dev environment (https://www.drupal.org/dev-env) and developers can install git before coming and git clone Drupal 8 core.

A great way to get started with contributing to Drupal core is to get involved with an initiative. We'll have local folks present with knowledge about Multilingual, Rules, CMI etc. Also check out the Drupal core initiatives and topics!

The following sprint topics have been proposed already:

Registration: RSVP here

Catégories: Elsewhere

Drupal core announcements: Changes to Drupal 8 that affect admin theme maintainers

Planet Drupal - ven, 09/01/2015 - 13:01

Happy Friday! I maintain the admin theme in Drupal 8 core: Seven. There have been many changes to Seven in Drupal 8 that affect the relationship between admin themes and modules, and how the admin UI is generated.

I've always thought that the strategy we've put in place are going to have a positive impact on maintainers of contrib admin themes, but I've never sought out feedback directly. I am now!

Object oriented CSS

We now have CSS standards in Drupal 8. All CSS in core is being rewritten and restructured inline with those standards. They are heavily influencds by the principles of OOCSS, SMACSS, BEM, and the writings of Nicolas Gallagher.

The Seven theme, with the introduction and evolution of the Seven Style Guide, embraced these principles from design down to implementation. As all modules with administrative UIs are tested against Seven, the architecture and design of Seven influences all contrib admin themes.

Reusable admin CSS components

Taking influence from frontend frameworks such as Bootstrap, Seven's design is now split into components, instead of per page overrides and designs.

This creates a 'visual api' of sorts that modules hook into and reuse to create the admin UI they need without having to write any CSS. It also ensures a greater consistency throughout Drupal's UX.

One common example are buttons, the classes .button, .button--primary, .button--danger, .buttoner--small can be applied to any element.

Another is the heading classes. Classes like .heading-a, .heading-b, heading-c</code mimic the hierarchy of the <code>h1, h2, h3 elements. You can pick the font sizes that look right for your page without affecting accessibility or overriding it in CSS.

We also have reusable classes to control layout. Using classes like .layout-column.half, .layout-column.quarter, .layout-column.three-quarter will layout your page for you. Classes such as .leader, .leader-double, .leader-triple will add spacing above an element that matches the base leading of Seven, while .trailer, .trailer-double, .trailer-triple will add spacing below.

Another low level component are the color classes, .color-success, .color-warning, .color-error allow you to reuse colors defined in the Seven styleguide, without a tool like Sass or CSS variables.

Less admin CSS in modules

With a full library of reusable CSS components, contrib modules will need to write less CSS. From my point of view, this is a big win for contrib admin theme maintainers, who have to write a lot of custom CSS to override custom CSS in some complex modules, and it's harder to tell if modules are broken because of the changes in the admin theme.

I'm hoping that admin theme maintainers will be able to override just the reusable components and have better coverage of core and contrib modules.

Ongoing work

We are still working on converting a lot of custom CSS into reusable components, and will continue to build the library of components after Drupal 8s release.

Feedback please!

Admin theme maintainers, are there any problems or pitfalls you see with this approach? I would like to know.

Catégories: Elsewhere

Appnovation Technologies: How to add JS and CSS assets to a Drupal 8 theme

Planet Drupal - ven, 09/01/2015 - 08:21

In one of my previous posts I wrote about creating a Drupal 8 theme and declaring assets (JS and CSS) associated with it.

var switchTo5x = false;stLight.options({"publisher":"dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683"});
Catégories: Elsewhere

LevelTen Interactive: Drupal 8 Videos You Need To Watch

Planet Drupal - ven, 09/01/2015 - 07:00

I searched far and wide to bring you great Drupal 8 presentations. These videos provide great examples of where Drupal is headed, why change is important and what you can expect from Drupal 8 and beyond.

... Read more

Catégories: Elsewhere

Akshay Kalose: Drupal 8: RDF UI (Schema.org Mappings)

Planet Drupal - ven, 09/01/2015 - 06:29

RDF UI is a module for Drupal 8 created by Sachini Aparna Herath for her Google Summer of Code 2014 project. RDF stands for Resource Description Framework; it provides a standardized model for data interchange. This module enables you to easily create mappings of Schema.org Things to Drupal Content Types and Fields. RDF UI will embed these specified mappings in the HTML as RDFa once your content is published. This blog post was made for Google Code-In 2014 to test and review RDF UI.

Installation

RDF UI can be easily installed using the Drush command line tool for Drupal. You may want to select installing the development version, as that will be the closest to running with the latest Drupal 8 development version:

drush dl rdfui --select

Upgrading

This section is about my experience upgrading RDF UI to the latest Drupal 8. This module was created over the summer, when GSoC takes place. As a result, it wasn’t compatible with the latest Drupal 8 development release, Beta 4.

I started upgrading from the stable version, and by the time I realized there was a development version, I had already done much of the upgrading, so I integrated the changes from that branch into my upgrade while still keeping most of mine similar to how it was before.

Some of the things I had to upgrade were: moving the attached CSS to a library, re-factoring the Form State from an array to an object, and accounting for the fact that Drupal\views_ui\OverviewBase was merged into Drupal\views_ui\DisplayOverviewBase. I also have included minor improvements here and there in the code.

One problem I encountered while using the sub module was that the default Schema.org/Text Data Type was text. However in the latest Drupal 8, this is the formatted text, and the plain text was needed, so this was fixed by changing the default from “text” to “string“:

diff --git a/rdf_builder/src/Form/ContentBuilderForm.php b/rdf_builder/src/Form/ContentBuilderForm.php index 6d2001a..c3cc50c 100644 --- a/rdf_builder/src/Form/ContentBuilderForm.php +++ b/rdf_builder/src/Form/ContentBuilderForm.php @@ -64,8 +64,8 @@ class ContentBuilderForm extends FormBase { public function __construct() { $this->converter = new SchemaOrgConverter(); $this->datatype_field_mappings = array( - 'http://schema.org/Text' => 'text', - 'http://schema.org/PostalAddress' => 'text_long', + 'http://schema.org/Text' => 'string', + 'http://schema.org/PostalAddress' => 'string_long', 'http://schema.org/Number' => 'integer', 'http://schema.org/MediaObject' => 'file', 'http://schema.org/AudioObject' => 'file', @@ -470,6 +468,6 @@ class ContentBuilderForm extends FormBase { return $this->datatype_field_mappings[$datatype]; } } - return 'text'; + return 'string'; } }

The full upgrade patch can be viewed at this Issue on RDF UI.

Usage

As said on the project page, integration of Schema.org mappings in Content Types is seamless. In the “Add Content Type” form you can choose which Schema.org Type this Content Type will be:

Once you fill this out and reach the “Manage Fields” page, you need to create you new fields. You can then click the “RDF Mappings” tab to assign these fields their Schema.org property:

Now you are ready to go ahead and create your content. Once created and published, the node should show the fields and the html should contain the Schema.org Type in the article tag and Schema.org Properties in the field-items divisions:

RDF UI Builder!

RDF UI also comes with a very helpful sub module named: RDF UI Builder. Want to shorten up all the steps above in creating Schema.org mapped Content Types? This sub module comes in handy for that very purpose.

Once this module is enabled, you can find the new “+ Add Schema.org Content Type” button next to the original “+ Add content type” button:

After selecting which Schema.org Type you want to use, you are redirected to the next page where the only thing you need to do is select which fields you want, and they will automatically be created and mapped for you!

That’s it, now you can go off and create content for that type.

Conclusion

Sachini Aparna Herath, with the help of her mentors Stéphane Corlosquet and Kevin Oleary, has created a great module for Drupal 8. RDF UI fits in with the rest of Drupal, and can be used to quickly create content types or fields and assign them Schema.org Types and Properties. This can help any site owner to provide “semantic rich data” on their web pages.

One improvement I can suggest is that the http://schema.org/Date Type should default as date only in Drupal. As of right now both http://schema.org/DateTime and http://schema.org/Date convert into Drupal datetime. This may be because Drupal does not have Date and DateTime options in the drop down. If this is the case, this improvement would be for Drupal Core to move selecting DateTime or only Date to the main select menu before selecting Date and then choosing for a new field.

From a Google Code-In perspective, this task had many obstacles which I had to go through to upgrade the module to be working with the latest Drupal 8 version, Beta 4, and I am glad as I keep learning more with the more problems I face. It is also the first time I have created a change record, because one of the errors received had not been included in the list of changes.

The post Drupal 8: RDF UI (Schema.org Mappings) appeared first on Akshay Kalose.

Catégories: Elsewhere

Károly Négyesi: static methods

Planet Drupal - ven, 09/01/2015 - 06:27

Here's something I learned from Wim Leers: the static keyword has a bad rep in PHP but that's because static variables can be problematic. static methods, especially protected static methods on the other hand are useful to indicate and enforce a method not changing the state of the object.

Catégories: Elsewhere

Dirk Eddelbuettel: random 0.2.3

Planet Debian - ven, 09/01/2015 - 03:50

A new release of my random package for truly (hardware-based) random numbers as provided by random.org is now on CRAN.

The main change is a switch to the curl() function from the eponymous package by Jeroen Ooms. This was caused by random.org now using https instead of http, annd the fact that te url() function from R does not cope well with the redirect. Besides this (enforced) change, everything else remains the same.

Courtesy of CRANberries comes a diffstat report for this release. Current and previous releases are available here as well as on CRAN.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Catégories: Elsewhere

Peter Eisentraut: Directing output to multiple files with zsh

Planet Debian - ven, 09/01/2015 - 02:00

Normally, this doesn’t work as one might naively expect:

program > firstfile > secondfile

The second redirection will override the first one. You’d have to use an external tool to make this work, maybe something like:

program | tee firstfile secondfile

But with zsh, this type of thing actually works. It will duplicate the output and write it to multiple files.

This feature also works with a combination of redirections and pipes. For example

ls > foo | grep bar

will write the complete directory listing into file foo and print out files matching bar to the terminal.

That’s great, but this feature pops up in unexpected places.

I have a shell function that checks whether a given command produces any output on stderr:

! myprog "$arg" 2>&1 >/dev/null | grep .

The effect of this is:

  • If no stderr is produced, the exit code is 0.
  • If stderr is produced, the exit code is 1 and the stderr is shown.

(Note the ordering of 2>&1 >/dev/null to redirect stderr to stdout and silence the original stdout, as opposed to the more common incantation of >/dev/null 2>&1, which silences both stderr and stdout.)

The reason for this is that myprog has a bug that causes it to print errors but not produce a proper exit status in some cases.

Now how will my little shell function snippet behave under zsh? Well, it’s quite confusing at first, but the following happens. If there is stderr output, then only stderr is printed. If there is no stderr output, then stdout is passed through instead. But that’s not what I wanted.

This can be reproduced simply:

ls --bogus 2>&1 >/dev/null | grep .

prints an error message, as expected, but

ls 2>&1 >/dev/null | grep .

prints a directory listing. That’s because zsh redirects stdout to both /dev/null and the pipe, which makes the redirection to /dev/null pointless.

Note that in bash, the second command prints nothing.

This behavior can be changed by turning off the MULTIOS option (see zshmisc man page), and my first instinct was to do that, but options are not lexically scoped (I think), so this would break again if the option was somehow changed somewhere else. Also, I think I kind of like that option for interactive use.

My workaround is to use a subshell:

! ( myprog "$arg" 2>&1 >/dev/null ) | grep .

The long-term fix will probably be to write an external shell script in bash or plain POSIX shell.

Catégories: Elsewhere

Forum One: Forum One to Host Global Sprint Weekend in DC

Planet Drupal - jeu, 08/01/2015 - 23:49

Want to join me for a marathon next weekend?

As part of a worldwide effort known as the Drupal Global Sprint Weekend, hundreds of coders from around the world are joining together in a united effort to complete a marathon task: the launch of the next generation of the world’s most popular open-source platform, Drupal 8.

To participate in this massive movement and contribute to the Drupal Community, Forum One is hosting a local Code Sprint in downtown Washington, DC on Saturday, January 17th. Sign up here »

Never been to a code sprint before? No worries; we’re pros at these events! Here’s what you can expect:

What is a code sprint?

A code sprint is when developers get together and write code. There’s minor instruction and some ad hoc mentoring, but mainly the focus is just uniting developers and hammering out code together. That’s all there is to it!

How will this event work?

Our developers will work with you to find Drupal 8 core issues for you to focus on. You won’t need to research anything on your own, but you will need to bring your own laptop, and it helps a lot if you set up your development environment beforehand. For instructions on how to get set up and for additional details like the event agenda, visit the RSVP page »

Why should I attend?
  • You’ll meet other DC area developers!
  • You’ll roll up your sleeves and become a bona fide Drupal 8 Core Contributor!
  • You’ll learn from our on-site mentors and fellow developers!
  • You’ll earn tons of karma by furthering the mission of the open-source development model!
  • It’s totally free!

Intrigued? Excited? Can’t hardly contain your enthusiasm? Awesome! Sign up for this free event and join me and the DC open-source developer community as we take on this marathon effort and get 26.2-ish miles closer to bringing Drupal 8 across the finish line.

Catégories: Elsewhere

Pages

Subscribe to jfhovinne agrégateur - Elsewhere