This commit is contained in:
Yann Esposito (Yogsototh) 2019-12-23 00:01:06 +01:00
parent c9965904a0
commit 5be92b888d
11 changed files with 71 additions and 56 deletions

View File

@ -1,16 +1,8 @@
#!/usr/bin/env bash
echo "* org-publish"
emacs \
--load project.el \
--eval "(progn (org-publish \"blog\" t) (evil-quit))"
--eval "(progn (org-publish \"blog\") (evil-quit))"
echo "Optim HTML size"
./optim-html.sh
echo "Gen themes clones"
./dup-for-themes.sh
echo "Building RSS"
./mkrss.sh
echo "Optim Classes accross CSS/HTML"
./optim-classes.sh
echo "Update file size"
./update-file-size.sh
echo "* org-publish [done]"

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
echo -n "* Clean site cache"
rm -rf _site
rm -rf _cache
./build.sh
echo " [done]"

View File

@ -3,8 +3,7 @@
rootdir=${0:h}
echo $rootdir
echo "Full Build"
./fullbuild.sh
echo -n "Publishing"
./clean.sh
./build.sh
./pre-deploy.sh
./sync.sh
echo " [done]"

View File

@ -20,6 +20,7 @@ trans(){
cat $fic | perl -p -e 's#href="?/css/mk.css"?#href=/css/'$suff'.css#;s#(/?(index|archive|slides|about-me)).html#$1-'$suff'.html#g;s#(posts/[a-zA-Z0-9_-]*).html#$1-'$suff'.html#g;s#-'$suff'.html>mk#.html>mk#g' > ${fic:r}-${suff}.html
}
print -- "Duplicate HTML by themes"
for fic in $filelist; do
if echo $fic|egrep -- '-(mk|min|sci|modern).html$'>/dev/null; then
continue
@ -30,3 +31,4 @@ for fic in $filelist; do
done
print "[OK]"
done
print "Duplicate HTML by theme [done]"

View File

@ -122,4 +122,4 @@ END
} > "$rssfile"
rm -rf $tmpdir
echo "RSS Generated"
echo "* RSS [done]"

12
pre-deploy.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
echo "Optim HTML size"
./optim-html.sh
echo "Gen themes clones"
./dup-for-themes.sh
echo "Building RSS"
./mkrss.sh
echo "Optim Classes accross CSS/HTML"
./optim-classes.sh
echo "Update file size"
./update-file-size.sh

View File

