Monday, October 10, 2016

Compress PDF file

This is the only solution that works for me in reducing the pdf file size:


1. In the  command line:

$ ./ mypdf.pdf

2. The command opens a GUI interface, select Screen-view only (72dpi) and click OK

3. Beautiful

Friday, October 7, 2016

Convert multiple PDF files to JPG in Ubuntu

Quite easy:

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

Saturday, October 1, 2016

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

Wednesday, September 14, 2016

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:

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="" data-lity>Youtube</a>

4. Bind the click event:

$(document).on('click', '[data-my-lightbox]', lity);