May 2012
7 posts
Moving!
I’m moving my blog off Tumblr:
Personal: http://blog.mervine.net/
Everything else: http://www.rubyops.net/
Thanks!
—J
Installing ack with Macports →
3 tags
Bring Vimcast to LA! →
April 2012
16 posts
Ruby: "&&" and "||" > "and" and "or" →
Who knew!!
6 tags
More on RSpec and Rake
Here’s a simple way to specify load order using rake and rspec…
With files:
RSpec::Core::RakeTask.new(:spec) do |task|
task.pattern = [ "./spec/fileone_spec.rb", "./spec/filetwo_spec.rb" ]
end
With directories:
RSpec::Core::RakeTask.new(:spec) do |task|
task.pattern = [ "./spec/dirone", "./spec/dirtwo" ]
end
RSpec2 and Rake →
I was looking for the following and found it here…
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
4 tags
rSpec -- testing protected and private methods
Add the following to the top of your _spec file…
before(:each) do
MyClass.send(:public, *MyClass.protected_instance_methods)
MyClass.send(:public, *MyClass.private_instance_methods)
end
EOM
3 tags
3 tags
3 tags
2 tags
[PMV] My Little Wu-Tang Clan - Shame on a Nigga →
That last pic of my daughter fondly made me think of this vid.
March 2012
32 posts
1 tag
Hunger Games?
Everyone I know and trust on movies said it was crap. Bad acting, not true to the book, etc. I never read it, should I see it?
9 tags
Ruby on Rails: Custom Models sans Database
I’m building an application that uses a API JSON as it’s data source. Decided I wanted it to be all ActiveRecord pretty.
I found the this, which I used as a guide, but I needed to expand on it, hence this post… enjoy.
Update: Modified self.find to make it more like Rails find and added self.where to do what find was doing, but what Rails where does. Note, it doesn’t...
13 tags
How-to: Setup MySQL and RoR on AWS
Warning!!
When I wrote this, I misunderstood the AWS pricing models when I was originally putting this together. The following configuration would run you about $8 per month for the first year and around $16 per month each following year. Please see Amazon’s AWS Pricing page for details.
Introduction
I have been working on setting up RoR with MySQL on an AWS instance and ran in to some...
4 tags
4 tags
Using Nginx and AWS to proxy sub-domains
Lately I’ve been thinking on ways to use free cloud services to handle a decent amount of traffic at no cost (or perhaps low cost).
I have a co-worker that’s using three free Heroku accounts to serve as a backend for his iPhone application, which using a random number generator, randomly connects to one of the three servers, thus allowing him to serve three connections per second,...
3 tags
4 tags
How to set up your own private Git server on Linux →
Bradley Wright:
One of the things I’m attempting to achieve this year is simplifying my life somewhat. Given how much of my life revolves around technology, a large part of this will be consolidating the various services I consume (and often pay for). The mention of payment is important, as up until now I’ve been paying the awesome GitHub for their basic plan.
I don’t have many private...
2 tags
We can’t solve problems by using the same kind of thinking we used when we...
– Albert Einstein (via @brownstone_one)
In the corporate world, you’re either bomb shelter, the sheltered or the...
– me
4 tags
Ruby: dynamically generated object with accessors
Hello -
I was working on created a super class for use in importing various unknown data types from hashs, so I started playing around with dynamic instance variable and attr_accessor generation and came up with the following, which I thought I would share.
Enjoy!
EDIT: I’ve commented out the method_missing logic and instead am specifically defining the methods using...
6 tags
5 tags
RSpec speed-up by tweaking ruby garbage collection →
Some developers I’ve worked with have seen up to 50% gains using this. Thanks @DougMcInnes for passing this on.
2 tags
3 tags
3 tags
1 tag
1 tag
Be who you are and say what you feel, because those who mind don’t matter...
– Dr. Seuss