@ -334,10 +334,9 @@ body,.main {
color: var(--fg);
min-height: 100vh;
}
::selection, .main ::selection,
::-moz-selection, .main ::-moz-selection {
::selection, .main ::selection {
color: white;
background: var(--b);
background: var(--v);
}
a, a:visited,
.main a, .main a:visited {

View File

@ -1,5 +0,0 @@
#! /usr/bin/env nix-shell
#! nix-shell -i runghc
#! nix-shell -p "ghc.withPackages (ps: [ ps.protolude ])"
#! nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz"
main = putStrLn "Hello World!"

View File

@ -50,13 +50,17 @@ But a few things have changed in the Haskell world.
But you must understand that there is not really any central mindset
within Haskeller unlike I can find in some other programming language
communities.
4. Haskell has become a lot more serious programming language now.
There are a lot more big projects written in Haskell not just toy projects.
4. I think that Haskell is now perceived as a lot more serious programming
language now.
There are a lot more big projects written in Haskell not just toy
projects.
Thus Haskell as proved that it can be considered to write succesful
complex entreprise projects.
Also I myself have certainly matured on my take on Haskell.
I am paid to work in Clojure since 2013 now, and most of my personal side
project are written either in Haskell or in Purescript (an Haskell inspired
language mostly focused on frontend development).
While the ecosystem evolved I believe that I myself have certainly matured.
Since 2013 I am paid to develop in Clojure.
Most of my personal side project are written in Haskell or in an
Haskell-inspired language.
As such I can follow two functional programming communities growth and
evolution.
@ -64,16 +68,17 @@ I am kind of confident that my Haskell understanding is a lot better than
before.
But I still think, the ability to learn new Haskell subject is infinite.
I want someday to write an article about my team philosophy about how we
program.
Mostly, our rule is to use as few features of a programming language as
One article I would like to write someday is about my current team
philosophy about programming.
Our main rule is to use as few features of a programming language as
possible to achieve your goal.
This is a kind of merge between minimalism and pragmatism that in the end
provide a tremendous amount of benefits.
This is why, even if I like to try the latest trend/hype in Haskell.
I generally program without those latest nice features because, with just a
very few amount of Haskell features you will already be in enviromnent with
a *lot* of benefits as compared to other programming languages ecosystem.
This is why, even if I like to play with the latest Haskell trendy feature,
I generally program without those.
With just a very few amount of Haskell features you will already be in
enviromnent with a *lot* of benefits as compared to many programming
languages.
So enough talk, here is my old article new again, with just a few changes
and cleanup.
@ -84,11 +89,16 @@ Be it a simple command line tool or a web application.
If you are going toward GUI programming, this is a whole subject on its own
and I do not really mention it.
My .02 for "Single Page Application" is to use Purescript with the halogen
framework.
My .02 for "Single Page Application" choice is to use Purescript with the
halogen framework.
Purescript is really awesome as well as halogen.
#+end_quote
* Introduction
:PROPERTIES:
:CUSTOM_ID: introduction
:END:
I really believe that every developer should learn Haskell.
I don't think every dev needs to be a super Haskell ninja, but they should
at least discover what Haskell has to offer.
@ -155,10 +165,6 @@ The article contains five parts:
- More on infinite tree; a more math oriented discussion about
infinite trees
* Introduction
:PROPERTIES:
:CUSTOM_ID: introduction
:END:
** Install
:PROPERTIES:
@ -185,7 +191,6 @@ The environment in which you will learn Haskell will be quite different
from an environment to use Haskell seriously for a new project.
This is because, there are too much choices for that.
Mainly, you can start by writing your code in a file and executing it by
putting one of the following at the top of your file:
@ -210,20 +215,33 @@ If you chose Stack: https://haskellstack.org
-}
#+END_EXAMPLE
*** code :noexport:
In this article most code block can be downloaded, it will have the =nix=
shebang.
So the first time you'll launch this script it will download all
dependencies for you and will start its execution.
The next time it should start a lot faster.
*** code :noexport:
:PROPERTIES:
:CUSTOM_ID: code
:END:
#+begin_src elisp :eval yes
(defun nixb ()
"#! /usr/bin/env nix-shell\n#! nix-shell -i runghc\n#! nix-shell -p \"ghc.withPackages (ps: [ ps.protolude ])\"\n#! nix-shell -I nixpkgs=\"https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz\"")
(defun nixb ()
(mapconcat 'identity
'("#! /usr/bin/env nix-shell"
"#! nix-shell -i runghc"
"#! nix-shell -p \"ghc.withPackages (ps: [ ps.protolude ])\""
"#! nix-shell -I nixpkgs=\"https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz\"")
"\n"))
#+end_src
#+RESULTS:
: nixb
#+MACRO: lnk @@html:<a href="$1" target="_blank">$1 ⤓</a>@@
#+MACRO: lnk @@html:<a href="$1" style="float:right" target="_blank">$1 ⤓</a>@@
** Don't be afraid
:PROPERTIES:
@ -241,7 +259,7 @@ to the mandatory "Hello World".
{{{lnk(hello.hs)}}}
#+BEGIN_SRC haskell :tangle hello.hs :shebang '(nixb)
main = putStrLn "Hello World!"
main = putStrLn "Hello World!"
#+END_SRC
#+BEGIN_EXAMPLE
@ -259,7 +277,7 @@ Hello World!
Now, a program asking your name and replying "Hello" using the name you
entered:
#+NAME: name.hs
{{{lnk(name.hs)}}}
#+BEGIN_SRC haskell :tangle name.hs :shebang '(nixb)
main = do
print "What is your name?"

4
src/posts/0010-Haskell-Now/name.hs Executable file → Normal file
View File

@ -1,7 +1,3 @@
#! /usr/bin/env nix-shell
#! nix-shell -i runghc
#! nix-shell -p "ghc.withPackages (ps: [ ps.protolude ])"
#! nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz"
main = do
print "What is your name?"
name <- getLine

View File

@ -3,4 +3,6 @@
rootdir=${0:h}
echo $rootdir
echo -n "Uploading website"
rsync --progress --partial -avHe ssh $rootdir/_site/ root@esy.fun:/var/www/her.esy.fun/ --delete
echo " [done]"