Tuan Anh

container nerd. k8s || GTFO

The six most common species of code

The six most common species of code

link bài gốc

Hyde

An elegant, open source and mobile first theme for jekyll by Mark Otto - creator of Bootstrap.

Hyde - Jekyll theme

link bài gốc

History of the browser user-agent string

Good read.

And then Google built Chrome, and Chrome used Webkit, and it was like Safari, and wanted pages built for Safari, and so pretended to be Safari. And thus Chrome used WebKit, and pretended to be Safari, and WebKit pretended to be KHTML, and KHTML pretended to be Gecko, and all browsers pretended to be Mozilla, and Chrome called itself Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13, and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded.

link bài gốc

Humble New Tab Page

The latest addition to my Chrome extensions list, replaced the good old ‘Empty New Tab Page’.

Humble New Tab Page is lightweight, fast, open-sourced and very customizable.

link bài gốc

Letter to a young programmer

From Guido van Rossum - inventor of Python.

I heard you enjoy a certain programming language named Python. Programming is a wonderful activity. I am a little jealous that you have access to computers at your age; when I grew up I didn’t even know what a computer was! I was an electronics hobbyist though, and my big dream was to build my own electronic calculator from discrete components. I never did do that, but I did build several digital clocks, and it was amazing to build something that complex and see it work. I hope you dream big too – programmers can make computers (and robots!) do amazing things, and this is a great time to become a programmer. Just imagine how much faster computers will be in five or ten years, and what you will be able to do with your skills then!

link bài gốc

Pinboard tab sets

I didn’t know this feature exist until I install Pinboard’s official Chrome extension today. Basically, it will save all current open tabs as a tab set so you can reopen everything later. Very useful when you need to stop in the middle of doing research or stuff-alike.

Tabs in tab set will not be added to your bookmarks

link bài gốc

Nexus 5 and Android KitKat

Beautiful.


Snip - another screenshot capture/annotation tool

Features: capture scrolling window (e.g. webpages), annotate screenshot, Retina-ready and a bunch of Chinese-users-oriented features.

Free on Mac App Store or direct download from QQ website.


Free OCR solution on OS X

Tesseract OCR is probably the best open source OCR engine available. It allows you to convert text from an image.

Install tesseract

I suppose you already have homebrew installed. If not, copy and paste this into Terminal.

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Once you got homebrew, installing tesseract is as simple as brew install tesseract

Automate the process

tesseract accepts input as image. If you input is PDF, you will have to convert it to image first, perferably TIFF format. You probably will want to automate this process with Automator.

Fire up Automator and create a new application.

Search for the action “Render PDF Pages as Images” and drag it to the right. Change the format to TIFF and increase DPI to 300 (The higher, the better accuracy rate)

Search and drag action “Rename Finder Items” to the workflow on the right and change it as the following image. Remember to tick “Make all number 4 digits long” just to ensure the numbering is right if you got lots of pages in the PDF file.

Add action “Move Finder Items” to the workflow. Select your desired folder as you see fit.

Now, this is the part where where OCR begins. We will convert each image to text by passing each image to tesseract. We then will append the output to our output.txt file. Remember to change tesseract path according to your tesseract version number. (It’s 3.02.02 as of this post)

The last step in the script is removing the images and the buffered text files. It’s optional.

rm ~/Desktop/out.txt
for f in "[email protected]"
do
  /usr/local/Cellar/tesseract/3.02.02/bin/tesseract "$f" "$f"
  cat "$f.txt" >> ~/Desktop/out.txt
  rm "$f" "$f.txt"
done

The last step looks like this in Automator

Save this Automator workflow to Desktop or wherever you want.

Next time you need to OCR a PDF document, just drag and drop it over the application’s icon. The output text will be saved as output.txt on Desktop.


Flamingo for Mac

Beautiful, modern chat client for Mac from Indragie Karunaratne - creator of Sonora.

Flamingo supports Google Hangouts, Facebook and other XMPP services with many cool features such as: inline media, send file via Droplr/CloudApp and an unified contact lists.

link bài gốc