Tag: Domain
Setting User’s Locale Based on Domain Name In Rails
June 18th, 2009, 2 Comments
In this tutorial I will show how you can quickly set the user’s locale based on the domain name they use to access your website. Let us assume you have your app, and you also own your own domain in several different country TLD’s, let’s say, you have example.com (main site), example.co.uk, example.fr, example.it example.es, [...]
Where are your users from? – (By SQL Email Domain)
April 19th, 2009, 1 Comment
Ever wondered who your users use as their email provider? Who are the biggest email providers of the users on your website? Luckily SQL has the answer in 1 easy step using the SUBSTRING_INDEX string function.
mysql> SELECT COUNT(*) AS Total, SUBSTRING_INDEX(email, ‘@’, -1) AS Domain FROM users GROUP BY SUBSTRING_INDEX(email, ‘@’, -1) ORDER BY COUNT(*) [...]