]> localhost Git - homepage.git/commitdiff
feat: blog in index + ai-is-not-bad
authorJansen <[email protected]>
Fri, 11 Jul 2025 14:31:46 +0000 (10:31 -0400)
committerJansen <[email protected]>
Fri, 11 Jul 2025 14:31:46 +0000 (10:31 -0400)
12 files changed:
cmd/main.go
pkg/blog/blog.go
pkg/routes/blog.go [deleted file]
pkg/routes/index.go
static/assets/css/blog.css
static/assets/css/common.css
static/assets/css/index.css
static/blog-pages/ai-is-not-bad-tech-is.html [new file with mode: 0644]
static/blog-pages/you-most-likely-dont-need-aws.html
static/templates/blog-page.html
static/templates/blog.html [deleted file]
static/templates/index.html

index dfad3afcba2e26eabea45bb90b809e94f5a82676..b8711a9f394f404e45809251d9311f4f45a9d4b8 100644 (file)
@@ -29,8 +29,7 @@ func main() {
        router.Handle("GET /static/assets/", http.FileServer(http.Dir(".")))
        router.HandleFunc("GET /projects", routes.Projects(templates))
        router.HandleFunc("GET /blog/{post}", routes.BlogPost(templates, blogPosts))
-       router.HandleFunc("GET /blog", routes.Blog(templates, blogPosts))
-       router.HandleFunc("GET /{$}", routes.Index(templates))
+       router.HandleFunc("GET /{$}", routes.Index(templates, blogPosts))
        router.HandleFunc("/", routes.NotFound(templates))
 
        server := http.Server{
index aa8b5c7de57c745fc05b431cca38e96369806eaa..a25e602506d3934b8c85090f617fa6a0f69cba98 100644 (file)
@@ -5,6 +5,7 @@ import (
        "io/fs"
        "os"
        "regexp"
+       "slices"
        "strings"
        "time"
 )
@@ -15,6 +16,7 @@ type BlogPost struct {
        Date     time.Time
        Summary  string
        Content  template.HTML
+       Tags             []string
 }
 
 func ParseBlogPages() ([]*BlogPost, error) {
@@ -48,6 +50,11 @@ func ParseBlogPages() ([]*BlogPost, error) {
        if err != nil {
                return nil, err
        }
+
+       slices.SortFunc(blogs, func(a, b *BlogPost) int {
+               return int(b.Date.Unix() - a.Date.Unix())
+       })
+
        return blogs, nil
 }
 
@@ -55,23 +62,28 @@ func parseSingleBlogPost(filename string, file []byte) (*BlogPost, error) {
        titleRegex, _ := regexp.Compile("<!-- TITLE:(.*) -->")
        summaryRegex, _ := regexp.Compile("<!-- SUMMARY:(.*) -->")
        dateRegex, _ := regexp.Compile("<!-- DATE:(.*) -->")
+       tagsRegex, _ := regexp.Compile("<!-- TAGS:(.*) -->")
 
        // Quita logo, melhor que deixar blog incompleto sem querer
        title := strings.TrimSpace(string(titleRegex.FindSubmatch(file)[1]))
        summary := strings.TrimSpace(string(summaryRegex.FindSubmatch(file)[1]))
        dateStr := strings.TrimSpace(string(dateRegex.FindSubmatch(file)[1]))
+       tagsList := strings.TrimSpace(string(tagsRegex.FindSubmatch(file)[1]))
 
        date, err := time.Parse("2006-01-02", dateStr)
        if err != nil {
                return nil, err
        }
 
+       tags := strings.Split(tagsList, ",")
+
        blog := &BlogPost{
                Filename: strings.Split(filename, ".")[0],
                Title:    title,
                Date:     date,
                Summary:  summary,
                Content:  template.HTML(string(file)),
+               Tags:     tags,
        }
 
        return blog, nil
diff --git a/pkg/routes/blog.go b/pkg/routes/blog.go
deleted file mode 100644 (file)
index 34b7251..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package routes
-
-import (
-       "html/template"
-       "log"
-       "net/http"
-
-       "jsdaj.com/homepage/pkg/blog"
-)
-
-func Blog(templ *template.Template, posts []*blog.BlogPost) http.HandlerFunc {
-       return func(w http.ResponseWriter, r *http.Request) {
-               err := templ.ExecuteTemplate(w, "blog.html", posts)
-               if err != nil {
-                       log.Print(err)
-                       http.Redirect(w, r, "/404", http.StatusSeeOther)
-                       return
-               }
-       }
-}
index ec98df47d0d0cce701924cb266cf16b0184bff15..d314db7266f1789be1f2aaae386f3dc16d85dd55 100644 (file)
@@ -4,11 +4,13 @@ import (
        "html/template"
        "log"
        "net/http"
+
+       "jsdaj.com/homepage/pkg/blog"
 )
 
-func Index(templ *template.Template) http.HandlerFunc {
+func Index(templ *template.Template, posts []*blog.BlogPost) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
-               err := templ.ExecuteTemplate(w, "index.html", "")
+               err := templ.ExecuteTemplate(w, "index.html", posts)
                if err != nil {
                        log.Print(err)
                        http.Redirect(w, r, "/404", http.StatusSeeOther)
index f05af92bbc1b9f5142510c4373ce1986d94d0a9f..e45c6cdc6c311c6f45805e4570f59077b7ce8ade 100644 (file)
@@ -1,17 +1,3 @@
-/* 
-* =========================================================
-* Header
-* =========================================================
-* */
-.header {
-  display: flex;
-  margin: 1rem auto;
-  list-style: none;
-  gap: 11rem;
-  align-items: center;
-  margin-bottom: 2rem;
-}
-
 /* 
 * =========================================================
 * Posts
 .post .summary {
   font-size: 14px;
 }
+
+.post .post-tags {
+  list-style: none;
+  display: inline-flex;
+  gap: .5rem;
+  margin-bottom: .5rem;
+}
+
+.post .post-tags li {
+  background-color: var(--bg3);
+  padding: .2rem .4rem;
+  border-radius: 100px;
+  font-size: 12px;
+}
index 29238236699d5cf465ceea9df1ce8ed482545ce2..6f7634dd8b762dde34b66a9e2399f332bf7ed8b7 100644 (file)
@@ -25,3 +25,8 @@ body {
   width: 800px;
   margin: auto;
 }
+
+.section-title {
+  font-size: 20px;
+  margin-bottom: 1rem;
+}
index 5beb2d74ed2c22d02e11424a2ef7480066fa0416..888f4bb7dde76d7d7eaf50ea45d8ef231b9b04fc 100644 (file)
@@ -67,4 +67,5 @@
   gap: .5rem;
   justify-content: center;
   align-items: center;
+  margin-bottom: 3rem;
 }
diff --git a/static/blog-pages/ai-is-not-bad-tech-is.html b/static/blog-pages/ai-is-not-bad-tech-is.html
new file mode 100644 (file)
index 0000000..77b8519
--- /dev/null
@@ -0,0 +1,95 @@
+<!-- TITLE: AI is not bad, tech in general is -->
+<!-- DATE: 2025-07-11 -->
+<!-- SUMMARY: AI cannot be considered bad, the problem is just overhype, marketing and this stupid money pursuit as always. -->
+<!-- TAGS: rant,not-code -->
+
+<p>
+  Looking at my first two posts this may feel like I'm avoiding at all costs to talk about actual tech and I'm going
+  for some kind of "capitalism bad" agenda or something. This is not my objective and this will <s>possibly</s> be my last
+  rant towards this. See, for quite some time I had some stuff stuck at the back of my throat I just wanted to write it
+  down somewhere.  
+</p>
+<p>
+  I grew up messing around with computers, video games and eletronics in general. I wrote my first line
+  of code when I was around 13 (more than half my life) and never stopped since. One of my main sources of joy is
+  writing and talking about code, watching videos about it, learning, studying, seeing about areas within tech I could
+  never fully understand due to limited time (job+personal life takes a big chunk of it). But for years now I'm just
+  tired. Full tired. Not because I dislike coding now, not at all. I still enjoy writing and doing my own projects. My
+  problem is with everything else.
+</p>
+<p>
+  If you're not part of the tech community or don't work on tech, it might be quite shocking when I say that tech is
+  one of the most toxic and stupid areas out there -- not because of tech itself but because of how it presents itself
+  towards the market. See, there's this whole notion of "we need to be innovative" or something similar (every company
+  has it's own "motto") that actually can translate to "we need to make way more money". At first you may think "Oh,
+  that's normal. It's a job and a company, the main objective is indeed money" and you're right, but the biggest 
+  difference is the shit ton of money available in tech and this makes ALL the difference.
+</p>
+<p>
+  As of 2025, out of the <a href="https://www.forbes.com/billionaires">10 richest people in the world, 7 is from tech</a>.
+  The meaning of this is that tech has a SHIT TON OF MONEY available, with a bunch of rich guys trying to get more money
+  out of it. This makes tech an insufferable extremely competitive field, meaning that people is always striving to find
+  one single scenario they can grow on. It's really easy to earn money in tech! It's even easier to go bankrupt. Most 
+  startups out there create a product doing something -- always claiming it's some kind of innovation, of course -- and
+  start having customers until they can capture VC from some backer. Most startups NEVER get to actually make money from
+  their products, everything comes from VC. That means the company and the product itself becomes a shit show, the
+  mission is not "let's make it better, we need to build something good!", but "let's make it better, or else 
+  shareholders won't invest on us again!" -- and this impacts DEEPLY on how software is developed. For years now most 
+  commercial software out there was not written with you, the user, in mind, but the shareholders. Reason? 
+  <a href="https://jsdaj.com/blog/you-most-likely-dont-need-aws">You don't pay our AWS account</a>, they do.
+</p>
+<p>
+  So the cycle has been always the same: one comes up with multiple ideas (not everyone makes it first time), 
+  implements each one of them in the most shitty and rushed way possible (we need to be quick, or else someone can 
+  implement it first!), tries to push it down everyone's throat (if we have a good sales and CS team, that means 
+  engineers can work in more features instead of fixing stuff!), tries to capture VC ("we're a new startup focused on 
+  innovation" I'm sure you heard that before), get's VC money, uses all VC money (our software is really shitty <s>
+  because we rushed it</s> for some reason no one knows, maybe we need more engineers? yeah, totally, we have VC),
+  shareholder gets angry and threatens to stop pumping money (don't worry, we'll have everything you need here), pushes
+  harder towards some imaginary deadline + starts cutting costs (layoff, suddenly everyone cares about infra, etc), and
+  either it works for some more years or it goes bankrupt sometime after.
+</p>
+<p>
+  But, from times to times, there's some mystical and "innovative" new shining piece of technology that, whatever shit
+  you do with it, some shareholder will give you money. That means the first steps I described above can be virtually
+  skipped (if this technology is innovation by itself, I don't need to be innovative! That's genius!), which results in
+  a bunch of people that pretend they have any idea of what they're doing but in fact they're just playing the same
+  game as everyone else and are hoping it works for as long as possible. The current "entrepreneurship silver bullet"
+  is (you guessed it) AI.
+</p>
+<p>
+  AI is not, by any means, bad tech. It's a whole field within Computer Science with a bunch of amazing solutions
+  involved -- from hard problems optimization (such as Lossless video scaling, rendering frame prediction, analysis of
+  genome data, etc), to computer vision, voice recognition, video game analysis, video-game AIs and more. For many
+  years now we've been using AI daily in some way or another, waaay before LLMs were a thing. The reason why people
+  didn't refer to them as AI that much is probably due to the <a href="https://en.wikipedia.org/wiki/AI_effect">AI effect</a>, and
+  the reason why LLMs are still being referred as AI is because of marketing. That's the only reason, marketing. LLMs
+  are very cool indeed: they're basically a text prediction machine. If your data can be parsed as text, they will most
+  likely be useful in some way. And not only that, but thanks to LLMs 1. AI fields are being more recognized then never
+  before and 2. a lot of <b><i>real</i></b> innovations were accomplished on the way to achieve what we have today. That's
+  marvelous... but the problem with LLMs are the overhype and the instrumentation of this overhype as a market maneuver.
+</p>
+<p>
+  Companies such as Anthropic and OpenAI lives from LLMs. And they need every penny possible because LLMs are <i>really</i>
+  pricey. There's just NO WAY they'll let the hype die. That's why every time the market is cooling off SUDDENLY there's
+  a new "OpenAI Product X" or "ChatGPT X.X -- now surpasses everyone's benchmarks" or even "Sam Altman says 'we
+  achieved AGI, but we're afraid to release it'"... really? This is bullshit. If you take any real researcher that 
+  doesn't work for any of those companies the predictions and conclusions are always astronomically different. People 
+  tend to forget that Sam Altman's <b>is NOT</b> a researcher. His an entrepreneur. While yes, he went to Stanford for CS, he
+  never graduated and never worked with tech directly. His first job was "being CEO of Loopt". Now you tell me, you 
+  really think this guys has any idea what the hell is actually going on with researches? You really think his predictions are 
+  accurate? That's the same as asking <a href="https://en.wikipedia.org/wiki/Chris_Kempczinski">Chris Kempczinski</a> 
+  to make a Big Mac, that won't happen. Different jobs. They don't need to know what the shit they're saying, they just
+  need to sell. And this is not a Sam Altman-only thing, or AI LLM-only thing -- this is how ALL the industry works:
+  1. have some (usually shitty) idea, 2. get tons of money, 3. hire a bunch of people, 4. sell it as a technical
+  panacea for as long as you can.
+</p>
+<p>
+  AI is not bad tech. The problem is that tech is bad. I'm not talking about tech itself, but the market around it. 
+  It's just some stupid billionaire's race. People that aims only for money and only that. One may argue that it's always
+  been like that -- and that's true. The difference is that now with all the tools available this can (and will) be
+  really harmful for the field (+everyone's mental health in the industry is shit). I'll probably never stop coding or 
+  messing up with old junk circuits around the house. I'll never stop thinking about software architecture, and how
+  software is cool and can help lots of people. I'll never stop trying to help people to learn software, or help people
+  through software. But I can't imagine working on the industry for more than 5 years now. It just sucks.
+</p>
index 9af88b00b8c7e910d234358117922fdf02931c18..41c4ad8999f06f1fc53d1f266ca09afb07ec4df0 100644 (file)
@@ -1,6 +1,7 @@
 <!-- TITLE: You (most likely) don't need AWS -->
 <!-- DATE: 2025-07-07 -->
 <!-- SUMMARY: Some thoughts on how (once again) marketing and entrepreneurship destroyed everyone's mind. -->
+<!-- TAGS: rant,not-code -->
 
 <p>
   When I first started working as a developer almost 10y ago, we usually had 3 options whenever you needed to
index 1bc144e46c81f96361a8a87e8495b49d5042f005..486e92bb5bd8a55f3a52eccb0480377b6cd3c96d 100644 (file)
@@ -12,7 +12,7 @@
   <body>
     <div class="page">
       <ul class="header">
-        <li><b><a href="/blog">Go Back</a></b></li>
+        <li><b><a href="/">Go Back</a></b></li>
       </ul>
 
       <header>
diff --git a/static/templates/blog.html b/static/templates/blog.html
deleted file mode 100644 (file)
index 998e3c5..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Jansen Saunier</title>
-
-    <link rel="stylesheet" href="/static/assets/css/themes/codeclocks.css">
-    <link rel="stylesheet" href="/static/assets/css/common.css">
-    <link rel="stylesheet" href="/static/assets/css/blog.css">
-  </head>
-  <body>
-    <div class="page">
-      <ul class="header">
-        <li><b><a href="/">Go Back</a></b></li>
-      </ul>
-
-      <ul class="post-list">
-        {{range .}}
-          <li class="post">
-          <a class="post-link" href="/blog/{{.Filename}}">
-              <div class="post-header">
-                <h1 class="title">{{.Title}}</h1>
-                <p class="date">{{.Date.Format "2006-01-02"}}</p>
-              </div>
-              <p class="summary">{{.Summary}}</p>
-            </a>
-          </li>
-        {{end}}
-      </ul>
-    </div>
-  </body>
-</html>
index 663778d05eae7d85385ffdcedd49c5a25ff3ef17..f7e02ea90aa9751b85d5f5908cc3383936d7f229 100644 (file)
@@ -8,6 +8,7 @@
     <link rel="stylesheet" href="/static/assets/css/themes/codeclocks.css">
     <link rel="stylesheet" href="/static/assets/css/common.css">
     <link rel="stylesheet" href="/static/assets/css/index.css">
+    <link rel="stylesheet" href="/static/assets/css/blog.css">
   </head>
 
   <body>
         <li><b><a href="/projects">Projects Showcase</a></b></li>
         <li>-</li>
         <li><b><a href="https://git.jsdaj.com">Git Forge</a></b></li>
-        <li>-</li>
-        <li><b><a href="/blog">Blog</a></b></li>
+      </ul>
+
+      <h1 class="section-title">
+        Read my stuff:
+      </h1>
+      <ul class="post-list">
+        {{range .}}
+          <li class="post">
+          <a class="post-link" href="/blog/{{.Filename}}">
+              <div class="post-header">
+                <h1 class="title">{{.Title}}</h1>
+                <p class="date">{{.Date.Format "2006-01-02"}}</p>
+              </div>
+              <ul class="post-tags">
+                {{range .Tags}}
+                <li>{{.}}</li>
+                {{end}}
+              </ul>
+              <p class="summary">{{.Summary}}</p>
+            </a>
+          </li>
+        {{end}}
       </ul>
     </div>
   </body>