Chart.JS with Rails 6 and Webpacker Mar 2020

Chart.js is a great javascript library to quickly create beautiful SVG charts.

With Rails 5 it was quick and easy to install a Chart.js Gem into the asset pipeline to get started.

Rails 6 introduced Webpacker as the default Javascript pre-processor and bundler. This is a much tidier and simpler way to manage JS dependencies. Installing Chart.js into your application is now even easier:

Add Chart.js with your favourite package manager (i.e Yarn) in the console.

yarn add chart.js 

Add a require() in your JS pack.

// app/javascript/packs/application.js require("chart.js")...

Cloudcall [CALL.L] Feb 2020

I was browsing some recent hedge fund letters and came accross an excerpt from Lightsail Capital Management which sounded familiar:

Late in September, we participated in a private financing deal for a small publicly-traded enterprise software company located in a developed market outside of the United States. The company is currently sub-scale, but has a large growth opportunity ahead of it that will required additional capital to pursue, hence hte capital raise.

Despite the company organically growing at 30-40%, generating gross margins above 70%, and demonstrating high customer retention, we were able to make our...

Song catalogues as an alternative investment through Hipgnosis Jan 2020

Hipgnosis has recently been attracting media attention after entry to the main market of the London Stock Exchange under the catchy ticker SONG.

Hipgnosis is an investment vehicle for songs and musical intellectual property. Admission to the main market was completed in November 2019 with a total raise of ~£625m which is quickly being deployed into acquiring catalogues.

The current portfolio of catalogues cover over 6,000 songs of which more than 1,000 have been number one or two on the global charts. The catalogues include The Chainsmokers (14th most streamed artist globally on Spotify), including the song 1-800-273-8255...

eCommerce is not living up to its promise Dec 2019

Ecommerce was promised to eliminate middlemen and enable businesses to sell globally directly to consumers who can now buy with ease at fair and transparent prices.

However, this hasn’t really happened.

Marketplaces such as amazon has been flooded with unsafe and potentially fake products (see Wall Street Journal). And sometimes they are not always the cheapest and best option, particulary with growth in Walmart and other large retailers.

There is even this niche called ‘retail arbitrage’ which literally involves people buying products from retail stores and then loading them into FBA by Amazon and making money on...

Like and dislike buttons - using acts_as_votable Nov 2019

I needed to implement a set of simple like/dislike actions to a Rails project and was inspired by the simple like and dislike buttons on ProductHunt. I struggled to find a well written guide on how to implement acts_as_votable asynchronously with Rails 6, so have put the following quick guide together which I hope gives a fairly complete example.

See below for a gif demonstration. For some reason the cursor isn’t visible - but hopefully self explanatory.

Like and dislike GIF

Gemfile

Using Bootstrap and Font Awesome in the code below.