Completed the first version of the site

This commit is contained in:
Konstantin Nazarov 2021-08-15 22:16:35 +01:00
parent 1baaf4b842
commit a2e8bda421
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22
7 changed files with 173 additions and 9 deletions

View file

@ -2,12 +2,29 @@ ODIR=output
PAGES_SRC := $(wildcard pages/*) PAGES_SRC := $(wildcard pages/*)
PAGES_DST := $(patsubst pages/%,$(ODIR)/%/index.html,$(PAGES_SRC)) PAGES_DST := $(patsubst pages/%,$(ODIR)/%/index.html,$(PAGES_SRC))
all: $(PAGES_DST) $(ODIR)/style.css $(ODIR)/index.html PROJECTS_SRC := $(wildcard projects/*)
PROJECTS_DST := $(patsubst projects/%,$(ODIR)/projects/%/index.html,$(PROJECTS_SRC))
POSTS_SRC := $(wildcard posts/*)
POSTS_DST := $(patsubst posts/%,$(ODIR)/posts/%/index.html,$(POSTS_SRC))
all: $(PAGES_DST) $(PROJECTS_DST) $(POSTS_DST) $(ODIR)/style.css $(ODIR)/index.html $(ODIR)/posts/index.html
$(ODIR)/%/index.html: pages/%/note.md $(ODIR)/%/index.html: pages/%/note.md
mkdir -p "$(dir $@)"
cat "$<" | ./mdpage.sh --notitle > "$@"
$(ODIR)/projects/%/index.html: projects/%/note.md
mkdir -p "$(dir $@)" mkdir -p "$(dir $@)"
cat "$<" | ./mdpage.sh > "$@" cat "$<" | ./mdpage.sh > "$@"
$(ODIR)/posts/%/index.html: posts/%/note.md
mkdir -p "$(dir $@)"
cat "$<" | ./mdpage.sh > "$@"
$(ODIR)/posts/index.html: $(POSTS_SRC)
./toc.sh posts "/posts" | awk -f markdown.awk | ./page.sh Posts > "$@"
$(ODIR)/index.html: index.md $(ODIR)/index.html: index.md
cat index.md | ./mdpage.sh --notitle > "$@" cat index.md | ./mdpage.sh --notitle > "$@"

14
pages/projects/note.md Normal file
View file

@ -0,0 +1,14 @@
Subject: Projects
This is a list of ongoing and completed projects that I participated in.
Personal side projects:
* [Homebrew tap for qemu with support for 3d accelerated guests](https://github.com/knazarov/homebrew-qemu-virgl)
* [Plain-text note taking system](https://github.com/knazarov/notes.sh)
* [Markdown-to-html in awk](https://github.com/knazarov/markdown.awk)
Tarantool-related:
* [Tarantool Cartridge](/projects/tarantool-cartridge)
* [Tarantool Data Grid](/projects/tarantool-data-grid)

View file

@ -0,0 +1,44 @@
Subject: A very productive OSX workflow
X-Date: 2020-06-09T13:00:00Z
I often work from my MacBook, with an external display. But the default overlapping window management is not very convenient: you either have to switch windows with Cmd-Tab or maximize windows and swipe between them. This doesn't work well if you have more than a few open apps at the same time: you need to store context about where that window was in your head.
I have tried to replicate Linux tiling window managers on a Mac. The good thing about a tiling window manager is that individual windows don't overlap and are usually grouped on a separate "workspace" that can be reached with a single shortcut (usually something like Cmd+1..9). It is then possible to associate every such shortcut with an app or a group of apps. In my case, for example:
* Workspace 1: Web browser
* Workspace 2: Text editor/IDE
* Workspace 3: Terminals
* Workspace 4: File management
* Workspace 5: Chats
* Workspace 6: Calendar
* Workspace 7: Email
* Workspace 8: Misc
* Workspace 9: Music
I've spent so much time working like this, that it has etched itself deeply into my reflexes.
Unfortunately, the real tiling window management is impossible on a Mac. The OS just doesn't let other software to control windows well enough to make the experience flawless. All existing software calling itself "tiling WMs for OS X" is buggy and janky.
So, instead what I would like to offer you is a way to achieve a convenient tiling-like workflow without any additional software, using only what's available by default.
## Don't run any apps in fullscreen mode
Unfortunately, it's impossible to assign a shortcut to a window that's been put to fullscreen mode, only to "workspaces". This is because doing so creates a "dynamic" workspace that is not listed in settings. Instead, just maximize windows by double-clicking on their titlebars. This will still keep the titlebar visible, but you'll have to pay this price for convenience.
## Auto-hide what's possible
Go to Settings->General and enable "Automatically hide and show the menu bar". Then go to Settings->Dock and enable "Automatically hide and show dock", and also set the dock position on the screen to "Left".
Doing this will save you some space, since you won't be using full-screen app mode.
## Change primary screen to external monitor
If you work on a MacBook and attach it to an external monitor, working in dual-screen mode (as I do), you may want to make the external monitor "primary". This is very convenient, because OS X will migrate all open apps to your primary display when it's attached, and then migrate them back to your laptop screen in exactly the same configuration/layout when you detach it. What's most important is that this will keep windows on the same workspaces.
To do this, you need to go to Settings->Displays->Arrangement and drag the white stripe representing the menu bar from your laptop screen to your external screen. I know, it doesn't make sense, but this actually makes your external monitor primary!
## Assign individual shortcuts to each workspace
First, do a three-finger swipe up on a touchbar and create 9 workspaces. Then go to Settings->Keyboard->Shortcuts, pick "Mission Control" from the list on the left, and on the right, assign shortcuts to actions "Switch to Desktop N". I recommend Cmd-1..9, since it's very natural to use.
Check that it works as expected by switching desktops a few times with these shortcuts.
## Enjoy
If you spend some time remembering associations between applications and workspace numbers, I'm sure you'll find it far more convenient and faster than your usual window switching habits. At least for me, it replicates around 80% of what I like about tiling window managers.

View file

@ -0,0 +1,31 @@
Subject: Zetteklasten: associative thought
X-Date: 2020-06-01T10:00:00Z
Zettelkasten is a knowledge management system invented by Niklas Luhmann, a German sociologist.
It is based on an idea that when you need to produce meaningful work, it is likely too late to start collecting input. Say, writing an article or an assignment. If you start with an idea and then try to work through sources of information as your idea develops, you put yourself under stress: it is very hard to think one step at a time in an area where you don't have expertise.
So there are 2 problems:
* Procrastination and loss of interest
* Forming negative association with writing
Instead, what Luhmann proposed was the idea that when you start writing, the process should be mostly editorial: there shouldn't be any active thinking or invention. You should just go over ideas, references and connections you've build up over time and combine them into a linear text.
In addition to that, he noted that the only viable way to actually collect ideas is to do your work and reading under assumption that you will write about it in the end. And the process of writing will then improve connections between subjects in your brain and will help you think better and will open up a way to more advanced topics.
In order to start, you need a place where you will capture raw ideas/notes, and another place where you will put ideas for permanent storage. The first one can be really anything - a pen and paper notebook will do fine, as well as digital alternatives like Evernote, OneNote or Apple Notes. The most important thing here is to not overthink the structure - just capture things as you read. The second one should be able to support links between notes, have tags and full-text search. One good example of this is Notational Velocity (if you are on a Mac).
When you read something, take very brief notes of core ideas (just a few sentences in your own words), include references to original article/book and store it into your first system.
Once in a while, take your time to transfer notes from your first system to the second one. Here, take time to think about what context you may use information in. Don't try to make any categories for your information - this will put unnecessary strain on your brain, produce unneeded clutter and in general won't help (you won't come up with a good taxonomy anyway). Instead, use tags such as #job, or #graduatework or things like that. Then you will be able to find your notes later with regular text search (which computers are really good at).
If you have an idea, do a text search on your second system to pull all relevant knowledge about it. Use those references and recorded thoughts to feed the new idea and develop it a few steps further. Make a new note that contains the idea and link back to original notes that you used to develop it. Rinse and repeat with more high-level ideas.
Above all, don't try to build any excessive structure in your knowledge base: it can kill your motivation. Computers are so powerful that they can find information in your notes instantly even if you produce dozens of pages a day, every day of your life. Think about it as an extension of your brain: it doesn't store information hierarchically, but associatively. This way they will hopefully be able to work together.
Further information:
* [5 minute video explaining the method](https://www.youtube.com/watch?v=rOSZOCoqOo8)
* [An in-depth article from Fortelabs](https://fortelabs.co/blog/how-to-take-smart-notes/)

View file

@ -0,0 +1,6 @@
Subject: Tarantool Cartridge
[https://www.tarantool.io/cartridge](https://www.tarantool.io/cartridge) is an open-source framework
that helps developers write distributed apps in Tarantool. It is one of the building blocks of Tarantool
Data Grid. We decided to open source Cartridge to standardize app development between community and
enterprise versions of Tarantool.

View file

@ -0,0 +1,7 @@
Subject: Tarantool Data Grid
[https://www.tarantool.io/datagrid](https://www.tarantool.io/datagrid) is a system for developing distributed
applications with a lightning-fast persistent in-memory storage. This can be applications for unified processing
of data that originates from different IT systems.
I've lead the development of Tarantool Data Grid and helped turn it into a product.

61
toc.sh
View file

@ -1,25 +1,70 @@
#!/bin/bash #!/bin/bash
set -e
get_header() {
HFILE="$1"
HEADER="$2"
FILTER="{ \
if (match(\$0, /^$HEADER: /)) {print substr(\$0, RLENGTH+1, length(\$0) - RLENGTH)}; \
if (\$0~/^$/) {exit}; \
if (!\$0~/^[^ ]*: .*$/) {exit}; \
}"
awk "$FILTER" "$HFILE"
}
render() { render() {
TITLE="$1" NODATE="$1"
DIR="$2" DIR="$2"
BASE="$3"
find "$DIR/" -type f -name '*.md' | while read -r FN pushd "$DIR" > /dev/null
find . ! -path . -type d | while read -r FN
do do
echo "FILE: $(realpath $FN)" PAGE="$(echo "$FN" | sed 's/^\.\///g')"
#echo "FILE: $PAGE"
MD="$PAGE/note.md"
if [ ! -f "$MD" ]; then
echo "$MD doesn't exist"
exit 1;
fi
SUBJECT="$(get_header "$MD" "Subject")"
FDATE="$(get_header "$MD" "X-Date" | sed 's/T.*$//g')"
if [ -z "$SUBJECT" ]; then
echo "No subject in $MD"
exit 1
fi
if [ -z "$FDATE" ] && [ "$NODATE" == "0" ]; then
echo "No date in $MD"
exit 1
fi
if [ -z "$FDATE" ]; then
echo "* [$SUBJECT]($BASE/$PAGE)"
else
echo "* $FDATE [$SUBJECT]($BASE/$PAGE)"
fi
done done
popd > /dev/null
} }
if [ -z "$1" ]; then NODATE=0
echo "Missing page title" if [ "$1" == "--nodate" ]; then
exit 1 NODATE=1
shift
fi fi
if [ ! -d "$2" ]; then if [ ! -d "$1" ]; then
echo "Missing source directory" echo "Missing source directory"
exit 1 exit 1
fi fi
render "$1" "$2" render "$NODATE" "$1" "$2" | sort -r