Blog

Restricting Product results with respect to selected language.

Handling Cookies in JavaScript

folder_openCoding, Snippets
commentNo Comments
Getting the Cookies: function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null;…
Click Me

MySQL – Drop all Tables from Command Line

folder_openCoding, Snippets
commentNo Comments
DROP PROCEDURE IF EXISTS `drop_all_tables`; DELIMITER $$ CREATE PROCEDURE `drop_all_tables`() BEGIN DECLARE _done INT DEFAULT FALSE; DECLARE _tableName VARCHAR(255); DECLARE _cursor CURSOR FOR SELECT table_name FROM information_schema.TABLES WHERE table_schema = SCHEMA(); DECLARE CONTINUE HANDLER FOR NOT FOUND SET _done =…
Click Me

Check available RAM in Linux

folder_openCoding, Snippets
commentNo Comments
This will convert any kB lines to MB: awk '$3=="kB"{$2=$2/1024;$3="MB"} 1' /proc/meminfo | column -t 1 awk '$3=="kB"{$2=$2/1024;$3="MB"} 1' /proc/meminfo | column -t This version converts to gigabytes: awk '$3=="kB"{$2=$2/1024^2;$3="GB";} 1' /proc/meminfo | column -t 1 awk '$3=="kB"{$2=$2/1024^2;$3="GB";} 1' /proc/meminfo | column -t…
Click Me
Menu