Undefined method or attribute error in a Chef recipe
There are multiple reasons Chef can display the following error message NoMethodError ------------- Undefined method or attribute `...' on `node' There are many ways to reference an attribute in a Chef recipe: node['ATTRIBUTE_NAME'] (the…
Generate a GUID in Chef with Ruby
When you need a unique string to name a resource in your Chef scrip, generate a GUID with SecureRandom.uuid To make sure the resource always gets a unique name: log "#{SecureRandom.uuid}" do message 'My message' level :info end
Last characters of a string in Ruby
To get the last characters of a string in Ruby, use the following instructions. If the string is shorter than the selected number of characters, the entire string is returned. a = '12345' b = a[-3..-1] || a puts b Returns 345
How to enable jQuery intellisense in Microsoft Visual Studio
To enable jQuery intellisense in Microsoft Visual Studio Open the _references.js file in the editor by double clicking it Drag the jquery-x.x.x.intellisense.js file into the _references.js file in the editor. The name of the file will be added to the…