Skip to main content

Stephen Duncan Jr

Member since Nov 21, 2010

Recent Blog Comments By Stephen Duncan Jr

  • Using Underscore.js Templates To Render HTML Partials

    Posted on Aug 18, 2012 at 10:34 AM

    @Ben, Wow, you're right, and it's been that way for a while. I guess the stuff I'd read previously about it is just very out of date. Sorry for the misinformation.... read more »

  • Using Underscore.js Templates To Render HTML Partials

    Posted on Aug 17, 2012 at 1:30 PM

    One thing to be aware of is that underscore's template, unlike other (such as Handlebars), does not do any HTML escaping for you. You can do it manually using _.escape. This is obviously important when it comes to preventing cross-sites-scripting vulnerabilities.... read more »

  • Seven Languages In Seven Weeks: Ruby - Day 1

    Posted on Nov 21, 2010 at 1:45 PM

    Here's what I remember of the rules (I'm just an amateur Ruby user still): {...} or do...end can be used for blocks, which are really an argument to a method. So they can be used on methods (upto for instance). You can't use {...} on language constructs like "for" "if", etc. W... read more »

  • Seven Languages In Seven Weeks: Ruby - Day 1

    Posted on Nov 21, 2010 at 1:36 PM

    D'oh. Gotta remember to refresh the page to see if someone like @Michael beat me to the punch. :)... read more »

  • Seven Languages In Seven Weeks: Ruby - Day 1

    Posted on Nov 21, 2010 at 1:33 PM

    @Ben To use a step-change on your range you can do: (0..10).step(2) do |i| puts "Num: #{i}" end Which prints: Num: 0 Num: 2 Num: 4 Num: 6 Num: 8 Num: 10... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel