diff --git a/src/posts/project-el/index.org b/src/posts/project-el/index.org index a606a4c..6537b30 100644 --- a/src/posts/project-el/index.org +++ b/src/posts/project-el/index.org @@ -102,3 +102,69 @@ You can setup the emacs package in spacemacs with: ))) ;; ... #+end_src + +The full current code should be easy to follow if you have basic notions +of eLISP: + +#+begin_src elisp +(require 'projectile) + +(defvar auto-load-project/trusted-gpg-key-fingerprints + '() + "The list of GPG fingerprint you trust when decrypting a gpg file. +You can retrieve the fingerprints of your own private keys +with: `gpg --list-secret-keys' (take care of removing the +spaces when copy/pasting here)") + +(defun auto-load-project/get-sign-key (file) + "Return the fingerprint of they key that signed FILE. + +To sign a file you should used + +`gpg --local-user my@email --output project.el.sig --detach-sign project.el`" + (string-trim-right + (shell-command-to-string + (concat + (format "gpg --status-fd 1 --verify %s.sig %s 2>/dev/null " file file) + "|grep VALIDSIG" + "|awk '{print $3}'")))) + +(defun auto-load-project/trusted-gpg-origin-p (file) + "Return non-nil if the FILE is encrypted with a trusted key." + (member (auto-load-project/get-sign-key file) + auto-load-project/trusted-gpg-key-fingerprints)) + +(defconst auto-load-project/project-file "project.el" + "Project configuration file name.") + +(defvar auto-load-project/loaded-projects (list) + "Projects that have been loaded by `auto-load-project/load'.") + +(defun auto-load-project/load () + "Loads the `auto-load-project/project-file' for a project. +This is run once the project is loaded signifying project setup." + (interactive) + (when (projectile-project-p) + (lexical-let* ((current-project-root (projectile-project-root)) + (project-init-file (expand-file-name auto-load-project/project-file current-project-root)) + (project-sign-file (concat project-init-file ".sig"))) + (when (and (not (member current-project-root auto-load-project/loaded-projects)) + (file-exists-p project-init-file) + (file-exists-p project-sign-file) + (auto-load-project/trusted-gpg-origin-p project-init-file)) + (message "Loading project init file for %s" (projectile-project-name)) + (condition-case ex + (progn (load project-init-file) + (add-to-list 'auto-load-project/loaded-projects current-project-root) + (message "%s loaded successfully" project-init-file)) + ('error + (message + "There was an error loading %s: %s" + project-init-file + (error-message-string ex)))))))) + +(add-hook 'find-file-hook #'auto-load-project/load t) +(add-hook 'dired-mode-hook #'auto-load-project/load t) + +(provide 'auto-load-project) +#+end_src diff --git a/src/posts/troll-2/index.org b/src/posts/troll-2/index.org index 0293f18..20821d8 100644 --- a/src/posts/troll-2/index.org +++ b/src/posts/troll-2/index.org @@ -47,7 +47,7 @@ So much you can only find them not terrorizing but funny and ridiculous. #+CAPTION: One goblin during the introduction scene of Troll 2 #+NAME: fig:troll-2-intro #+ATTR_HTML: A goblin -[[./troll-2/Troll-2-intro.jpg]] +[[./Troll-2-intro.jpg]] Soon after that, you realize the acting of all actors is extremely bad. In fact, it is so bad, you might not believe me how bad it is. @@ -58,7 +58,7 @@ Apparently all actor were amateurs, it was their first and last movie. #+CAPTION: One particularly terrible acting scene #+NAME: fig:bad-acting #+ATTR_HTML: A bad acting demonstration -[[file:troll-2/bad-acting.png]] +[[file:bad-acting.png]] The dialog are, really something... For example the expression "clusters of hemorrhoid" is used in a non ironic @@ -86,7 +86,7 @@ It misses the point so bad, that the irony still make it funny. #+CAPTION: Our hero save the day by urinating on the table. His family is frozen for 30s said grandpa, they were for 70s. #+NAME: fig:prevent-eating #+ATTR_HTML: Eliott prevents his family to eat the food by urinating on the table -[[./troll-2/prevent-eating-scene.jpg]] +[[./prevent-eating-scene.jpg]] Of course, the very last scene is a classical so terrible cliché. To let you close the experience in awe. @@ -105,20 +105,21 @@ Still, it was quite entertaining. :END: What is really interesting though is that I really enjoyed the watch. -It was so bad, that can't enter in the movie. -You analyze the movie, and see all mistakes and notice everything wrong +It was so bad, that I couldn't enter in the movie. +I analyzed the movie, and saw all its failures and noticed everything wrong about it. -And this is really fun. +In the end, the experience was still quite enjoyable. For example, there are some attempts at humor, but almost all of them fail terribly. -And so, you can laugh at how much it failed. +I didn't laugh about the joke, but I did nonetheless by thinking about how +bad that joke was. -Once going to imdb, I discovered I wasn't alone in loving that terrible +Once going to [[https://www.imdb.com/title/tt0105643/][imdb]], I discovered I wasn't alone in loving that terrible movie. Now, I don't know if I should give that movie a 1 or 2 stars or 8 to 9 stars because it was so entertaining. -But I learned a few nice anecdotes about that movie. +Since then, I learned a few anecdotes about that movie. It was realized in America by Claudio Fragasso who didn't speak fluent English. @@ -142,3 +143,7 @@ that he had no idea what was happening around him, and that his disturbed “performance” in the film was not acting”. #+end_quote +Also that movie is so bad, there is a documentary about that movie named: +[[https://www.imdb.com/title/tt1144539]["Best Worst Movie"]]. + +