G. Ruby: Mocking HTTP Response body
I’m sure there are many ways to do this — probably better ways — but this is a simple way I’ve done it. class FakeResponse attr :body def initialize body @body = body end end describe Foo" do before(:each) do @data = File.read "./http/response/body.txt" Net::HTTP.stub!(:post_form).and_return(FakeResponse.new @data) end it "should return stuff" do ...
F2. Proud Papa...
I totally just caught Thing 1 (almost 4) speaking Huttese while watching Return of the Jedi.
F2. Pro-Parenting Tip
Have your kid(s) get their PJs on 30 minutes to an hour before bed time when their motivated to do so quickly by something that want to do, as opposed to motivated to do so slowly at the prospect of going to bed. I’m sharing this, as it took me way too long to learn it on my own. :P
G. Bash: past dates in epoch format
Here are some notes on converting dates to epoch and tweaking what dates are displayed. For the purpose of this, I’m trying to pass start and end dates in epoch format to a REST API. I’m looking for ranges which include: yesterday, last 7 days, last 14 days and last 31 days. Start Time Note: I set this up so that by changing the DAYS_AGO, you can control how far back in time you...
G. Ruby: sourcing and setting environment varibles
I was looking for a simple way to source and set a bash environment variable from a file, in this specific instance, I can’t be 100% sure that the any steps I take to ensure that the file itself is sourced on the host before Rails is started, nor can I impact the format of the file itself (e.g. changing it to YAML). Here are the best options I’ve found. File.readline This is not...
G. On Set: Empire Strikes Back →
F2. Hey Father...
Thing 1: Hey, father?
Me: Yes, daughter?
Thing 1: When is Mother going to be home?
We're been working on manners, but I have no idea where that came from?!?!
F2. Super Simple Solo Dad Dinner
Buitoni Three Cheese Tortellini Spaghetti sauce Frozen meatballs Cook all three per package instructions. Pour sauce over pasta, with meatballs on top. For fun, melt motzerlla over toast for a cheesy bread side.
G. iPhone App Store Filter
Is it just me, or would it be nice to be able to filter out Games from the iPhone App Store’s Top 25. I don’t really play games on my phone, nor do I care about them. It’s annoying as hell to have to scroll through pages and pages of games to see what apps people are using and find things that I might find interesting. Hear that Apple? Give me better filtering for the App...
F2. Why French Parents Are Superior →
While Americans fret over modern parenthood, the French are raising happy, well-behaved children without all the anxiety. Pamela Druckerman on the Gallic secrets for avoiding tantrums, teaching patience and saying ‘non’ with authority. French Lessons Children should say hello, goodbye, thank you and please. It helps them to learn that they aren’t the only ones with...
This February 14 of 2012 had all the makings of a shitty day. Death in the family, spat with my wife, standard exhaustion level that come with have two little ones. That said, thanks to my wonderful, amazing and unbelievably beautiful wife, it was truly wonderful. No doubt, I married up and am a lucky man.
Nick Wynja: Ikea Hack Standing Desk →
While I don’t personally use, need or want a standup desk, this is pretty cool for those of you that do… nickwynja: When we moved into a new office this past summer, I had a chance to Ikea hack the perfect standing desk. I’ve been using this set up for about 6 months and it’s been ergonomically sound and I’m quite happy with it. I’m taller than most people at 6’ 5” so it was a bit...
RIP Captain Jack D. Stanard USN(Ret.)
To quote my cousin, Jason Stanard, “My family lost a great man tonight. Captain Jack Stanard passed away at 6:20 this evening. He was a soldier, a father, a grandfather, and a good man. I will dearly miss him.” A true statement couldn’t have been said about my Grandfather, he was a rock in our family, yet soft as a teddy bear with us grandkids when we were young and continued it...
One for the ladies... →
H1. Edible Underwear (Safe for Work) →
This made me LOL. Thanks Chai, you sick deviant bastard!
F2. ... best friend ...
Thing 1: Daddy?
Me: Yeah, baby?
Thing 1: I want you to be my best friend.
Me: Baby, you'll always be my best friend.
Thing 1: You'll always be my best friend too.
F2. Solo night with the kids...
Race home from work, fighting traffic the whole way. Kiss wife goodbye, wish her a good night at work. Start solo evening with Thing 1 (3-1/2) and Thing 2 (8 weeks). Pop Thing 2 in the baby carrier, grab the leash and Thing 1 and head out for a nice long walk, but not too long lest Thing 1 need to pee or want to be carried, or Thing 2 get hungry and start balling. Pre-heat the oven for...
G. So I've deleted RVM...
I’ve been known to say how much I hate RVM. But that’s not 100% true. I hate gemsets, they’re messy, hard to track and easily get lost across rubies. I do like the ruby versioning aspect of RVM. After attending LA Ruby Conf last week and listening to (and agreeing with) Steven Baker’s rant on how much he hated RVM, I asked him what he does instead. The short version is...
G. Ruboto + Ruby + JRuby = Android App →
Interesting for those that don’t like Java (like myself).
Oh Big Bang Theory, where have you been all my life.
G. Do, do not. There is no try.
How many different geeky ways are their to say that? Ruby: [ "do", "do not" ].include? "try" => false Ruby: "do".include? "try" or "do not".include? "try" => false Bash: $DO || ! $DO; try -bash: try: command not found I could probably spend 20-30 and figure out how to do this in PERL, Python, PHP, etc. but I want to see if you all out there have them on...
G. #LaRubyConf Points of Interest
Presenter — Steven Baker Death to Bundler “I hate Bundler… I use Isolate… You should use Bundler…” “Bundler sucks ass and you all should use it!” Isolate Isolate Blog Post Isolate on Rails 3 Blog Post S.O.L.I.D. Single Responsibility A class should have a single responsibility. Open-Closed Open an object, write it and...
Optimizing Stand Up →
A quick daily meeting to check the pulse of your project can be immeasurably helpful to everyone on the team. If you’re not careful, these quick daily meetings can easily turn into long sessions where everyone talks, not much is said, and even less is heard. One of the ways to encourage these meetings to be more efficient is to have them standing up.
At #LaRubyConf in Burbank for Maintainable Rails by http://stevenrbaker.com/.
The word “hacker” has an unfairly negative connotation from being portrayed in...– Mark Zuckerberg