Still progress

This commit is contained in:
Yann Esposito (Yogsototh) 2019-07-13 23:30:59 +02:00
parent 8cf013bfb0
commit 2525d63244
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
5 changed files with 152 additions and 77 deletions

View File

@ -4,5 +4,5 @@
#+begin_archive
@@html:<li>@@ @@html:<span class="archive-item"><span class="archive-date">@@ 2019-07-12: @@html:</span>@@ [[file:posts/draft-professional-lessons-and-opinions.org][Professional Lessons and Opinions]] @@html:</span>@@ @@html:</li>@@
@@html:<li>@@ @@html:<span class="archive-item"><span class="archive-date">@@ 2019-07-05: @@html:</span>@@ [[file:posts/2019-07-04-org-publish.org][org-publish]] @@html:</span>@@ @@html:</li>@@
@@html:<li>@@ @@html:<span class="archive-item"><span class="archive-date">@@ 2019-07-07: @@html:</span>@@ [[file:posts/2019-07-04-static-org-publish.org][Static blog with org-mode]] @@html:</span>@@ @@html:</li>@@
#+end_archive

View File

@ -6,13 +6,25 @@ body {
font-family: menlo, monospace;
font-size: 15px;
line-height: 20px;
max-width: 50em;
margin: 0 auto;
margin: 0;
padding: 0;
border: 0;
hyphens: auto;
-webkit-hyphens: auto;
-moz-hyphens:auto;
-ms-hyphens:auto;
}
#preamble,#postamble {
opacity: 0.5;
}
#preamble:focus,#postamble:focus,
#preamble:hover,#postamble:hover {
opacity:1;
}
#content,.content {
max-width: 50em;
margin: 0 auto;
}
h1, h2, h3, h4, h5, h6,
pre, code, blockquote, ol, ul,
@ -48,7 +60,6 @@ hr {
line-height: 0;
overflow: hidden;
border: 0;
margin: 20px 0;
}
hr:after {
content: "----------------------------------------------------------------------------------------------------";
@ -117,32 +128,49 @@ ol > li:before {
/* colors */
img { max-width: 100%;
max-height: 800px;
margin: 20px auto; }
footer { font-size: 0.8em; opacity: 0.5; }
footer:hover { opacity: 1; }
navigation { font-weight: bold;
font-family: menlo, monospace;
}
navigation a { display: inline-block;
padding: .5ex 1ex;
margin-right: 1em;
}
.article-date { opacity: 0.5; font-size: 0.8; }
table { width: 100%;
margin: 20px 0;
border-collapse: collapse;
border: solid 1px; }
td, th { height: 20px;
padding: 0 10px;
text-align: left;
vertical-align: middle;
border-right: solid 1px;
border-left: solid 1px;
}
img {
max-width: 100%;
max-height: 800px;
margin: 20px auto;
}
footer {
font-size: 0.8em;
}
.article-date {
opacity: 0.5;
font-size: 0.8;
}
table {
width: 100%;
margin: 20px 0;
border-collapse: collapse;
border: solid 1px;
}
td, th {
height: 20px;
padding: 0 10px;
text-align: left;
vertical-align: middle;
border-right: solid 1px;
border-left: solid 1px;
}
navigation {
font-weight: bold;
font-family: menlo, monospace;
display: block;
margin: 0 0 20px 0;
}
navigation > a {
margin-right: 10px;
}
.footpara { display: inline; }
.footdef > sup {
font-size: 16px;
vertical-align: middle;
}
.footdef > sup::after {
content: ": ";
}
/* colors
$base03: #002b36;

View File

@ -1,5 +1,4 @@
#+TITLE: Welcome!
#+DATE: 2019-07-04
#+KEYWORDS: programming
#+AUTHOR: Yann Esposito
#+EMAIL: yann.esposito@gmail.com
@ -7,6 +6,7 @@
#+LANGUAGE: en
#+LANG: en
#+OPTIONS: H:5
#+STARTUP: showeverything
This is a new take on my personal blog.
I tried to have some minimalism in mind but not too much.
@ -27,7 +27,7 @@ With [[http://orgmode.org][org-mode]]
You can have a basic demo about most supported content styles/type (paragraphs,
lists, tables, etc...) [[file:./demo.org][here]].
* Code magic :noexport:
* Code magic :noexport:
#+begin_src elisp :results none
(require 'org)
(require 'ox-publish)
@ -37,8 +37,8 @@ lists, tables, etc...) [[file:./demo.org][here]].
(defun org-blog-prepare (project-plist)
"With help from `https://github.com/howardabrams/dot-files'.
Touch `index.org' to rebuilt it.
Argument `PROJECT-PLIST' contains information about the current project."
Touch `index.org' to rebuilt it.
Argument `PROJECT-PLIST' contains information about the current project."
(let* ((base-directory (plist-get project-plist :base-directory))
(buffer (find-file-noselect (expand-file-name "index.org" base-directory) t)))
(with-current-buffer buffer
@ -52,22 +52,27 @@ lists, tables, etc...) [[file:./demo.org][here]].
"<link rel=\"alternative\" type=\"application/rss+xml\" title=\"Subscribe to articles\" href=\"/archives.xml\" />"
"<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\">"))
(defun org-blog-preamble (info)
"Pre-amble for whole blog."
(concat
"<strong><code>Her.esy.fun"
(when-let ((date (get-from-info info :date)))
(format " - <span class=\"article-date\">%s</span>" date))
"</code></strong>"))
(defun menu ()
"Blog menu"
(concat
"<navigation>"
"<a href=\"/\">Home</a>"
"<a href=\"/archive.html\">Posts</a>"
"<navigation id=\"menu\">"
(mapconcat 'identity
'("<a href=\"/index.html\">Home</a>"
"<a href=\"/archive.html\">Posts</a>"
"<a href=\"#preamble\">↑ Top ↑</a>")
" | ")
"</navigation>"))
(defun org-blog-preamble (info)
"Pre-amble for whole blog."
(concat
"<div class=\"content\">"
"<strong><a href=\"/index.html\">Her.esy.fun</a></strong>"
(when-let ((date (get-from-info info :date)))
(format " - <span class=\"article-date\">%s</span>" date))
" - <a href=\"#menu\">↓ menu ↓</a>"
"</div>"))
(defun get-from-info (info k)
(let ((i (car (plist-get info k))))
(when (and i (stringp i))
@ -75,26 +80,30 @@ lists, tables, etc...) [[file:./demo.org][here]].
(defun org-blog-postamble (info)
"Post-amble for whole blog."
(concat "<footer>"
(when-let ((author (get-from-info info :author)))
(if-let ((email (plist-get info :email)))
(format "<div class=\"author\">Author: <a href=\"mailto:%s\">%s</a></div>" email author)
(format "<div class=\"author\">Author: %s</div>" author)))
(when-let ((date (get-from-info info :date)))
(format "<div class=\"date\">Created: %s</div>" date))
(when-let ((keywords (plist-get info :keywords)))
(format "<div class=\"keywords\">Keywords: <code>%s</code></div>" keywords))
(format "<div class=\"date\">Generated: %s</div>"
(format-time-string "%Y-%m-%d %H:%M:%S"))
(format (concat "<div class=\"creator\"> Generated with "
"<a href=\"https://www.gnu.org/software/emacs/\" target=\"_blank\" rel=\"noopener noreferrer\">Emacs %s</a>, "
"<a href=\"http://spacemacs.org\" target=\"_blank\" rel=\"noopener noreferrer\">Spacemacs %s</a>, "
"<a href=\"http://orgmode.org\" target=\"_blank\" rel=\"noopener noreferrer\">Org Mode %s</a>"
"</div>")
emacs-version spacemacs-version org-version)
"</footer>"
"<hr/>"
(menu)))
(concat
"<div class=\"content\">"
"<footer>"
"<hr/>"
(when-let ((author (get-from-info info :author)))
(if-let ((email (plist-get info :email)))
(format "<div class=\"author\">Author: <a href=\"mailto:%s\">%s</a></div>" email author)
(format "<div class=\"author\">Author: %s</div>" author)))
(when-let ((date (get-from-info info :date)))
(format "<div class=\"date\">Created: %s</div>" date))
(when-let ((keywords (plist-get info :keywords)))
(format "<div class=\"keywords\">Keywords: <code>%s</code></div>" keywords))
(format "<div class=\"date\">Generated: %s</div>"
(format-time-string "%Y-%m-%d %H:%M:%S"))
(format (concat "<div class=\"creator\"> Generated with "
"<a href=\"https://www.gnu.org/software/emacs/\" target=\"_blank\" rel=\"noopener noreferrer\">Emacs %s</a>, "
"<a href=\"http://spacemacs.org\" target=\"_blank\" rel=\"noopener noreferrer\">Spacemacs %s</a>, "
"<a href=\"http://orgmode.org\" target=\"_blank\" rel=\"noopener noreferrer\">Org Mode %s</a>"
"</div>")
emacs-version spacemacs-version org-version)
"<hr/>"
"</footer>"
(menu)
"</div>"))
(defun org-blog-sitemap-format-entry (entry _style project)
"Return string for each ENTRY in PROJECT."
@ -194,4 +203,3 @@ lists, tables, etc...) [[file:./demo.org][here]].
'my-org-export-add-target-blank-to-http-links)
#+end_src

View File

@ -6,15 +6,13 @@
This is the first article using my new blog system.
Each time I try different things.
Once in a while, I create a new personal website.
A long time ago, I used PHP for my first website.
I used include and took care of XHTML pages validation.
Then I used [[http://nanoc.ws][nanoc]], a ruby static website.
Then I switched to [[https://jaspervdj.be/hakyll/][hakyll]] because I wanted to switch to a Haskell's written tool.
Now I'll try to use emacs [[http://orgmode.org][org-mode]].
So the article is a classical, Why?, How?
Then I used [[http://nanoc.ws][nanoc]], a ruby static website generator.
Then I switched to [[https://jaspervdj.be/hakyll/][hakyll]] because I wanted to switch to a Haskell's written
tool.
Now I'll try to use [[http://orgmode.org][org-mode]].
* Why?
@ -28,8 +26,8 @@ Then I started to work in Clojure and I heard that emacs might certainly be a
better fit for LISP dialiects.
But, I couldn't switch to an editor without vim keybindings support because they
are so great once you're used to them.
But miracle it was about the time [[http://spacemacs.org][spacemacs]] appeared and I switched.
It was really impressive how well the vim keybindings worked so well.
By chance it was about the same time that [[http://spacemacs.org][spacemacs]] appeared and I switched.
Is is really impressive how well the vim keybindings are supported.
Even most of the advanced vim features I used to use worked like a charm.
The first benefit of emacs is you can configure emacs with elisp.

View File

@ -5,15 +5,56 @@
#+KEYWORDS: programming, blog, org-mode
#+DESCRIPTION: Different divagations about my experiences in the professional world of Software Developper
* Technical Choices
#+begin_comment
How to choose a programming language/paradigm to write with.
- programming is about making the program do what you want it to do.
- not much told, lot harder, and not as natural/intuitive; a program should not
do something you do not want it to do.
- programming paradigms, functional is superior because it better fit all
real-life scenarios.
- in Machine Learning, Kolmogorov complexity. Object Oriented is worse than
Functional programming to represent naturally many real life problems.
What did I learned? Is it a set of specific knowledges or can we discover great
common principles?
- restart from zero, tabula rasa, what is programming?
#+end_comment
I could talk to much about that.
But a few short written down lessons.
If you want to reach productivity and not necessarily enlightenment.
You have to stop learning and use what you know well.
And do not try to use things you don't know.
In particular, most programming languages/ide/workflow/utils/tools have basic
and advanced features.
If want want to produce and deliver in time. Your best bet is to limit yourselve to
a minimal set of features that give you enough power of combination instead of
looking for a super generic strong solution.
Clojure for example has:
- functions
- higher-level functions
- destructuring
- defmethods
- protocols
- macros
- atoms, agents, core.async
- Java FFI
In fact, writing a fully working app you only need, basic data structure (edn) and functions.
That's it.
I was part of a team that created an advanced full featured app using only those.
No magic, just taking care of the state and not writting spaggethi code.
* How I choose
- Functional programming is superior to imperative and object oriented
languages