diff options
Diffstat (limited to '_posts')
27 files changed, 96 insertions, 62 deletions
diff --git a/_posts/2017-04-21-profiling-python-web-applications-with-visual-tools.md b/_posts/2017-04-21-profiling-python-web-applications-with-visual-tools.md index 70e25f9..2e2ec70 100644 --- a/_posts/2017-04-21-profiling-python-web-applications-with-visual-tools.md +++ b/_posts/2017-04-21-profiling-python-web-applications-with-visual-tools.md | |||
| @@ -22,7 +22,7 @@ If you are using MacOS you should check out [Profiling | |||
| 22 | Viewer](http://www.profilingviewer.com/) or | 22 | Viewer](http://www.profilingviewer.com/) or |
| 23 | [MacCallGrind](http://www.maccallgrind.com/). | 23 | [MacCallGrind](http://www.maccallgrind.com/). |
| 24 | 24 | ||
| 25 |  | 25 | {:loading="lazy"} |
| 26 | 26 | ||
| 27 | We will be dividing this post into two main categories: | 27 | We will be dividing this post into two main categories: |
| 28 | 28 | ||
| @@ -147,7 +147,7 @@ will be using Profilling Viewer under MacOS. You can open image in new tab. As | |||
| 147 | you can see from this example there is hierarchy of execution order of your | 147 | you can see from this example there is hierarchy of execution order of your |
| 148 | code. | 148 | code. |
| 149 | 149 | ||
| 150 |  | 150 | {:loading="lazy"} |
| 151 | 151 | ||
| 152 | > Make sure you convert output of the cProfile output every time you want to | 152 | > Make sure you convert output of the cProfile output every time you want to |
| 153 | refresh and take a look at your possible optimizations because cProfile updates | 153 | refresh and take a look at your possible optimizations because cProfile updates |
| @@ -178,7 +178,7 @@ $ snakeviz awesome_random_number.prof | |||
| 178 | # shows visualized profile | 178 | # shows visualized profile |
| 179 | ``` | 179 | ``` |
| 180 | 180 | ||
| 181 |  | 181 | {:loading="lazy"} |
| 182 | 182 | ||
| 183 | Reddit user [ccharles](https://www.reddit.com/user/ccharles) suggested a better | 183 | Reddit user [ccharles](https://www.reddit.com/user/ccharles) suggested a better |
| 184 | way for installing pip software by targeting user level instead of using sudo. | 184 | way for installing pip software by targeting user level instead of using sudo. |
diff --git a/_posts/2017-08-11-simple-iot-application.md b/_posts/2017-08-11-simple-iot-application.md index 3c9b4f9..b552e8f 100644 --- a/_posts/2017-08-11-simple-iot-application.md +++ b/_posts/2017-08-11-simple-iot-application.md | |||
| @@ -51,7 +51,7 @@ to API and another to serving HTML with chart. | |||
| 51 | Schema below represents what we will try to achieve and how different parts | 51 | Schema below represents what we will try to achieve and how different parts |
| 52 | correlates to each other. | 52 | correlates to each other. |
| 53 | 53 | ||
| 54 |  | 54 | {:loading="lazy"} |
| 55 | 55 | ||
| 56 | ## Simple Python API | 56 | ## Simple Python API |
| 57 | 57 | ||
| @@ -219,12 +219,12 @@ available via POST method on /api route. | |||
| 219 | After testing the service with Restlet Client you should be able to view your | 219 | After testing the service with Restlet Client you should be able to view your |
| 220 | data in a database file ```data.db```. | 220 | data in a database file ```data.db```. |
| 221 | 221 | ||
| 222 |  | 222 | {:loading="lazy"} |
| 223 | 223 | ||
| 224 | You can also check the contents of new database file by using desktop client | 224 | You can also check the contents of new database file by using desktop client |
| 225 | for SQLite → [DB Browser for SQLite](http://sqlitebrowser.org/). | 225 | for SQLite → [DB Browser for SQLite](http://sqlitebrowser.org/). |
| 226 | 226 | ||
| 227 |  | 227 | {:loading="lazy"} |
| 228 | 228 | ||
| 229 | Table structure is as simple as it can be. We have ts (timestamp) and value | 229 | Table structure is as simple as it can be. We have ts (timestamp) and value |
| 230 | (value from Arduino). As you can see timestamp is generated on API side. If you | 230 | (value from Arduino). As you can see timestamp is generated on API side. If you |
| @@ -586,7 +586,7 @@ every 5 seconds. | |||
| 586 | If you navigate to ```http://0.0.0.0:5000``` you should see rendered chart as | 586 | If you navigate to ```http://0.0.0.0:5000``` you should see rendered chart as |
| 587 | shown on picture below. | 587 | shown on picture below. |
| 588 | 588 | ||
| 589 |  | 589 | {:loading="lazy"} |
| 590 | 590 | ||
| 591 | Complete application with all the code is available for | 591 | Complete application with all the code is available for |
| 592 | [download](/assets/posts/iot-application/simple-iot-application.zip). | 592 | [download](/assets/posts/iot-application/simple-iot-application.zip). |
diff --git a/_posts/2018-01-16-using-digitalocean-spaces-object-storage-with-fuse.md b/_posts/2018-01-16-using-digitalocean-spaces-object-storage-with-fuse.md index 543439f..d29bd09 100644 --- a/_posts/2018-01-16-using-digitalocean-spaces-object-storage-with-fuse.md +++ b/_posts/2018-01-16-using-digitalocean-spaces-object-storage-with-fuse.md | |||
| @@ -56,7 +56,7 @@ Instuctions on how to use SSH keys and how to setup them are available in | |||
| 56 | article [How To Use SSH Keys with DigitalOcean | 56 | article [How To Use SSH Keys with DigitalOcean |
| 57 | Droplets](https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets). | 57 | Droplets](https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets). |
| 58 | 58 | ||
| 59 |  | 59 | {:loading="lazy"} |
| 60 | 60 | ||
| 61 | After we created Droplet it's time to create new Space. This is done by clicking | 61 | After we created Droplet it's time to create new Space. This is done by clicking |
| 62 | on a button [Create](https://cloud.digitalocean.com/spaces/new) (right top | 62 | on a button [Create](https://cloud.digitalocean.com/spaces/new) (right top |
| @@ -69,7 +69,7 @@ key](https://cloud.digitalocean.com/settings/api/tokens). This link will guide | |||
| 69 | to the page when you can generate this key. After you create new one, please | 69 | to the page when you can generate this key. After you create new one, please |
| 70 | save provided Key and Secret because Secret will not be shown again. | 70 | save provided Key and Secret because Secret will not be shown again. |
| 71 | 71 | ||
| 72 |  | 72 | {:loading="lazy"} |
| 73 | 73 | ||
| 74 | Now that we have new Space and Access key we should SSH into our machine. | 74 | Now that we have new Space and Access key we should SSH into our machine. |
| 75 | 75 | ||
diff --git a/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md b/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md index 0bb774e..1de83af 100644 --- a/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md +++ b/_posts/2019-01-03-encoding-binary-data-into-dna-sequence.md | |||
| @@ -110,7 +110,7 @@ The nucleotide in DNA consists of a sugar (deoxyribose), one of four bases | |||
| 110 | Cytosine and thymine are pyrimidine bases, while adenine and guanine are purine | 110 | Cytosine and thymine are pyrimidine bases, while adenine and guanine are purine |
| 111 | bases. The sugar and the base together are called a nucleoside. | 111 | bases. The sugar and the base together are called a nucleoside. |
| 112 | 112 | ||
| 113 |  | 113 | {:loading="lazy"} |
| 114 | *DNA (a) forms a double stranded helix, and (b) adenine pairs with thymine and | 114 | *DNA (a) forms a double stranded helix, and (b) adenine pairs with thymine and |
| 115 | cytosine pairs with guanine. (credit a: modification of work by Jerome Walker, | 115 | cytosine pairs with guanine. (credit a: modification of work by Jerome Walker, |
| 116 | Dennis Myts)* | 116 | Dennis Myts)* |
| @@ -300,7 +300,7 @@ Then we encode FASTA file from previous operation to encode this data into PNG. | |||
| 300 | 300 | ||
| 301 | After encoding into PNG format this file looks like this. | 301 | After encoding into PNG format this file looks like this. |
| 302 | 302 | ||
| 303 |  | 303 | {:loading="lazy"} |
| 304 | The larger the input stream is the larger the PNG file would be. | 304 | The larger the input stream is the larger the PNG file would be. |
| 305 | 305 | ||
| 306 | Compiled basic Hello World C program with | 306 | Compiled basic Hello World C program with |
| @@ -369,7 +369,7 @@ dd if=<(openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count= | |||
| 369 | ``` | 369 | ``` |
| 370 | 370 | ||
| 371 | 371 | ||
| 372 |  | 372 | {:loading="lazy"} |
| 373 | Our freshly generated 1KB file looks something like this (its full of | 373 | Our freshly generated 1KB file looks something like this (its full of |
| 374 | garbage data as intended). | 374 | garbage data as intended). |
| 375 | 375 | ||
| @@ -395,10 +395,10 @@ Then we GZIP all the FASTA files to see how much the can be compressed. | |||
| 395 | gzip -9 < 10MB.fa > 10MB.fa.gz | 395 | gzip -9 < 10MB.fa > 10MB.fa.gz |
| 396 | ``` | 396 | ``` |
| 397 | 397 | ||
| 398 |  | 398 | {:loading="lazy"} |
| 399 | The speed increase that occurs when encoding to FASTA format. | 399 | The speed increase that occurs when encoding to FASTA format. |
| 400 | 400 | ||
| 401 |  | 401 | {:loading="lazy"} |
| 402 | Size of the out file after encoding. | 402 | Size of the out file after encoding. |
| 403 | 403 | ||
| 404 | [Download CSV file with benchmarks](/assets/posts/dna-sequence/benchmarks.csv). | 404 | [Download CSV file with benchmarks](/assets/posts/dna-sequence/benchmarks.csv). |
diff --git a/_posts/2019-10-19-using-sentiment-analysis-for-clickbait-detection.md b/_posts/2019-10-19-using-sentiment-analysis-for-clickbait-detection.md index 5aad23c..a1b237b 100644 --- a/_posts/2019-10-19-using-sentiment-analysis-for-clickbait-detection.md +++ b/_posts/2019-10-19-using-sentiment-analysis-for-clickbait-detection.md | |||
| @@ -93,7 +93,7 @@ plt.show() | |||
| 93 | longer period of time and then perform analysis again and use either machine | 93 | longer period of time and then perform analysis again and use either machine |
| 94 | learning or deep learning on top of it. | 94 | learning or deep learning on top of it. |
| 95 | 95 | ||
| 96 |  | 96 | {:loading="lazy"} |
| 97 | 97 | ||
| 98 | Figure above displays difference between title and description sentiment for | 98 | Figure above displays difference between title and description sentiment for |
| 99 | specific RSS feed item. 1 means positive and -1 means negative sentiment. | 99 | specific RSS feed item. 1 means positive and -1 means negative sentiment. |
diff --git a/_posts/2020-03-22-simple-sse-based-pubsub-server.md b/_posts/2020-03-22-simple-sse-based-pubsub-server.md index 23a3640..ffb7285 100644 --- a/_posts/2020-03-22-simple-sse-based-pubsub-server.md +++ b/_posts/2020-03-22-simple-sse-based-pubsub-server.md | |||
| @@ -39,7 +39,7 @@ simple. We have subscribers that receive messages, and we have publishers that | |||
| 39 | create and post messages. Similar model is also well know pattern that works on | 39 | create and post messages. Similar model is also well know pattern that works on |
| 40 | a premise of consumers and producers, and they take similar roles. | 40 | a premise of consumers and producers, and they take similar roles. |
| 41 | 41 | ||
| 42 |  | 42 | {:loading="lazy"} |
| 43 | 43 | ||
| 44 | **These are some naive characteristics we want to achieve:** | 44 | **These are some naive characteristics we want to achieve:** |
| 45 | 45 | ||
| @@ -75,7 +75,7 @@ page](https://html.spec.whatwg.org/multipage/server-sent-events.html). | |||
| 75 | 75 | ||
| 76 | ### Current browser support | 76 | ### Current browser support |
| 77 | 77 | ||
| 78 |  | 78 | {:loading="lazy"} |
| 79 | 79 | ||
| 80 | Check | 80 | Check |
| 81 | [https://caniuse.com/#feat=eventsource](https://caniuse.com/#feat=eventsource) | 81 | [https://caniuse.com/#feat=eventsource](https://caniuse.com/#feat=eventsource) |
| @@ -143,7 +143,7 @@ which is quite nice and available from Developer Tools under Network tab. | |||
| 143 | > ones. For debugging server events add `console.log` to `server.js` code and | 143 | > ones. For debugging server events add `console.log` to `server.js` code and |
| 144 | > print out events. | 144 | > print out events. |
| 145 | 145 | ||
| 146 |  | 146 | {:loading="lazy"} |
| 147 | 147 | ||
| 148 | ## Server implementation | 148 | ## Server implementation |
| 149 | 149 | ||
diff --git a/_posts/2020-09-06-esp-and-micropython.md b/_posts/2020-09-06-esp-and-micropython.md index 9a005af..bfd05d9 100644 --- a/_posts/2020-09-06-esp-and-micropython.md +++ b/_posts/2020-09-06-esp-and-micropython.md | |||
| @@ -20,7 +20,7 @@ but I could easily choose | |||
| 20 | contains which tools I use and how I prepared my workspace to code for | 20 | contains which tools I use and how I prepared my workspace to code for |
| 21 | [ESP8266](https://www.espressif.com/en/products/socs/esp8266). | 21 | [ESP8266](https://www.espressif.com/en/products/socs/esp8266). |
| 22 | 22 | ||
| 23 |  | 23 | {:loading="lazy"} |
| 24 | 24 | ||
| 25 | This guide covers: | 25 | This guide covers: |
| 26 | 26 | ||
diff --git a/_posts/2020-09-08-bind-warning-on-login.md b/_posts/2020-09-08-bind-warning-on-login.md index 94b5a5f..4b2c983 100644 --- a/_posts/2020-09-08-bind-warning-on-login.md +++ b/_posts/2020-09-08-bind-warning-on-login.md | |||
| @@ -31,7 +31,7 @@ bind '"\e[Z":menu-complete-backward' | |||
| 31 | I haven't noticed anything wrong with this and all was working fine until I | 31 | I haven't noticed anything wrong with this and all was working fine until I |
| 32 | restarted my machine and then I got this error. | 32 | restarted my machine and then I got this error. |
| 33 | 33 | ||
| 34 |  | 34 | {:loading="lazy"} |
| 35 | 35 | ||
| 36 | When I pressed OK, I got into the [Gnome | 36 | When I pressed OK, I got into the [Gnome |
| 37 | shell](https://wiki.gnome.org/Projects/GnomeShell) and all was working fine, but | 37 | shell](https://wiki.gnome.org/Projects/GnomeShell) and all was working fine, but |
diff --git a/_posts/2021-01-24-replacing-dropbox-with-s3.md b/_posts/2021-01-24-replacing-dropbox-with-s3.md index fb4ba68..7599949 100644 --- a/_posts/2021-01-24-replacing-dropbox-with-s3.md +++ b/_posts/2021-01-24-replacing-dropbox-with-s3.md | |||
| @@ -106,7 +106,7 @@ You can use this script in a combination with [Cron](https://en.wikipedia.org/wi | |||
| 106 | When you start syncing your local stuff with a remote server you can review your | 106 | When you start syncing your local stuff with a remote server you can review your |
| 107 | items on DigitalOcean. | 107 | items on DigitalOcean. |
| 108 | 108 | ||
| 109 |  | 109 | {:loading="lazy"} |
| 110 | 110 | ||
| 111 | I have been using this script now for quite some time, and it's working | 111 | I have been using this script now for quite some time, and it's working |
| 112 | flawlessly. I also uninstalled Dropbox and stopped using it completely. | 112 | flawlessly. I also uninstalled Dropbox and stopped using it completely. |
diff --git a/_posts/2021-01-25-goaccess.md b/_posts/2021-01-25-goaccess.md index 4de65e8..779bce5 100644 --- a/_posts/2021-01-25-goaccess.md +++ b/_posts/2021-01-25-goaccess.md | |||
| @@ -42,11 +42,11 @@ all the functionalities I need, and it's a single binary. Written in Go. | |||
| 42 | 42 | ||
| 43 | GoAccess can be used in two different modes. | 43 | GoAccess can be used in two different modes. |
| 44 | 44 | ||
| 45 |  | 45 | {:loading="lazy"} |
| 46 | 46 | ||
| 47 | *Running in a terminal* | 47 | *Running in a terminal* |
| 48 | 48 | ||
| 49 |  | 49 | {:loading="lazy"} |
| 50 | 50 | ||
| 51 | *Running in a browser* | 51 | *Running in a browser* |
| 52 | 52 | ||
diff --git a/_posts/2021-06-26-simple-world-clock.md b/_posts/2021-06-26-simple-world-clock.md index 31692e1..d1b53b4 100644 --- a/_posts/2021-06-26-simple-world-clock.md +++ b/_posts/2021-06-26-simple-world-clock.md | |||
| @@ -24,7 +24,7 @@ have a bunch of [Raspberry Pi's | |||
| 24 | Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) lying around that | 24 | Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) lying around that |
| 25 | I really need to use. | 25 | I really need to use. |
| 26 | 26 | ||
| 27 |  | 27 | {:loading="lazy"} |
| 28 | 28 | ||
| 29 | Since the Inky [Inky | 29 | Since the Inky [Inky |
| 30 | pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) is | 30 | pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) is |
| @@ -95,7 +95,7 @@ Then we add a cronjob with `crontab -e`. | |||
| 95 | 95 | ||
| 96 | So, we end up with a result like this. | 96 | So, we end up with a result like this. |
| 97 | 97 | ||
| 98 |  | 98 | {:loading="lazy"} |
| 99 | 99 | ||
| 100 | And for the enclosure that can be 3D printed, but I haven't yet something like | 100 | And for the enclosure that can be 3D printed, but I haven't yet something like |
| 101 | this can be used. | 101 | this can be used. |
diff --git a/_posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md b/_posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md index b469a05..4f9bc09 100644 --- a/_posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md +++ b/_posts/2021-12-03-debian-based-riced-up-distribution-for-developers.md | |||
| @@ -77,35 +77,35 @@ Fonts being applied across the distro and things like that. | |||
| 77 | First, I choose terminal installer and left it to load additional components. | 77 | First, I choose terminal installer and left it to load additional components. |
| 78 | Avoid using graphical installer in this case. | 78 | Avoid using graphical installer in this case. |
| 79 | 79 | ||
| 80 |  | 80 | {:loading="lazy"} |
| 81 | 81 | ||
| 82 | After that I selected hostname and created a normal user and set password for | 82 | After that I selected hostname and created a normal user and set password for |
| 83 | that user and root user and choose guided mode for disk partitioning. | 83 | that user and root user and choose guided mode for disk partitioning. |
| 84 | 84 | ||
| 85 |  | 85 | {:loading="lazy"} |
| 86 | 86 | ||
| 87 | I left it run to install all the things required for the base system and opted | 87 | I left it run to install all the things required for the base system and opted |
| 88 | out of scanning additional media for use by the package manager. Those will be | 88 | out of scanning additional media for use by the package manager. Those will be |
| 89 | downloaded from the internet during installation. | 89 | downloaded from the internet during installation. |
| 90 | 90 | ||
| 91 |  | 91 | {:loading="lazy"} |
| 92 | 92 | ||
| 93 | I opted out of the popularity contest, and **now comes the important part**. | 93 | I opted out of the popularity contest, and **now comes the important part**. |
| 94 | Uncheck all the boxes in Software selection and only leave 'standard system | 94 | Uncheck all the boxes in Software selection and only leave 'standard system |
| 95 | utilities'. I also left an SSH server, so I was able to log in to the machine | 95 | utilities'. I also left an SSH server, so I was able to log in to the machine |
| 96 | from my main PC. | 96 | from my main PC. |
| 97 | 97 | ||
| 98 |  | 98 | {:loading="lazy"} |
| 99 | 99 | ||
| 100 | At this point, I installed GRUB bootloader on the disk where I installed the | 100 | At this point, I installed GRUB bootloader on the disk where I installed the |
| 101 | system. | 101 | system. |
| 102 | 102 | ||
| 103 |  | 103 | {:loading="lazy"} |
| 104 | 104 | ||
| 105 | That concluded the installation of base Debian and after restarting the computer | 105 | That concluded the installation of base Debian and after restarting the computer |
| 106 | I was prompted with the login screen. | 106 | I was prompted with the login screen. |
| 107 | 107 | ||
| 108 |  | 108 | {:loading="lazy"} |
| 109 | 109 | ||
| 110 | Now that I had the base installation, it was time to choose what software do I | 110 | Now that I had the base installation, it was time to choose what software do I |
| 111 | want to include in this so-called distribution. I wanted out of the box | 111 | want to include in this so-called distribution. I wanted out of the box |
| @@ -142,7 +142,7 @@ What I was doing in Gnome was having windows in a layout like the diagram | |||
| 142 | below. This is my common practice. And if you look at it you can clearly see I | 142 | below. This is my common practice. And if you look at it you can clearly see I |
| 143 | was replicating tiling window manager setup in Gnome. | 143 | was replicating tiling window manager setup in Gnome. |
| 144 | 144 | ||
| 145 |  | 145 | {:loading="lazy"} |
| 146 | 146 | ||
| 147 | That made me look into a bunch of tiling window managers and then tested them | 147 | That made me look into a bunch of tiling window managers and then tested them |
| 148 | out. Candidates I was looking at were: | 148 | out. Candidates I was looking at were: |
| @@ -212,7 +212,7 @@ something similar. | |||
| 212 | 212 | ||
| 213 | This is some of the output from the installation script. | 213 | This is some of the output from the installation script. |
| 214 | 214 | ||
| 215 |  | 215 | {:loading="lazy"} |
| 216 | 216 | ||
| 217 | Let's take a look at some examples in the installation script. | 217 | Let's take a look at some examples in the installation script. |
| 218 | 218 | ||
| @@ -274,4 +274,4 @@ And this is how it looks with two terminals side by side. I really like the | |||
| 274 | simplicity and clean interface. I will polish the colors and stuff like that, | 274 | simplicity and clean interface. I will polish the colors and stuff like that, |
| 275 | but I really do like the results. | 275 | but I really do like the results. |
| 276 | 276 | ||
| 277 |  | 277 | {:loading="lazy"} |
diff --git a/_posts/2021-12-25-running-golang-application-as-pid1.md b/_posts/2021-12-25-running-golang-application-as-pid1.md index 1f67ee1..edd5a57 100644 --- a/_posts/2021-12-25-running-golang-application-as-pid1.md +++ b/_posts/2021-12-25-running-golang-application-as-pid1.md | |||
| @@ -24,7 +24,7 @@ Really worth a read. | |||
| 24 | If we compare a normal operating system to a unikernel side by side, they would | 24 | If we compare a normal operating system to a unikernel side by side, they would |
| 25 | look something like this. | 25 | look something like this. |
| 26 | 26 | ||
| 27 |  | 27 | {:loading="lazy"} |
| 28 | 28 | ||
| 29 | From this image, we can see how the complexity significantly decreases with | 29 | From this image, we can see how the complexity significantly decreases with |
| 30 | the use of Unikernels. This comes with a price, of course. Unikernels are hard | 30 | the use of Unikernels. This comes with a price, of course. Unikernels are hard |
diff --git a/_posts/2021-12-30-wap-mobile-web-before-the-web.md b/_posts/2021-12-30-wap-mobile-web-before-the-web.md index 058ad55..665be0f 100644 --- a/_posts/2021-12-30-wap-mobile-web-before-the-web.md +++ b/_posts/2021-12-30-wap-mobile-web-before-the-web.md | |||
| @@ -33,7 +33,7 @@ These phones were rocking: | |||
| 33 | 33 | ||
| 34 | Let's take a look at these beauties. | 34 | Let's take a look at these beauties. |
| 35 | 35 | ||
| 36 |  | 36 | {:loading="lazy"} |
| 37 | 37 | ||
| 38 | ## WAP - Wireless Application Protocol | 38 | ## WAP - Wireless Application Protocol |
| 39 | 39 | ||
diff --git a/_posts/2022-06-30-trying-out-helix-editor.md b/_posts/2022-06-30-trying-out-helix-editor.md index c6ebd6f..61f653a 100644 --- a/_posts/2022-06-30-trying-out-helix-editor.md +++ b/_posts/2022-06-30-trying-out-helix-editor.md | |||
| @@ -48,7 +48,7 @@ popups that show you what the keyboard shortcuts are. | |||
| 48 | And it comes us packed with many | 48 | And it comes us packed with many |
| 49 | [really good themes](https://github.com/helix-editor/helix/wiki/Themes). | 49 | [really good themes](https://github.com/helix-editor/helix/wiki/Themes). |
| 50 | 50 | ||
| 51 |  | 51 | {:loading="lazy"} |
| 52 | 52 | ||
| 53 | It's still young but has this mature feeling to it. It has sane defaults and | 53 | It's still young but has this mature feeling to it. It has sane defaults and |
| 54 | mimics Vim (works a bit differently, but the overall idea is similar). | 54 | mimics Vim (works a bit differently, but the overall idea is similar). |
diff --git a/_posts/2022-07-05-what-would-dna-sound-if-synthesized.md b/_posts/2022-07-05-what-would-dna-sound-if-synthesized.md index 7aaac68..6efe559 100644 --- a/_posts/2022-07-05-what-would-dna-sound-if-synthesized.md +++ b/_posts/2022-07-05-what-would-dna-sound-if-synthesized.md | |||
| @@ -178,7 +178,7 @@ An example spectrogram of Ludwig van Beethoven Symphony No. 6 First movement. | |||
| 178 | <source src="/assets/posts/dna-synthesized/symphony-no6-1st-movement.mp3" type="audio/mpeg"> | 178 | <source src="/assets/posts/dna-synthesized/symphony-no6-1st-movement.mp3" type="audio/mpeg"> |
| 179 | </audio> | 179 | </audio> |
| 180 | 180 | ||
| 181 |  | 181 | {:loading="lazy"} |
| 182 | 182 | ||
| 183 | The other option could also be in combination with | 183 | The other option could also be in combination with |
| 184 | [gnuplot](http://www.gnuplot.info/). This would require an intermediary step, | 184 | [gnuplot](http://www.gnuplot.info/). This would require an intermediary step, |
| @@ -233,7 +233,7 @@ spectrogram based on a WAV file. | |||
| 233 | <source src="/assets/posts/dna-synthesized/quote/out.mp3" type="audio/mpeg"> | 233 | <source src="/assets/posts/dna-synthesized/quote/out.mp3" type="audio/mpeg"> |
| 234 | </audio> | 234 | </audio> |
| 235 | 235 | ||
| 236 |  | 236 | {:loading="lazy"} |
| 237 | 237 | ||
| 238 | ### Mouse | 238 | ### Mouse |
| 239 | 239 | ||
| @@ -245,7 +245,7 @@ here](http://ftp.ensembl.org/pub/release-106/fasta/mus_musculus/dna/). | |||
| 245 | <source src="/assets/posts/dna-synthesized/mouse/out.mp3" type="audio/mpeg"> | 245 | <source src="/assets/posts/dna-synthesized/mouse/out.mp3" type="audio/mpeg"> |
| 246 | </audio> | 246 | </audio> |
| 247 | 247 | ||
| 248 |  | 248 | {:loading="lazy"} |
| 249 | 249 | ||
| 250 | ### Bison | 250 | ### Bison |
| 251 | 251 | ||
| @@ -257,7 +257,7 @@ here](http://ftp.ensembl.org/pub/release-106/fasta/bison_bison_bison/cdna/). | |||
| 257 | <source src="/assets/posts/dna-synthesized/bison/out.mp3" type="audio/mpeg"> | 257 | <source src="/assets/posts/dna-synthesized/bison/out.mp3" type="audio/mpeg"> |
| 258 | </audio> | 258 | </audio> |
| 259 | 259 | ||
| 260 |  | 260 | {:loading="lazy"} |
| 261 | 261 | ||
| 262 | ### Taurus | 262 | ### Taurus |
| 263 | 263 | ||
| @@ -269,7 +269,7 @@ here](http://ftp.ensembl.org/pub/release-106/fasta/bos_taurus/cdna/). | |||
| 269 | <source src="/assets/posts/dna-synthesized/taurus/out.mp3" type="audio/mpeg"> | 269 | <source src="/assets/posts/dna-synthesized/taurus/out.mp3" type="audio/mpeg"> |
| 270 | </audio> | 270 | </audio> |
| 271 | 271 | ||
| 272 |  | 272 | {:loading="lazy"} |
| 273 | 273 | ||
| 274 | ## Making a drummer out of a DNA sequence | 274 | ## Making a drummer out of a DNA sequence |
| 275 | 275 | ||
| @@ -282,11 +282,11 @@ Elektron is connected to my MacBook via USB cable and audio out is patched to a | |||
| 282 | Sony Bluetooth speaker I have that supports 3.5 mm audio in. Elektron doesn't | 282 | Sony Bluetooth speaker I have that supports 3.5 mm audio in. Elektron doesn't |
| 283 | have internal speakers. | 283 | have internal speakers. |
| 284 | 284 | ||
| 285 |  | 285 | {:loading="lazy"} |
| 286 | 286 | ||
| 287 |  | 287 | {:loading="lazy"} |
| 288 | 288 | ||
| 289 |  | 289 | {:loading="lazy"} |
| 290 | 290 | ||
| 291 | For communicating with Elektron, I choose `pygame` Python module that has MIDI | 291 | For communicating with Elektron, I choose `pygame` Python module that has MIDI |
| 292 | built in. With this, it was rather simple to send notes to the device. All I did | 292 | built in. With this, it was rather simple to send notes to the device. All I did |
| @@ -295,7 +295,7 @@ was map MIDI notes to the actual Nucleotides. | |||
| 295 | Before all of this I also checked Audio MIDI Setup app under MacOS and checked | 295 | Before all of this I also checked Audio MIDI Setup app under MacOS and checked |
| 296 | MIDI Studio by pressing ⌘-2. | 296 | MIDI Studio by pressing ⌘-2. |
| 297 | 297 | ||
| 298 |  | 298 | {:loading="lazy"} |
| 299 | 299 | ||
| 300 | The whole script that parses and send notes to the Elektron looks like this. | 300 | The whole script that parses and send notes to the Elektron looks like this. |
| 301 | 301 | ||
diff --git a/_posts/2022-08-13-algae-spotted-on-river-sava.md b/_posts/2022-08-13-algae-spotted-on-river-sava.md index 064c112..02314f4 100644 --- a/_posts/2022-08-13-algae-spotted-on-river-sava.md +++ b/_posts/2022-08-13-algae-spotted-on-river-sava.md | |||
| @@ -15,17 +15,17 @@ This is the first time I've seen something like this in my whole life. | |||
| 15 | 15 | ||
| 16 | Below are some photographs taken from a DJI drone capturing the event. | 16 | Below are some photographs taken from a DJI drone capturing the event. |
| 17 | 17 | ||
| 18 |  | 18 | {:loading="lazy"} |
| 19 | 19 | ||
| 20 |  | 20 | {:loading="lazy"} |
| 21 | 21 | ||
| 22 |  | 22 | {:loading="lazy"} |
| 23 | 23 | ||
| 24 |  | 24 | {:loading="lazy"} |
| 25 | 25 | ||
| 26 |  | 26 | {:loading="lazy"} |
| 27 | 27 | ||
| 28 |  | 28 | {:loading="lazy"} |
| 29 | 29 | ||
| 30 | I will try to get more photos of this in the future days and if something | 30 | I will try to get more photos of this in the future days and if something |
| 31 | intriguing shows up will post it again on the blog. | 31 | intriguing shows up will post it again on the blog. |
diff --git a/_posts/2023-05-24-fresh-9front-desktop.md b/_posts/2023-05-24-fresh-9front-desktop.md index bdad44a..5da89e7 100644 --- a/_posts/2023-05-24-fresh-9front-desktop.md +++ b/_posts/2023-05-24-fresh-9front-desktop.md | |||
| @@ -11,5 +11,5 @@ tags: [plan9] | |||
| 11 | I have been experimenting with Plan9/9front for a week now. Noice! This is how | 11 | I have been experimenting with Plan9/9front for a week now. Noice! This is how |
| 12 | my desktop looks like. | 12 | my desktop looks like. |
| 13 | 13 | ||
| 14 |  | 14 | {:loading="lazy"} |
| 15 | 15 | ||
diff --git a/_posts/2023-05-25-dcss-new-player-guide.md b/_posts/2023-05-25-dcss-new-player-guide.md index 76242f3..dd63f79 100644 --- a/_posts/2023-05-25-dcss-new-player-guide.md +++ b/_posts/2023-05-25-dcss-new-player-guide.md | |||
| @@ -15,7 +15,7 @@ form on another on [craw's](https://github.com/crawl/crawl) official repository. | |||
| 15 | game | 15 | game |
| 16 | - [DCSS Manual](/assets/notes/dcss_manual.pdf) - Extensive manual about the game | 16 | - [DCSS Manual](/assets/notes/dcss_manual.pdf) - Extensive manual about the game |
| 17 | 17 | ||
| 18 |  | 18 | {:loading="lazy"} |
| 19 | 19 | ||
| 20 | **Movement and Exploration** | 20 | **Movement and Exploration** |
| 21 | 21 | ||
diff --git a/_posts/2023-05-25-show-xterm-colors.md b/_posts/2023-05-25-show-xterm-colors.md index 00a3e76..56050fd 100644 --- a/_posts/2023-05-25-show-xterm-colors.md +++ b/_posts/2023-05-25-show-xterm-colors.md | |||
| @@ -11,7 +11,7 @@ tags: [linux] | |||
| 11 | - `bash xterm-palette.sh` - will show you number of max colors available | 11 | - `bash xterm-palette.sh` - will show you number of max colors available |
| 12 | - `bash xterm-palette.sh -v` - will create a list of all colors with codes | 12 | - `bash xterm-palette.sh -v` - will create a list of all colors with codes |
| 13 | 13 | ||
| 14 |  | 14 | {:loading="lazy"} |
| 15 | 15 | ||
| 16 | ```sh | 16 | ```sh |
| 17 | #!/usr/bin/env bash | 17 | #!/usr/bin/env bash |
diff --git a/_posts/2023-05-27-drawing-pixels-in-plan9.md b/_posts/2023-05-27-drawing-pixels-in-plan9.md index c1e9335..3d37a2c 100644 --- a/_posts/2023-05-27-drawing-pixels-in-plan9.md +++ b/_posts/2023-05-27-drawing-pixels-in-plan9.md | |||
| @@ -22,7 +22,7 @@ More information: | |||
| 22 | - [all man pages](https://9fans.github.io/plan9port/man/man3/) | 22 | - [all man pages](https://9fans.github.io/plan9port/man/man3/) |
| 23 | can be a valuable resource for learning about the system | 23 | can be a valuable resource for learning about the system |
| 24 | 24 | ||
| 25 |  | 25 | {:loading="lazy"} |
| 26 | 26 | ||
| 27 | ```c | 27 | ```c |
| 28 | // main.c | 28 | // main.c |
diff --git a/_posts/2023-05-29-grep-to-less-maintain-colors.md b/_posts/2023-05-29-grep-to-less-maintain-colors.md index 49baa01..b1421b9 100644 --- a/_posts/2023-05-29-grep-to-less-maintain-colors.md +++ b/_posts/2023-05-29-grep-to-less-maintain-colors.md | |||
| @@ -23,4 +23,4 @@ string. | |||
| 23 | grep --color=always -rni "TODO:" | less -R | 23 | grep --color=always -rni "TODO:" | less -R |
| 24 | ``` | 24 | ``` |
| 25 | 25 | ||
| 26 |  | 26 | {:loading="lazy"} |
diff --git a/_posts/2023-06-25-development-environments-with-nix.md b/_posts/2023-06-25-development-environments-with-nix.md index ddac7e0..a905f10 100644 --- a/_posts/2023-06-25-development-environments-with-nix.md +++ b/_posts/2023-06-25-development-environments-with-nix.md | |||
| @@ -59,7 +59,7 @@ export PS1="[\033[38;5;9m\]\u@\h\[$(tput sgr0)\]]$(is_inside_nix_shell)\[\033[33 | |||
| 59 | And this is what it looks like when you are in a Nix shell. Otherwise that part | 59 | And this is what it looks like when you are in a Nix shell. Otherwise that part |
| 60 | of prompt is omitted | 60 | of prompt is omitted |
| 61 | 61 | ||
| 62 |  | 62 | {:loading="lazy"} |
| 63 | 63 | ||
| 64 | More resources: | 64 | More resources: |
| 65 | 65 | ||
diff --git a/_posts/2023-08-01-make-b-w-svg-charts-with-matplotlib.md b/_posts/2023-08-01-make-b-w-svg-charts-with-matplotlib.md index 6e1fa14..461842d 100644 --- a/_posts/2023-08-01-make-b-w-svg-charts-with-matplotlib.md +++ b/_posts/2023-08-01-make-b-w-svg-charts-with-matplotlib.md | |||
| @@ -66,6 +66,6 @@ legend.get_frame().set_linewidth(0) | |||
| 66 | plt.savefig("plot.svg", format="svg") | 66 | plt.savefig("plot.svg", format="svg") |
| 67 | ``` | 67 | ``` |
| 68 | 68 | ||
| 69 |  | 69 | {:loading="lazy"} |
| 70 | 70 | ||
| 71 | The image above is SVG and you can zoom in and out and check that the image is vector. | 71 | The image above is SVG and you can zoom in and out and check that the image is vector. |
diff --git a/_posts/2023-08-05-floods-in-slovenia.md b/_posts/2023-08-05-floods-in-slovenia.md index 5a42781..8b2354a 100644 --- a/_posts/2023-08-05-floods-in-slovenia.md +++ b/_posts/2023-08-05-floods-in-slovenia.md | |||
| @@ -11,9 +11,9 @@ draft: false | |||
| 11 | 11 | ||
| 12 | <video src="/assets/notes/floods/IMG_1474.mp4" controls></video> | 12 | <video src="/assets/notes/floods/IMG_1474.mp4" controls></video> |
| 13 | 13 | ||
| 14 |  | 14 | {:loading="lazy"} |
| 15 | 15 | ||
| 16 |  | 16 | {:loading="lazy"} |
| 17 | 17 | ||
| 18 | <video src="/assets/notes/floods/IMG_1461.mp4" controls></video> | 18 | <video src="/assets/notes/floods/IMG_1461.mp4" controls></video> |
| 19 | 19 | ||
diff --git a/_posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md b/_posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md index 23d14b7..c47a726 100644 --- a/_posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md +++ b/_posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md | |||
| @@ -38,4 +38,4 @@ ffmpeg -y \ | |||
| 38 | - This will also cap frame rate to 6 (refer to `fps=6`) since that is enough and | 38 | - This will also cap frame rate to 6 (refer to `fps=6`) since that is enough and |
| 39 | this makes playback of GIFs smoother in a browser. | 39 | this makes playback of GIFs smoother in a browser. |
| 40 | 40 | ||
| 41 |  | 41 | {:loading="lazy"} |
diff --git a/_posts/2023-11-05-add-lazy-loading-to-jekyll-posts.md b/_posts/2023-11-05-add-lazy-loading-to-jekyll-posts.md new file mode 100644 index 0000000..8293a4d --- /dev/null +++ b/_posts/2023-11-05-add-lazy-loading-to-jekyll-posts.md | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | --- | ||
| 2 | title: "Add lazy loading of images in Jekyll posts" | ||
| 3 | permalink: /add-lazy-loading-to-jekyll-posts.html | ||
| 4 | date: 2023-11-05T09:04:28+02:00 | ||
| 5 | layout: post | ||
| 6 | type: note | ||
| 7 | draft: false | ||
| 8 | --- | ||
| 9 | |||
| 10 | Normally you define images with `![]()` in markdown files. But jekyll also | ||
| 11 | provides a way to adding custom attributes to tags with `{:attr="value"}`. | ||
| 12 | |||
| 13 | If you have lots of posts this command will append `{:loading="lazy"}` to all | ||
| 14 | images in all your markdown files. | ||
| 15 | |||
| 16 | ```md | ||
| 17 |  | ||
| 18 | ``` | ||
| 19 | |||
| 20 | will become | ||
| 21 | |||
| 22 | ```md | ||
| 23 | {:loading="lazy"} | ||
| 24 | ``` | ||
| 25 | |||
| 26 | Shell line bellow. Go into the folder where your posts are (probably `_posts`). | ||
| 27 | |||
| 28 | ```sh | ||
| 29 | find . -type f -name "*.md" -exec sed -i -E 's/(\!\[.*\]\((.*?)\))$/\1{:loading="lazy"}/' {} \; | ||
| 30 | ``` | ||
| 31 | |||
| 32 | Under the hood this adds `loading="lazy"` to HTML `img` nodes. | ||
| 33 | |||
| 34 | That is about it. | ||
