Uncategorized

Compile Boostrap from sources in Ubuntu 14.04

Unfortunately, Ubuntu software repos are not up to date with Nodejs.

You shall use Chris Lea’s Repo

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update

Then, install nodejs:

sudo apt-get install nodejs

Then it’s time for grunt to be installed (that’s  just plain Bootstrap’s tutorial from now on):

sudo npm install -g grunt-cli

Get into your bootstrap directory and run

npm install
npm update

You’re good to go, just run

grunt watch

Also, if you want sourcemaps, see this SO answer.

Standard
Snippets, Web Development

Dynamically generated content loses behaviour in Zurb Foundation

If you dynamically generate or load content in a foundation page, javascript behaviour won’t be automatically attached. Here’s the dirty way to do refresh foundation’s page behaviour:

To reflow all components:

$(document).foundation('reflow')

Or, to reflow just the section component:

$(document).foundation('section', 'reflow')

via github

Standard
Web Development

Create and use your own NuGet packages

If you are an ASP.net developer and you do not know NuGet, you most certainly should.

If you already use it, chances are that you are using it just download other people’s library.

Instead, you should create your own NuGet Packages, and possibly open source them and make it available to others.

Why?

For reusability.
I think that having an easy way to include a library reduces viscosity. You will update your library and update it in all your projects

For better code.
Just the idea that somebody else will criticize, use, or even just look at your code will push you into writing better code;
Not only; writing micro libraries will force you somehow into using SOLID principles.

For Kaizen.
Not only your microlibraries will continuously improve; you’ll get more feedback from other developers, helping you develop better skills and knowledge.

Or at least, those are the expectations that prompted me to start publishing packages.

Standard