My Point of View
technology, programming, and rants (not necessarily in that order)
CanCan is a wonderful plugin for Rails that allows you to define all your authorization logic in one place. For small apps, it works well. But as my app’s authorization needs grew more complex, I realized I needed a different approach to declaring and testing authorization.
So I went looking… It turns out that the Authority gem is exactly what I was looking for:
Authority splits out auth logic into individual “Authorizers”. Each one handles authorization for a single model (or multiple models that behave the same way), with individual methods for each action. Authority doesn’t try to do too much – it gives you an organized way to check authorization in regular Ruby code, explicitly, without having to write implicit rules. For our app, authorization got much simplified with regular “if” statements (compare to this):
If you’re like me, you have thousands of photos on Flickr, and thousands more scattered accross your laptop, external drive, and phone.
What’s been uploaded to Flickr and what hasn’t? Who knows!
I hacked up a quick solution in Ruby and called it Flickr Upload Set.
It’s built as a web app with Sinatra, but it’s not meant to run on a server – just on your local computer.
A lightning talk (5-minute) presentation I gave at TulsaWebDevs:
What is Quality
Note: I used to have this presentation embedded here, but it was scrolling the page and interfering, so now it’s just a link.
Here are some common time sinks encountered when building a JavaScript app, along with some tips to avoid them.
Note: these tips were originally shared as a part of my TulsaWebDevs presentation following 2012 Startup Weekend Tulsa.
Bind 🔗In JavaScript, scope is resolved during a function’s execution – not its definition. When working with classes, you expect that this will point to the class, but it often won’t.
Example:
var Todo = Backbone.View.extend({ events: { 'click input': 'check' }, check: function() { console.log(this); } }); Solution 1:
Posterous is set to shut down on April 30th. For the past month, I’ve been dreading the move from Posterous to whatever.
Today I bit the bullet and decided to migrate my Posterous blog to Jekyll. There are many reasons I chose Jekyll – independence from free hosted services is probably the biggest reason.
I chose to use Octopress, which extends Jekyll with a set of sane defaults and a good structure for customizing layout, CSS, etc.
I recently switched from Gnome to i3 on my main laptop. So far, I'm enjoying the simplicity of piecing together my own desktop environment from small, specialized tools.
One thing I missed from Gnome was my clipboard history tool, Gpaste. I've come to expect that my previous dozen or more clipboard copies are a keystroke or two away and not lost forever.
While tweaking my i3 setup, I realized it would be possible to replicate some or even all of the functionality of GPaste using simple unix tools:
The Tulsa Hackathon is steaming ahead. The night is still young!
People have gone from standing to sitting, staring intently at backlit screens and making things happen.
Here are some more pics…
More pics!
So far the Tulsa Hackathon, an all-night programming drive benefiting needy Tulsa non-profits, is going underway and going well.
We had an excellent catered meal, project presentations were made, and teams have been formed. People seem to be figuring out team member responsibilities and getting started on the various projects.
I’ll write a couple more blog posts as the night progresses. Here are pics thus far:
I wanted my own Campfire-style web chat room, so I created on with node.js and socket.io that runs on Heroku. Robot images are thanks to robohash.org. Enjoy. github.com/seven1m/robots-chatting-with-other-robots