Skip to content

Instantly share code, notes, and snippets.

@Edukanezza
Edukanezza / trimText.js
Created April 29, 2015 20:54
Trim text down and add ...
// Trim text.
function trimText( jquery_obj_to_trim, trim_length ){
var currentText = jquery_obj_to_trim.text();
var newLength = trim_length;
var currentTextTrimmed = currentText.substr(0, newLength);
var endOfCurrentText = /\W?\s?\b\w+\W*?$/.exec( currentTextTrimmed );
if( endOfCurrentText === null ) return;
var endOfCurrentTextLength = endOfCurrentText[0].length;
currentTextTrimmed = currentText.substr(0, newLength - endOfCurrentTextLength );
ssh [email protected] "tar czpf - repo/gpec.git" | tar xzpf - -C /Users/agencymabu002/Desktop/repo/