F%#ck Github Pages for my Jekyll blog. Why I decided to use Digital Ocean instead?
You've finally decided to create a blog. You want to share your view of the world with everyone who cares to read about it. If you're a developer like me, you probably like Markdown and you'll end up creating your blog with Jekyll since it's very customizable and easy to use.
Besides that, Github (the most beloved Webapp for all developers) has a nice feature that lets you easily deploy your Jekyll blog for everyone to read it.
However, not everything that Github does is pure gold. In this article, I'll tell you about my own experience when creating this blog and why I decided to move away from Github and Github pages to deploy my blog in Digital Ocean.
Gulp is awesome, but do we really need it?
When I build a Single Page Application (SPA), I need to somehow concatenate, minify and compress all my JS, CSS and Image files for production while keeping them as they oringinally are for development. Also, I'd like my app to continually redeploy on each change I do while I'm coding.
Before Grunt existed, I thought that doing this in an easy and manteinable way was impossible. That's why I thought Grunt was the holly grail for build tools. But then, Gulp appeared. Now I could have all the pipeline of transformations that happens to certain type of files in only one place. It was so much easier to understand than Grunt. And then again, now I thought Gulp was the holly grail.
But what if none of this complex build tools are needed and we can just do the same with less code making it more manteinable and easier to use? This is what we're going to be talking about in this post!
New Play Framework 2 Video Course: How to create WebApps
TL;DR: I’ve created a new Play Framework Video Course. Please click here to check it out.
I know there’re a lot of people trying to learn Play Framework 2, as they want a nicer and easier Java or Scala framework than using Spring MVC, JSP, Servlets and so on.
This is why I’ve created jointly with PacktPub editorial a Play Framework 2 video course. In this course, you’ll learn how to create a WebApplication and you’ll learn it with a lot of examples and comparison. You’ll also learn how to create and consume REST APIs, how to secure your app, how to use Twitter Bootstrap and much much more.
After finishing the course you’ll be able to create your own app. If you have any questions or concerns, please contact me.
I hope you enjoy it. To check it out, please click here.
Angularytics: The solution to tracking page views and events in a SPA with AngularJS
TL;DR: Check out the Angularytics GitHub repo and quick bootstrap here
We need Analytics to improve our app. However, most analytics (Like Google Analytics) aren’t yet fully prepared for Single Page Apps (SPA). Google Analytics tracks page views once your browser refreshes the page, which in old pages meant changing the URL. Now, with AngularJS, we never refresh the page. We have a complete WebApp which changes URLs, changes resources, but never does a refresh. So, the question is how can we track page views and events now?
That’s why I’ve created Angularytics. Angularytics makes it easy to track page views and events. For now, it works with a console logger and with Google Analytics.
In order to configure this to automatically track page views, all you need to do is the following:
Withi this, every time the URL changes in your SPA, Google is going to track this page view. Just 5 lines of code and you have this working in your SPA.
*Now, if you want to track events, you can do this by either using the trackEvent filter or the Angularytics service. *The track event method signature is the same as the one in Google Analytics and can be checked by clicking here
Let’s see how we can use the filter. Imagine we want to track an event when a user clicks on certain button that actually calls a function in the scope.
Pretty easy, right?
Now, let’s see how we can do this in a service:
This is it :). What do you think about this? I’d love your feedback :).
If you want to learn how to add an extra event handler like KissMetrics or for further information, please check on GitHub by clicking here.
Check and inspect Angular’s scope for any DOM element in Developer Console from Chrome
Today I come with a quick tip that you might not know.
angular has a method where you can actually send either an element or a selector and angular will select that element. That element has some cool functions that aren’t available if we select that element any other way.
One of this methods is scope(). It actually returns the scope binded to the selected element, which is really cool :). It also supports using $0 as the selector, so if we inspect some element in the developer console and then we do angular.element($0).scope() it will return the scope of the selected element.
I know that using the AngularJS developer console extension you can do this as well, but I actually hate that console. I’d rather do this and jsut work with the “regular” Developer console.
Check the following
I hope this works out for you guys