Posts

Showing posts from 2012

JQuery - window offset right

Script that counts right offset of an element in a window. Taken from: stackoverflow.com answers var $whatever = $('#whatever'); var offset_right = ($(window).width() - ($whatever.offset().left + $whatever.outerWidth()))

How to set width of a table within Twitter Bootstrap

All tables within the bootstrap stretch according to their container, which you can easily do by placing your table inside a .span* grid element of your choice. If you wish to remove this property you can create your own table class and simply add it to the table you want to expand with the content within: .table-nonfluid { width: auto; } Taken from: stackoverflow answers .

MySQL database size script

Useful scripts that count MySQL database size or individual tables sizes (taken from: http://www.mkyong.com/mysql/how-to-calculate-the-mysql-database-size/ ):  Database size: SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema; Individual tables sizes: SELECT TABLE_NAME, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024),2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "schema_name";

AppFog: download log files

To download a log file from AppFog use simple command: af files appname [app/relative/log/path/on/server] > [path/to/local/file] af commands are described in detail here: https://docs.appfog.com/getting-started/af-cli