Nodes disappearing from internal cache in Umbraco

Occasionally some of the sites I have made in Umbraco 4 have pages that are for some reason not in the internal cache. The solution is to run the following command while logged in to Umbraco:

This will republish all pages and put them back into the cache. It can take quite a while if it is a large site.

Read more

Prevent reload with BrowserSync and Laravel

I use BrowserSync with Laravel Elixir and I found that when I use cache busting it reloads the page instead of injecting the CSS into it. This is of course due to the way cache busting works. Still, this is quite annoying. However, there is a really simple solution to the issue. In your master blade template just make a check to see if you are on a local environment like so:

This is half the solution.

Read more

Remove node_modules folder on Windows without errors

I sometimes get errors when I run npm install for my Gulp or Grunt projects. To retry I need to remove the node_modules folder and sometimes that causes problems as when you are on Windows. I had a look around and found a Git repository named rimraf.

To remove a node_modules folder on your system, first install rimraf globally

Then, navigate to the folder just above the folder you want to remove and run

…and the node_modules folder will be removed.

Read more

Create additional databases in Laravel Homestead

It is really easy to ad more databases in Laravel Homested. Simply edit the Homestead.yaml file (in Windows under C:Usersyour-username.homesteadHomestead.yaml)

Under databases add your databases like this:

If you virtual machine is already running navigate to your Homestead folder and run the command  vagrant provision to create the new database(s). If it is not running simply run  vagrant up.

You should now be able to access your new database with the default credentials.

Read more

Solution to MySQL error “Error establishing a database connection” in WordPress on DigitalOcean

I’m hosting my sites with DigitalOcean (referral link) on the smallest VPS with 512 MB Ram. It’s a cheap way of hosting as I can have virtually as many sites I want on the VPS – and in case it is too slow I can easily upgrade it from the control panel. However, I occasionally get an error on my WordPress sites saying  “Error establishing a database connection”. I searched around for a solution and finally found that I needed to add a swap file to the server.

Read more