Commit graph

166 commits

Author SHA1 Message Date
Oliver Davies 52836ee597 fix: duplicate background color in code blocks 2022-10-16 13:07:59 +01:00
Oliver Davies 7d91a71917 fix: add the correct import 2022-10-16 12:52:45 +01:00
Oliver Davies f9df869c24 refactor: remove unused import 2022-10-16 12:52:23 +01:00
Oliver Davies 1ed365b129 refactor: extract getSlugFromFile() 2022-10-16 11:13:09 +01:00
Oliver Davies ee4f48abcd refactor(talks): use flatMap and size methods 2022-10-16 01:01:01 +01:00
Oliver Davies 217e98b7e3
docs(daily-email): add 2022-10-11 2022-10-15 17:24:18 +01:00
Oliver Davies 490aafca9b feat: re-add About Me block 2022-10-15 16:50:48 +01:00
Oliver Davies 535b4fef45 docs(talks): add mob programming talk 2022-10-15 16:14:54 +01:00
Oliver Davies 9e2b8196bd feat(talks): make talk count dynamic 2022-10-15 16:14:41 +01:00
Oliver Davies d2244d084c docs(talks): mark talks as online 2022-10-15 16:14:41 +01:00
Oliver Davies ad3c9171f7 refactor(talks): extract talk components 2022-10-15 16:14:37 +01:00
Oliver Davies d34d3415c1 feat: re-add events to talk pages 2022-10-15 00:33:17 +01:00
Oliver Davies 6e94d52f90 fix: re-add description 2022-10-15 00:03:28 +01:00
Oliver Davies 43ef7c2c70
docs(daily-emails): add 2022-10-10 2022-10-14 23:54:41 +01:00
Oliver Davies 6d7adf8c35 feat: re-add 404 page 2022-10-13 09:14:22 +01:00
Oliver Davies 5c4e54152a refactor: extract a Markdown component 2022-10-13 08:55:38 +01:00
Oliver Davies 18a1dd0e03 fix: remove unwanted URLs for daily emails 2022-10-13 08:49:55 +01:00
Oliver Davies 69112f3976 fix: add article content to description 2022-10-13 00:15:24 +01:00
Oliver Davies 5efaf23eca chore(daily-email): re-add form 2022-10-10 23:02:27 +01:00
Oliver Davies 5f7acceb93 docs(daily-email): add email 2022-10-10 22:58:04 +01:00
Oliver Davies 1cedd10c90 chore: re-add Plausible Analytics 2022-10-10 21:07:51 +01:00
Oliver Davies d1b76dda33 chore: replace Sculpin with Astro 2022-10-10 20:50:54 +01:00
Oliver Davies d0ef96dead
fix(daily-emails): typo 2022-10-08 22:44:27 +01:00
Oliver Davies fd8975c2b3
docs(daily-email): add 2022-10-08 2022-10-08 22:43:32 +01:00
Oliver Davies 3407a052b0
docs(daily-email): add 2022-10-03 2022-10-05 07:33:26 +01:00
Oliver Davies 1c317feeac
docs(daily-email): add 2022-10-02 2022-10-04 00:57:10 +01:00
Oliver Davies c935c174b0
docs(daily-email): add 2022-10-01.md 2022-10-03 00:55:57 +01:00
Oliver Davies f99561e66a docs(daily-email): add post
diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg
deleted file mode 100644
index cc79c59..0000000
--- a/ansible/ansible.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[defaults]
-inventory = ./hosts.ini
diff --git a/ansible/deploy.yml b/ansible/deploy.yml
deleted file mode 100644
index ea5647a..0000000
--- a/ansible/deploy.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- hosts: web
-  gather_facts: false
-
-  tasks:
-    - name: Update the code
-      git:
-        repo: https://github.com/opdavies/oliverdavies.uk
-        dest: ~/oliverdavies.uk
-
-    - name: Pull the latest images and re-generate the site.
-      shell: ./run run-production
-      args:
-        chdir: ~/oliverdavies.uk
diff --git a/ansible/hosts.ini b/ansible/hosts.ini
deleted file mode 100644
index 01a3341..0000000
--- a/ansible/hosts.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[web]
-18.132.197.147
-
-[web:vars]
-ansible_user=ubuntu
diff --git a/website/source/_daily_emails/2022-09-30.md b/website/source/_daily_emails/2022-09-30.md
new file mode 100644
index 0000000..f5a63eb
--- /dev/null
+++ b/website/source/_daily_emails/2022-09-30.md
@@ -0,0 +1,83 @@
+---
+title: "Store Wars: different state management in Vue.js"
+date: "2022-09-30"
+permalink: "/archive/2022/09/30/store-wars-vuejs"
+tags: ["vue"]
+---
+
+I'm currently working on a Vue.js application that I started building in Vue 2 before starting to use the Composition API, and then moved it to Vue 3.
+
+In the original version, I was using Vuex for state management within the application, and interacting with Vuex directly within my Vue components - calling `getters` and `dispatch` to retrieve and update data.
+
+As part of moving to Vue 3, I wanted to evaluate any new options, like Pinia which is now the default state management library for Vue.
+
+But because I was integrating with Vuex directly, switching to an alternative would mean changing code within my components.
+
+## Defining a Store interface
+
+This is a situation that often occurs in back-end development - where you may need to switch to a different type of database or a different payment provider in an eCommerce application.
+
+In that situation, you need a generic interface that can be used by different implementations. Because they have consistent methods, one implementation can be replaced with another or multiple can be added at the same time. This is called the Strategy design pattern, and related to the open-closed principle in SOLID.
+
+This is what I did by adding a `Store` interface:
+
+```javascript
+export default interface Store {
+  actions: {
+    addRow(): void;
+    init(): void;
+    removeRow(index: Number): void;
+  };
+
+  state: {
+    isLoading: boolean;
+    selection: {
+      items: [];
+    };
+  };
+}
+```
+
+Any store that I want to work with needs to have these defined actions and state values, so I can use them within my components knowing that they will always be available.
+
+## Creating a native Vue store
+
+This is one implementation of the `Store` interface, using just Vue's `reactive` function from the Composition API:
+
+```javascript
+let state = reactive({
+  isLoading: false,
+  selection: {
+    items: [],
+  },
+});
+
+let actions = {
+  addRow(): void {
+    state.selection.items.push({
+      // ...
+    });
+  },
+
+  init(): void {
+    state.isLoading = true;
+
+    // ...
+  },
+
+  removeRow(index: number): void {
+    state.selection.items.splice(index, 1);
+  },
+};
+
+const vueStore: Store = {
+  actions,
+  state: readonly(state),
+};
+
+export default vueStore;
+```
+
+If I needed to add a Pinia version or another library, I can create another implementation that complies with same interface.
+
+Each implementation being responsible for any specifics for that library - extracting that logic from the component code making it more flexible and reusable.
2022-10-01 22:54:10 +01:00
Oliver Davies 7baf281e8a ci: start replacing run with just 2022-09-29 23:19:08 +01:00
Oliver Davies 6d551e354d docs(daily-email): add a link to GitHub
diff --git a/website/source/_daily_emails/2022-09-28.md b/website/source/_daily_emails/2022-09-28.md
index e9f6378..44a5770 100644
--- a/website/source/_daily_emails/2022-09-28.md
+++ b/website/source/_daily_emails/2022-09-28.md
@@ -13,6 +13,8 @@ We worked on the FizzBuzz kata in PHP, using Pest for our automated tests.

 We followed the Driver and Navigator model, with one person responsible for the typing and interpreting the instructions from the Navigators, and switched roles every ten minutes.

