Posts

Mass change timezone of all sites in WordPress Multisite

I would use the  wp-cli  command line tool to reset timezone of all sites in my WordPress Multisite. For example to GMT+7 wp site list --field=url --allow-root | xargs -n1 -I {} sh -c 'wp --url={} option update gmt_offset 7 --allow-root'

A great moment

Image

Compress PDF file

Image
This is the only solution that works for me in reducing the pdf file size: Usage: 1. In the  command line: $ ./compresspdf.sh mypdf.pdf 2. The command opens a GUI interface, select Screen-view only (72dpi) and click OK  3. Beautiful

Convert multiple PDF files to JPG in Ubuntu

Quite easy: for filename in /path/to/*.pdf; do convert -density 300 "$filename" "$filename.jpg";done

Another quote of the day

“The effect you have on others is the most valuable currency there is.”  — Jim Carrey

Quote of the day

“If you rest, you rust.”  — Helen Hayes

Lightbox effect made easy with litty

So you want to make a webpage that when you click a button, a youtube video frame will overlay the current windows instead of opening in a new screen. Lightbox effect is what you want to achieve. But it sounds like something fancy and would take a lot of javascript-fu to implement it. Fortunately, we have Lity . Official website:  http://sorgalla.com/lity/ Here is how to use it: 1. Download the distribute package of litty from github . You only need 2 files: lity.js and lity.css from  the dist directory. 2. Include the library in your web page (and jQuery): <link href="lity.css" rel="stylesheet"> <script src="jquery.js"></script> <script src="lity.js"></script> 3. Add data-lity to your link tag: <a href="https://www.youtube.com/watch?v=XSGBVzeBUbk" data-lity>Youtube</a> 4. Bind the click event: $(document).on('click', '[data-my-lightbox]', lity); Awesome!!!