Archive for the ‘Uncategorized’ Category

Turntable.fm replacement plug.dj looks great

I was really upset when turntable.fm went offline, it was something I ended up using regularly. Before that site, I really didn’t understand what a “DJ” was, I thought it was just some guy that hit the play button. But the more I used the site, the more I started to understand a good DJ can feel out the vibe in a room and decide where to take it through music. It was quite the epiphany when I put that together. When that went offline, I thought that experience was gone. Then I find plug.djRead On…

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 Read On…

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.

How to reorder OS X menu bar icons

I just installed iStat menus from iSlayer and it’s pretty cool, but the date/time is just too far to the left. So I figured I would try and move it over to the right where the date/time used to be (I turned it off since this one now has the day displayed as well). With a few trial and errors, I figured out it’s just hold command, click and drag the item to where you want. Simple. Gotta love OS X’s simplicity and reorder OS X menu bar icons is no exception. If this was Windows, it would have probably required a reboot.

reorder

Greasemonkey script for experts-exchange

I quickly wrote this Greasemonkey script (or Greasekit if you’re using Safari) to remove a bunch of crap from experts-exchange to make it somewhat tolerable to look at. It uses jQuery because I like it. It would be a lot more efficient to include the implementation of the method I’m using in my script rather than making reference to another site, but like I said at the beginning, it was quickly thrown together while waiting for some code to deploy. So here it is in all its glory, Greasemonkey script for experts-exchange:

// ==UserScript==
// @name           BlurredAnsweres
// @namespace      ee
// @include        http://www.experts-exchange.com/*
// ==/UserScript==

// Add jQuery
    var GM_JQ = document.createElement('script');
    GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
    GM_JQ.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(GM_JQ);

// Check if jQuery's loaded
    function GM_wait() {
        if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
    else { $ = unsafeWindow.jQuery; letsJQuery(); }
    }
    GM_wait();

// All your GM code must be inside this function
    function letsJQuery() {
        $(".blurredAnswer, .relatedSolutions, .allZonesMain, .qStats, .lightImage").remove();
    }