Welcome to Rants and Raves!
I kept hearing that I needed to write, so here is the blog that I ended up starting.
It is mostly an accounting of my progression through creating a web site, nuances with code, and tips about what I did to make things work.
In there you will find sprinkled about some gems of life, and letting loose fun.
Enjoy!
Happy Easter!
2023-04-09
Had a chill day today with a good shopping trip, good conversations, good Pokémon Go catches, good amount of driving, and good chilling.
Let's Encrypt!
2023-04-08
Now that the basics of using DataTables is known it's time to do something that has been long overdue, SSL. As a reminder for why this is important:
It proves that you have control over your site.
It encrypts the data transfer to prevent someone from easily seeing what is being sent.
It adds the 's' at the end of 'https'.
I think Google no longer displays search results that do not have it.
I was perhaps a bit worried at the cost, but you can implement it for free with Let's Encrypt. To set your mind at ease, it's not some hole in the wall site but rather one of the top Certificate Authorities.
https://letsencrypt.org/
The process seems rather simple, however I did not end up going through their process as Forge can implement for us.
https://forge.laravel.com/docs/1.0/sites/ssl.html
The basic process is this:
Log into Forge
Go to the site that you wish to set up the SSL certificate
Select the "SSL Certificates" tab
Tap on "LetsEncrypt (Beta)" button
Make sure that your domains are listed
Tap "Obtain Certificate" button
https://laracasts.com/discuss/channels/forge/setting-up-lets-encrypt-on-forge
Some notes.
By default when you select "Let's Encrypt" it will put in both your domain.com and www.domain.com. If that's all you care about, then you're golden.
If you want to have subdomains you will need to add each sub.domain.com to the list.
If you want to add the '*' wildcard for a subdomain it will need to be before the first '.' in the domain.
Also, when including the '*' wildcard you cannot have 'redundant' subdomains, i.e. *.domain.com will conflict with sub.domain.com or even www.domain.com.
Another thing when including the '*' wildcard you will need to provide credentials to one of the DNS providers the Forge supports:
Cloudflare
DNSimple
DigitalOcean
Linode
OVH
Route53
Luckily I am using DO as my DNS provider, so that worked in my favor. If you already know what one of your DO API access tokens is you can use that. If not, you will need to create a new one, as DO only shows the token upon creation. I might recommend only having one feature tied to one token anyway because you will have to replace it everywhere you used it when the token gets regenerated. To make a new DO API token:
Log into DO
Select 'API' on the left
Select 'Generate New Token'
Give it a name, expiration period, and scope
Select 'Generate Token'
COPY THE TOKEN
From here you can place the copied token into your Forge SSL process, and finally hit 'Obtain Certificate'. If everything goes smoothly then Forge will show the certificate being installed, and even more desired, active.
To Hunt Or To Code?
2023-04-07
Spent some time putting in my name for a few jobs. It always seems like a beast of a process, but it's nice when they have the option to apply directly with Indeed. Unfortunately it took long enough that I didn't get to coding today. Well, that and the fact that my phones Hotspot has chosen the same network ID that my development environment uses. Now the dev environment errors on its network check before starting. The "quick fix" is to disable wifi and start the dev environment, or just start the dev environment prior to connecting wifi. More ideally it would be to change the homestead.yaml and hosts files to a network ID that isn't being the used. The frustration is that my Hotspot is supposed to change its network ID randomly, which it hasn't in a few days. I haven't been able to find what IP range it's allowed to use so that I can pick one for my dev environment that isn't going to conflict. It also seems that I'm not allowed to set a static address for my Hotspot. So between some dev nuances and what I had present on my screen I ended up job hunting more than anticipated today.
Adding DataTable Export Buttons
2023-04-06
With DataTables working it's export time. This is initially easy enough by adding them to the DataTables constructor:
$('#myTable').DataTable( {
buttons: [
'copy', 'excel', 'pdf'
]
} );
Generally speaking, they don't show with just that. You need to either add it to the dom parameter, or by direct insertion. Note that they recommend using direct insertion when using Bootstrap styling. I decided in the end to go with the dom parameter even though I am using Bootstrap.
$('#myTable').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'excel', 'pdf'
]
} );
https://datatables.net/extensions/buttons/
The reason I went with the dom parameter is because it actually seemed like the quickest/easiest way to get the styling I want, it still might not be the best route to go. The dom parameter can actually have the styling included as part of the parameters that you select.
$('#example').dataTable( {
"dom":
'<"row"'+
'<"col-sm-12 col-md-6"B>'+
'<"col-sm-12 col-md-6"l>'+
'<"col-sm-12 col-md-6"f>'+
'>'+
't'+
'<"row"'+
'<"col-sm-12 col-md-5"i>'+
'<"col-sm-12 col-md-7"p>'+
'>',
} );
https://datatables.net/reference/option/dom
You do need to make sure you include the appropriate extension source script in your HTML I did end up using the DataTables download builder. You just go through, select the components that you are using, and it will generate links needed to include in your project.
https://datatables.net/download/
I ended up with these:
<link href="https://cdn.datatables.net/v/bs5/jq-3.6.0/jszip-2.5.0/dt-1.13.4/b-2.3.6/b-html5-2.3.6/b-print-2.3.6/datatables.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/v/bs5/jq-3.6.0/jszip-2.5.0/dt-1.13.4/b-2.3.6/b-html5-2.3.6/b-print-2.3.6/datatables.min.js"></script>
DataTables Is Functioning
2023-04-05
Found the issue that was causing a malformed server response, I had put in an echo as part of my troubleshooting that was causing issues. After removing that the response was appropriate, as long as the Ajax script included the columns section that defined what it was looking for.
https://datatables.net/forums/discussion/53552/php-array-to-json-to-datatable
https://datatables.net/examples/ajax/objects.html
Also do make sure your JQuery references are in the header, not the footer.
https://stackoverflow.com/questions/2075337/uncaught-referenceerror-is-not-defined
I did use this tutorial as my baseline for my Laravel code, the controller will likely need some tweaks for your model.
https://shareurcodes.com/blog/laravel%20datatables%20server%20side%20processing
One of the saving graces in this troubleshooting was seeing what was being sent and received using the Chrome Debug Console.
https://datatables.net/manual/tech-notes/7
They mention in the tutorial some of the parameters used with DataTables, well here are them all.
https://datatables.net/manual/server-side
Spring Cleaning Doesn't End
2023-04-04
I guess spring cleaning wasn't technically done. After attempting to catch a potential mouse, we needed to put our "pantry" back together. We end up taking the food items that are prime mouse targets out and putting them in a more secure location. It's a bit inconvenient of a spot, so it tends to be temporary. We took this opportunity to clean up the shelves before putting the food back in. Feels nice to have everything cleaned up and reorganized.
Found The Frog
2023-04-03
We brought the truck in for a few little things, and ended up waiting around for what seemed like a full PM service. Luckily the yard had a couple of pondish areas that provided some chill and entertainment. One was a pretty balanced environment with lots of different vegetation, animals, and bugs. We did manage to spot one of the elusive frogs, and found soo many snails. While we were locked out of our home for a while, we did have a pretty relaxing and enjoyable day for the most part.
Woken Too Early
2023-04-02
The other night there were some really noisy neighbors in the middle of the night that woke us up. Unfortunately we weren't getting back to sleep so we started our day. That, the caffeine to boost the sleepy day, and the looooong day have had some unpleasant ripples to recover from. The day itself ended up being a decently productive one and we had a really good relationship evaluation conversation, but the recovery is rough.
April Fools'... Or Not...
2023-04-01
I applied for a job today. It's been a little bot challenging because it wasn't a quick Indeed apply, so had to fill out a bunch of info again. It was better than some of the others that are being so slow that the reCAPTCHA is timing out. I might try them again when we aren't moving, but at least there's one application in.
TAXES DONE!
2023-03-31
It only took several goes at it, misunderstandings in discrepancies, and many phone calls to get insurance info. It's done now though!