Skip to content

Instantly share code, notes, and snippets.

View heisenberg-lgbt-ulanbator's full-sized avatar
🏳️‍🌈
I am happy my new reality

heisenbergjs heisenberg-lgbt-ulanbator

🏳️‍🌈
I am happy my new reality
  • Ulan Bator
View GitHub Profile

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@heisenberg-lgbt-ulanbator
heisenberg-lgbt-ulanbator / truncate_html_utf8.php
Last active October 24, 2017 19:07 — forked from andykirk/truncate_html.php
PHP Truncate HTML Function
<?php
/**
* truncate_html()
*
* Truncates a HTML string to a given length of _visisble_ (content) characters.
* E.g.
* "This is some <b>bold</b> text" has a visible/content length of 22 characters,
* though the total string length is 29 characters.
* This function allows you to limit the visible/content length whilst preserving any HTML formatting.