Skip to content

Commit 72c4e48

Browse files
committed
got basic site working with extism for using enhance wasm in go
1 parent 3d7d0ce commit 72c4e48

File tree

79 files changed

+4871
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4871
-169
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ COPY --from=build /bin/main /
2727
COPY --from=build /src/web/static /web/static
2828
COPY --from=build /src/web/custom-elements /web/custom-elements
2929
COPY --from=build /src/wasm/enhance-ssr.wasm /wasm/enhance-ssr.wasm
30+
COPY --from=build /src/content /content
3031
ENTRYPOINT ["/main"]

Taskfile.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ tasks:
6767
--build.bin "tmp/bin/main" \
6868
--build.delay "20" \
6969
--build.exclude_dir "node_modules,data,public" \
70-
--build.include_ext "go" \
70+
--build.include_ext "go,mjs" \
71+
--build.include_dir "routes,handlers,web,content" \
7172
--build.stop_on_error "false" \
7273
--misc.clean_on_exit true
7374
@@ -80,7 +81,7 @@ tasks:
8081
--build.delay "100" \
8182
--build.exclude_dir "" \
8283
--build.include_dir "$STATIC_DIR" \
83-
--build.include_ext "js,css"
84+
--build.include_ext "mjs,js,css"
8485
8586
live:
8687
deps:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
_id: "511fdb02-998a-4d86-9abb-128654f00c02"
3+
title: "Coding Bootcamp Begins"
4+
published: "August 13, 2020"
5+
slug: "coding-bootcamp-begins"
6+
description: "I started coding bootcamp with Jack Russell Coding School"
7+
categories: ["Career Changer", "Coding Bootcamp"]
8+
author: "Ben Patton"
9+
authorImage: "https://cdn.sanity.io/images/nfspldzq/production/3ceeda54221c7c0614ecc51f955c7be39a1da34e-512x512.jpg"
10+
type: "Blog"
11+
---
12+
13+
_This is an article that I originally wrote for my Wordpress site but have moved here._
14+
15+
I started a new thing on August 3rd. So consider this a journal of sorts.
16+
17+
I started coding bootcamp with Jack Russell Coding School. I had been waiting for this for months to start a coding bootcamp so it is no surprise that I am late on this blog. I will detail the process of settling on a bootcamp in a later blog.
18+
19+
As is the nature of a bootcamp, from what I hear, we were welcomed to the class and began learning code immediately. This bootcamp is teaching us to be Full-stack Web Developers. That does mean something but I will define it later.
20+
21+
We started with HTML. Whether it is important or not to you, dear reader, html stands for “hyper text mark-up language.” The best way to think of html is like writing a word document that is housed on the inter-webs. A word doc. is formatted uniquely, therefore a html file must be formatted in a specific way. Here is a sample document and the boiler-plate (necessary formatting) for it.
22+
23+
_\*I took out the boiler plate info here._
24+
25+
If that looks strange, it is ok. This is just basic and necessary code for beginning an html document. HTML feels very like writing a word doc meaning it can feel very tedious for very little reward. That does all change but it will take time to learn the other code to make it all look nice.
26+
27+
Point is, learning to code, even though I had done a far amount of coding before, is challenging.
28+
29+
The next blog I will get into CSS.
30+
31+
– Ben

