aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig2
-rw-r--r--site.tmpl29
-rw-r--r--src/curriculum-vitae.md2
-rw-r--r--src/experiments/encoding-binary-data-into-dna-sequence.md2
-rw-r--r--src/experiments/profiling-python-web-applications-with-visual-tools.md8
-rw-r--r--src/experiments/simple-iot-application.md2
-rw-r--r--src/experiments/using-digitalocean-spaces-object-storage-with-fuse.md2
-rw-r--r--src/experiments/using-sentiment-analysis-for-click-bait-detection-in-rss-feeds.md2
-rw-r--r--src/files/python-profiling/kcachegrind.pngbin0 -> 88486 bytes
-rw-r--r--src/files/python-profiling/profiling-viewer.pngbin0 -> 173672 bytes
-rw-r--r--src/files/python-profiling/snakeviz.pngbin0 -> 59601 bytes
-rw-r--r--src/index.html8
-rw-r--r--src/notes/golang-profiling-simplified.md2
-rw-r--r--src/notes/simplifying-and-reducing-clutter.md2
-rw-r--r--src/notes/what-i-ve-learned-developing-ad-server.md2
-rw-r--r--src/static/comments.js63
-rw-r--r--src/static/style.css40
17 files changed, 145 insertions, 21 deletions
diff --git a/.editorconfig b/.editorconfig
index 9f48fab..1923d41 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,6 +1,8 @@
1root = true 1root = true
2 2
3[*] 3[*]
4indent_style = space
5indent_size = 2
4charset = utf-8 6charset = utf-8
5trim_trailing_whitespace = true 7trim_trailing_whitespace = true
6insert_final_newline = true 8insert_final_newline = true
diff --git a/site.tmpl b/site.tmpl
index 243fc59..39e8c6c 100644
--- a/site.tmpl
+++ b/site.tmpl
@@ -72,15 +72,22 @@
72 <article> 72 <article>
73 <header> 73 <header>
74 <h1>{{ .Title }}</h1> 74 <h1>{{ .Title }}</h1>
75 {{ if eq .Other.Type "post" }}
75 <div class="info"> 76 <div class="info">
76 {{ template "date" .Date }} 77 {{ template "date" .Date }}
77 {{ template "author" . }} 78 {{ template "author" . }}
78 </div> 79 </div>
80 {{ end }}
79 </header> 81 </header>
80 <section> 82 <section>
81 {{ .Content }} 83 {{ .Content }}
82 </section> 84 </section>
83 </article> 85 </article>
86
87 {{ if eq .Other.Type "post" }}
88 {{ template "comments" . }}
89 {{ end }}
90
84 {{ template "modified" . }} 91 {{ template "modified" . }}
85{{ end }} 92{{ end }}
86 93
@@ -113,3 +120,19 @@
113 <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-core.min.js"></script> 120 <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-core.min.js"></script>
114 <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/plugins/autoloader/prism-autoloader.min.js"></script> 121 <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/plugins/autoloader/prism-autoloader.min.js"></script>
115{{ end }} 122{{ end }}
123
124{{ define "comments" }}
125 <div class="comments">
126 <h3>Comments</h3>
127 <div class="form">
128 <div><input id="name" placeholder="Your name" maxlength="20"></div>
129 <div><textarea id="comment" placeholder="Your comment" maxlength="500"></textarea></div>
130 <div><button id="submit">Post a comment</button></div>
131 </div>
132 <ul></ul>
133 </div>
134
135 <script src="https://www.gstatic.com/firebasejs/7.2.1/firebase-app.js"></script>
136 <script src="https://www.gstatic.com/firebasejs/7.2.1/firebase-database.js"></script>
137 <script src="{{ .Rel "static/comments.js" }}?v={{ .ModTime.Format "20060102150405" }}" async></script>
138{{ end }}
diff --git a/src/curriculum-vitae.md b/src/curriculum-vitae.md
index 6900867..acbd83e 100644
--- a/src/curriculum-vitae.md
+++ b/src/curriculum-vitae.md
@@ -1,6 +1,6 @@
1title: Curriculum Vitae 1title: Curriculum Vitae
2date: 2018-01-16 2date: 2018-01-16
3tags: research 3type: page
4hide: false 4hide: false
5---- 5----
6 6
diff --git a/src/experiments/encoding-binary-data-into-dna-sequence.md b/src/experiments/encoding-binary-data-into-dna-sequence.md
index cdff15f..bfcf710 100644
--- a/src/experiments/encoding-binary-data-into-dna-sequence.md
+++ b/src/experiments/encoding-binary-data-into-dna-sequence.md
@@ -1,7 +1,7 @@
1title: Encoding binary data into DNA sequence 1title: Encoding binary data into DNA sequence
2description: Imagine a world where you could go outside and take a leaf from a tree and put it through your personal DNA sequencer and get data like music, videos or computer programs from it 2description: Imagine a world where you could go outside and take a leaf from a tree and put it through your personal DNA sequencer and get data like music, videos or computer programs from it
3date: 2019-01-03 3date: 2019-01-03
4tags: experiment 4type: post
5hide: false 5hide: false
6---- 6----
7 7
diff --git a/src/experiments/profiling-python-web-applications-with-visual-tools.md b/src/experiments/profiling-python-web-applications-with-visual-tools.md
index 58d85bf..cf7164c 100644
--- a/src/experiments/profiling-python-web-applications-with-visual-tools.md
+++ b/src/experiments/profiling-python-web-applications-with-visual-tools.md
@@ -1,7 +1,7 @@
1title: Profiling Python web applications with visual tools 1title: Profiling Python web applications with visual tools
2description: Missing link when debugging and profiling python web application 2description: Missing link when debugging and profiling python web application
3date: 2017-04-21 3date: 2017-04-21
4tags: experiment 4type: post
5hide: false 5hide: false
6---- 6----
7 7
@@ -16,7 +16,7 @@ Before we begin there are some requirements. We will need to:
16 16
17If you are using MacOS you should check out [Profiling Viewer](http://www.profilingviewer.com/) or [MacCallGrind](http://www.maccallgrind.com/). 17If you are using MacOS you should check out [Profiling Viewer](http://www.profilingviewer.com/) or [MacCallGrind](http://www.maccallgrind.com/).
18 18
19![KCachegrind](/files/kcachegrind.png) 19![KCachegrind](/files/python-profiling/kcachegrind.png)
20 20
21We will be dividing this post into two main categories: 21We will be dividing this post into two main categories:
22 22
@@ -135,7 +135,7 @@ $ pyprof2calltree -i awesome_random_number.prof
135 135
136This file can be opened with visualizing tools listed above. In this case we will be using Profilling Viewer under MacOS. You can open image in new tab. As you can see from this example there is hierarchy of execution order of your code. 136This file can be opened with visualizing tools listed above. In this case we will be using Profilling Viewer under MacOS. You can open image in new tab. As you can see from this example there is hierarchy of execution order of your code.
137 137
138![Profilling Viewer](/files/profiling-viewer.png) 138![Profilling Viewer](/files/python-profiling/profiling-viewer.png)
139 139
140> Make sure you convert output of the cProfile output every time you want to refresh and take a look at your possible optimizations because cProfile updates .prof file every time browser hits the function. 140> Make sure you convert output of the cProfile output every time you want to refresh and take a look at your possible optimizations because cProfile updates .prof file every time browser hits the function.
141 141
@@ -158,7 +158,7 @@ $ snakeviz awesome_random_number.prof
158# shows visualized profile 158# shows visualized profile
159``` 159```
160 160
161![SnakeViz](/files/snakeviz.png) 161![SnakeViz](/files/python-profiling/snakeviz.png)
162 162
163Reddit user [ccharles](https://www.reddit.com/user/ccharles) suggested a better way for installing pip software by targeting user level instead of using sudo. 163Reddit user [ccharles](https://www.reddit.com/user/ccharles) suggested a better way for installing pip software by targeting user level instead of using sudo.
164 164
diff --git a/src/experiments/simple-iot-application.md b/src/experiments/simple-iot-application.md
index 1543e52..c7f59cf 100644
--- a/src/experiments/simple-iot-application.md
+++ b/src/experiments/simple-iot-application.md
@@ -1,7 +1,7 @@
1title: Simple IOT application supported by real-time monitoring and data history 1title: Simple IOT application supported by real-time monitoring and data history
2description: Develop simple IOT application with Arduino MKR1000 and Python 2description: Develop simple IOT application with Arduino MKR1000 and Python
3date: 2017-08-11 3date: 2017-08-11
4tags: experiment 4type: post
5hide: false 5hide: false
6---- 6----
7 7
diff --git a/src/experiments/using-digitalocean-spaces-object-storage-with-fuse.md b/src/experiments/using-digitalocean-spaces-object-storage-with-fuse.md
index ab0079f..1d3fe48 100644
--- a/src/experiments/using-digitalocean-spaces-object-storage-with-fuse.md
+++ b/src/experiments/using-digitalocean-spaces-object-storage-with-fuse.md
@@ -1,7 +1,7 @@
1title: Using DigitalOcean Spaces Object Storage with FUSE 1title: Using DigitalOcean Spaces Object Storage with FUSE
2description: Using DigitalOcean Spaces Object Storage with FUSE 2description: Using DigitalOcean Spaces Object Storage with FUSE
3date: 2018-01-16 3date: 2018-01-16
4tags: experiment 4type: post
5hide: false 5hide: false
6---- 6----
7 7
diff --git a/src/experiments/using-sentiment-analysis-for-click-bait-detection-in-rss-feeds.md b/src/experiments/using-sentiment-analysis-for-click-bait-detection-in-rss-feeds.md
index 1f9d400..ad0362b 100644
--- a/src/experiments/using-sentiment-analysis-for-click-bait-detection-in-rss-feeds.md
+++ b/src/experiments/using-sentiment-analysis-for-click-bait-detection-in-rss-feeds.md
@@ -1,7 +1,7 @@
1title: Using sentiment analysis for click&#8209;bait detection in RSS feeds 1title: Using sentiment analysis for click&#8209;bait detection in RSS feeds
2description: Using Python with sentiment analysis to detect if titles in RSS feeds are click-bait 2description: Using Python with sentiment analysis to detect if titles in RSS feeds are click-bait
3date: 2019-10-19 3date: 2019-10-19
4tags: experiment 4type: post
5hide: false 5hide: false
6---- 6----
7 7
diff --git a/src/files/python-profiling/kcachegrind.png b/src/files/python-profiling/kcachegrind.png
new file mode 100644
index 0000000..0dc48ab
--- /dev/null
+++ b/src/files/python-profiling/kcachegrind.png
Binary files differ
diff --git a/src/files/python-profiling/profiling-viewer.png b/src/files/python-profiling/profiling-viewer.png
new file mode 100644
index 0000000..a450513
--- /dev/null
+++ b/src/files/python-profiling/profiling-viewer.png
Binary files differ
diff --git a/src/files/python-profiling/snakeviz.png b/src/files/python-profiling/snakeviz.png
new file mode 100644
index 0000000..5bab395
--- /dev/null
+++ b/src/files/python-profiling/snakeviz.png
Binary files differ
diff --git a/src/index.html b/src/index.html
index c0767b0..6b987f7 100644
--- a/src/index.html
+++ b/src/index.html
@@ -2,8 +2,10 @@
2<ul class="article-list"> 2<ul class="article-list">
3{{ range .Site.Pages.Children "experiments/" }} 3{{ range .Site.Pages.Children "experiments/" }}
4 <li> 4 <li>
5 {{ template "date" .Date }} 5 <div>
6 <a href="{{ $.Rel .Url }}" title="{{ .Title }}">{{ .Title }}</a> 6 <time>{{ template "date" .Date }}</time>
7 <a href="{{ $.Rel .Url }}" title="{{ .Title }}">{{ .Title }}</a>
8 </div>
7 </li> 9 </li>
8{{ end }} 10{{ end }}
9</ul> 11</ul>
@@ -12,7 +14,7 @@
12<ul class="article-list"> 14<ul class="article-list">
13{{ range .Site.Pages.Children "notes/" }} 15{{ range .Site.Pages.Children "notes/" }}
14 <li> 16 <li>
15 {{ template "date" .Date }} 17 <time>{{ template "date" .Date }}</time>
16 <a href="{{ $.Rel .Url }}" title="{{ .Title }}">{{ .Title }}</a> 18 <a href="{{ $.Rel .Url }}" title="{{ .Title }}">{{ .Title }}</a>
17 </li> 19 </li>
18{{ end }} 20{{ end }}
diff --git a/src/notes/golang-profiling-simplified.md b/src/notes/golang-profiling-simplified.md
index c8c6f16..29e07d6 100644
--- a/src/notes/golang-profiling-simplified.md
+++ b/src/notes/golang-profiling-simplified.md
@@ -1,7 +1,7 @@
1title: Golang profiling simplified 1title: Golang profiling simplified
2description: Golang profiling demystified 2description: Golang profiling demystified
3date: 2017-03-07 3date: 2017-03-07
4tags: blog 4type: post
5hide: false 5hide: false
6---- 6----
7 7
diff --git a/src/notes/simplifying-and-reducing-clutter.md b/src/notes/simplifying-and-reducing-clutter.md
index 064f08b..483d0dc 100644
--- a/src/notes/simplifying-and-reducing-clutter.md
+++ b/src/notes/simplifying-and-reducing-clutter.md
@@ -1,7 +1,7 @@
1title: Simplifying and reducing clutter in my life and work 1title: Simplifying and reducing clutter in my life and work
2description: Simplifying and reducing clutter in my life and work 2description: Simplifying and reducing clutter in my life and work
3date: 2019-10-14 3date: 2019-10-14
4tags: blog 4type: post
5hide: false 5hide: false
6---- 6----
7 7
diff --git a/src/notes/what-i-ve-learned-developing-ad-server.md b/src/notes/what-i-ve-learned-developing-ad-server.md
index d1cc791..25f11a3 100644
--- a/src/notes/what-i-ve-learned-developing-ad-server.md
+++ b/src/notes/what-i-ve-learned-developing-ad-server.md
@@ -1,7 +1,7 @@
1title: What I've learned developing ad server 1title: What I've learned developing ad server
2description: Lessons I learned developing contextual ad server 2description: Lessons I learned developing contextual ad server
3date: 2017-04-17 3date: 2017-04-17
4tags: blog 4type: post
5hide: false 5hide: false
6---- 6----
7 7
diff --git a/src/static/comments.js b/src/static/comments.js
new file mode 100644
index 0000000..c8234d2
--- /dev/null
+++ b/src/static/comments.js
@@ -0,0 +1,63 @@
1var firebaseConfig = {
2 apiKey: "AIzaSyD3E0XtiUJI4-JIxcIPZziNLGVaTdojz20",
3 authDomain: "mitja-felicijan-blog.firebaseapp.com",
4 databaseURL: "https://mitja-felicijan-blog.firebaseio.com",
5 projectId: "mitja-felicijan-blog",
6 storageBucket: "mitja-felicijan-blog.appspot.com",
7 messagingSenderId: "41650892882",
8 appId: "1:41650892882:web:b308f0a9c47198bdf7ef8b"
9};
10firebase.initializeApp(firebaseConfig);
11
12var database = firebase.database();
13var docPath = 'comments' + window.location.pathname.replace('.html', '');
14var submit = document.querySelector('#submit');
15var comments = document.querySelector('.comments ul');
16var textName = document.querySelector('#name');
17var textComment = document.querySelector('#comment');
18var ref = firebase.database().ref(docPath);
19
20function encodeHTML(s) {
21 return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
22}
23
24ref.on("value", function (snapshot) {
25 comments.innerHTML = '';
26 var commentList = Array();
27
28 // generating normal array
29 snapshot.forEach(function (item) {
30 commentList.push(item.val())
31 });
32
33 // rendering html
34 commentList.reverse().forEach(function (item) {
35 var liItem = `<li>
36 <div><b>${encodeHTML(item.name)}</b> - ${encodeHTML(item.published)}</div>
37 <div>${encodeHTML(item.comment)}</div>
38 </li>`;
39 comments.innerHTML += liItem;
40 });
41
42}, function (errorObject) {
43 console.log("The read failed: " + errorObject.code);
44});
45
46submit.addEventListener('click', function (evt) {
47 if (textName.value && textComment.value) {
48 submit.disabled = true;
49 firebase.database().ref(docPath + '/' + Date.now()).set({
50 name: textName.value,
51 comment: textComment.value,
52 published: new Date().toISOString().slice(0, 16).replace('T', ' '),
53 }, function (error) {
54 if (error) {
55 alert('Data could not be saved.' + error);
56 } else {
57 textName.value = '';
58 textComment.value = '';
59 submit.disabled = false;
60 }
61 });
62 }
63});
diff --git a/src/static/style.css b/src/static/style.css
index b7fe7f7..f76fea0 100644
--- a/src/static/style.css
+++ b/src/static/style.css
@@ -1,3 +1,7 @@
1* {
2 box-sizing: border-box;
3}
4
1body { 5body {
2 line-height: 150%; 6 line-height: 150%;
3 margin-bottom: 100px; 7 margin-bottom: 100px;
@@ -39,14 +43,19 @@ img {
39} 43}
40 44
41ul.article-list li { 45ul.article-list li {
42 margin-bottom: 10px; 46 margin-bottom: 10px;
47}
48
49ul.article-list li div {
50 display: flex;
43} 51}
44 52
45ul.article-list time { 53ul.article-list time {
46 display: inline-block; 54 display: inline-block;
47 min-width: 120px; 55 min-width: 130px;
48} 56}
49 57
58
50article .info { 59article .info {
51 font-style: oblique; 60 font-style: oblique;
52} 61}
@@ -84,6 +93,31 @@ p.modified {
84 color: #000; 93 color: #000;
85} 94}
86 95
96
97.comments {
98 margin-top: 50px;
99}
100.comments ul {
101 margin-top: 30px;
102 padding-left: 15px;
103}
104.comments ul li {
105 margin-bottom: 20px;
106}
107.comments input,
108.comments textarea {
109 width: 100%;
110 padding: 10px;
111 margin-bottom: 10px;
112 font-family: inherit;
113 font-size: inherit;
114 border: 1px solid lightgray;
115}
116.comments textarea {
117 resize: vertical;
118 height: 100px;
119}
120
87@media only screen and (max-width:480px) { 121@media only screen and (max-width:480px) {
88 main { 122 main {
89 padding: 20px; 123 padding: 20px;