+You can [see the code that we wrote](1da5dd5a79/php/tests/FizzBuzzTest.php) on my code katas GitHub repository.
+
 It was a fun experience and nice to code with some people who I hadn't coded with before.

 We did some code kata sessions during our online meetups which also seemed to go well, so coding nights on katas or personal or open-source projects might be something that we do more of in the future.
2022-09-29 22:26:06 +01:00
Oliver Davies ae023bc09e docs(daily-email): add post
diff --git a/website/source/_daily_emails/2022-09-28.md b/website/source/_daily_emails/2022-09-28.md
new file mode 100644
index 0000000..e9f6378
--- /dev/null
+++ b/website/source/_daily_emails/2022-09-28.md
@@ -0,0 +1,18 @@
+---
+title: "Mob programming at PHP South Wales"
+date: "2022-09-28"
+permalink: "/archive/2022/09/28/mob-programming-php-south-wales"
+tags: []
+---
+
+Tonight was our September meetup for the PHP South Wales user group, where I ran a hands-on session on mob programming.
+
+I created [a small slide deck](https://speakerdeck.com/opdavies/an-introduction-to-mob-programming) before we started a mob session with the group.
+
+We worked on the FizzBuzz kata in PHP, using Pest for our automated tests.
+
+We followed the Driver and Navigator model, with one person responsible for the typing and interpreting the instructions from the Navigators, and switched roles every ten minutes.
+
+It was a fun experience and nice to code with some people who I hadn't coded with before.
+
+We did some code kata sessions during our online meetups which also seemed to go well, so coding nights on katas or personal or open-source projects might be something that we do more of in the future.
2022-09-29 22:22:37 +01:00
Oliver Davies a0681d966b docs(daily-email): add post 2022-09-28 22:56:36 +01:00
Oliver Davies 0f471622cf docs(daily-email): add post 2022-09-27 08:25:03 +01:00
Oliver Davies 35d778bd79 docs(daily-email): add post 2022-09-26 10:28:05 +01:00
Oliver Davies ac54cda1a6 fix(daily-email): add content 2022-09-25 00:21:13 +01:00
Oliver Davies 14055e8eb0 docs(daily-email): add post
diff --git a/website/source/_daily_emails/2022-09-23.md b/website/source/_daily_emails/2022-09-23.md
new file mode 100644
index 0000000..3c5edb5
--- /dev/null
+++ b/website/source/_daily_emails/2022-09-23.md
@@ -0,0 +1,7 @@
+---
+title: "ADRs and Technical Design Documents"
+date: "2022-09-23"
+permalink: "/archive/2022/09/23/adrs-technical-design-documents"
+tags: []
+---
+
2022-09-25 00:15:44 +01:00
Oliver Davies bed1b899cf chore: update page URL 2022-09-23 12:15:36 +01:00
Oliver Davies 2d213ba656 docs(daily-email): add post 2022-09-23 08:14:26 +01:00
Oliver Davies 3560fd0e9c docs: mark posts as draft 2022-09-22 00:30:17 +01:00
Oliver Davies abfdc6b079 docs(daily-email): add post 2022-09-22 00:11:38 +01:00
Oliver Davies 8ff7cebcfa docs(daily-email): add post 2022-09-20 23:23:16 +01:00
Oliver Davies d3e4d1296c docs(daily-email): add post 2022-09-20 08:10:48 +01:00
Oliver Davies 817051314e docs(daily-email): add post 2022-09-18 23:07:37 +01:00
Oliver Davies 4c3ea3be8a docs(daily-email): add post 2022-09-17 01:41:01 +01:00
Oliver Davies d6b5978548 docs(daily-email): add post 2022-09-15 00:04:50 +01:00
Oliver Davies a1f5ff4325 docs(daily-email): add yesterday's post 2022-09-13 19:30:19 +01:00
Oliver Davies 98049127dc docs(daily-email): add yesterday's post 2022-09-12 16:14:41 +01:00
Oliver Davies 8f22ae704c docs(daily-email): changes 2022-09-10 23:41:11 +01:00
Oliver Davies acb52d7370 docs(daily-email): add post 2022-09-10 23:30:23 +01:00
Oliver Davies 49543000cb docs(daily-email): update title 2022-09-09 21:39:30 +01:00
Oliver Davies fa147c8432 docs(daily-email): add post 2022-09-09 21:35:18 +01:00
Oliver Davies 6cd0a2d25a docs(daily-email): add yesterday's email 2022-09-09 10:34:20 +01:00
Oliver Davies 4164fc41e0 docs(daily-email): Tailwind CSS origin story 2022-09-07 22:25:54 +01:00
Oliver Davies 7913aa2570 docs(daily-email): deploying with Ansible 2022-09-07 00:47:45 +01:00
Oliver Davies 7920339ce2 feat: add footer to other Ansible emails 2022-09-05 22:08:38 +01:00
Oliver Davies 3c9a8860d6 docs(daily-email): add today's email 2022-09-05 22:07:43 +01:00
Oliver Davies c651a3a71a docs(daily-email): add yesterday's email 2022-09-05 20:56:39 +01:00
Oliver Davies 44ea181581 Add Ansible course landing page 2022-09-05 20:50:30 +01:00
Oliver Davies 85f63d5d1c docs(daily-email): ansible part 2 2022-09-04 01:08:28 +01:00
Oliver Davies a1c7a0228c docs(daily-email): automating with Ansible 2022-09-02 23:37:51 +01:00
Oliver Davies c9eb1944c5 docs(daily-email): commits and CHANGELOGs 2022-09-02 00:21:17 +01:00
Oliver Davies c835a039ce docs(daily-email): monorepos 2022-09-01 10:30:10 +01:00
Oliver Davies ee10db7176 chore: replace RSS feed link with Daily List 2022-08-31 18:03:01 +01:00
Oliver Davies df78e0c0d7 docs(daily-email): add post 2022-08-31 00:04:31 +01:00
Oliver Davies eae5448451 docs(daily-email): Why I like Drupal 2022-08-29 23:57:29 +01:00
Oliver Davies 3b7dba8539 docs(daily-email): how I got started coding 2022-08-29 00:26:20 +01:00
Oliver Davies cd55e6b4f6 docs(daily-email): giving back 2022-08-27 21:10:05 +01:00
Oliver Davies 1e21b97b97 docs(daily-email): always be learning 2022-08-26 21:58:13 +01:00
Oliver Davies d096e985b9 docs(daily-email): why I work in Neovim 2022-08-26 00:46:42 +01:00
Oliver Davies 3962c85566 docs(daily-email): update link 2022-08-25 01:10:55 +01:00
Oliver Davies 3670c333e0 docs(daily-email): Git configuration 2022-08-25 01:01:36 +01:00
Oliver Davies 1046783156 docs: add link to daily emails page 2022-08-24 23:40:58 +01:00
Oliver Davies ed9eb09715 docs(daily-email): Git GUIs or command line? 2022-08-24 01:32:32 +01:00
Oliver Davies 1322f93fa2 docs(daily-post): T-shaped developers 2022-08-22 22:05:51 +01:00
Oliver Davies 7aec6c7e5c chore: update daily email forms 2022-08-22 00:44:52 +01:00
Oliver Davies 48795f6f4d docs(daily-email): Docker and Docker Compose 2022-08-22 00:23:22 +01:00
Oliver Davies afd532c495 feat(daily-email): add Drip subscribe forms 2022-08-21 21:57:05 +01:00
Oliver Davies aeb6200828 docs(daily-email): return to offline events 2022-08-21 00:09:34 +01:00
Oliver Davies 2e1beef91e feat(daily-email): add links 2022-08-20 01:37:24 +01:00
Oliver Davies 3f11618c69 docs(daily-email): add post 2022-08-20 01:20:02 +01:00
Oliver Davies 4478fbc89a docs(daily-email): Talking Drupal/Tailwind post 2022-08-18 23:09:01 +01:00
Oliver Davies fc325ec947 docs(daily-email): add Git worktree command post 2022-08-17 19:10:07 +01:00
Oliver Davies e86407cfee docs: add Git hooks post 2022-08-16 23:58:53 +01:00
Oliver Davies 729b88904a docs: add run file post 2022-08-16 01:29:07 +01:00
Oliver Davies b3757714a5 docs: move dates into filenames 2022-08-15 16:16:27 +01:00
Oliver Davies 2dae670ed1 feat: add archive RSS feed 2022-08-14 22:40:45 +01:00
Oliver Davies cb8500b700 docs: typo 2022-08-14 22:40:34 +01:00
Oliver Davies 5e5ce448b8 docs: add daily email article 2022-08-14 22:26:01 +01:00
Oliver Davies be7205a013 chore: hide the subscribe form
Re-add a Convertkit form at a later date.
2022-08-14 00:35:14 +01:00
Oliver Davies cb97b693c0 docs: made it link to the GitHub repo 2022-08-13 21:58:13 +01:00
Oliver Davies 808124cfcb fix(assets): indentation in code blocks 2022-08-13 21:57:04 +01:00
Oliver Davies c8a9acd4b4 fix(assets): update source path 2022-08-13 21:56:44 +01:00
Oliver Davies 3ceb4a414e fix: re-order daily email archives 2022-08-13 21:42:22 +01:00
Oliver Davies 3a432ddd57 docs: add daily email article 2022-08-13 21:36:12 +01:00
Oliver Davies 1b0ca7186a fix(assets): copy assets in production 2022-08-13 13:13:53 +01:00
Oliver Davies 7a05eb1bdf fix(assets): update build paths 2022-08-13 12:42:46 +01:00
Oliver Davies 072ec2db46 fix(assets): update build paths 2022-08-13 12:32:33 +01:00
Oliver Davies b7456fdf42 fix(daily-email): update post URL 2022-08-13 00:25:36 +01:00
Oliver Davies a79d50dd76 fix(daily-email): update archive page link 2022-08-13 00:21:39 +01:00
Oliver Davies 3d410f3b6c fix(daily-email): remove trailing slash from URLs 2022-08-13 00:15:05 +01:00