Dion Boles

Full Stack Engineer · Healthcare & FHIR


Moving a domain's DNS to Cloudflare Pages

When I moved this site to Cloudflare Pages, the simplest way to connect my domain was to let Cloudflare manage its DNS, because many registrars can't point a bare domain at a hosted site. The general steps:

1. Deploy the built site to a Pages project.

2. Add the domain to Cloudflare on the free plan. It gives you two nameservers.

3. At your registrar, replace the existing nameservers with those two.

4. Wait until Cloudflare shows the domain as active, then add the domain under the Pages project's custom domains.

My first try returned a Cloudflare 522 timeout. The cause was a leftover DNS record still pointing at my old host. After I deleted the old records and added the custom domain again, Cloudflare created the right record and the site came up. If you see a 522 after a move, check for old records first.

A static blog with React Router: prerender every page

React Router can generate plain HTML files at build time, so a blog like this needs no server. In framework mode you turn off server rendering and list the paths to prerender:

import type { Config } from "@react-router/dev/config";

export default {
  ssr: false,
  prerender: ["/", "/about", ...posts.map((p) => `/post/${p.id}`)],
} satisfies Config;

A few things I ran into:

Only prerendered routes can have a loader, so my catch-all 404 route has none and just throws a 404 response from the component.

In React Router v8 the meta function receives loaderData, not data. I had every post titled “Not found” until I changed that.

The build writes about 100 HTML pages plus a __spa-fallback.html. I copy that file to 404.html after the build so unknown URLs show the site's 404 page.

Styling is Tailwind v4 with CSS variables for the colors, so the monthly accent and dark mode are just a different set of variables on the html element.

I moved my blog off Tumblr and rebuilt it myself

I've moved this blog off Tumblr. dionboles.me is now a static site that I build and host myself, instead of a theme running on someone else's platform.

I had a backup of my posts on my laptop, so the move was mostly a matter of rebuilding the site around them. It's a small React Router project: the 40 posts from the backup, the same design I had been building for the Tumblr theme, a monthly accent color, dark mode, and highlighted code blocks with a copy button.

The importer reads only the exported post HTML, cleans it up, and writes one JSON file. Photos are copied over only if a post uses them. Along the way I fixed code blocks that Tumblr had split into one paragraph per line.

The upside of owning the site is that I control the design, the URLs and the backups. Posts are now just entries in a file, so adding one is a quick edit and a deploy.

Here is how you can run Python or Node in a Docker container and execute it in terminal mode:

docker run -it --rm python:3.8-slim /bin/bash

To add a volume in Docker, use the -v flag followed by the path on the host machine, a colon, and the path in the container. For example, to mount the current directory on the host machine to /app in the container:

for python

docker run -it --rm -v $(pwd):/app python:3.8-slim /bin/bash

for node

docker run -it --rm -v $(pwd):/app node:8 /bin/bash

Hello world!

So I realize this is my first post in about a year or two, but I have come back to talk about how learning C++ and other languages cn be amazing for your growth as a programmer .

The main thing is learning about memory, pointers, references, and how they work in your computer’s memory. 

So a small example based off of what I learn:

Ok so this is a symbol for a Pointer *

And here is one for a reference &

——————————

Pseudocode

Int x = 1 // this a throwaway value

Int *y = x // this is a pointer so y (points at) -> x = 1 so if x changes then the pointer will change with it

Int z = &y // so this is a reference and this goes to the address in memory and it takes the value of x because y is pointing to x.

This made me think of how variables work in JavaScript. I’ll have to look more into this; this is just a quick brainstorming post.

The Last Days of the Pebble

Today I’m sad to say that the Pebble smartwatch will not be made by the Pebble team anymore. Today they officially announced that they have decided to join the Fitbit team. 

I’m not sad for them joining a team or “selling out” as some people may say - rather, I’m sad because my first and favorite smart watch has come to an end. I have been in all 3 kickstarter campaigns and with the introduction of the Pebble 2 I thought Pebbles look into sleep tracking and fitness. It would have been a cool API that would take the team into the future. The pebble core is something that I wanted to see turn into a mini iPod-like device that I could speak to with Amazon’s Alexa built in. I wanted to see how to make amazing JavaScript apps with the core. 

I’m sad to see the Pebble team go but I hope that Fitbit can use their products to make a better designed product. I hope the Pebble lives on in Fitbit. Thank you to the Pebble team for making amazing products! 

