BitBonsai Labs Mauricio Wolff's geekness

29Jun/100

Testing pastie.org embed

27Apr/100

JS Tip: Revealing Module Pattern

From Christian Heilmann. Nothing too fancy for those who are used to write jQ plugins, but nice to save it for reference...

var myApp = function(){
	var nome = 'Mauricio Wolff';
	var idade = 35;
 
	function insertPessoa(){
		// [...]
	}
 
	function updatePessoa(){
		// [...]
	}
 
	function setPessoa () {
		// [ usa insert ou update ]
	}
 
	function getPessoa () {
		// [...]
	}
 
	return{
		set: setPessoa,
		get: getPessoa
	}
}();
 
// Example usage:
myApp.get();
14Dec/091

recursively chmod only subdirectories

When I use Betterzip to uncompress a directory tree, it chmods the dirs with 700. Here's the command to solve this:

find . -type d | xargs chmod 755

It finds all subdirectories and chmod'em to 755. Clever, isn't it?

Tagged as: , , 1 Comment
6Dec/090

Lifesaver snippets

Alguns códigos são simplesmente salvadores da pátria...

Por exemplo: Tens de subir um site por 3g, e mesmo targzipando o site ele fica com 12Mb por causa dos .svn escondidos...

tar --exclude='.svn' -czvf file.tar.gz ./*

6MB. Simples e eficaz...