Saturday, July 27, 2019

Tuesday, July 16, 2019

directory is in windows path, but program is not found from console

Check if the path variable contains quotes ("). There should be no quotes in the value of PATH.

Monday, July 15, 2019

emacs vc-dir hide unregistered files

(add-hook 'vc-dir-mode-hook 'my-vc-dir-mode-hook)

(defun my-vc-dir-mode-hook ()
  (local-set-key (kbd "d") 'vc-diff)
  (local-set-key (kbd "0") (lambda ()
                             (interactive)                             
                             (vc-dir-hide-state 'unregistered))))

Friday, July 12, 2019

fix character encoding for utf-8 (elisp)

(let ((chars '(("ú" . "ú")
               ("á" . "á")
               ("í" . "í")
               ("ó" . "ó")
               ("é" . "é"))))
  (dolist (char chars)
    (save-excursion
      (goto-char (point-min))
      (while (search-forward (car char) nil t)
        (replace-match (cdr char) t)))))

Thursday, July 11, 2019

Fix for old android cannot connect to some https sites (no secure connection)

Download opera mini and use that. It uses its own network, so it can connect to those sites.

install app to old android without google play

Look up the relevant apk version on apkmirror, download it and tap on it on the phone. Previously you need to enable installing apps from unknown sources in settings.

Wednesday, July 10, 2019

Fix for slow Emacs I/O on Windows

Check your antivirus software if you have one. It may interfere with what Emacs is doing.

Thursday, July 4, 2019

javascript render html to text with jquery

// create an element where the html content as the string
$('<div/>', {
  html: htmltext
// get text content from element for decoded text  
}).text()