SambucaJS – jQuery plugin

Small jquery plugin that adds some functionality to jquery, eg: Check if an item is empty Check whether an item exists Take a parameter in the querystring of the current Web page. /*! * jQuery…

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() {…