How to create many-to-many relationships with associated properties in SQLAlchemy

I once had a scenario where one business could be managed by multiple users, and each user could manage multiple businesses. To further complicate matters, only one user could be the Administrator of a business, which should ideally also be represented by the relationship.

Finding out how to represent that relationship was tricky as I couldn't find it in the SQLAlchemy docs, and StackOverflow was a mixed bag. This is what I pieced together:

from datetime import datetime as dt ☞

What's your capacity to hustle?

This gem turned up in the Ribbonfarm post Stone-Soup for the Capitalist’s Soul:

  1. Your rights to your wealth do not extend beyond your understanding of it.
  2. You are fair game for hustlers who understand your wealth better than you do.
  3. The role of the state is to limit the violence with which you can be hustled.
  4. If you are poor you have the right to hustle the rich within certain limits.

It's a take on the old stone-soup fable ☞

Installing Apache Cordova on BunsenLabs Linux

Apache Cordova header image

Installing Cordova wasn't straightforward, so I wrote up what worked for me.

First install Nodejs and create a symlink because it gets installed as nodejs rather than node.

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node

NPM is thankfully in the debian repos:

sudo apt-get install npm
sudo apt-get install -y build-essential

Install Cordova using NPM and create your first project:

sudo npm ☞

Calling the Top

Some time mid-2013 I was reading through rpietila's posts on the bitcointalk.org forums and came across the theory that you could "call the top" of a bubble simply by selling if the price doubles in 7 days.

Unfortunately, he's got 4.7k-odd posts now, so the exact post has eluded me so far.

While the old trope "past performance doesn't indicate future results" always applies, there's no harm in being prepared to take advantage of an identified pattern should ☞

blogging with Pelican and Github pages

Hey! Welcome to my new blog.

So, when it came to setting up a blog again, I didn't want to go the old route to Livejournal / Blogger / Tumblr. Too much Y2K, Google, and teenage girl angst, respectively. Svbtle & Ghost cost money, and Medium's focus is on the platform, not you. That's when I remembered Github pages allows you to setup a free static site.

First create a new Github pages repo called username.github.io, where username is your Github ☞

« Page 2 / 2