• Simple JSON API with Python and Flask

    This should be the first of a few blog posts explaining how to get a simple API up and running with Python, and using the Flask framework. I’ll try and link all these together once I get more up. And if you’d like the source code at any time, you can grab it here: github.com/billturner/simple_flask_api. The branch for this part will be 01-bare-bones.

    I’ll be using Python 3.x, and I’m going to assume you have it all set up and in your path. If you don’t have it set up, you can find a downloadable installer on the Python web site.

    Read more →

  • How to get started

    A wonderful comic by Alex Norris on learning distractions

    With the internet, there are so many resources available to help you learn about something new - a new recipe, a new hotel, a new celebrity couple, and a new-to-you programming language. In fact, there are often too many resources and opinions out there, and finding the right place to start learning can be quite daunting. I’ve found this to be the case lately while trying to learn Python.

    In addition to the book and tutorial I mentioned last post, I’ve also been going through another tutorial on how to write a roguelike game using Python. Despite the varied resources, I feel like I’m beginning to get a better grip on the language and its syntax.

    But then I wanted to start working on an initial Flask API for Lists of Bests. Sounds somewhat simple enough, but once I started looking at documentation and tutorials, I quickly became overwhelmed. Flask by itself could probably do what I want, but I found references to all kinds of libraries to supposedly make things easier. There’s RESTful, and then RESTPlus, and another with the awesome name Marshmallow. And I’m sure that’s not all of them.

    I think I may need to take another approach at this. Since I’m still quite new to the language, I think I’ll start with the most simple example first - without any extra libraries or distractions. I think if I can get my head around the basics, it will be much easier to add in those libraries later. And I may not even need them. I’ll attempt to document my learning into a couple of blog posts in the chance that someone else happens to have fallen into the library well like I did.

    The excellent and oh-so-true comic by Alex Norris (@dorrismccomics).

  • Learning Python

    When I initially thought about how I’d rebuild Lists of Bests, I had in mind to use some technologies that were somewhat new to me, so I’d have a chance to learn along the way. Well, since that post those new technologies aren’t all that new to me anymore. At my new(-ish) position at Arcadia, I’ve been writing quite a bit of React along with Ruby on Rails (and its API capabilities). So, there isn’t that much of a need to learn those tools from scratch.

    So, what to use instead? Well, I’m thinking it may be Python and the latest version of Angular (I still work some in AngularJS 1.x, but not at all with any version greater than 1.6). Why these? Well, I think the primary goal of getting the app up and running again was to use the process as a learning opportunity. If I’m using familiar technologies that I’ve used before, or currently during my day job, then it won’t be as much of a learning experience.

    Read more →

  • Back to Windows?

    Crappy photo of the MSi laptop I bought

    About a year ago, I bought a Windows laptop so that I could have a non-work computer to use. I thought about getting another Mac (for over 10 years, have been using them for work and home), but I didn’t feel like shelling out how much they’re asking for the newer MacBook Pros. So I started looking at Windows laptops for their power, but also the ability to play games that aren’t available on Macs. I bought an MSi laptop, and it’s mostly succeeded as becoming a fill in for the Macs I’m used to.

    However, getting things exactly like I’m used to has been a bit of a struggle. I was happily surprised at the software ecosystem for Windows, but still there were a couple of hiccups. Some applications and tools can be quickly installed with the Chocolately package manager. Thankfully, many of the other tools I normally use have a Windows version, like Visual Studio Code, 1Password, SimpleNote, and others.

    The one thing that’s not quite set up how I would like it is the more Unix-y tools I’m used to, like Vim, Ruby, Node.js, Git, ssh, and others. There are some packages available from Chocolately for these, but PowerShell isn’t bash, so getting all these tools working together how I’m used to is still a work in progress.

    There are also some neat new features in Windows, like the Windows Subsystem for Linux, that I’m eager to play around with a bit more. Hopefully, details about things like that will end up as blog posts as well.

  • Making my own sketchbooks

    Some of the sketchbooks that I have made so far

    Since I’ve been sketching more the last few years, it sometimes seems like I’m always searching for the next sketchbook to buy. I’ve been a huge fan of the different sizes of the Stillman & Birn Alpha sketchbooks, but I thought it could be fun to make some sketchbooks of my own.

    When I started looking for some bookbinding tutorials, I came across Sea Lemon’s videos on YouTube, and specifically her simple saddle stitch bookbinding tutorial. That definitely seemed like something I could pull off. Plus, it didn’t seem like the supplies for those kinds of books would set me back too much.

    Read more →

  • Stopping CNN's autoplaying videos with a Chrome extension

    Even though I have uninstalled Flash and checked all the appropriate settings in Chrome, CNN still seems to be able to get its videos to start playing whether I want them to or not (I don’t). And because of this, I decided I’d like to give building a Chrome extension a try in order to stop those videos from autoplaying.

    I realize there may be other Chrome extensions out there (like Disable HTML5 Autoplay), but I want something very simple and something I can update as needed. I don’t want to disable videos across the whole web. For the moment, I just want to focus on CNN, and maybe BBC News.

    Read more →

  • Setting up SSL/HTTPS with Let's Encrypt for kindofblue.com

    With an upcoming version of Firefox set to warn users when they’re browsing on a site without SSL encryption enabled, I figured it wouldn’t hurt to get it all set up for this domain - kindofblue.com - as an experiment. I knew that with Let’s Encrypt, the SSL certificates are free. It just requires a bit of work to get them set up.

    Luckily, at DigitalOcean - where I host this site/domain - they have this handy guide for getting HTTPS set up with LetsEncrypt (for Ubuntu Linux). Since I’m using the same HTTP server (nginx), I was able to follow along without needing any extra help.

    I did have to adjust my DNS setup at Namecheap, since I had a wildcard (*) catch-all domain record. Once all I had was my necessary DNS entries (minus the wildcard), I followed along with the instructions pretty much as given.

    Read more →

  • How I'll build the new Lists of Bests

    When Lists of Bests launched in 2003 (see previous post), the site consisted of a few Perl scripts and maybe an external CSS file. I don’t think I used a bit of JavaScript on the site at all, and my design skills were less than competant.

    Despite all that, the site did quite well. I can’t recall the total number of users I had on the site at the time I sold it to the Robot Co-op, but it was maybe a few thousand. And that was many more than I had ever expected. All in all, I considered the project a success.

    The web development landscape has changed quite a bit since that time, and I have some new decisions to make, when it comes to how I’m going to put the site back together again. I suppose using Perl again is an option, but I’ve forgotten everything about that language.

    I think for the second version (well, third, if you count Robot Co-op’s version) of the site, I’m going to split the front-end and the back-end into separate pieces. That’s how we build things at work and it seems to work well. So, given that, I needed to make a decision on which direction to go.

    For the back-end, I was wondering if I should go with a JavaScript server like Express, or stick with what I know and use Ruby on Rails, and specifically using the new-ish Rails API-only functionality.

    On the front-end, I was a bit less sure. I’ve already built a small React application, but at work I’ve primarily worked with Angular. At this point, I’d say I’m probably a bit more proficient with Angular, but I’d like to attempt a larger project with React. And then there’s also Vue.js, which looks interesting and has gained a lot of steam lately.

    In the end, based on experience and ability to find online documentation and examples, I think I’m going to go with React for the front-end, and Rails for the back-end. I think I’ll be able to spin something up quicker with these than with any other technology.

    Finally, for the original I stored all the data in the MySQL database, but I’ve been working with PostgreSQL the last six or so years, and I’m a little more comfortable with it.

  • Bringing back an old friend

    I have a crazy idea. It may even be a bad idea.

    I’m going to try and bring Lists of Bests back from the dead.

    If you don’t know what I’m talking about, here’s the story. Back in early 2003, I had an idea for a website where you could keep track of books you’ve read, films you’ve seen, and albums you’ve listened to that happened to be on a list of greats (think The Academy Awards, the Pulitzer Prize list, etc). The result was Lists of Bests. It started out with maybe 10 lists, but over the years grew to over 30 lists of all kinds.

    Then in 2006, I sold the domain and the site to the Robot Co-op group (old blog post), and they added a lot of neat features to the site and integrated it with their other properties. It was in good hands, and they kept it running for many years.

    But at a certain point in the last decade, the Robot Co-op - and Lists of Bests - ceased to exist.

    Now, flash forward to a few weeks ago when Namecheap had a sale on domain name registration, where .org sites were only a few dollars to register for a year. On a whim, I picked up listsofbests.org (the .com domain seems to have fallen into hands trying to make a buck), and thought I’d try and bring the site back up… in a way. I guess the big question is this: why?!

    I think it will be a good chance to a) learn something new, and b) give me something to write about here on the weblog. There are still many unanswered questions about this endeavour, but I’m going to give it a decent attempt. I don’t think it will end up being a fully functional site at the level it was before, but it could end up as a neat proof of concept. We’ll have to see where it goes.

    I’ll likely be sharing the code, and I’ll definitely keep track of progress here on the blog. But who knows what I’ll end up with in the end. It could be fun, right? Wish me luck.

  • I think I'm going to like this book

    Today I picked up Charles Stross’ 2004 book The Atrocity Archives from the library. So far, I’ve only read the introduction, but I really think I’m going to like this book. Here’s a small bit from Ken McLeod’s intro:

    It is Charlie’s experience in working in and writing about the Information Technology industry that gives him the necessary hands-on insight into the workings of the Laundry. For programming is a job where Lovecraft meets tradecraft, all the time. The analyst or programmer has to examine documents with an eye at once skeptical and alert, snatching and collating tiny fragments of truth along the way. His or her sources of information all have their own agendas, overtly or covertly pursued. He or she has handlers and superiors, many of whom don’t know what really goes on at the sharp end. And the IT worker has to know in their bones that if they make a mistake, things can go horribly wrong. Tension and cynicism are constant companions, along with camaraderie and competitiveness. It’s a lot like being a spy, or necromancer. You don’t get out much, and when you do it’s usually at night [emphasis mine].

    Previously, I’ve read Stross’ book Accelerando and liked it. But this book, and the ones that follow it in the “Laundry Files” series, have come up a few times in reading up on some other books I’ve been reading recently.

    So, I was really looking forward to this book after reading that intro, and then I saw the book’s subjects in the front pages.

    1. Geeks (Computer enthusiasts)–Fiction. 2. Intelligence service–Fiction. 3. Office politics–Fiction. 4. Great Britain–Fiction. 5. Demonology–Fiction. 6. Monsters–Fiction. 7. Nazis–Fiction.

    Yeah, I think this is going to be good.