TinyMCE and Flask - Part 2 - Managing Images

Posted on by Kevin Foong

This is the second part of my earlier Flask / TinyMCE tutorial. See the first part here.

In this blog post I will outline the steps I used to save a thumbnail version of any image I upload to my post. Here I used the very useful Pillow (Python Imaging Library) library.


Tags: tinymce, flask, python

Investigating a soccer dataset in Python

Posted on by Kevin Foong

Using Python to analyse a dataset on Premier League soccer matches around the metrics of "possession" and "matches won", reveals some interesting findings. This is a previous assignment I did for my Udacity Nanodegree in Data Analysis.

In season 2015/2016 Leicester City won the league at starting odds of 5000-1.  Their possession stats (number of matches where they had more possession than the opposition) put them 3rd from bottom, but then we can deduce that perhaps they were also a lethal counter-attacking side.


Tags: python, data

CSS Redesign

Posted on by Kevin Foong

I have just completely re-designed the front-end of this website using HTML, CSS and some smattering of vanilla Javascript (no more JQuery!). As you recall the previous design used Bootstrap CSS. I found that, even though redoing the whole design was time consuming, it wasn't actually all that difficult. Modern day HTML and CSS certainly gives you a lot out of the box and one must question how much you really need frameworks like Bootstrap now.


Tags: CSS, frontend

Snake Game

Posted on by Kevin Foong

This is the biggest sketch (big for a P5.js sketch) I have done in P5.js - 356 lines of code. The classic Snake game. Eat the food (in green) and avoid the poison (in purple).  The green food is worth 2 points. After a while it turns pink and is only worth 1 point. If you eat the poison 3 points is deducted.

It was originally designed for the phone hence the controls is via a 3x3 grid. Clicking the left or right third moves the snake left or right. And likewise clicking the top and bottom thirds moves the snake up and down.

See Snake Game


Tags: processing, p5.js, games


Posted on by Kevin Foong

This is another sketch I did using P5.js

This one experiments with bezier curves. Click anywhere on the grass to grow your own garden!

See Garden

Tags: processing, p5.js