T-SQL – Find running queries

Here’s a little script in T-SQL to find queries running in our SQL SERVER database: SELECT sqltext.TEXT, res.session_id, res.status, res.command, res.cpu_time, res.total_elapsed_time FROM sys.dm_exec_requests res CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext This script is also useful…

SQL Server – How create a function

CREATE FUNCTION dbo.MyFunction (@input VARCHAR(200)) RETURNS VARCHAR(200) AS BEGIN DECLARE @WebSite VARCHAR(250) SET @WebSite = @Input SET @WebSite = REPLACE(@WebSite , ‘https://’, ”) SET @WebSite = REPLACE(@WebSite , ‘http://’, ”) SET @WebSite = REPLACE(@WebSite ,…

jQuery – Textbox accept only numbers

Implement a functionality for a textbox to allow only numbers in jQuery: $(‘.only-digits’).on(‘keypress’, function (e) { if ((e.keyCode < 48) || (e.keyCode > 57)) { return false; } }); Remains the problem that you can…

Instantly create a secure password.

Do not take lightly the choice of passwords for your online services. Every day thousands of accounts are violated because of the easy password. Generate the password with our tool: .Maui Password Generator It’s free,…

Javascript Trim a String

How remove whitespace from both sides of a string (trim function): Pure Javascript var mystring = ”       dotmaui.com        “; mystring.trim(); For browsers that do not support the trim() method: String.prototype.trim = function() {…

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(“…