Articles & Snippets

Search for content...
/

Start typing to search

HTML Minifier

Posted by Cătălin on Fri, 14 Jul 2017

HTML Minifier - Minify HTML and any CSS or JS included in your markup

This will do the magic: //start HTML Minifier function sanitize_output($html) { $search = array( '/\>[^\S ]+/s', // strip whitespaces after tags, except space '/[^\S ]+\/'...

Read More...
code

Compare tables find and update in MySQL

Posted by Cătălin on Thu, 22 Jun 2017

Compare two tables find and update only matching data in MySQL

Find: SELECT id, mailing FROM directory_list a JOIN email_temp b ON a.email=b.email; Update: UPDATE directory_list a JOIN email_temp b ON a.email=b.email SET mailing = concat(COALESCE(mailing,...

Read More...
code

MySQL find duplicates

Posted by Cătălin on Tue, 13 Jun 2017

MySQL query to find duplicates and to select all but ignore duplicates

Find duplicates: SELECT email FROM directory_list GROUP BY email HAVING COUNT(email) >1; Select all but ignore duplicates: SELECT email FROM directory_list WHERE email LIKE '%@%' GROUP BY email ASC;...

Read More...
code

Enable GZIP Compression in WHM

Posted by Cătălin on Fri, 19 May 2017

How to add GZIP compression server-wide in cPanel WHM EasyApache3 or EasyApache4

In cPanel WHM EasyApache3 or EasyApache4, you can add GZIP compression server-wide, including new accounts, by adding the following to Service Configuration → Apache Configuration → Include Editor...

Read More...
code

Image blur filter

Posted by Cătălin on Wed, 22 Mar 2017

How to apply a Gaussian blur to an image.

CSS The value of ‘radius’ defines the value of the standard deviation to the Gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur. If...

Read More...
code

Encrypt files on OS X

Posted by Cătălin on Thu, 9 Mar 2017

Encrypt any files on OS X with openssl

Encrypt openssl enc -aes-256-cbc -e -in /Users/name/Desktop/file.pdf -out /Users/name/Desktop/file_encrypted.pdf Decrypt openssl enc -aes-256-cbc -d -in /Users/name/Desktop/file_encrypted.pdf -out...

Read More...
code