WebIT.ca

Montreal Web Development

Limit user email domains in BuddyPress

Friday, March 4th, 2011

One of my upcoming projects is an intranet. For many reasons, I have chosen to use BuddyPress as the starting point and customize it for specific needs.

One such need is a restriction on which email address domains can be used to register a user. For instance, if I were to create such a system for webit.ca, I would want only users with a @webit.ca email address to register. Anyone else would simply not be allowed.

After some digging around, it seemed like there was no plugin that would quickly do what I was looking for. There were options, but most felt complicated or hacks. That is, until I found the following line in bp-core-signup.php:

// in function bp_core_validate_user_signup
$limited_email_domains =
    get_site_option( 'limited_email_domains', 'buddypress' );

Great! All that is left is a quick plugin to populate ‘limited_email_domains’.

<?php
/*
Plugin Name: Restricted Email Domains
Description: Restricts registration user email addresses to @webit.ca
*/
add_option('limited_email_domains', array('webit.ca'));

Activate the plugin and you’re good to go.

NoSQL Primer for Python

Monday, January 31st, 2011

Bellow is a video of my presentation at MontrealPython 18. It is a short introduction to NoSQL databases for the Python programmer.

The slides

Google Hackathon in Montreal

Saturday, January 22nd, 2011

Screenshot of EvoTune, audio generating web app

I attended the latest Google Hackathon in Montreal. Together, with Maxime Chevalier, we spent the day working on a little project called EvoTune. Simply told, it’s a music generator that uses user votes to measure which generated tunes rank above the rest. With the power of Genetic Algorithms, the low-ranking tunes are dropped from the app and new tunes are added through the process of marriage and mutation of the top-ranking tracks.

I’m glad to say that our project was one of the four winners of the event.

Give it a look and vote. http://evotune.appspot.com/

Reclaim Some Privacy: 3rd-party Cookies

Wednesday, May 12th, 2010

Which sites are Facebook and Google tracking you on? It could be any.

Each time you visit a site that implements either Facebook’s or Google’s widgets (Like button, AdSense) or traffic monitoring (Analytics), you are exposing your browsing history. It’s like a credit card company knowing your shopping habits by tracking your purchases. Unlike with credit cards, you can do something about it.

One small step to reclaim your privacy is by disabling 3rd party cookies in your browser. Doing this prevents your browser from sending your information to a site other than the one you’re visiting. Here’s how you do it.

Google Chrome

  • Select Chrome > Preferences on the menu bar.
  • Click the Under the Hood tab.
  • Click Content settings in the “Privacy” section.
  • Check Block all third-party cookies without exception

Firefox

http://support.mozilla.com/en-US/kb/Disabling+third+party+cookies

Safari or Opera

You’re in luck, 3rd party cookies are disabled by default.

Internet Explorer

By disabling 3rd party cookies, you’re taking back some control over your privacy.

PIL 1.1.7, Python 2.6 and Mac 10.5

Tuesday, May 11th, 2010

Here’s how it’s done.

http://countergram.com/articles/install-pil-intel-mac/

Extending the Django User model

Wednesday, May 5th, 2010

There appears to be 3 ways to extend the functionality of the Django User model:

  • Through sub-classing
  • With a profile class
  • By monkey-patching

Read the rest of this entry »

Review of the book ReWork

Sunday, April 4th, 2010
Front cover of the book ReWork

Joel Spolsky once wrote of two kinds of companies: those which enter a saturated market and grow cautiously on a small budget and the pioneer companies which enter new markets and grow as quickly as financially possible. Rework is advice on starting and running the first kind.

Read the rest of this entry »

On The Radar, Spring ’10

Saturday, March 27th, 2010

Since the last On The Radar, Palm has seen a slump in sales, the cloud has became our safe storage medium and the real time web is closer to reality. This year, the number of technology trends is fewer. In fact, on the WebIT radar, there is only one:

Read the rest of this entry »

A case for Test Driven Development

Thursday, March 25th, 2010

I will be honest: TDD is hard. It’s hard to get into, it’s hard to keep up. It’s all too easy to revert to a time when programming was about creativity, experimentation and the gratifying feeling of printing ‘Hello, world!’.

Read the rest of this entry »

What is good software?

Thursday, January 21st, 2010

I have been going through some change. Good change. The kind of change which makes a professional question the merit and quality of their work. It’s the kind of change which leaves the inquisitive pondering for days. Am I writing good software? What is good software, anyway?

Read the rest of this entry »