Skip to content

Instantly share code, notes, and snippets.

View rawroland's full-sized avatar

Roland Awemo rawroland

View GitHub Profile
// encode(decode) html text into html entity (assuming entity is hex)
var HtmlEntity = {
decode : function(str) {
return str.replace(/&#x([0-9A-F]+);/gi, function(match, dec) {
return String.fromCharCode(parseInt(dec, 16));
});
},
encode : function(str) {
var buf = [];
@rawroland
rawroland / gist:182aa73caa3501286ccaedb1dc99decc
Created July 26, 2016 18:21 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote