Skip to content

Instantly share code, notes, and snippets.

@LamCiuLoeng
LamCiuLoeng / introrx.md
Last active August 29, 2015 14:27 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@LamCiuLoeng
LamCiuLoeng / README.md
Created March 25, 2016 01:54 — forked from dannguyen/README.md
Using Google Cloud Vision API to OCR scanned documents to extract structured data

Using Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

@LamCiuLoeng
LamCiuLoeng / gist:eefa0261fbabff171139168d154112a7
Created August 22, 2018 06:55 — forked from lxneng/gist:1003869
How to do a “git export” (like “svn export”)

How to do a “git export” (like “svn export”)

Probably the simplest way to achieve this is with git archive. If you really need just the expanded tree you can do something like this.

git archive master | tar -x -C /somewhere/else

Most of the time that I need to 'export' something from git, I want a compressed archive in any case so I do something like this.

@LamCiuLoeng
LamCiuLoeng / RPi-aria2-with-webui.sh
Created September 26, 2017 01:08 — forked from akaxxi/RPi-aria2-with-webui.sh
Install Aria2 and webui on Raspberry Pi with one simple script.
#!/bin/sh
DOWNLOAD_DIR="${HOME}/MiniDLNA"
CONFIG_DIR="${HOME}/.aria2"
RPC_TOKEN="changeIt"
RPC_PORT="6800"
change_apt_source(){
if [ -f /etc/apt/sources.list ]; then
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak