However I ran into an issue today in which I updated Node.JS outside of Visual Studio, but since VS uses its own install that is separate from any outside installation, you can potentially run into a node_modules package dependency issue where one version of npm installs a package (which makes it rely on that version of Node/npm), and then you can’t run commands in the other version (they break).
Running npm install or npm rebuild node-sass –force, as the error message says, did not help.
How to solve it
Open Visual Studio 2017
Go to Tools -> Options…
Go to Projects and Solutions -> Web Package Management
move $(PATH) to the top of that list and close that window.
Web package management - Visual Studio 2017
Now close all running tasks (if any)
refresh the Task runner explorer and you should be good to go.
What is Redis and what is it used for? I’ve come across it in two of the projects I’ve been working on, but never had to do anything else than start it. It seems to be used along side a persistence database.
This is the first post in the What is series where I’m aiming to answer questions I’m thinking about but never take the time to answer. I got this idea from another Swedish developer, who I cant remember the name of right now. Inez or Ines maybe? If you know who i’m looking for, please let me know in the comments :)
How does redis explain itself
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster. -Redis.io
Ok, so I guess it can be used as a database itself, and i do not need to have another one in my application, such as postgres, mysql or any other database.
It seems to be some kind of cache as well. Have to look into that.
Is it a cache, database or both?
After going through the FAQ I learned that using Redis together with an on-disk database is a good idea and a common design pattern that is used. Use Redis for write heavy small data and store big blobs of data into an sql on disk database.
But you can use redis as a stand alone database that keeps data in memory and eventually saves it to disk.
But what do they mean by using it as a cache? Well, since Redis keeps data in memory you can load data into it that is used and displayed often without getting the data from disk everytime, for example loading product data from an sql-database, making it very quick.
In recent days Proposales released a new version. And with that version came an Electron app which I was hired to develop.
Proposales is an award-winning startup by Joakim Green that helps you to create, deliver and monitor business proposals online.
This is how Proposales explain their business:
Replaces the traditional PDF proposal. Proposales is a new standard for interactive and mobile-friendly business proposals that is presented for the recipient via a webpage.
Proposales electron app
Proposales is testing a new alternative to support old browsers. Instead of supporting outdated browsers they offer this desktop app. But it’s also available for all their users so that they can keep it in the dock or start menu to be able to start sending proposals without starting a browser.
This tutorial walks you through how to add an info window when a user clicks or taps on a Google map marker. The tutorial starts where the Ionic 2 Google map markers left off.
Open up src/pages/home/home.ts and add a new method in that class called addInfoWindowToMarker.
An info windows displays HTML of our choice. I add the title of the marker wrapped around some divs in the infoWindowContent variable. Then assign variable to the infoWindows content property.
This method also adds an eventlistener that listens for user taps och clicks, and when this happens a call to the infowindows method open is called.
We’ll call this method from the addMarkersToMap method which we created in the markers tutorial Now it looks like this:
Now when running the app this is how the infoWindow looks:
InfoWindow Google map marker
Closing other info windows when opening a new one
To close an InfoWindow we need to call its close() method. To do that we also need to keep a reference to our windows.
Add a property called infoWindows in home.ts, and initialize it as an array in the constructor.
We’ll use this property to store references to infoWindows. Right before closing the addInfoWindowToMarker we’ll push an infoWindow to the new array. We’ll also call a new method called closeAllInfoWindows() in marker.addListener.
This is what the closeAllInfoWindows method looks like: