Stephen Duncan Jr
Member since Nov 21, 2010
- Profile: /members/7325-stephen-duncan-jr.htm
- URL: http://www.stephenduncanjr.com
- Comments: 5
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 »