Short tips I learned during development. Also used as reminders.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md

README.md

Lessons learned

Short tips I learned during development. Quite obvious for most people, not for me when I discovered them 💩.

Angular

Application tick

Force detection change for Angular applications using ApplicationRef.tick method.

Using it in a lazy load image component which doesn't show image on weird Android devices until a touch on the screen. It's similar to $scope.$apply() in AngularJS.

Docs:

Cordova

Link to official stores

To open official store through a link just use:

market://details?id=<package-name> // Android
itms-apps://itunes.apple.com/app/id<ios-app-id> // iOS

Docs:

Make all Javascript hooks executable recursively

Inside project hooks folder:

$ find . -name '*.js' -exec chmod u+x {} \;

Docs:

git

Delete remote branch

$ git push origin --delete <branch_name>
$ git branch -d <branch_name>

Docs:

Remove invalid remote branch tracking

$ git branch -rd origin/badbranch

Docs:

Squash using reset

Use git reset --soft HEAD~5 to delete last 5 commits but saving file modifications, then stage modified files and commit only once.

--soft Does not touch the index file or the working tree at all (but resets the head to , just like all modes do). This leaves all your changed files "Changes to be committed", as git status would put it.

Docs:

RxJS

delay

Use delay operator instead of wrapping subscriptions into setTimeout closure.

Delay — shift the emissions from an Observable forward in time by a particular amount

Docs:

Handling exceptions on hot observables (RxJS + Angular + Zone.js)

This is about RxJS + Angular + Zone.js. Each subscription to hot observables MUST handle exceptions or future subscribers will not be able to handle exception through the chain.

Docs:

ReplaySubject

Use ReplaySubject to store values and notify future subscribers with same values from buffer.

Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.

Docs:

Services & tools

Mailgun

Don't stuck with SMTP configurations on VPS any more! Use mailgun APIs to send emails even through your verified domain.

Docs:

OneSignal

Send push (& web) notifications for free with OneSignal. Available for multiple platforms and (about) every SDK out there, 15 minutes configuration.

Docs: