This website is composed of information connected through taxonomy. It is simultaneously a proof-of-concept and a means to allow Agaric to share and store information both within the collective and the world as part of our open documentation philosophy.

User login

This website is composed of information connected through taxonomy. It is simultaneously a proof-of-concept and a means to allow Agaric to share and store information both within the collective and the world as part of our open documentation philosophy.

Python dictionary objects do not allow accessing of values with dot notation

Documenting this because it's the kind of frustrating mistake to solve that could drive someone away from Python entirely, yet it'll be a mistake i'll probably never make again and would be able to solve in seconds if i do.

A dictionary, or 'dict', must be accessed with bracket notation. Unlike JavaScript, dot notation is not an option for dicts.

This works:

Facebook Use Predicts Declines in Subjective Well-Being in Young Adults

"We text-messaged people five times per day for two-weeks to examine how Facebook use influences the two components of subjective well-being: how people feel moment-to-moment and how satisfied they are with their lives. Our results indicate that Facebook use predicts negative shifts on both of these variables over time. The more people used Facebook at one time point, the worse they felt the next time we text-messaged them; the more they used Facebook over two-weeks, the more their life satisfaction levels declined over time."

Naming convention for follows / is followed by relationship?

Yes, i searched for what other people chose for a naming convention for a table (model) of follower and followee relationships.

The only directly relevant discussion was in this Ruby on Rails tutorial, which settled on "Relationship". What we've been using, Followership, is better than that, i think.

Hide the empty cart in Drupal Commerce

At least for a site based on Commerce Kickstart, simply edit the view, which you can get to from the gear on the cart itself when logged in:

/admin/structure/views/view/shopping_cart/edit/block

Under Advanced, no results behavior, remove the text result and summary for this block display only.

Save and you're done!

Assign people a random avatar image when they create a user account

If you want to assign not just a default avatar, but a random default avatar, that is possible with a setting in the Avatar Selection module.

(I almost made a module to allow a random avatar image to be pulled from a set uploaded by the administrator, in fact I was on my way to the Contributed Module Ideas group, but fortunately i kept searching and found this great module by Stella Power that has this random avatar feature as a bonus.)

Setting up a new GNU/Linux computer (Debian/Ubuntu flavor) for Drupal work, Agaric style

Create an SSH key

ssh-keygen

Send a copy of the public key to an agaric with access to the test server to add it there. Read more about setting up public keys and agent forwarding.

Get Drush

Follow composer instructions on https://github.com/drush-ops/drush (preferred over apt-get or PEAR.)

You cannot reassign an object in a function and expect the outside object to change

Stefan found a bug introduced in a contributed module when the authors took a passed-in object and, instead of only updating its properties as before, tried to change it by assigning a whole new object to the variable name.

This does not work:

Make your menus understand people's angle of intent

I read years ago how Apple at the time had a much more intuitive interface because of things like interpreting anything in the direction of a submenu as headed there, rather than immediately moving focus to whatever happened to be under one's cursor (and also how putting menus at the very edge of the screen gave them infinite depth). Always was on the lookout for people applying this to the web as best practice and finally here's an article and a JQuery plugin:

JavaScript to open external sites (not on domain or subdomain) in new target

It's bad Web practice to open any links in a separate window, but it does help when going for an HTML mobile app and it's becoming accepted expected behavior for anything with a stream.

So here's the JavaScript:

Translation for a Modern Web Application: Gettext

"The domain setting is which group inside of locale_data that the keys will be looked up in."

seems one can switch the domain application wide (so we would have Gyms, Skiing, Hotels as domains) but i'm not 100% sure about that. But it's not very recommended-- see http://stackoverflow.com/questions/9668471/use-multiple-domains-in-gettext-in-a-php-application