Brad Lucas

Programming, Clojure and other interests

Increase Your Macbook Pro's Display Resolution

October 9, 2017

It turns out your Retina MacBook Pro 15" can run beyond the resolutions offered in it's System Preferences. In researching this fact I found that there are a number of third-party utilities that can be used to go beyond your Mac's offered resolutions.

The following utility from avibrazil is a good one and I recommend it. I've been using it for a few days and it works flawlessly with my MacBook as well as an external display.

The first link is to the project itself and the second link is the installable binary dmg file.

Continue reading →

Remove Siri From Touch Bar On A New Macbook Pro

October 8, 2017

I don't use Siri and on a new MacBook I hit the Siri button far too often as it is just about the Delete key. Here is how to remove the Siri button from the Touch Bar

  • System Preferences
  • Keyboard
  • Customize Control Strip

Notice your Control Strip will be wiggling Hold the Siri button and notice the Done button change to a Trash Can Drage and drop the Siri button to the Trash

Click Done

Continue reading →

Auto Increment Key In Postgresql

October 7, 2017

In MySql and MariaDB you can create a unique identity value for rows with the AUTO_INCREMENT attribute. PostgreSQL has the same idea with the SERIAL attribute.

CREATE TABLE domains
(id SERIAL PRIMARY KEY,
 name VARCHAR(254) UNIQUE,
 timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW()
 );
 

The example also shows how to have a column which stores the time when the record was created.

Continue reading →

Install PostgreSQL On A Mac Using Brew

October 6, 2017

To install Postgres on a Mac you can use brew.

$ brew update
$ brew install postgres

To create a database for yourself and login.

$ createdb `whoami`
$ psql
Continue reading →

Clojure Ads Txt Crawler Saving To A SQLite Database

October 5, 2017

SQLite is a small self contained SQL database engine that reads and writes to a normal file. It is a good first pass for adding database storage to your application. It's easy to use and with a single file to deal with offers no real issues. Being a SQL database though means you won't be far off if you decide to up your database requirements to Postgres or some other database system.

My recent project of building a Clojure Ads.txt file crawler is a good target for SQLite support for a couple reasons. One is that the project is simple and works just fine writing to result files but having a database would be good in the long term especially as the project grows. Second is that the original Python Ads.txt file crawler defaulted to writing to a SQLite database. I figure the Clojure project should at the very least be able to do the same.

The results of adding SQLite are in the repository if you are curious.

Continue reading →