Update SASS on OSX

I needed to use the latest version of SASS (v3.2) in order to use a new feature where you can pass @content blocks to @mixins. Updating is pretty simple, this worked on OSX 10.8.2: # sudo gem update As an FYI, here’s an example of using @content blocks: @mixin retina …

How to Wrap an Element Within a New Element Using Javascript

Here’s a simple way of wrapping an HTML fragment that exists in the DOM within another element, in this case a div: var wrapper = document.createElement(‘div’); wrapper.id = ‘the-wrapper’; wrapper.appendChild(document.querySelector(‘#the-html-fragment’)); At this point, the HTML fragment that was selected via the #the-html-fragment selector was removed from the DOM and attached …