Platypus Header

Platypus Innovation Blog

28 May 2018

Splitting out a React js project for code reuse - The easy way

We like React, and we run a few projects on it: Good-Loop's portal, SoGive, and some internal tools. So we wanted to reuse code between these projects.
One way would be to make separate npm packages. But this is a painful solution: The compilation setup is painful, and you lose source-code maps (so you end up debugging from babelled code).
Instead, we found a simple solution using symlinks:
  1. Just sym-link the "packages" in, using ln -s (for Linux or Mac; I don't know what the equivalent is for Windows).
  2. Set webpack's resolve.symlinks property to false. In our setup that meant editing webpack.config.js to have resolve: {symlinks: false }}.
Then your code is split out -- but as far as the build process is concerned, or your code editor, nothing has changed.
You can also unit test with tests in each "package".
E.g. your project folders might end up looking something like this:
  • myapp
    • src
      • subpackage: a symlink to subpackage/src
    • webpack.config.js, package.json, etc.
  • subpackage
    • src
    • test: unit tests for src files
    • webpack.config.js for the unit tests
This is easy and it works.

12 April 2018

Invest in Good-Loop

This is an unusual post for me. After 10 years as an entrepreneur, I am asking for money.

Amy and I set out in 2016 with a mission: to make something positive and good in the often sordid world of online advertising. Good-Loop is an ad network, but different from any other:

  • 50% of the money goes to charity. To be clear: that's not 50% of profits, or 50% of our commission. That's 50% of the total revenue. The rest is split, approximately 30-40% to the publisher and 10-20% to us.
  • The user is in control: of whether we show them an ad, and what we do with their data. This is the "ad-choice" alternative to adblockers, which avoids annoying ads whilst still supporting publishers to create.

We believe that if you treat people with respect and aim to do good, then you can create both a positive impact (money raised for charity), and a better space for advertising (happy viewers are more likely to listen than annoyed ones).

The results so far back this up: because we engage users in a positive way, Good-Loop adverts are watched rather than skipped (benchmarked against YouTube and Facebook video ads), and generate more actual customer activity (measured with one of our clients, Lifecake by Canon). Unilever's chief marketing officer, Keith Weed, describes our approach as a "win-win!" (namedropping, because, wow, not only are we working Unilever, who have one of the world's largest ad budgets and an ethical ethos, but their CMO tweeted about it).

We are not a charity: we plan to make profits and deliver a return. Our aim is to be both profitable and good for the community. I think this investment is a good bet: we have a reasonable chance of delivering an unreasonable return.

Warning: Any investment in a start-up is risky - do not invest money unless you're OK losing it. I cannot provide financial advice here.

If you want to be part of what we're doing - now you can! Over April 2018, we are running an open investment round: https://seedrs.com/good-loop

This is open to anyone. The bulk of the round will likely be established investors who we've pitched to. However if you know and like what we're doing, then you can invest, regardless of cheque size -- the investments so far range from £15 to £30,000.

I hope you'll join us.
If you have any questions, feel free to contact me: daniel@sodash.com

10 January 2018

Upgrading from Jetty 8 to 9

I'm upgrading from Jetty 8.1 to Jetty 9.4. Here are the changes I've encountered so far:

Several classes renamed / replaced:

* SelectChannelConnector has become ServerConnector
* ServletContextHandler has become ServletHandler

Server.setThreadPool() has gone.

Lots of jar changes.

The JSON class (org.eclipse.jetty.util.ajax.JSON) has moved out into a separate Maven project: https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util-ajax, which gives you jetty-util-ajax.jar

We also needed the Maven packages: jetty-server, jetty-servlet


You must upgrade to servlet-api 3.1 (so change anything which pulls in the servlet-api-3.0.jar or earlier).

Good-Loop Unit