content/2020-08-18-css-and-div-s.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
_id: "7180c247-be59-40f2-90ac-c75cd6d3c7b6"
3+
title: "CSS & Div's"
4+
published: "August 18, 2020"
5+
slug: "css-and-div-s"
6+
description: "...in the beginning stages of learning how to do web development, we learned that there are so…many…div’s"
7+
categories: ["Coding Bootcamp", "Career Changer", "Junior Developer"]
8+
author: "Ben Patton"
9+
authorImage: "https://cdn.sanity.io/images/nfspldzq/production/3ceeda54221c7c0614ecc51f955c7be39a1da34e-512x512.jpg"
10+
type: "Blog"
11+
---
12+
13+
_This is an article that I originally wrote for my Wordpress site but have moved here._
14+
15+
Day two through the end of Week one we were learned how to write efficient html and CSS. Since we were in the beginning stages of learning how to do web development, we learned that there are so…many…div’s. A div is an element that essentially divide’s the page into sections. It can get super confusing, when using just basic code and not templates, because your html page can start to look like the matrix.
16+
17+
To the div you can assign classes which help to style the layout of your web page through the use of CSS. A div with a class or id is written as follows: `_div class=”my-div”></div_`
18+
19+
Then in your CSS, either in a new file called filename.css or in the html file using _style_ tags, you can style your code. Coder’s have a love hate relationship with CSS. If you enjoy making things look nice, CSS will not frustrate you as much. If you want to make things work, CSS is beyond frustrating. It is not that it is too hard to learn, necessarily, there is infinite possibilities for how you can style things. So if you like fonts, colors, etc, (think graphic design even though graphic designers might not like me saying that) then CSS is your cup of tea but you can add any sweetener and doctor up your tea however you like, or drink coffee. Hopefully the point has been made. My last comparison, if you are an artist, in the realm of painters because everyone can consider themselves and artist, then you would enjoy CSS. Color wheel’s and spectrums and the like.
20+
21+
So after we learned a bit of CSS we created the basic first page of a website. For day 3 this was a feat for most of us. It took us the majority of the day but using html and CSS we knew we made it look about as close as possible.
22+
23+
By the end of the week we had learned enough to recreate a the landing page of a website. We did this by recreating the Airbnb landing page.
24+
25+
Reflections:
26+
27+
- Even though it was a lot of tedious work using basic HTML and CSS, it was nice to see what we were able to do with not a lot of tools.
28+
- Personally, it is very nice to be doing something that takes a lot of time to complete. Obviously the goal is to get better and more efficient but it is nice to know what I am to be doing and work at it till it is completed. This is how I like to work and it took me a long time to figure that out before coding bootcamp.
29+
- As my next blog will deal with some Javascript, I can go ahead and say I am excited to become more proficient with this stack and learn frameworks that serve to help us become better developers.
30+
- Someone might ask the question, “why not just learn the frameworks and then not have to deal with all the frustration without them?” My understanding is that if we went straight to frameworks we would not understand most of what we are using the frameworks for. So we are building a very foundational level of understanding and then getting into frameworks. Once we do, even though there will be a learning curve, it will be a lot smoother than if we just tried to understand a framework before knowing the basics. My best analogy at this point, which I am sure someone could refute, is that it is like trying to be a mechanic without understanding anything about cars.
31+
32+
Till next time.
33+
34+
– Ben
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
_id: "681d45fb-c392-4f19-aa7c-8f47664312b3"
3+
title: "Javascript Beginnings"
4+
published: "August 23, 2020"
5+
slug: "javascript-beginnings"
6+
description: "I am now seeing the value of having kept this blog up either on a daily"
7+
categories:
8+
["Coding Bootcamp", "Career Changer", "Junior Developer", "Javascript"]
9+
author: "Ben Patton"
10+
authorImage: "https://cdn.sanity.io/images/nfspldzq/production/3ceeda54221c7c0614ecc51f955c7be39a1da34e-512x512.jpg"
11+
type: "Blog"
12+
---
13+
14+
_This is an article that I originally wrote for my Wordpress site but have moved here._
15+
16+
So we just finished week 3 of bootcamp and I am now seeing the value of having kept this blog up either on a daily, every other day or weekly basis. The nature of the immersive bootcamp is that where we are now, all I know is I know more than I knew three weeks ago.
17+
18+
Anyways, at some point towards the end of week 1 and by the start of week 2 we began to learn Javascript. Javascript, like most other languages, is incredibly vast. I will list a few things about Javascript, that go with what we learned in week 2 because week 3, which will be the next blog, was quite intense (Asynchronous Javascript anyone?).
19+
20+
So, week 2, the basics of Javascript.
21+
22+
- Strings and numbers (literally words and numbers)
23+
- Booleans (uses evaluators like `>`, `<`, `<=`,`>=`, etc to determine true or false)
24+
- Variables (holds something like a ‘word’ or number or eventually lines upon lines of code)
25+
- If-else statements (if ‘this’ then do this, else ‘do this’) (you can add if conditions within if conditions which are labeled as ‘else if’ statements)
26+
- Loops (while loop – while ‘this condition’ do this) (for loop – for ‘this condition’ do this). This is an incredible over simplification.
27+
- Functions – take everything above into a function and every time you want to use that function you can just call the function. The functions definition is all the code you give it (again and incredible over-simplification).
28+
- Array’s and Objects (Array’s are a list of values which are placed inside [ ]).
29+
- Objects need their own line and sub-line.
30+
- Objects are recognized by `{ }`. So the most confusing thing is that Objects are Array’s.
31+
- Array’s have values [1, 2, 4, 24, 465].
32+
- The first value in an array is 1. 1 is at an index of 0.
33+
- So if you want to pull 1 from the array it looks like array[0].
34+
- If you were to type the array by index it would look like Array[0:1, 1:2, 2:4, 3:24, 4:465]
35+
HOWEVER!
36+
- That format is what an Object is. Object `{Key: value, Key: value}`.
37+
- Array’s do not get formatted/typed by index. The index is understood
38+
- Confused? Me too, google it.
39+
- Putting html, css and javascript together.
40+
- Made a calculator. A lot harder than it sounds.
41+
42+
So, that is most of week 2. Like I said, next week will be a little deeper but it might end abruptly due to the complexity and melting of the brain when thinking about Asynchronous programming.
43+
44+
Till next time,
45+
46+
– Ben
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
_id: "e4b8fd6d-3e40-45c5-8fa4-acf860bae08d"
3+
title: "Coding Bootcamp - Week 3"
4+
published: "August 31, 2020"
5+
slug: "coding-bootcamp-week-3"
6+
description: "This week was one of the more difficult conceptually"
7+
categories: ["Career Changer", "Coding Bootcamp"]
8+
author: "Ben Patton"
9+
authorImage: "https://cdn.sanity.io/images/nfspldzq/production/3ceeda54221c7c0614ecc51f955c7be39a1da34e-512x512.jpg"
10+
type: "Blog"
11+
---
12+
13+
_This is an article that I originally wrote for my Wordpress site but have moved here._
14+
15+
This week was one of the more difficult conceptually. I say that because I also started writing my functional programming blog which takes the concepts of conceptuality and gets more complex conceptually (if that was hard to follow….you understand).
16+
17+
_\*If someone reads this, wants to correct me/help me with this, feel free._
18+
19+
Anyways, this week we looked at the call-stack and asynchronous functions.
20+
21+
What I am about to say is my best attempt at explaining async functions as a newbie. You’ve been warned.
22+
23+
So, remember, all of this is within Javascript. Javascript reads all of its code synchronously. That means it reads it top down. This never changes within Javascript.
24+
25+
So async programming is basically programming that is being run somewhere else while Javascript finishes running its synchronous code. Asynchronous code is executed in the browser and even though it maybe finished running before all the synchronous code is finished, it is placed into the callback queue. This means that it will not run until all the synchronous code is finished and then the first async code in the queue will be executed first (FIFO – first in first out).
26+
27+
There are also these things called promises within all of this. Promises are more important than your typical async code and will be placed into the 'microtask' queue which is run before the callback queue.
28+
29+
So right now, as we are still very new to learning, our code can get a bit muggy trying to think through this whole call-stack, call-back, 'microtask' queue flow. But it’s part of the fun of learning to code (look for that blog to come soon).
30+
31+
The next blog in the bootcamp series will be the reflection on week 4 followed by “The Fun of Learning to Code.”
32+
33+
Til next time,
34+
35+
– Ben
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
_id: "cee85c0a-67c0-4ffd-856f-1201637685b4"
3+
title: "Coding Bootcamp: Week 4 - Functional Programming Part 1 & Part 2"
4+
published: "09-01-2020"
5+
slug: "coding-bootcamp-week-4-functional-programming-part-1-and-part-2"
6+
description: "So my goal is to keep this super, I mean incredibly super, basic"
7+
categories: ["Coding Bootcamp", "Career Changer"]
8+
author: "Ben Patton"
9+
authorImage: "https://cdn.sanity.io/images/nfspldzq/production/3ceeda54221c7c0614ecc51f955c7be39a1da34e-512x512.jpg"
10+
type: "Blog"
11+
---
12+
13+
_This is an article that I originally wrote for my Wordpress site but have moved here._
14+
15+
Functional Programming Part 1:
16+
17+
🤔
18+
19+
Functional Programming Part 2:
20+
21+
For anyone who reads this who is like “oh no, another perspective on functional programming” just know that I am not necessarily offering guidance but just reflections on a week of learning it so feel free to comment or help understand.
22+
23+
So my goal is to keep this super, I mean incredibly super, basic.
24+
25+
Of the few things we have learned so far, one of the seemingly most important is this:
26+
27+
In functional programming you must use pure functions. What this means is that a function cannot be dependent upon anything outside of the function for its ‘functionality.’ If so it isn’t pure. The common comparison used is comparing functional programming to calculus. Functional programming is highly mathematic so it makes sense (and here we are talking about the way functional programming works is mathematical but you do not necessarily have to have a deep understanding of math to use it).
28+
29+
So far it seems that functional programming is a paradigm of programming that seeks to make code more readable. You can put functions within functions but the goal in mind is always readability and understandability for our code.
30+
31+
Back to the use of the word conceptual, if what I am writing seems very conceptual, thats because it is. It can be highly practical but functional programming is a mind-bending endeavor.
32+
33+
A much clearer explanation of functional programming as well as a deep dive into it can be found at the link below. Kyle Simpson makes functional programming reasonably understandable for ‘the other guy’ (me).
34+
35+
The main point and take-away of this post is this:
36+
37+
As coders, programmers, software-engineer’s, web-developer’s, etc, a great goal to have is readable and reasonable code. A bunch of for loops `(for (let i = 0; i < arr.length; i++)` with if statements in adds line upon line to files and makes it difficult to understand. If we can create functions that explain themselves and put functions within other functions so that we can see what we are doing on a SINGLE line of code, that is a much better alternative for those that may read our code whether on the job or just our repositories of code out there for the world to see.
38+
39+
I might say more about Functional Programming at a later time so there is no soon-to-be part 3. I know how much that bums anyone out who reads this 😏.
40+
41+
Til next time,
42+
43+
– Ben
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
_id: "d26f50fa-9d37-4745-919e-73993aa9cd86"
3+
title: "Coding Bootcamp - Week 5"
4+
published: "September 7, 2020"
5+
slug: "coding-bootcamp-week-5"
6+
description: "It is honestly hard to believe we are five weeks into our coding bootcamp"
7+
categories: ["Coding Bootcamp", "Career Changer"]
8+
author: "Ben Patton"
9+
authorImage: "https://cdn.sanity.io/images/nfspldzq/production/3ceeda54221c7c0614ecc51f955c7be39a1da34e-512x512.jpg"
10+
type: "Blog"
11+
---
12+
13+
_This is an article that I originally wrote for my Wordpress site but have moved here._
14+
15+
It is honestly hard to believe we are five weeks into our coding bootcamp. So two quick things: This will be the typical blog of reflecting on this past week. I mentioned in a previous post that I would write an article on the process of choosing a bootcamp as well as an article on reflecting on the bootcamp so far. I plan to have those done this week and scheduled for Wednesday and Thursday.
16+
17+
Week 5 Review
18+
19+
This week we began learning backend, and in a small way, we are now able to do full-stack applications. Meaning we can implement web applications using both front-end and back-end technologies.
20+
21+
We did this primarily by installing some software that enables us to create our own databases and have api calls to our databases that are then able to be rendered on screen.
22+
23+
So we began creating a blog. Why a blog? A blog shows, on a basic level, that we are able to implement what is necessary for a website to work. We can make our server and create our database that our front-end is able to make calls to and therefore display the information on screen. Specifically for different users we can display their blog and then create more blogs for that user and delete them. We still have a good ways to go on begin able to edit the blog and use authorization and authentication, which we will learn next week, week 6.
24+
25+
By the end of week 6 we will be able to call from databases using Sql and Mongo and other databases as well as implement authorization and authentication for the blog site (we call our Rockbottom blog since we are at rockbottom of our coding journey, feel free to laugh here. There needs to be some way of styling text to indicate laughter when being sarcastic).
26+
27+
After that we will move on to React and then Material UI, and we as a class are counting down the days until we get to use those things. We are doing the work now in the most difficult way SO THAT when we get to those things we know more of what we are doing and can adapt quickly.
28+
29+
This week was a refreshing week after functional programming last week.
30+
31+
So, look for those two blogs I mentioned on Wednesday and Thursday.
32+
33+
Til next time,
34+
35+
– Ben

0 commit comments

Comments
 (0)