Plurrrr

week 15, 2019

Finding hexadecimal color codes on macOS

Use the Digital Color Meter to find the hexadecimal color code of a specific color on macOS or OS X. The program shows default decimal values. Select "as Hexadecimal" in the "Display Values" submenu available under "View" to obtain hexadecimal values.

Switching the Digital Color Meter to hexadecimal
Switching the Digital Color Meter to hexadecimal.

Looking up user info on macOS

$ dscacheutil -q user -a name john
name: john
password: ********
uid: 501
gid: 20
dir: /Users/john
shell: /bin/bash
gecos: John Bokma

To look up information of all users, use:

dscacheutil -q user

Emacs highlight-regexp

After some playing with font-lock in Emacs I was wondering how to highlight the entire line when it just has a % character on it in Markdown mode. Entire line as in all other columns, with a background color.

So I asked this question at the Emacs StackExchange and very soon got a helpful answer by Tobias which with some additional Googling led to the following solution:

(defface markdown-item-face
  '((t (:background "#364e7a")))
  "Used to highlight %")

(add-hook 'markdown-mode-hook
    (lambda()
        (highlight-regexp
         "^%\n"
         'markdown-item-face)))

Now my blog posts in Emacs are separated by blue bars:

Emacs with highlight-regexp in Markdown mode showing blue bars
Emacs with highlight-regexp in Markdown mode showing blue bars.

Update, update!

I just pushed two updates to the tumblelog repository:

  • A new style has been added: thought-provoking.scss.
  • The label format for week can now be specified via the command line.

The default for the latter is 'week %V, %Y' with %V the ISO 8601 week as a decimal number with an optional leading zero and %Y the four digit year.

Garden centre "De Carlton"

In the afternoon I went with my mother to the garden centre "De Carlton" near to her house. We had a coffee and I took a few photos with my iPhone 5 of the plants on sale.

African daisies (Osteospermum) flowering
African daisies or daisybushes flowering; Osteospermum species.
Moth orchid (Phalaenopsis) flowering
Moth orchid flowering; Phalaenopsis species.
Tillandsia species for sale
Tillandsia species for sale, including Tillandsia ionantha, Tillandsia xerographica, and Tillandsia usneoides.
Treasure flowers (Gazania rigens) flowering
Treasure flowers, Gazania rigens, flowering.
Brachyscome angustifolia flowering
Brachyscome angustifolia flowering.

SEO friendly titles are coming

I just finished an update to the Perl version of tumblelog which makes it possible to give each day page a title. This is more SEO friendly. Tomorrow, I'll port this to the Python version and make both available on GitHub

Emacs font lock

I have been playing with font lock in Emacs and managed to give a specific face to each line starting with an ISO date. I use this in Markdown mode in which I write this blog. I will blog about this on my main blog tomorrow.

More Style

I just pushed another update to of tumblelog. This time I modified both the HTML and SCSS to make styling of a tumblelog easier. I also made the HTML slightly more semantic. Enjoy!

Importing a CSV into MySQL

I helped Paul out with the problem of importing a CSV file created in OpenOffice on Windows into an existing table on MySQL. After some reading I came up with a command similar to:

LOAD DATA LOCAL INFILE
"file.csv"
INTO TABLE tablename
COLUMNS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES;

Note the LINES TERMINATED value, which must be '\r\n' if the file was created on Windows. If on Linux, use just '\n'.

Don't forget the LOCAL otherwise MySQL can't execute the command if running with the --secure-file-priv option.