Install Ruby through Version Manager (RVM) on Mac

Firstly you need to add the GPG Keys by heading to the terminal and executing: $ gpg –keyserver hkp://ipv4.pool.sks-keyservers.net –recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB Then install the latest stable version of ruby $ \curl -sSL https://get.rvm.io | bash -s stable –ruby If you want to install a specific version of ruby e.g. 2.5.2, you can run $… Read More »

Linking in Vue

Having set up Vue Router, linking within th components is relatively straight forward. In router.js ensure you’ve declared your routes, i.e. const routes = [ { path: “/contact”, component: Contact, name: “contact”, }, { path: “/about”, component: About, name: “about”, }]; You can then use router-link to embed a tags in your page <router-link :to=”{name:… Read More »

Removing hash from URL Laravel-Vue

The hash (#) in the url is there to support older browsers so if you need to support older browsers you best not remove it. To move to a cleaner URL structure we need to use the HTML 5 History mode by adding mode: ‘history’ to your router. const router = new VueRouter({ routes, mode:… Read More »

Vue Router in Laravel

To use the view router we need to tell laravel that everything we need to route that’s not to the api needs to be taken care of through the Vue router. In your routes/web.php add Route::get(‘/{prms?}’, function () { return view(‘welcome’); })->where(‘prms’, ‘^(?!api\/)[\/\w\.-]*’); This tells laravel to consider everything after the forward slash as a… Read More »

Laravel authorisation

php artisan make:auth is now deprecated… however it’s a simple fix. Instead of using $ php artisan make:auth We need to use: $composer require laravel/ui –dev $ php artisan ui vue –auth $ php artisan migrate $ npm install $ npm run dev

Docker CheatSheet

$ docker ps # List all running containers $ docker ps –all # List all containers whether running or not $ docker system prune # remove all containers To run container and see output add -a flag $ docker logs <container id> # Show logs from last time container ran $ docker stop <container id>… Read More »

Change frequency of Time Machine back ups on OSX

Create a new plist called com.apple.backup-auto.plist in ~/Library/LaunchDaemons Add the following: Label com.apple.backupd-auto ProgramArguments /System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper -auto StartInterval 259200 RunAtLoad KeepAlive The 259200 is the time in seconds between backups – i.e. 259200 seconds is 3 days.

Rails App Set Up

My default prototyping for an app is still Rails, it’s so quick and easy – if I just want to build something to test out an idea I think the framework is amazing. Here’s what I tend to do when first setting up, note I do the initial create using RubyMine which is as easy… Read More »

Laravel Gripes

Only a couple of weeks into Laravel and trivial but feels like it doesn’t support – for want of a better phrase, pythonic syntax. I’m more lines of code than I would in Ruby or Python oh and there are lots of types of arrays… you have to declare it’s an array also! $myArray =… Read More »

Helper methods in Laravel

Rails gives you a great helper framework for each controller, allowing you to keep the logic out of the view, wanting to replicate but looks like Laravel takes a different approach. First create a helper file in the root of the app $ touch helper.php Now add the following namespace App\Helpers; class Helper { public… Read More »