Creating a new tar:
tar zcvf new.tar.gz the_folder_i_want_to_tar
Exploding the tar:
tar zxvf new.tar.gz
Everything that glitters is not gold. But I definitely am.
November 26th, 2009 — Never forget
Creating a new tar:
tar zcvf new.tar.gz the_folder_i_want_to_tar
Exploding the tar:
tar zxvf new.tar.gz
October 18th, 2009 — Never forget
Backup:
mysqldump -u user -p database_name > dump.sql (Enter password)
Restore:
mysql -u user -p new_database_name < dump.sql (Enter password)
October 11th, 2009 — Never forget, Web
On the remote server:
mkdir repository.git cd repository.git git --bare init
On the developer’s machine:
mkdir cool_app cd cool_app git init touch README git add README git commit -m 'first commit' git remote add origin ssh://user@server:port/full/path/to/repository.git git push origin master
September 23rd, 2009 — Never forget, Programming
The number of tests in the app I’m developing it’s getting really big. Sometimes, I just need to run a single test and not all of them. I only need to remember this line:
ruby -Itest test/unit/availability_time_test.rb
September 8th, 2009 — Javascript, Never forget, Programming, Web
var s = "1337"; alert(parseInt(s) * 2);
September 1st, 2009 — Javascript, Never forget, Programming, Web
Sometimes I need to time how long a Javascript operation takes. It’s very easy if you are using jQuery.
console.time("longOperation");
for (var i=0; i<1000; ++i){ var j = i*i; } //do something complicated
console.timeEnd("longOperation");
Then, you’ll see the result in the Firebug console:
