Trim Line Python

I found Trim curve for rhino python script editor in the following link. 

http://www-personal.umich.edu/~gwil/gendescom/post050/trim_line.py

tutorial video: 

http://www-personal.umich.edu/~gwil/gendescom/post050/trim_line.mp4

Conversion into GH python on file below.  

Any feed back thank you in advance. 

TrimCurve.gh