Best wishes,

Dion Boles

Flask and Python

I’m learning how to be a full stack developer. Using Flask as a web framework and MySQL as a backend and good old HTML and jQuery as a frontend. The steps to create a website will only take a couple of minutes to make a route in flask it looks like this:

So quick start with flask:

First, you need Flask, so you can use “pip install” Flask Python 2 or
“pip3 install” Flask Python 3 and then that will install Flask in your computer. Then make a file called server.py and insert the code below:

from flask import
Flask,render_template
@app.route('/index')
def index():
 return render_template('index.html',title="data")
 if __name__ =="__main__":
 app.run(debug= True)

Your need to make an index.html and you can insert this HTML boilerplate: 

Next, just save the file, then you should go into your command line or open terminal and run python server.py or use Python3 server.py

Next copy and paste the highlighted portion of the code into your web browser and then you will get this web page!

The boy behind the “success kid” meme is all grown up — and trying to use his viral fame to save his dad’s life

rose-schwartz:

micdotcom:

Remember this little guy? His name’s Sam Griner. 

On Aug. 26, 2007 his mom took a photo of him at 11-months-old, standing on the beach in a green and white shirt, staring into the camera and making a determined little fist. Soon after, the photo morphed into the “Success Kid” meme, and Sam was Internet famous. 

He’s now 8 years old:

And he’s trying to use his Internet fame to find a kidney donor and save his dad’s life. 

(Visit the family’s GoFundMe page for more).

a memer needs your help tumblr

To create without the Creative Cloud

So you want to make cool art work or somewhat cool art then you need software like photoshop or illustrator but you don’t have the money to keep pay adobe for the software but you want to create what do you? you can download software like gimp  or pixelmator for your photoshop needs. I have try to use other software to not pay adobe but beacuse of most of the tools that are used in the design community are adobe’s it is more effective to use adobe’s software beacause of the fact that they make the task that you need to create faster and better then using a work around with in the software that you use inside of apps like gimp  or pixelmator.I will keep try to find alternative for the Creative suite. What do your think about adobe vs indie ?

Warby Parker in dc I love getting glasses from there they have one of the best customer support and they make you to buy glasses from Warby Parker is the best glasses seller hands down 😊.

The best podcast player ever

I love listening to podcasts most days I spend hours listening to my favorite podcast like ATP, Cortex I find that using Overcast is the best podcast player because of the use of smart speed and Voice boost to make some Eq settings simple with the use of one click. This app makes drives shorter then the hours I spent driving. I love Overcast i hope your feel the same way if you want to see this app in action on your iPhone or iPad then check out this link

I think i still like php :) but node js fun.

I have recently made a youtube tutorial that is base on how to stream video with node js but i just recently recoded in php and it was shorter to code in php like ok so here is the node js code. I will post the code below.    


Node JS Code 

var http = require(“http”);
var fs = require(“fs”);

console.log(“Server starting at localhost 3000”);
http.createServer(function (request,response) {
response.writeHead(200,{‘Content-Type’: 'video/mp4’});
var rs = fs.createReadStream(“cat.mp4”);
rs.pipe(response);
}).listen(3000);

and here is the php code 

Php Code and Html 5 

$files = “cat.mp4”;
$size = filesize($files);
header(“Content-Type: video/mp4”);
header(“Content-Length:”.$size);
readfile($files);

<!DOCTYPE html>
<html>
<head>
<meta charset=“UTF-8”>
<title>video stream</title>
</head>
<body>
<h1> video </h1>
<video src=“video.php” type=“video/mp4” controls></video>
</body>
</html>

This was the php code was more reuseable i could stream a file into a html video tag but i’m not that experienced in node js or php i just dabble with both. i feel like php is great and node js is the future of web dev but maybe php is still more useful. 

Node js and me

The Journey to learn Node js is a hard one for me because of the millions of frameworks that are on npm. I want to learn how to code with node js because of the speed benefits. But Learning to use a framework like express then ejs or jade i want to learn the basics so maybe I can make my own. I have to learn so much now just to keep up. I’m going to learn it all but I just found php to be easier then node js but maybe I just need to sit down and really make something like a blog engine that sounds fun. I just wanted to talk about my journey with node js. It sounds like a first world developer problem.