diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/curriculum-vitae.md | 2 | ||||
| -rw-r--r-- | src/experiments/encoding-binary-data-into-dna-sequence.md | 2 | ||||
| -rw-r--r-- | src/experiments/profiling-python-web-applications-with-visual-tools.md | 8 | ||||
| -rw-r--r-- | src/experiments/simple-iot-application.md | 2 | ||||
| -rw-r--r-- | src/experiments/using-digitalocean-spaces-object-storage-with-fuse.md | 2 | ||||
| -rw-r--r-- | src/experiments/using-sentiment-analysis-for-click-bait-detection-in-rss-feeds.md | 2 | ||||
| -rw-r--r-- | src/files/python-profiling/kcachegrind.png | bin | 0 -> 88486 bytes | |||
| -rw-r--r-- | src/files/python-profiling/profiling-viewer.png | bin | 0 -> 173672 bytes | |||
| -rw-r--r-- | src/files/python-profiling/snakeviz.png | bin | 0 -> 59601 bytes | |||
| -rw-r--r-- | src/index.html | 8 | ||||
| -rw-r--r-- | src/notes/golang-profiling-simplified.md | 2 | ||||
| -rw-r--r-- | src/notes/simplifying-and-reducing-clutter.md | 2 | ||||
| -rw-r--r-- | src/notes/what-i-ve-learned-developing-ad-server.md | 2 | ||||
| -rw-r--r-- | src/static/comments.js | 63 | ||||
| -rw-r--r-- | src/static/style.css | 40 |
15 files changed, 117 insertions, 18 deletions
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 @@ | |||
| 1 | title: Curriculum Vitae | 1 | title: Curriculum Vitae |
| 2 | date: 2018-01-16 | 2 | date: 2018-01-16 |
| 3 | tags: research | 3 | type: page |
| 4 | hide: false | 4 | hide: 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 @@ | |||
| 1 | title: Encoding binary data into DNA sequence | 1 | title: Encoding binary data into DNA sequence |
| 2 | description: 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 | 2 | description: 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 |
| 3 | date: 2019-01-03 | 3 | date: 2019-01-03 |
| 4 | tags: experiment | 4 | type: post |
| 5 | hide: false | 5 | hide: 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 @@ | |||
| 1 | title: Profiling Python web applications with visual tools | 1 | title: Profiling Python web applications with visual tools |
| 2 | description: Missing link when debugging and profiling python web application | 2 | description: Missing link when debugging and profiling python web application |
| 3 | date: 2017-04-21 | 3 | date: 2017-04-21 |
| 4 | tags: experiment | 4 | type: post |
| 5 | hide: false | 5 | hide: false |
| 6 | ---- | 6 | ---- |
| 7 | 7 | ||
| @@ -16,7 +16,7 @@ Before we begin there are some requirements. We will need to: | |||
| 16 | 16 | ||
| 17 | If you are using MacOS you should check out [Profiling Viewer](http://www.profilingviewer.com/) or [MacCallGrind](http://www.maccallgrind.com/). | 17 | If you are using MacOS you should check out [Profiling Viewer](http://www.profilingviewer.com/) or [MacCallGrind](http://www.maccallgrind.com/). |
| 18 | 18 | ||
| 19 |  | 19 |  |
| 20 | 20 | ||
| 21 | We will be dividing this post into two main categories: | 21 | We will be dividing this post into two main categories: |
| 22 | 22 | ||
| @@ -135,7 +135,7 @@ $ pyprof2calltree -i awesome_random_number.prof | |||
| 135 | 135 | ||
| 136 | This 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. | 136 | This 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 |  | 138 |  |
| 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 |  | 161 |  |
| 162 | 162 | ||
| 163 | Reddit user [ccharles](https://www.reddit.com/user/ccharles) suggested a better way for installing pip software by targeting user level instead of using sudo. | 163 | Reddit 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 @@ | |||
| 1 | title: Simple IOT application supported by real-time monitoring and data history | 1 | title: Simple IOT application supported by real-time monitoring and data history |
| 2 | description: Develop simple IOT application with Arduino MKR1000 and Python | 2 | description: Develop simple IOT application with Arduino MKR1000 and Python |
| 3 | date: 2017-08-11 | 3 | date: 2017-08-11 |
| 4 | tags: experiment | 4 | type: post |
| 5 | hide: false | 5 | hide: 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 @@ | |||
| 1 | title: Using DigitalOcean Spaces Object Storage with FUSE | 1 | title: Using DigitalOcean Spaces Object Storage with FUSE |
| 2 | description: Using DigitalOcean Spaces Object Storage with FUSE | 2 | description: Using DigitalOcean Spaces Object Storage with FUSE |
| 3 | date: 2018-01-16 | 3 | date: 2018-01-16 |
| 4 | tags: experiment | 4 | type: post |
| 5 | hide: false | 5 | hide: 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 @@ | |||
| 1 | title: Using sentiment analysis for click‑bait detection in RSS feeds | 1 | title: Using sentiment analysis for click‑bait detection in RSS feeds |
| 2 | description: Using Python with sentiment analysis to detect if titles in RSS feeds are click-bait | 2 | description: Using Python with sentiment analysis to detect if titles in RSS feeds are click-bait |
| 3 | date: 2019-10-19 | 3 | date: 2019-10-19 |
| 4 | tags: experiment | 4 | type: post |
| 5 | hide: false | 5 | hide: 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 @@ | |||
| 1 | title: Golang profiling simplified | 1 | title: Golang profiling simplified |
| 2 | description: Golang profiling demystified | 2 | description: Golang profiling demystified |
| 3 | date: 2017-03-07 | 3 | date: 2017-03-07 |
| 4 | tags: blog | 4 | type: post |
| 5 | hide: false | 5 | hide: 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 @@ | |||
| 1 | title: Simplifying and reducing clutter in my life and work | 1 | title: Simplifying and reducing clutter in my life and work |
| 2 | description: Simplifying and reducing clutter in my life and work | 2 | description: Simplifying and reducing clutter in my life and work |
| 3 | date: 2019-10-14 | 3 | date: 2019-10-14 |
| 4 | tags: blog | 4 | type: post |
| 5 | hide: false | 5 | hide: 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 @@ | |||
| 1 | title: What I've learned developing ad server | 1 | title: What I've learned developing ad server |
| 2 | description: Lessons I learned developing contextual ad server | 2 | description: Lessons I learned developing contextual ad server |
| 3 | date: 2017-04-17 | 3 | date: 2017-04-17 |
| 4 | tags: blog | 4 | type: post |
| 5 | hide: false | 5 | hide: 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 @@ | |||
| 1 | var 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 | }; | ||
| 10 | firebase.initializeApp(firebaseConfig); | ||
| 11 | |||
| 12 | var database = firebase.database(); | ||
| 13 | var docPath = 'comments' + window.location.pathname.replace('.html', ''); | ||
| 14 | var submit = document.querySelector('#submit'); | ||
| 15 | var comments = document.querySelector('.comments ul'); | ||
| 16 | var textName = document.querySelector('#name'); | ||
| 17 | var textComment = document.querySelector('#comment'); | ||
| 18 | var ref = firebase.database().ref(docPath); | ||
| 19 | |||
| 20 | function encodeHTML(s) { | ||
| 21 | return s.replace(/&/g, '&').replace(/</g, '<').replace(/"/g, '"'); | ||
| 22 | } | ||
| 23 | |||
| 24 | ref.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 | |||
| 46 | submit.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 | |||
| 1 | body { | 5 | body { |
| 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 | ||
| 41 | ul.article-list li { | 45 | ul.article-list li { |
| 42 | margin-bottom: 10px; | 46 | margin-bottom: 10px; |
| 47 | } | ||
| 48 | |||
| 49 | ul.article-list li div { | ||
| 50 | display: flex; | ||
| 43 | } | 51 | } |
| 44 | 52 | ||
| 45 | ul.article-list time { | 53 | ul.article-list time { |
| 46 | display: inline-block; | 54 | display: inline-block; |
| 47 | min-width: 120px; | 55 | min-width: 130px; |
| 48 | } | 56 | } |
| 49 | 57 | ||
| 58 | |||
| 50 | article .info { | 59 | article .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; |
