Small PHP class to write log files
Here is a small class in PHP to write log files. If the file name is not specified, it will be assigned by the script. <?php class Log { private $PATH; function __construct($file_name = null)…
Here is a small class in PHP to write log files. If the file name is not specified, it will be assigned by the script. <?php class Log { private $PATH; function __construct($file_name = null)…
To check if an item is present in the DOM using jQuery, it is sufficient to use the length property, like this: if ($(‘#myElement’).length) { // Exists } else { // Not Exists } Or…
Small piece of programming code in vb.net. How to Perform a Group By with LINQ. Dim Result = From p In Person Group p By MyGroup = New With { Key .Name = p.Name, Key…
How reverse a boolean with one line of code. VB.net MyVar = Not MyVar PHP $myvar = !$myvar; C# myvar = !myvar; Python my_var = not my_var Go MyVar = !MyVar Javascript myvar = !myvar;…
Python provides the urllib2 module that helps us in HTTP requests by defining functions and classes for redirecting, cookies, authentication and more. Here’s an example to take the content of a page and store it…
Install and Update Pip3: sudo apt install python3-pip sudo pip3 install –upgrade pip sudo pip3 install –upgrade setuptools Now launch the installation command for psycopg2: sudo pip3 install psycopg2 If it returns the following error:…
We think Telegram is the best instant messaging app and we love its privacy philosophy, in addition to its speed and security. For these reasons we have opened a Telegram channel where we will update…
jQuery is a great JavaScript Library, it helps to write less and simplifies JavaScript programming But often there is no need to include jQuery, because the necessary functions are few. It might be fun and useful…
Here is a small function to get the value of a selected radio button without using jQuery: function getRadioValue(name) { var radios = document.getElementsByName(name); for (var i = 0; i< radios.length; i++) { if (radios[i].checked)…
There are several reasons why a CDN could benefit your website. All of these reasons are all well explained in this article, needless to repeat. That’s why we’ve been thinking of offering our registered users…