Servint vs. AWS

Note: This is an honest personal endorsement. I was not paid or offered any incentives for this post.

circuit I’ve been running Birdhouse Hosting for more than a decade now, and most of that time I’ve been hosting my services on a dedicated VPS at Servint.

I absolutely love the reliability and support I get through Servint, but every so often wonder whether I could reduce expenses by moving to Amazon Web Services, which lets you “pay as you go.” But every time I scratch the surface and try to do a real apples-to-apples comparison, I come to the same conclusion: Birdhouse is already in excellent hands, and I would not actually save money by moving, all things considered.
Continue reading “Servint vs. AWS”

Mt. Tam Loop

Amazing day with family and friends, hiking a rigorous 6.5 mile loop through Mt. Tamalpais. Starting near Stinson Beach and working our way up to the (a) crest, through three distinct biomes (fern/rainforest/giant redwood, California Coastal, and dry rolling hills). Everyone worked for it, rewarded by more beautiful vistas around every corner. In the middle, a 15-foot ladder erected in the middle of Steep Ravine to accomplish the elevation. Kids talked and sung improvised songs and exhausted themselves and got stronger by the step. All of us appreciating yet another amazing trail in our own backyard.

tamalpais

Trail map

Flickr Set

DIY.org

diyorg diy.org is one of the best sites for keeping kids stimulated and engaged in the real world I’ve ever encountered. Beautifully designed and engineered, it breaks real-world maker skills into more than a hundred categories. When kids accomplish three tasks in a category, they get a virtual badge (you can purchase a real version of the badge for $5). This is the site I wish I had thought to build, dangit.

No idea what their monetization strategy is, but huge applause to the engineers and designers behind the project.

Miles (@Milezinator) is spending his Christmas break on a mad DIY badge quest (a blissful escape from Minecraft for us!).

django-allauth: Retrieve First/Last Names from FB, Twitter, Google

Of the several libraries/packages available for setting up social network logins for Django projects, I currently find django-allauth the most complete, with the best docs and the most active development. Doesn’t hurt that the lead dev on the project is super friendly and responsive on StackOverflow!

But not everything about it is intuitive. After wiring up Twitter, Facebook and Google as login providers, I found that first and last names were not being retrieved from the remote services when an account was successfully created. I also, frustratingly, could find only the most oblique references online to how to accomplish this.

There are a couple of ways to go about it – you can either receive and handle the allauth.account.signals.user_signed_up signal that allauth emits on success, or set up allauth.socialaccount.adapter.DefaultSocialAccountAdapter, which is also unfortunately barely documented.

I decided to go the signals route. The key to making this work is in intercepting the sociallogin parameter your signal handler will receive when an account is successfully created. I then installed a breakpoint with import pdb; pdb.set_trace() to inspect the contents of sociallogin. Once I had access to those goodies, I was able to post-populate the corresponding User objects in the database.

This sample code grabs First/Last names from Twitter, Facebook or Google; season to taste:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# When account is created via social, fire django-allauth signal to populate Django User record.
from allauth.account.signals import user_signed_up
from django.dispatch import receiver
 
@receiver(user_signed_up)
def user_signed_up_(request, user, sociallogin=None, **kwargs):
    '''
    When a social account is created successfully and this signal is received,
    django-allauth passes in the sociallogin param, giving access to metadata on the remote account, e.g.:
 
    sociallogin.account.provider  # e.g. 'twitter'
    sociallogin.account.get_avatar_url()
    sociallogin.account.get_profile_url()
    sociallogin.account.extra_data['screen_name']
 
    See the socialaccount_socialaccount table for more in the 'extra_data' field.
    '''
 
    if sociallogin:
        # Extract first / last names from social nets and store on User record
        if sociallogin.account.provider == 'twitter':
            name = sociallogin.account.extra_data['name']
            user.first_name = name.split()[0]
            user.last_name = name.split()[1]
 
        if sociallogin.account.provider == 'facebook':
            user.first_name = sociallogin.account.extra_data['first_name']
            user.last_name = sociallogin.account.extra_data['last_name']
 
        if sociallogin.account.provider == 'google':
            user.first_name = sociallogin.account.extra_data['given_name']
            user.last_name = sociallogin.account.extra_data['family_name']
 
        user.save()

Spinning Burning Steel Wool

We did it! Inspired by this Mashable series, and using this tutorial, I built a little rig for spinning burning steel wool today, then took it out to the local park with Amy and Miles after dinner. Amy shot the images while Miles and I took turns spinning. Not nearly as scary as I thought it would be, but we still wore a protective hoodie and goggles, and brought along a gallon of water just in case (none of it needed).

These are all 30-second exposures. The hardest part is getting the distance right – tough to know in advance how far away the subject needs to be, so the tops/sides of several of these are off. More practice needed. Would also like to figure out how to change the color of the sparks. Any chemists in the house?

Flickr set