Setting Access-Control-Allow-Origin for a rails application

I was experimenting with AngularJS and using Rails as a backend and needed to enable Access-Control-Allow-Origin for $http. Here is a simple snippet I created that does the trick. If you were doing this in production, I would assume Apache or Nginx would be the appropriate place for this code. However, this is just a POC.

# application_controller.rb
after_filter :local_access_control_headers
def local_access_control_headers
  headers['Access-Control-Allow-Origin'] = 'http://localhost:8000'
  headers['Access-Control-Request-Method'] = '*'
end

Well planned and executed marketing by Wegmans

Wegmans isn’t just a super market around here, it’s a destination. Going the store is less about “getting food” and more about shopping. My local store is huge, but it feels comfortable. The selection is massive, but I can always find what I came for. I can also find things that I didn’t come for and didn’t know I wanted until I saw them. So how can Wegmans accomplish this? How can they have a massive store, but yet have items that catch my attention that I wasn’t specifically looking for. The answer: The Wegmans Magazine Continue reading “Well planned and executed marketing by Wegmans”

Being agile or using Scrum does not mean sitting in the same room

I had a troubling conversation about Agile with project manager that is transitioning into a “Scrum master” role. I used the noun version of agile since I live in the corporate world and if we cannot fit it into a box, it’s not enterprise ready. What made me pause was his immediate reaction to impose his understanding and view of Agile on an existing and copasetic team.
Continue reading “Being agile or using Scrum does not mean sitting in the same room”

Capistrano, SSH Keys, and multiple Git repos

I hate monolithic software. It causes so many problems when trying to be fast and agile when refactoring or rolling out new features. Just like the single responsibility principle in SOLID,  I like clean separation of project concerns too. This leads me down a path of having multiple Git repositories, which in itself isn’t an issue, but it does tend to get a little tricky when using a service like GitHub or Bitbucket that requires SSH keys for deployment. So, how do I handle this? Continue reading “Capistrano, SSH Keys, and multiple Git repos”

Keyboard navigation in Chrome, just like I'm used to in Vim

Since switching to Vim and working on accessibility related projects, I’ve become very comfortable using just the keyboard. Not only comfortable, but efficient as well. In order to get the Vim feel along with the requirements of surfing the web (you know, follow hyperlinks and such), I’ve been running using a few plugins that make me feel at home in my browser. Continue reading “Keyboard navigation in Chrome, just like I'm used to in Vim”

This sums up my experience with desktop Linux

Somewhat predictably, I rely on a Macbook Pro for work and play. I did Linux-on-the-desktop for years and years, before I finally got bored of the constant round of customisation, kernel recompilation, drivers and things just-not-quite-working, and made the shift to OS X. I’ve never regretted it! Virtualisation takes care of the need to run Linux occasionally.

I like to see what other people are running so I subscribe to “The Setup” and pulled that quote from Paul Tweedy. It rings true even today as I just installed Ubuntu on an extra machine I had at work and after playing with it for a few hours, I realized I could use it as my daily machine, but do I really want to bother with all the baggage that comes along? The answer is still no. Ain’t no body got time for that.

Upgraded to RubyMine 5, it feels the same as 4.5 to me

I’m still a new RubyMine user after deciding to purchase a license back in September. I was a full time Vim user before that so I wasn’t sure how the transition back to an “IDE” would go. There are pros and cons that I won’t go into, but if I had to pick a Ruby IDE, this would be it. It has a lot of features I need, and not a lot that I don’t. That says something in a world of IDEs that are super bloated…looking at you MyEclipse
First thing I did was finally hook up RSpec to the internal test runner. Previously I would just run them via the command line and a key bind I created “;spec” which would execute “bundle exec rspec”, then tab back to the IDE when it was done. I kind of like the integrated runner, especially when it’s green.
So now I can just hit “^r” and off I go, no more fumbling for iTerm, making sure I’m in the right directory, waiting, switching back…etc.