TrickJarrett.com

Posts Tagged: programming

Tonight's coding is not on Glowbug but on another one of my projects. One in need of a refresh and rewrite: My Fixture Picker. Currently it lives on firsttou.ch, but honestly I might let the domain drop and just bring it over to trickjarrett.com. We'll see.

This site solves a problem for me: I really like watching soccer. I have access to lots of games in different leagues on different channels or streaming services. How do I pick what I should watch?

What exists right now is entirely made via server side code using PHP. What I need is to rewrite it so instead it provides your browser with all the raw match data and then you can set some variables for preferences, pick favorite teams, etc. And then it is saved in cookies or as a unique user for you.

So, my plan today is to begin working on that rewrite. I might use this as a chance to experiment with ReactJS since I have no experience with it. We'll see.

Share to: | Tags: javascript, soccer, php, proj:fixture picker, programming

Late night Glowbug coding. I have had this idea for a few days. On the back end I can save drafts of posts. Primarily it's a link queue saved either from a bookmarklet when I come across a link to read later, or a link saved from my phone.

Well there is a cron job which runs every twenty minutes that, as of now, does two things.

  1. If a draft is older than 48 hours, it deletes it. Sometimes I save a link meaning to read it and I keep putting it off. Well, if it gets to 48 hours I lose the chance. Or if I meant to save it longer than that it should be a browser bookmark instead.
  2. If the system hasn't grabbed the page's title, it goes ahead and does that. It's a small thing but it is much nicer than the sometimes opaque URLs which I don't know what I'm linking too.

Small coding thing, took me 15 minutes. The majority of which was triple checking my timeout deletion query, but otherwise I had it mapped out in my head and it went lickety-split nice and easy.

Share to: | Tags: glowbug, programming

The Guardian Newspaper has a new automated tool for copyediting

Newspapers follow style guides. Rules which define how they grammatically write. When do you write eleven vs. 121? How do you refer to individuals who cause an uprising in a country? Etc. etc. Essentially, it is the programming language rules for that newspaper's use of language.

Heck, I've even thought about my own style guide rules for this blog.

Here is a link to the virtual reference of the Guardian's own style guide. Chicago Manual of Style. And here is the Associated Press's Stylebook. You get the idea.

The linked article is a coder focused deep dive in the system the Guardian set up for improving automated fixes of the style guide for the paper.

Share to: | Tags: writing, programming, newspaper

Javascript is a weird language and today as I was changing stuff on the admin side, I caused a bug in the pagination of the posts where it normally outputs a selection and elides the majority of the pages. Instead it was giving me all 25 pages. It was because I was grabbing the current page from the URL, so javascript was seeing the number as a string. One 'parseInt()' function later I've got it fixed, but it took me a while to debug this one silly thing.

Share to: | Tags: glowbug, javascript, programming

Alright, I'm calling it a wrap on development today. Probably a total of 5 hours spread over the day. But tagging is probably 80% done. The biggest feature still to do is make tags have their own templates, so people could follow the "us politics" tag or something like that. Those get complicated because long term you could end up with tags with hundreds of entries. So I'd need to paginate them, which is more complicated.

I am also working on how I go about tagging, choosing keywords and ideas. I have decided I am not going to put people's names in as tags, but I will do it for other proper nouns such as countries, etc.

I wrote the code for automated tweets to grab the tags from all of those posts and take the top 3 tags to be mentioned in the tweet in hopes of making it more interesting to people and driving more engagement. We will see how it goes.

Share to: | Tags: glowbug, programming

So, this morning's biggest coding lesson was to put "preventDefault()" on a keydown event rather than keyup event if you want to stop a form from submitting when you press enter.

Share to: | Tags: javascript, programming

This morning's coding project is to finally begin adding tagging. I mapped it out in my head last night into this rough "to-do" list for the devwork as follows:

I suspect I might get to the third item this morning, we'll see. After doing this I think I will prioritize code cleanup and organization as things like the admin javascript are getting a bit unruly.

Update: Three-ish hours of work and I'm mostly done with the first four to-dos. Next will come templating it and then going back and tagging old posts which will be arduous. But this is a good stopping point.

Share to: | Tags: glowbug, programming

As Glowbug continues to be my pet project, last night I coded in functionality to enable easy sharing from my phone. I use an Android device, so the workflow (for now) makes use of Tasker and AutoShare (a plugin for it) to call a custom endpoint on the webserver. It is still not a 100% process, as it turns out Android sharing is a pretty messy thing and is not standardized as nice as I would like. But I've got a working structure for now.

At some point I'll probably code a simple Android app that acts as a sharing bridge, solely existing to take the text and dump it into a webcall to the server. But for now, the Tasker + AutoShare functionality gets the job done.

Share to: | Tags: glowbug, android, programming

Glowbug Development & Commit Updates

The recent commits to Glowbug's Github:

By far the biggest of these was the image manager implementation. I don't currently plan for any major coding, we'll see what comes up.

Share to: | Tags: glowbug, github, google, programming

Last night's coding was to give Glowbug some additional functionality around images:

First, I coded the upload to shrink any image upload to fit within a 1024x1024 square. Secondly I coded an image manager page that lets me see all the uploaded images, and gives me the easy ability to delete images as well as rename them. Renaming them changes the file name and then looks for posts which referred to that image name and changes it to point to the new name.

Just some more admin functionality. I still want to add ability to rotate images, since I want to do more uploading pictures from my phone and I suspect that will be an issue.

Share to: | Tags: glowbug, programming

What started as a small quicklinks project, then was renamed to 'Blips' as I seek something to replace Twitter as an easy way to drop small thoughts, has been renamed 'Glowbug.'

Years ago I had plans to make my own complete site CMS, and that was called 'Glowbug' at the time. It quickly became evident that Wordpress and other offerings were far more robust and beyond what I could do. But here we are, coming full circle, as I build my own little tool out.

Share to: | Tags: glowbug, programming