<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>See John Code - Latest Comments</title><link>http://seejohncode.disqus.com/</link><description></description><atom:link href="https://seejohncode.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 16 May 2014 09:19:27 -0000</lastBuildDate><item><title>Re: CoffeeScript: A Love Story?</title><link>http://www.seejohncode.com/2011/02/13/coffeescript/#comment-1388741536</link><description>&lt;p&gt;thanks for the note - will update&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Fri, 16 May 2014 09:19:27 -0000</pubDate></item><item><title>Re: CoffeeScript: A Love Story?</title><link>http://www.seejohncode.com/2011/02/13/coffeescript/#comment-1384230326</link><description>&lt;p&gt;coffescript doesn't always produce js that passes jslint : &lt;a href="https://github.com/jashkenas/coffeescript/issues/2500" rel="nofollow noopener" target="_blank" title="https://github.com/jashkenas/coffeescript/issues/2500"&gt;https://github.com/jashkena...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SB</dc:creator><pubDate>Wed, 14 May 2014 04:21:21 -0000</pubDate></item><item><title>Re: Using ENUMs with Rails</title><link>http://www.seejohncode.com/2011/02/18/enums-with-rails/#comment-1381118945</link><description>&lt;p&gt;My current app doesn't really have a good use for them, but I do still think they're interesting for a case like this one.  Also check this out if you haven't seen it yet: &lt;a href="http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html" rel="nofollow noopener" target="_blank" title="http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html"&gt;http://edgeapi.rubyonrails....&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Mon, 12 May 2014 11:59:59 -0000</pubDate></item><item><title>Re: Using ENUMs with Rails</title><link>http://www.seejohncode.com/2011/02/18/enums-with-rails/#comment-1376576393</link><description>&lt;p&gt;Hi! Sorry for commenting on 3 years old post, but it'd be cool to know your current experience with enum fields. Do you still use them? Have you met any new disadvantages? Would you still recommend to use them? Thank you!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Roman</dc:creator><pubDate>Fri, 09 May 2014 09:29:04 -0000</pubDate></item><item><title>Re: Copying an Array in JavaScript</title><link>http://www.seejohncode.com/2012/03/27/copying-an-array-in-javascript/#comment-1370897427</link><description>&lt;p&gt;Deep copy for everything &lt;br&gt;var b = JSON.parse(JSON.stringify(a))&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">objectCloner</dc:creator><pubDate>Mon, 05 May 2014 16:36:25 -0000</pubDate></item><item><title>Re: Copying an Array in JavaScript</title><link>http://www.seejohncode.com/2012/03/27/copying-an-array-in-javascript/#comment-1370894860</link><description>&lt;p&gt;Omg, hope that no one will use such technic in our days. It has huge disadvantage - it will not copy/clone nested arrays or object. All this post could be in one line modern solution that works for everything (objects, array, strings, numbers, etc.): &lt;br&gt;var b = JSON.parse(JSON.stringify(a))&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">arrayCloner</dc:creator><pubDate>Mon, 05 May 2014 16:34:39 -0000</pubDate></item><item><title>Re: CoffeeScript: A Love Story?</title><link>http://www.seejohncode.com/2011/02/13/coffeescript/#comment-1256168411</link><description>&lt;p&gt;Hmm - if there was an equal sign on the first line that would be true (this output is directly from the coffeescript compiler).  Anyway, there was meant to be one in the coffeescript, so I'll update the example - thanks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Sat, 22 Feb 2014 09:40:34 -0000</pubDate></item><item><title>Re: CoffeeScript: A Love Story?</title><link>http://www.seejohncode.com/2011/02/13/coffeescript/#comment-1255888050</link><description>&lt;p&gt;The JavaScript output for square should be:&lt;/p&gt;&lt;p&gt;square = function(x) {&lt;br&gt;  return x * x;&lt;br&gt;};&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dan Dascalescu</dc:creator><pubDate>Sat, 22 Feb 2014 00:56:51 -0000</pubDate></item><item><title>Re: Ruby &amp;#8211; #tap that!</title><link>http://www.seejohncode.com/2012/01/02/ruby-tap-that/#comment-1114432631</link><description>&lt;p&gt;Gotcha. I also saw a follow-up article you wrote regarding this. I dig it. :)&lt;/p&gt;&lt;p&gt;Cheers!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mark</dc:creator><pubDate>Fri, 08 Nov 2013 15:47:06 -0000</pubDate></item><item><title>Re: Using Ruby&amp;#8217;s #tap and #to_proc Together</title><link>http://www.seejohncode.com/2012/03/28/using-rubys-tap-and-to_proc-together/#comment-1114431848</link><description>&lt;p&gt;Aha! There's an example I can dig. Cheers.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mark</dc:creator><pubDate>Fri, 08 Nov 2013 15:46:29 -0000</pubDate></item><item><title>Re: Ruby &amp;#8211; #tap that!</title><link>http://www.seejohncode.com/2012/01/02/ruby-tap-that/#comment-1114092892</link><description>&lt;p&gt;sure, here's one:&lt;/p&gt;&lt;p&gt;[1, 2, 3].tap(&amp;amp;:compact!).reverse # would error if non-tapped since compact took no action&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Fri, 08 Nov 2013 12:34:03 -0000</pubDate></item><item><title>Re: Ruby &amp;#8211; #tap that!</title><link>http://www.seejohncode.com/2012/01/02/ruby-tap-that/#comment-1114003768</link><description>&lt;p&gt;Hmm. Your examples could easily be re-written as:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre&gt;object = Model.new.save!&lt;br&gt;&lt;br&gt;&lt;br&gt;object = SomeClass.new{ |obj| obj.key = 'value'}&lt;br&gt;&lt;br&gt;&lt;br&gt;# and&lt;br&gt;[1,2,3].reverse!&lt;br&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;All of the examples return the original object, so tap is unnecessary and superfluous—or am I missing the point here? What are some other examples?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mark</dc:creator><pubDate>Fri, 08 Nov 2013 11:26:58 -0000</pubDate></item><item><title>Re: Copying an Array in JavaScript</title><link>http://www.seejohncode.com/2012/03/27/copying-an-array-in-javascript/#comment-1106618861</link><description>&lt;p&gt;That's the appropriate behavior, and what I'd expect (no mistake IMO)..&lt;br&gt;It'd be weird if this wasn't the case - you want a deep_copy if not&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Sat, 02 Nov 2013 17:43:46 -0000</pubDate></item><item><title>Re: Copying an Array in JavaScript</title><link>http://www.seejohncode.com/2012/03/27/copying-an-array-in-javascript/#comment-1106459894</link><description>&lt;p&gt;Same code, same mistake. This won't clone/copy an array of objects, it'll just copy the reference.&lt;br&gt;Everyone says OMG USE SLICE ITS AWESOME, but look:&lt;/p&gt;&lt;p&gt;var a = [{a:1, b:2},3]&lt;br&gt;    var b = a.slice();&lt;br&gt;    b[0].a = "WHYYYY";&lt;br&gt;    console.log(a); // → [ { a: 'WHYYYY', b: 2 }, 3 ]&lt;br&gt;    console.log(b); // → [ { a: 'WHYYYY', b: 2 }, 3 ]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">amdc</dc:creator><pubDate>Sat, 02 Nov 2013 14:37:56 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-1067358815</link><description>&lt;p&gt;I've not personally tried JSCover, but it looks like it should be a compatible output, so you should be able to just substitute it for jscoverage&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Wed, 02 Oct 2013 09:58:42 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-1067231373</link><description>&lt;p&gt;There's no more new releases for jscoverage, have you tried JSCover to run a test with Mocha?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David</dc:creator><pubDate>Wed, 02 Oct 2013 08:19:44 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-1060303786</link><description>&lt;p&gt;thanks :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Thu, 26 Sep 2013 16:23:11 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-1059664316</link><description>&lt;p&gt;Thanks. Great post! =)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexander Bykhov</dc:creator><pubDate>Thu, 26 Sep 2013 07:44:13 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-986316827</link><description>&lt;p&gt;Don't `cd` into the test-cov directory, and you need an environment variable when you call mocha to indicate it should run with the test-cov directory instead of the test directory&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Fri, 02 Aug 2013 14:56:38 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-986288446</link><description>&lt;p&gt;dev@ubuntu:~/Documents/test$ jscoverage --no-highlight files/ test-cov/&lt;/p&gt;&lt;p&gt;dev@ubuntu:~/Documents/test$ cd test-cov/&lt;/p&gt;&lt;p&gt;dev@ubuntu:~/Documents/test/test-cov$  mocha -R html-cov &amp;gt; coverage.html&lt;/p&gt;&lt;p&gt;node.js:201&lt;/p&gt;&lt;p&gt;        throw e; // process.nextTick error, or 'error' event on first tick&lt;/p&gt;&lt;p&gt;              ^&lt;/p&gt;&lt;p&gt;ReferenceError: _$jscoverage is not defined&lt;/p&gt;&lt;p&gt;    at Object.&amp;lt;anonymous&amp;gt; (/home/dev/Documents/test/test-cov/test.js:40:7)&lt;/p&gt;&lt;p&gt;    at Module._compile (module.js:441:26)&lt;/p&gt;&lt;p&gt;    at Object..js (module.js:459:10)&lt;/p&gt;&lt;p&gt;    at Module.load (module.js:348:32)&lt;/p&gt;&lt;p&gt;    at Function._load (module.js:308:12)&lt;/p&gt;&lt;p&gt;    at Module.require (module.js:354:17)&lt;/p&gt;&lt;p&gt;    at require (module.js:370:17)&lt;/p&gt;&lt;p&gt;    at /usr/local/lib/node_modules/mocha/lib/mocha.js:152:27&lt;/p&gt;&lt;p&gt;    at Array.forEach (native)&lt;/p&gt;&lt;p&gt;    at Mocha.loadFiles (/usr/local/lib/node_modules/mocha/lib/mocha.js:149:14)&lt;/p&gt;&lt;p&gt;    at &lt;a href="http://Mocha.run" rel="nofollow noopener" target="_blank" title="Mocha.run"&gt;Mocha.run&lt;/a&gt; (/usr/local/lib/node_modules/mocha/lib/mocha.js:306:31)&lt;/p&gt;&lt;p&gt;    at Object.&amp;lt;anonymous&amp;gt; (/usr/local/lib/node_modules/mocha/bin/_mocha:339:7)&lt;/p&gt;&lt;p&gt;    at Module._compile (module.js:441:26)&lt;/p&gt;&lt;p&gt;    at Object..js (module.js:459:10)&lt;/p&gt;&lt;p&gt;    at Module.load (module.js:348:32)&lt;/p&gt;&lt;p&gt;    at Function._load (module.js:308:12)&lt;/p&gt;&lt;p&gt;    at Array.0 (module.js:479:10)&lt;/p&gt;&lt;p&gt;    at EventEmitter._tickCallback (node.js:192:41)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Leonardo Apolonio</dc:creator><pubDate>Fri, 02 Aug 2013 14:28:40 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-986267536</link><description>&lt;p&gt;I advocate using a Makefile like in the tutorial&lt;br&gt;What error are you seeing?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Fri, 02 Aug 2013 14:09:44 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-986246341</link><description>&lt;p&gt;i'm trying to run this manually from command line (to possible integrate with jenkins) after "jscoverage test test-cov" where do i run "mocha -R html-cov &amp;gt; coverage.html"? running the command in test-cov throws an error....&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Leonardo Apolonio</dc:creator><pubDate>Fri, 02 Aug 2013 13:53:25 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-970261608</link><description>&lt;p&gt;I haven't worked specifically with mocha-phantomjs, but I'd imagine those two don't really interact.  The command is run from the root of your project directory as long as your lib/ directories are the same as mine - if not, you'll need to update some paths&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Crepezzi</dc:creator><pubDate>Sat, 20 Jul 2013 09:23:02 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-966963499</link><description>&lt;p&gt;Its a nice example but I'm using mocha-phantomjs, how does this fit in with your testrunner html file which you need to supply when you run mocha-phantomjs? Any ideas? Also which directory do you run the run command from?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jon</dc:creator><pubDate>Thu, 18 Jul 2013 10:34:16 -0000</pubDate></item><item><title>Re: Setting up Mocha &amp;#038; JSCoverage</title><link>http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/#comment-961171085</link><description>&lt;p&gt;Thank you! This helped a lot! I love your method of defining an environment variable to modify the require() directory.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">JoshuaToenyes</dc:creator><pubDate>Sat, 13 Jul 2013 16:50:28 -0000</pubDate></item></channel></rss>