Skip to content

Category Archives: Software

Git: When to Close (Delete) Branch after PR

15-Jan-19

When should I close (i.e. delete) the branch after a successful pull request? Rule of thumb: always. (There are exceptions of course.) What if I need to recover the deleted work? You'll just git checkout -b <branch> <sha>  

JavaScript: get domain from url with JS regex

07-Nov-18

It's as simple as url.match(/\/\/(.[^/]+)/)[1]. Requires the double slash before the domain part, but not a slash after it.

Bootstrap 3 text-align (left/right) for xs, sm, md, lg screen sizes

02-Nov-18

/** * Text alignment for screen sizes */ @media (max-width:767px){ .xs-text-right { text-align: right; } .xs-text-left { text-align: left; } } @media (min-width:768px){ .sm-text-right { text-align: right; } .sm-text-left { text-align: left; } } @media (min-width:992px){ .md-text-right { text-align: right; } .md-text-left { text-align: left; } } @media (min-width:1200px){ .lg-text-right { text-align: right; } .lg-text-left […]

Conflicting package-lock.json in Git?

30-Oct-18

Include package-lock.json in your git repository, but try to commit it alone (to avoid noise in diffs). When encountering conflicts during merge: npm install --package-lock-only As running that command then suggests, you might also want to consider automating the process by installing npm-merge-driver (npx npm-merge-driver install -g).

Cancel Conflicting Git Merge (--ABORT)

30-Oct-18

Your keyword here isĀ abort. git merge --abort