Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Standup 2011-08-19: Moldova Watch

Ask for Help

*”Is there such a thing as an ActiveResourceModel, containing all the niceness of ActiveModel with an ActiveResource backend?”

Problems with ActiveResource include not being able to parse the output provided by the standard Rails to_json method on the other end. It is possible to change to_json‘s [] wrapping behavior globally via a Rails setting.

Or you can use HTTParty or the remote-object wrapper of your choice and roll your own happy path.

*”Has anyone installed ant on a CentOS box?”

Igor Kozachenko has.

*”Any good fixes for long-running DDOS attacks? Other than rejecting all requests from Moldova?”

Cloudflare may help, but it takes some time to get set up. You can also throw more caching proxies at it, such as Varnish

*”What happens with document.write calls from within external javascripts?”

Say I have a page that loads some script tags:

  <script src:"a.js"></script>
  <script src:"b.js"></script>
  <script src:"c.js"></script>

a.js and b.js want to add additional script tags. I’d expect head to look like this after the page has loaded.

  <script src:"a.js"></script>
  <script src:"b.js"></script>
  <script src:"c.js"></script>
  <script src:"foo.js"></script>
  <script src:"bar.js"></script>


(function() {
  document.write('<script src="foo.js"></script>")


  var scriptTag = document.createElement('script');
  scriptTag.setAttribute('src', "bar.js");

Would it surprise anyone that foo.js never makes it into the DOM? But that bar.js is there every time? Where does document.write go?

Interesting things

  • When setting a data-x attribute that contains a JSON-formatted string ( such as '{a:1, b:2}'), retrieving that attribute value via automatically returns the evaluated JS object, not the JSON-formatted string. Surprise!

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *