Personal

CSV to JSON Convert Ruby

Here. Easy way to convert your CSV (with headers) to a representative json hash. It just creates a file with .json tacked onto the end.

require 'json'
require 'csv'

file_name="observations.csv"

File.open("#{file_name}.json", "w") { |f| f.write(CSV.open(file_name, headers: true, header_converters: :symbol, converters: :all).to_a.map(&:to_hash).to_json) }

AngularJS ngMin Json Properties

One thing I ran across using these tools while trying to lazy load routes/pages was the inability to properly compress the JSON Object properties. One of the workarounds, specifically for a templateUrl in this case works like so (you have to specify that you want the function value, and not the first value returned from the array.

templateUrl: ["$stateParams", function($stateParams){
var templateUrl = "views/folder/" + $stateParams.page + ".html";
return templateUrl;
}][1],

Technology & Web Flashiness

I really like flashy-ness and feel that I have run across a bunch of cool sites on the web.  One thing that never surprises me though is running into security holes and vulnerabilities… Especially when I get to see the code from someone’s site.  When it boils down to it, that a developer can have a widget update several counts at the same time to enhance functionality to a user OR the developer can make a call back to the server to see if a username or keyword is available, doesn’t mean that the developer is super l33t.

The ability to build a solution that works inside and out, completely answering the business’ needs is a more valuable trait of a senior developer than any of these things above.  Maybe when you’re interviewing or discussing with potential team mates; mentioning the flashy coolness of AJAX is worth a shot, for small talk.  But a more important conversation about answering the business needs with a subset of functionality that does what the business wants it to do in a robust way is more beneficial.

To boot, using the proper architecture and development strategies to enhance your product with the flashy-ness later in short iterative bursts will show your customer that you are analyzing usage and making all business functionality easier for them.  Spend minimal time to market, then use feedback and user test analysis to decide where your product needs to grow.  Always consider your audience, get them on it first so you not only understand what they’re doing but have a very good idea of HOW they are doing it.  Use your AJAX L33tness and JavaScript skillz to create that “brilliance” that we all know exists and deliver the best product for your customer.

Spring Training in Full Swing!

Spring Training is in full swing now.  Training for a half marathon and loving it so far.  The legs don’t like it so much!  Here’s the training schedule (pukes)!

  1. Sunday – Long bike trying to match the duration of my long run.  Last week I did 16.5 miles on the trainer
  2. Monday – Easy 3 miles or Cross Train (Pick One). Last week I cross-trained on a running apparatus
  3. Tuesday – Bike.  Last week I went 10 miles on the trainer
  4. Wednesday – Hill Workouts (Yuck!) Last week we down the ladder.  Can’t wait to get to the point where I can go back up.
  5. Thursday – Easy 3 or Cross Train (Pick Opposite of Monday). Last week I did 2.1  miles @ 12:20 per
  6. Friday – Off. Yeah, I am taking this off
  7. Saturday – 5 miles TBD!

This is exciting. I’m meeting new people, even though I’m so shy.  Maybe they’ll read this and introduce themselves or something! :)

© 2012 - Jeff Ancel
Wordpress Themes
Scroll to Top