Setting up Github Actions for Deploying Pelican

Posted on Wed 18 December 2019 in development • Tagged with web, Pelican

Github actions allow me to implement continuous delivery for this blog. Each time I merge to master, jimkubicek.com is built and deployed.

First, this action should run anytime the master branch is updated.

name: Build and Deploy

on:
  push:
    branches: [master]

Now we need to create our deploy steps …


Continue reading

Setting up Let's Encrypt with Nginx

Posted on Fri 13 December 2019 in development • Tagged with web, ssl, server

This blog is a static site generated with Pelican. It's now almost 2020, which means that using https isn't just a good idea, it's pretty-much mandatory. The good news is that setting up Ubuntu, Nginx and Let's Encrypt is incredibly straightforward. Start to finish it only took me a bit …


Continue reading

Creating a Swift Collection

Posted on Mon 16 February 2015 in development • Tagged with swift

Let's say you'd like to create your own collection class. In this example, it's going to be a collection of books that only allow the addition of a new book if it's written by a select list of your favorite authors.

typealias Book = (title: String, author: String)

struct MyCollection {

    private …

Continue reading

Creating a Homebrew formula for a Python project

Posted on Sat 14 February 2015 in development

I just finished writing a homebrew formula for a python script I wrote, I'm going to walk through how I did it. Hopefully this helps anyone else who is thinking about distributing their code.

Why did I use Homebrew and not Pip? Two reasons: first, my code requires some Java …


Continue reading

Amend Files to Previous Commit

Posted on Thu 08 August 2013 in development

I run into this frequently when doing big a big refactor. I'm carefully committing my changes in nice bisectable units, but then Woah! there's a change that should be included in a previous commit. Here's how you fix this up in Git.

Disclaimer: We are modifying Git history. Do not …


Continue reading

Debugging Smashed Memory in Obj-C

Posted on Tue 23 April 2013 in development • Tagged with debugging

We were getting a crash inside a button. Calling po self wasn't helpful.

(lldb) po self
$1 = 0x0ce854d0 [no Objective-C description available]

Well.. That's weird. I wonder what's at that memory location?

(lldb) memory read 0x0ce854d0
0x0ce854d0: 00 00 00 b0 93 6a ce a0 0e 00 00 00 00 …

Continue reading

List Rake Tasks by Default

Posted on Sun 27 January 2013 in development

I add this to all my Rakefiles.

task :default do
  system "rake --tasks"
end

It prints a list of Rake tasks when you run Rake without a command. Not only does it help you remember what options are available in the current project, but it keeps you from accidentally performing …


Continue reading

JSLint: Expected 'return' at column X, not column Y

Posted on Thu 17 January 2013 in development

I've been writing some Javascript using the default settings in Chocolat, tabs instead of spaces and each tab is equivalent to 2 spaces. Running most of my javascript files through JSLint is fine, but there were a few lines that were generating warnings, even though the spacing looked just fine …


Continue reading

When isKindOfClass is not kind of class?

Posted on Tue 16 October 2012 in development

I've been running into an issue over the past few days where [objA isKindOfClass:[ClassA class]] is returning false when clearly objA is a kind of ClassA. I'm running these tests using SenTesting kit and I'm not compiling the .m files in my test target, which is the only issue …


Continue reading

Abusing UIView

Posted on Thu 11 October 2012 in development

Sometimes I long for the day when I get to create an iOS app that just uses Apple's default interface element. Of course, this doesn't last long, because using and abusing UIView is fun. Over the years I've picked up a few tips and tricks for making the most out …


Continue reading

Sort Obj-C Methods with Automator

Posted on Thu 20 September 2012 in development • Tagged with obj-c

Big view controllers in big projects tend to accumulate a lot of private methods and properties. In a perfect world, these methods and properties should be carefully organized into functional groups and carefully documented. In the world we actually live in, that shit doesn't happen, which is why I've resigned …


Continue reading

Open sourcing? Eliminate all warnings

Posted on Thu 06 September 2012 in development

A few months ago Matt Gemmell created a fantastic writeup on creating open-source components. One salient point he missed, though, is that you must compile and test your code with the strictest warnings available. You never know who's going to be using your code and what warnings they have enabled …


Continue reading

Configure git to only push current branch

Posted on Thu 16 August 2012 in development

I've always used plain git push to update my remote repos and I'm finally getting tired of seeing this error every time:

(master)> git push
...
To git@github.com:jkubicek/my_proj.git
   21b430d..dd378ca  master -> master
 ! [rejected]        release -> release (non-fast-forward)
error: failed to push some refs to …

Continue reading

Don't Lazily Load Your Views

Posted on Thu 09 August 2012 in development

I seem to run accross a lot of developers lazily loading their properties. As an example:

- (UILabel *)myTextLabel {
     if (_myTextLabel == nil) {
         _myTextLabel = [[UILabel alloc] init];
         [self addSubview:_myTextLabel];
     }
 }

At least in iOS developement, I suspect this is caused by Apple's sample code, particularly Apple's default setup for Core Data projects …


Continue reading