It’s been a while since I’ve posted. Busy winter break, and just now getting to a place where where I’m on top of things in the new semester. Yesterday, I wanted to get two things done (aside from real work):
- Find some professional Math mailing lists to join.
- Get posting on my blog again, and maybe even work on some of the design elements.
So… any simple task, such as googling Math mailing lists, becomes a beginning programming homework exercise.
I found that I wanted to try about 60 different search phrases, and I found that they all had the same basic form:
I could make a double-nested loop in C… But this is the perfect time to use Haskell list comprehension! So, I made my first ever Haskell program:
Compiling gives an executable called
search_terms returns one search phrase per line (wrapped in quotes for some reason) which I could output to a plain text file and then copy and paste each line into Google.
But why would I go to all that work if I could automate it in Bash!
A while ago, I made a crappy little Bash script that lets me google things from the command line. Here’s an abridged version:
web_search.sh -w "hello world" will search Wikipedia with the search term “hello world”.
It’s a little buggy: I’d like to be able to not wrap the search term in quotes, but that breaks it.
search_terms returns strings pre-wrapped in quotes.
Now, I just have to loop over the lines of
This will open 60 browser windows, each one with a different search phrase.\ That was fun!
It’s been a while since I’ve edited this blog, so I had to relearn some Jekyll basics.
jekyll build and
jekyll serve don’t work the way I expected them to.
jekyll build spits out a version error, in fact.
After some frustration and googling, I relearned that I needed to use Bundler to instance my Ruby environment. This will keep the versions of Ruby and Jekyll I’m using to build my site synchronized with the versions that GitHub Pages is using to build my site. A few of the common commands are recorded below, mostly so I can come back here two months from now when I’ve forgotten everything again:
- Keep Bundler, Jekyll, and Ruby up to date.
- Build site.
- Run local development server.
Okay, now that that’s recorded for posterity, my next project involves some custom Jekyll plugins that GitHub Pages doesn’t support. In order to use them, I’ll need to turn off server-side Jekyll, build my site locally, and push the built site up to GitHub Pages. That’s a project for another day (read: another month).