Skip to content

Commit

Permalink
updated old blog posts and tweaked theme
Browse files Browse the repository at this point in the history
  • Loading branch information
urbanophile committed Apr 5, 2024
1 parent cbfb9ea commit 8133cd6
Show file tree
Hide file tree
Showing 17 changed files with 357 additions and 61 deletions.
47 changes: 45 additions & 2 deletions content/Blog/js_in_pelican.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
Embedding js in pelican
#######################
#########################

:date: 2024-01-22
:tags: pelican, javascript, chart.js
:authors: Matt Gibson
:modified: 2024-04-04

This is a stub. An example of how to embed a javascript file in a pelican article.

Sometimes I like to write a little js in my blog posts. Here is an example of how to embed a javascript file in a pelican article.

.. raw:: html

<div id="demo"></div>
<script src="{static}/js/demo.js"></script>

Below the fold, is an example of embedding a js chart into a pelican article. Specifically, we have the crude marriage rates in Australia for 2000 to 2022. Not many surprises here, the crude marriage rate has been in decline for the past 20 years, barring some minor fluctions most dramatically due to Covid.

.. raw:: html

<div>
<canvas id="myChart"></canvas>
</div>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

<script>
const ctx = document.getElementById('myChart');
new Chart(ctx, {
type: 'line',
data: {
labels: ['2020', '2019', '2018','2017', '2016', '2015', '2014', '2013', '2012', '2011', '2010', '2009', '2008', '2007', '2006', '2005', '2004', '2003', '2002', '2001', '2000'].toReversed(),
datasets: [{
label: 'marriages per 1,000 residents in Australia',
data: [3.1, 4.5, 4.8, 4.6, 4.9, 4.8, 5.2, 5.1, 5.4, 5.4, 5.4, 5.5, 5.5, 5.5, 5.5, 5.4, 5.5, 5.4, 5.4, 5.3, 5.9].toReversed(),
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
},
animation: {
duration: 0
}
}
});
</script>

source data: `Parliamentary library <https://www.aph.gov.au/About_Parliament/Parliamentary_Departments/Parliamentary_Library/FlagPost/2021/December/Marriage_and_divorce>`_

Note `this website <https://www.statista.com/statistics/610957/australia-crude-marriage-rate/>`_ here is wrong because the `ABS changed there methods <https://www.abs.gov.au/statistics/people/people-and-communities/marriages-and-divorces-australia/latest-release#marriages>`_. Pretty cheeky to charge you $199 USD per year for bad collation of public data.
20 changes: 18 additions & 2 deletions content/Blog/jupyter_ecosystem.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
The Wild West of the Jupyter
The Wild West of Jupyter
#############################

:date: 2024-02-13
:authors: Matt Gibson

this is a stub. There's some wacky stuff in the Jupyter ecosystem.
There's some wacky stuff in the Jupyter ecosystem, but I think on thing that really stood out for me is the extension of jupyter notebooks into web development and the interaction with javascript. So web assembly is a thing and you can run C code little isolated javascripts instances, maybe even from your CDN, so of course you want to compile `Python in WASM <https://pyodide.org/en/stable/>`_, and now you're wondering, didn't Jupyter do some fancy refactoring and that I think about I can put a webserver in there too...


Behold `JupyterLite <https://jupyterlite.readthedocs.io/en/latest/quickstart/embed-repl.html>`_:

.. raw:: html

<iframe
src="https://jupyterlite.github.io/demo/repl/index.html?kernel=python&code=print('hello world')"
width="100%"
height="100%"
></iframe>

Wow! Just what you always wanted free notebook hosting! you can install packages, you can code,

powered by this:
https://jupyterlite.readthedocs.io/en/latest/_images/jupyterlite-diagram.svg
22 changes: 22 additions & 0 deletions content/data/CrudeMarriageRateAU.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Year, CrudeMarriageRate
2020, 3.1
2019, 4.5
2018, 4.8
2017, 4.6
2016, 4.9
2015, 4.8
2014, 5.2
2013, 5.1
2012, 5.4
2011, 5.4
2010, 5.4
2009, 5.5
2008, 5.5
2007, 5.5
2006, 5.5
2005, 5.4
2004, 5.5
2003, 5.4
2002, 5.4
2001, 5.3
2000, 5.9
12 changes: 12 additions & 0 deletions content/data/median_age_at_first_marriage_au.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Year Men Women
2021 30.8 29.4
2020 30.6 29.2
2019 30.7 29.3
2018 30.7 29.2
2017 30.4 28.8
2016 30.3 28.7
2015 30.1 28.5
2014 30.0 28.4
2013 29.9 28.3
2007 29.6 27.6
1997 27.8 25.9
26 changes: 16 additions & 10 deletions content/js/demo.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
// get id div #demo and change text
let some_soft_colours = ["#D9EDBF", "#FFB996", "#FFCF81", "#FEFBC9B", "#FBF3D5", "#D6DAC8", "#79AC78"];
let some_text = ["Hello", "World", "How", "Are", "You", "Today", "?"];

function myCallback() {
const elt = document.getElementById("demo");
if (elt.innerHTML === "Hello JavaScript") {
elt.innerHTML = "Hello World";
elt.style.backgroundColor = "#64a6ea";
elt.style.maxWidth = "7em";
} else {
elt.innerHTML = "Hello JavaScript";
elt.style.backgroundColor = "#7eed94";
elt.style.maxWidth = "10em";
}
// cycle through the colours and text sequentially
let colour = some_soft_colours.shift();
let text = some_text.shift();
some_soft_colours.push(colour);
some_text.push(text);
// get the div element
let div = document.getElementById("demo");
// change the text and colour
div.innerHTML = text;
div.style.color = colour;
div.style.backgroundColor = "navy";
// set max width
div.style.maxWidth = "80px";


}

Expand Down
14 changes: 14 additions & 0 deletions content/pages/About.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
Title: About Me
Author: Matt Gibson
Summary: About me page
save_as: index.html
---

I am a software and machine learning developer in [Sydney](http://en.wikipedia.org/wiki/Sydney), NSW, Australia. I like [computing](https://en.wikipedia.org/wiki/MOS_Technology_6502), [data](https://search.r-project.org/CRAN/refmans/vcd/html/HorseKicks.html), [machine learning](https://pytorch.org/) and [cooking](https://web.archive.org/web/20160210065535/http://www.seriouseats.com/the-food-lab/?ref=nav_main). I'm delighted by the scientific enterprise which allows us ["to see a World in a Grain of Sand"](https://www.poetryfoundation.org/poems/43650/auguries-of-innocence).

I'm also quite keen on gibbons 🐒.

I acknowledge and pay my respects to the Traditional Custodians of the land on which I work and live, and their elders past, present, and emerging. Sovereignty was never ceded.

This second version of my homepage hosted by Github Pages and created using [Pelican](https://github.com/getpelican/pelican).
29 changes: 29 additions & 0 deletions content/pages/CV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
Title: CV
Author: Matt Gibson
Summary: My CV
---

Looking for work. My email can be found on my github commits.

### Experience


- Contract Developer
- Machine Learning Researcher
- Research Engineer
- Data Scientist
- Data Analyst

### Education


- Ph.D. UNSW, CS (Computer Vision and Machine learning)
- M.Sc. University of Sydney, Maths (Algebraic Combinatorics)
- B.Sc. University of Auckland, Maths (H1) + Computation and Logic

### Skills

- Tools: Linux, Tensorflow, Pytorch
- Techniques: Deep Learning, Computer Vision, Time Series
- Languages: Python, Javascript, R, SQL, C, HTML, CSS
23 changes: 0 additions & 23 deletions content/pages/CV.rst

This file was deleted.

17 changes: 0 additions & 17 deletions content/pages/about.rst

This file was deleted.

5 changes: 4 additions & 1 deletion pelicanconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@
]
# ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲

LOAD_CONTENT_CACHE = False


DISPLAY_PAGES_ON_MENU = False
DISPLAY_CATEGORIES_ON_MENU = False

# where the source content is located
PATH = "content"

# pages are standalone html
PAGE_PATHS = ['pages']
PAGE_PATHS = ["pages"]

# articles are arranged chronologically
ARTICLES_PATH = ["Blog"]
Expand Down
56 changes: 54 additions & 2 deletions themes/my-basic/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
--my-bg-color: #fff;
--my-link-color: navy;
--my-header-link-color: black;
--small-font-size: 75%;

--border: #ccc;
--standard-border-radius: 5px;
}

body {
Expand All @@ -29,6 +33,29 @@ body {
display: block; */
}

/* Typographical settings */
h1, h2, h3 {
line-height: 1.1rem;
}

h1 {
font-size: 2.35em;
}

h2 {
font-size: 2em;
}

h3 {
font-size: 1.75em;
}


small, sub, sup {
font-size: var(--small-font-size);
}

/* styling for nav */
nav ul {
display: flex;
margin: 0;
Expand All @@ -37,15 +64,24 @@ nav ul {
}

nav ul a {
padding: 0.5em 1em;
padding: 0.5em 1em 0.5em 0;
display: block;

}

/* nav li {
border: 1px solid var(--border);
border-radius: var(--standard-border-radius);
margin: 0 0.5em;
} */

hgroup h1 a:hover, hgroup h1 a:visited, hgroup h1 a:link {
text-decoration: none;
}

header a:link {
color: var(--my-header-link-color);
text-decoration: none;
text-decoration: underline;
}

header a:hover,
Expand All @@ -70,7 +106,23 @@ main a:visited {
}


/* styling for code */


/* for articles */
article {
padding: 0 0 0.75em 0;
border-bottom: 1px solid #ccc;
margin-bottom: 0.75em;
}

article p {
margin: 0 0 0.8em 0;
}

article footer {
font-size: var(--small-font-size);
margin-top: 1em;
/* border-top: 1px solid #8a55a8; */
padding-top: 0.5em;
}
File renamed without changes.
Loading

0 comments on commit 8133cd6

Please sign in to comment.