wip
This commit is contained in:
parent
c9965904a0
commit
5be92b888d
11 changed files with 71 additions and 56 deletions
14
build.sh
14
build.sh
|
@ -1,16 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo "* org-publish"
|
||||||
emacs \
|
emacs \
|
||||||
--load project.el \
|
--load project.el \
|
||||||
--eval "(progn (org-publish \"blog\" t) (evil-quit))"
|
--eval "(progn (org-publish \"blog\") (evil-quit))"
|
||||||
|
|
||||||
echo "Optim HTML size"
|
echo "* org-publish [done]"
|
||||||
./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
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo -n "* Clean site cache"
|
||||||
rm -rf _site
|
rm -rf _site
|
||||||
rm -rf _cache
|
rm -rf _cache
|
||||||
|
echo " [done]"
|
||||||
./build.sh
|
|
|
@ -3,8 +3,7 @@
|
||||||
rootdir=${0:h}
|
rootdir=${0:h}
|
||||||
echo $rootdir
|
echo $rootdir
|
||||||
|
|
||||||
echo "Full Build"
|
./clean.sh
|
||||||
./fullbuild.sh
|
./build.sh
|
||||||
echo -n "Publishing"
|
./pre-deploy.sh
|
||||||
./sync.sh
|
./sync.sh
|
||||||
echo " [done]"
|
|
||||||
|
|
|
@ -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
|
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
|
for fic in $filelist; do
|
||||||
if echo $fic|egrep -- '-(mk|min|sci|modern).html$'>/dev/null; then
|
if echo $fic|egrep -- '-(mk|min|sci|modern).html$'>/dev/null; then
|
||||||
continue
|
continue
|
||||||
|
@ -30,3 +31,4 @@ for fic in $filelist; do
|
||||||
done
|
done
|
||||||
print "[OK]"
|
print "[OK]"
|
||||||
done
|
done
|
||||||
|
print "Duplicate HTML by theme [done]"
|
||||||
|
|
2
mkrss.sh
2
mkrss.sh
|
@ -122,4 +122,4 @@ END
|
||||||
} > "$rssfile"
|
} > "$rssfile"
|
||||||
|
|
||||||
rm -rf $tmpdir
|
rm -rf $tmpdir
|
||||||
echo "RSS Generated"
|
echo "* RSS [done]"
|
||||||
|
|
12
pre-deploy.sh
Executable file
12
pre-deploy.sh
Executable 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
|
|
@ -334,10 +334,9 @@ body,.main {
|
||||||
color: var(--fg);
|
color: var(--fg);
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
::selection, .main ::selection,
|
::selection, .main ::selection {
|
||||||
::-moz-selection, .main ::-moz-selection {
|
|
||||||
color: white;
|
color: white;
|
||||||
background: var(--b);
|
background: var(--v);
|
||||||
}
|
}
|
||||||
a, a:visited,
|
a, a:visited,
|
||||||
.main a, .main a:visited {
|
.main a, .main a:visited {
|
||||||
|
|
|
@ -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!"
|
|
|
@ -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
|
But you must understand that there is not really any central mindset
|
||||||
within Haskeller unlike I can find in some other programming language
|
within Haskeller unlike I can find in some other programming language
|
||||||
communities.
|
communities.
|
||||||
4. Haskell has become a lot more serious programming language now.
|
4. I think that Haskell is now perceived as a lot more serious programming
|
||||||
There are a lot more big projects written in Haskell not just toy projects.
|
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.
|
While the ecosystem evolved I believe that I myself have certainly matured.
|
||||||
I am paid to work in Clojure since 2013 now, and most of my personal side
|
Since 2013 I am paid to develop in Clojure.
|
||||||
project are written either in Haskell or in Purescript (an Haskell inspired
|
Most of my personal side project are written in Haskell or in an
|
||||||
language mostly focused on frontend development).
|
Haskell-inspired language.
|
||||||
|
|
||||||
As such I can follow two functional programming communities growth and
|
As such I can follow two functional programming communities growth and
|
||||||
evolution.
|
evolution.
|
||||||
|
@ -64,16 +68,17 @@ I am kind of confident that my Haskell understanding is a lot better than
|
||||||
before.
|
before.
|
||||||
But I still think, the ability to learn new Haskell subject is infinite.
|
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
|
One article I would like to write someday is about my current team
|
||||||
program.
|
philosophy about programming.
|
||||||
Mostly, our rule is to use as few features of a programming language as
|
Our main rule is to use as few features of a programming language as
|
||||||
possible to achieve your goal.
|
possible to achieve your goal.
|
||||||
This is a kind of merge between minimalism and pragmatism that in the end
|
This is a kind of merge between minimalism and pragmatism that in the end
|
||||||
provide a tremendous amount of benefits.
|
provide a tremendous amount of benefits.
|
||||||
This is why, even if I like to try the latest trend/hype in Haskell.
|
This is why, even if I like to play with the latest Haskell trendy feature,
|
||||||
I generally program without those latest nice features because, with just a
|
I generally program without those.
|
||||||
very few amount of Haskell features you will already be in enviromnent with
|
With just a very few amount of Haskell features you will already be in
|
||||||
a *lot* of benefits as compared to other programming languages ecosystem.
|
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
|
So enough talk, here is my old article new again, with just a few changes
|
||||||
and cleanup.
|
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
|
If you are going toward GUI programming, this is a whole subject on its own
|
||||||
and I do not really mention it.
|
and I do not really mention it.
|
||||||
|
|
||||||
My .02 for "Single Page Application" is to use Purescript with the halogen
|
My .02 for "Single Page Application" choice is to use Purescript with the
|
||||||
framework.
|
halogen framework.
|
||||||
Purescript is really awesome as well as halogen.
|
Purescript is really awesome as well as halogen.
|
||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
|
* Introduction
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: introduction
|
||||||
|
:END:
|
||||||
|
|
||||||
I really believe that every developer should learn Haskell.
|
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
|
I don't think every dev needs to be a super Haskell ninja, but they should
|
||||||
at least discover what Haskell has to offer.
|
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
|
- More on infinite tree; a more math oriented discussion about
|
||||||
infinite trees
|
infinite trees
|
||||||
|
|
||||||
* Introduction
|
|
||||||
:PROPERTIES:
|
|
||||||
:CUSTOM_ID: introduction
|
|
||||||
:END:
|
|
||||||
|
|
||||||
** Install
|
** Install
|
||||||
:PROPERTIES:
|
: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.
|
from an environment to use Haskell seriously for a new project.
|
||||||
This is because, there are too much choices for that.
|
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
|
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:
|
putting one of the following at the top of your file:
|
||||||
|
|
||||||
|
@ -210,20 +215,33 @@ If you chose Stack: https://haskellstack.org
|
||||||
-}
|
-}
|
||||||
#+END_EXAMPLE
|
#+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:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: code
|
:CUSTOM_ID: code
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+begin_src elisp :eval yes
|
#+begin_src elisp :eval yes
|
||||||
(defun nixb ()
|
(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\"")
|
(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
|
#+end_src
|
||||||
|
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: nixb
|
: 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
|
** Don't be afraid
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
@ -241,7 +259,7 @@ to the mandatory "Hello World".
|
||||||
|
|
||||||
{{{lnk(hello.hs)}}}
|
{{{lnk(hello.hs)}}}
|
||||||
#+BEGIN_SRC haskell :tangle hello.hs :shebang '(nixb)
|
#+BEGIN_SRC haskell :tangle hello.hs :shebang '(nixb)
|
||||||
main = putStrLn "Hello World!"
|
main = putStrLn "Hello World!"
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_EXAMPLE
|
#+BEGIN_EXAMPLE
|
||||||
|
@ -259,7 +277,7 @@ Hello World!
|
||||||
Now, a program asking your name and replying "Hello" using the name you
|
Now, a program asking your name and replying "Hello" using the name you
|
||||||
entered:
|
entered:
|
||||||
|
|
||||||
#+NAME: name.hs
|
{{{lnk(name.hs)}}}
|
||||||
#+BEGIN_SRC haskell :tangle name.hs :shebang '(nixb)
|
#+BEGIN_SRC haskell :tangle name.hs :shebang '(nixb)
|
||||||
main = do
|
main = do
|
||||||
print "What is your name?"
|
print "What is your name?"
|
||||||
|
|
4
src/posts/0010-Haskell-Now/name.hs
Executable file → Normal file
4
src/posts/0010-Haskell-Now/name.hs
Executable file → Normal 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
|
main = do
|
||||||
print "What is your name?"
|
print "What is your name?"
|
||||||
name <- getLine
|
name <- getLine
|
||||||
|
|
2
sync.sh
2
sync.sh
|
@ -3,4 +3,6 @@
|
||||||
rootdir=${0:h}
|
rootdir=${0:h}
|
||||||
echo $rootdir
|
echo $rootdir
|
||||||
|
|
||||||
|
echo -n "Uploading website"
|
||||||
rsync --progress --partial -avHe ssh $rootdir/_site/ root@esy.fun:/var/www/her.esy.fun/ --delete
|
rsync --progress --partial -avHe ssh $rootdir/_site/ root@esy.fun:/var/www/her.esy.fun/ --delete
|
||||||
|
echo " [done]"
|
||||||
|
|
Loading…
Reference in a new issue