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 →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 →
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 →It is true that creating branches in Git are easy and cheap so you don't really need to git stash something. But, sometimes you don't want to save something to a branch because you really want it to be a temporary thing so you stash it.
Sometimes though you'll stash something then merge your feature branch and when you git pop conflict the stash back you'll have a conflict.
You'll see "unmerged paths" which is your clue to this situation.
What to do?
Continue reading →The Clojure Ads.txt crawler is working well. Using the top 100 domains list from PPC.land the crawler creates the following results:
accuweather.com
allrecipes.com
ameblo.jp
babycenter.com
babygaga.com
bhaskar.com
businessinsider.com
cbsnews.com
cnet.com
daily.co.jp
dailymail.co.uk
dingit.tv
diply.com
drugs.com
elmundo.es
elpais.com
espn.com
forbes.com
foxnews.com
genius.com
globo.com
healthline.com
howstuffworks.com
latimes.com
littlethings.com
nypost.com
nytimes.com
ranker.com
softonic.com
speedtest.net
theguardian.com
therichest.com
tmz.com
topix.com
uol.com.br
usatoday.com
vice.com
washingtonpost.com
weather.com
webmd.com
wikihow.com