Minify JavaScript with Telegram

Now with @DotMauiBot, the dotmaui.com Telegram bot, you can minimize Javascript code directly from this instant messaging application. Obviously it is more convenient to use this feature from the desktop client or from the website,…

Vulture CSS pre alpha 2 Released

Remove dead CSS from your stylesheets. We’ve improved page rendering. Before controlling the use of CSS rules, Vulture CSS expects the DOM to be loaded and processed by any Javascript. Try it now: Vulture CSS.

JavaScript – Check if a variable is an integer

function isInt(value) { return !isNaN(value) && parseInt(Number(value)) == value && !isNaN(parseInt(value, 10)); } Tests: isInt(7) // true isInt(“7”) // true isInt(7e5) // true isInt(“7e7″) // true isInt(” 7 “) // true isInt(“”) // false isInt(“…

Prevent sql injection with php

Here is a simple function to prevent Sql Injection with PHP. Just recall it and check both GET and POST parameters <?php function checkInjection() { $badchars = array("DROP", "SELECT", "UPDATE", "DELETE", "INSERT", "TRUNCATE", "UNION ALL",…

JS Minify 1.3.2 Released

To make JS Minify more and more complete, we started implementing some options. Version 1.3.2 provides: remove unreachable code drop unreferenced functions and variables join consecutive var statements preserve comments discard calls to console.* functions…

Python – Run two threads and stop them

In this post i extend an example found on stackoverflow.com, here’s how to launch two simultaneous threads and stop them after 5 seconds. import threading import time def doit(arg): t = threading.currentThread() while getattr(t, “do_run”,…