I know, I just can’t keep quiet about Aurelia. But it is one of the most exciting things to happen to Javascript in a long time. So I decided to write up a quick tutorial on creating a custom element in Aurelia for Select 2, which is a popular library for adding custom select elements to your applications.
Prep Before we begin, you need to have Aurelia installed locally and the development server running. The easiest way to do this is to download the Aurelia Skeleton Navigation project and follow the README instructions. This tutorial assumes you already have an Aurelia project and that you’re not starting from scratch.
Recently whilst working on my day-job project I needed to get a HTMLElement from the DOM and then store it as a string. Using innerHTML obviously didn’t make sense because it would only get the inner contents, not the outer. I wanted the whole element.
The logical choice was the lesser known property outerHTML. I say lesser-known because you don’t really see it used all too much, in face of innerHTML anyway. It isn’t the fact developers don’t know about it, it just doesn’t get used a whole lot.
If you’re a user of Aurelia and you’re writing unit tests, you might have run into some confusion around testing your custom elements, more specifically how you can mock an injected instance of something into a class.
In my case I had a Custom Element which allows me to display a select2 custom select within my application. I was also injecting the Element itself and EventAggregator onto the class using the @inject class decorator.
When it comes to working with your servers (or any remote machine for that matter), public key encryption is a must. The basics are: you register a public key on the server-side and then use your private key to authenticate with the remote machine.
So you’ve generated a new SSH keypair or you have your existing SSH keys in the form of id_rsa or whatever. Now you want to push them to your remote server so you can use your private key to login?
How many of your friends and family come over and want to use your wifi? For me, It would take me a while to count all of the people who I have given access to my wifi connection. Usually I just give them the password when they come over or type it in for them without thinking twice.
Of all of the people who have used my wifi connection, they all have the details saved so they can connect later without asking for the password again. This is why I like the Wifi Sense feature in Windows 10 because it mitigates the need to share my wifi password with anyone.
Lets be honest. There are developers who love all of the additional styling for forms, typography and widgets that come with Bootstrap and there are those who absolutely despise everything Bootstrap has and stands for, with exception (for most) the great grid system.
Recently I wanted to use the Bootstrap grid system but without having to use Bootstrap itself. While Bootstrap does offer the ability to customise your download, if you are like me and you use JSPM or Bower for managing stuff like this or you use Git sub-modules, then including just a stylesheet file into your project isn’t the most ideal approach.
Geronimo Jerky is a small Brisbane based company that produce beef jerky. At the helm is The Big Chief aka Mark Hoyle, who moved to Australia from the USA 20 years ago, bringing with him an authentic native American family recipe for jerky.
Their slogan is, “The best beef jerky you’ve ever tasted” it is a pretty big claim to make, so does Geronimo’s jerky live up to the claim?
If you are currently working with the Aurelia Javascript framework, then you would know that every so often given the not-so-beta nature of the framework, a new update comes out for one or more of the framework components.
This article is specifically for Jspm users, updating dependencies in Webpack and RequireJS applications uses Npm instead of Jspm.
If you’re not staying up-to-date for each update, it is possible to fall behind. While you might assume that jspm update would work. Sometimes if you’re updating an older code-base, the newer code can and possibly will break your application using update.
Leading off from my previous post about swapping variable values, I thought I would write a follow-up post on how to reverse a string in Javascript. Surprisingly in Javascript there is no native means of reversing a string (I guess there are very few situations where you would need to do that).
This is not going to be an exercise in code golfing. In-fact, I am only going to show you 3 different ways to reverse a string (although there are potentially tens of different ways to do it). My preference is the first solution using Array.reverse, but pick whatever suits your needs.
While most developers will probably never encounter a situation where they’ll need to swap two integer values without a third variable unless you’re heavily into code golf.
While novel and impractical for most purposes, it can be nice to improve your problem solving skills and learn new things by solving problems without choosing the most obvious solution.
A little bit of trivia: I was actually asked to swap two integer values in a technical interview once-upon-a-time. So you never know if you find yourself going for a front-end development position and you’re asked during the coding test to swap two integer values without a third variable.