-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 146afc9
Showing
52 changed files
with
1,763 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
rake test | ||
|
||
export CFZ=$CFZ | ||
export CFK=$CFK | ||
SUCCESS=$(curl -X POST "https://api.cloudflare.com/client/v4/zones/${CFZ}/purge_cache" \ | ||
-H "Authorization: Bearer ${CFK}" \ | ||
-H "Content-Type: application/json" \ | ||
--data '{"purge_everything":true}' \ | ||
| jq '.success') | ||
|
||
if [ "$SUCCESS" != "true" ]; then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Ruby | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 | ||
with: | ||
ruby-version: '3.1' | ||
- name: Install dependencies | ||
run: bundle install | ||
- name: Run script | ||
run: | | ||
"${GITHUB_WORKSPACE}/.github/scripts/main.sh" | ||
env: | ||
CFZ: ${{ secrets.CFZ }} | ||
CFK: ${{ secrets.CFK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*.DS_Store | ||
Gemfile.lock | ||
.ruby-gemset | ||
.vscode | ||
.sass-cache | ||
_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
layout: base | ||
title: 404 | ||
lang: en | ||
sitemap: false | ||
--- | ||
|
||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-12 col-lg-7"> | ||
|
||
{% include header.html heading="Page not found" %} | ||
|
||
<div style="max-width:854px" class="mt-5"> | ||
<div style="position:relative;height:0;padding-bottom:56.25%"> | ||
<iframe src="https://embed.ted.com/talks/renny_gleeson_404_the_story_of_a_page_not_found" width="854" height="480" style="position:absolute;left:0;top:0;width:100%;height:100%" frameborder="0" scrolling="no" allowfullscreen></iframe> | ||
</div> | ||
</div> | ||
|
||
{% include footer.html %} | ||
|
||
</div> | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hadalin.me |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem "webrick", "~> 1.7" | ||
gem 'github-pages', group: :jekyll_plugins | ||
gem 'jekyll-sitemap' | ||
gem 'jekyll-feed' | ||
gem 'rake' | ||
gem 'html-proofer' | ||
gem 'jekyll-redirect-from' | ||
|
||
group :jekyll_plugins do | ||
gem 'jekyll-commonmark-ghpages' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[![.github/workflows/ci.yml](https://github.com/hadalin/hadalin.github.io/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/hadalin/hadalin.github.io/actions/workflows/ci.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'html-proofer' | ||
|
||
task :test do | ||
sh "bundle exec jekyll build --config _config.yml,_config_rake.yml" | ||
options = { | ||
:check_html => true, | ||
:enforce_https => false, | ||
:report_invalid_tags => true, | ||
:report_mismatched_tags => true, | ||
:report_missing_doctype => true, | ||
:check_opengraph => true, | ||
:check_favicon => true, | ||
:ignore_status_codes => [403, 503, 999], | ||
:url_ignore => [/^https:\/\/twitter.com.*$/], | ||
:typhoeus => { | ||
:ssl_verifypeer => false, | ||
:ssl_verifyhost => 0, | ||
} | ||
} | ||
HTMLProofer.check_directory("./_site", options).run | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
title: Primož Hadalin | ||
markdown: CommonMarkGhPages | ||
commonmark: | ||
options: ["UNSAFE", "SMART", "FOOTNOTES"] | ||
extensions: ["strikethrough", "autolink", "table", "tagfilter"] | ||
highlighter: rouge | ||
exclude: [CNAME, Gemfile, Gemfile.lock, README.md] | ||
permalink: /:categories/:title | ||
|
||
baseurl: / | ||
url: https://hadalin.me | ||
plugins: | ||
- jekyll-sitemap | ||
- jekyll-feed | ||
- jekyll-redirect-from | ||
|
||
whitelist: | ||
- jekyll-redirect-from | ||
|
||
defaults: | ||
- | ||
scope: | ||
path: "files/**/*" | ||
values: | ||
sitemap: false | ||
|
||
sass: | ||
style: compact | ||
|
||
owner: Primož Hadalin | ||
email: [email protected] | ||
github: https://github.com/hadalin | ||
gitlab: https://gitlab.com/primoz.hadalin | ||
linkedin: https://linkedin.com/in/hadalin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
url: localhost:4000 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div class="mb-3"> </div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="mt-5 heading header"> | ||
<small><a href="{{ site.url }}">Primož Hadalin</a>{% if include.breadcrumb_1_title %} <span class="separator">/</span> <a href="{{ include.breadcrumb_1_url }}">{{ include.breadcrumb_1_title }}</a>{% endif %}</small> | ||
<h1>{{ include.heading }}</h1> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<html{% if page.lang %} lang="{{ page.lang }}"{% endif %}> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>{{ page.title }}{% if page.url != '/' %} - {{ site.title }}{% endif %}</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
|
||
<link rel="icon" type="image/ico" href="{{ '/favicon.ico' | relative_url }}"> | ||
<link rel="apple-touch-icon" sizes="180x180" href="{{ '/apple-touch-icon.png' | relative_url }}"> | ||
<link rel="icon" type="image/png" sizes="32x32" href="{{ '/favicon-32x32.png' | relative_url }}"> | ||
<link rel="icon" type="image/png" sizes="16x16" href="{{ '/favicon-16x16.png' | relative_url }}"> | ||
<link rel="manifest" href="{{ '/site.webmanifest' | relative_url }}"> | ||
<link type="text/plain" rel="author" href="{{ '/humans.txt' | relative_url }}"> | ||
|
||
{% if page.description %} | ||
<meta name="description" content="{{ page.description }}"> | ||
{% endif %} | ||
|
||
{% if page.keywords %} | ||
<meta name="keywords" content="{{ page.keywords | join: ',' }}"> | ||
{% endif %} | ||
|
||
{% if page.canonical %} | ||
<link rel="canonical" href="{{ page.canonical }}"> | ||
{% endif %} | ||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Serif+Pro:400,700&subset=latin-ext"> | ||
<link rel="stylesheet" href="{{ '/assets/css/bootstrap-4.6.2.min.css' | relative_url }}"> | ||
|
||
<link rel="alternate" type="application/atom+xml" title="Essays Atom Feed" href="{{ 'feed.xml' | absolute_url }}"> | ||
|
||
<noscript> | ||
<style> | ||
.contains-js { display: none; } | ||
</style> | ||
</noscript> | ||
|
||
<!-- The empty space inside script tag prevents CSS transition from firing on page load. | ||
https://bugs.chromium.org/p/chromium/issues/detail?id=332189 | ||
--> | ||
<script data-proofer-ignore> </script> | ||
|
||
|
||
{{ content }} | ||
{% comment %} Don't forget to add </head><body> when extending this layout. {% endcomment %} | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
layout: base | ||
--- | ||
|
||
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/home.css' | relative_url }}?bust={{ site.time | date_to_xmlschema | cgi_escape }}"> | ||
|
||
<meta property="og:url" content="{{ site.url }}"> | ||
<meta property="og:type" content="website"> | ||
<meta property="og:title" content="Primož Hadalin"> | ||
<meta property="og:description" content="Software Engineer"> | ||
<meta property="og:image" content="{{ "/assets/img/hadalin_bw.jpg" | absolute_url }}"> | ||
|
||
<meta name="twitter:card" content="summary"> | ||
<meta name="twitter:site" content="{{ site.url }}"> | ||
<meta name="twitter:title" content="Primož Hadalin"> | ||
<meta name="twitter:description" content="Software Engineer"> | ||
<meta name="twitter:image" content="{{ "/assets/img/hadalin_bw.jpg" | absolute_url }}"> | ||
|
||
<script type="application/ld+json"> | ||
{ | ||
"@context":"http://schema.org", | ||
"@type":"Person", | ||
"image":"{{ '/assets/img/hadalin.jpg' | absolute_url }}", | ||
"name":"Primož Hadalin", | ||
"givenName":"Primož", | ||
"familyName":"Hadalin", | ||
"email":"{{ site.email }}", | ||
"gender":"male", | ||
"url":"{{ site.url }}", | ||
"jobTitle":"Software Engineer", | ||
"description":"Experienced software engineer developing software that serves people and the planet.", | ||
"nationality":{ | ||
"@type":"Country", | ||
"name":"Slovenia" | ||
} | ||
} | ||
</script> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
{{ content }} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
layout: base | ||
--- | ||
|
||
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/post.css' | relative_url }}?bust={{ site.time | date_to_xmlschema | cgi_escape }}"> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-12" itemscope itemtype="http://schema.org/BlogPosting"> | ||
|
||
<div itemprop="author" itemscope itemtype="http://schema.org/Person"> | ||
<span itemprop="name" content="{{ site.title }}"></span> | ||
</div> | ||
<span itemprop="datePublished" content="{{ page.date | date: '%F' }}"></span> | ||
<span itemprop="dateModified" content="{{ page.date | date: '%F' }}"></span> | ||
|
||
{% assign essays_url = '/essays' | relative_url %} | ||
<span itemprop="headline" content="{{ page.title }}"></span> | ||
{% include header.html breadcrumb_1_url=essays_url breadcrumb_1_title='Essays' heading=page.title %} | ||
<span class="date">{{ page.date | date:"%b %-d, %Y" }}</span> | ||
|
||
<div class="content" itemprop="articleBody"> | ||
{{ content }} | ||
</div> | ||
|
||
{% if page.hackernews and page.medium %} | ||
<span itemprop="discussionUrl" content="{{ page.medium }}"></span> | ||
<p class="discuss text-center"> | ||
<a href="{{ page.hackernews }}">HackerNews</a> ~ <a href="{{ page.medium }}">Medium</a> | ||
</p> | ||
{% endif %} | ||
|
||
{% include footer.html %} | ||
|
||
</div> | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
layout: post | ||
title: How to become a better programmer | ||
lang: en | ||
description: Primarily you should come up with a solution, rather than search for a solution, but junior developers tend to do it the other way around or leave the first part altogether. | ||
categories: [essays] | ||
hackernews: https://news.ycombinator.com/item?id=15355757 | ||
medium: https://medium.com/@hadalin/how-to-become-a-better-programmer-190084830aa4 | ||
canonical: https://medium.com/@hadalin/how-to-become-a-better-programmer-190084830aa4 | ||
redirect_from: | ||
- /blog/how-to-become-a-better-programmer | ||
--- | ||
|
||
Primarily you should _come up_ with a solution, rather than _search_ for a solution, | ||
but junior developers tend to do it the other way around or leave the first part altogether. | ||
|
||
Copy/pasting from Stack Overflow is just so quick and easy, isn’t it? | ||
You scroll down to the first answer, it has a green check, many upvotes, the code works, | ||
case closed. Do you really think trusting a green check to put something | ||
into your codebase is called software developing? Maybe. | ||
Do you think Linus Torvalds does it this way? Highly doubt it. | ||
As long as the code is working it doesn’t matter where it came from. Or does it? | ||
|
||
When you’re using Stack Overflow or code snippets from some blog post, | ||
you’re one or many steps away from the primary source of information, | ||
it being official documentation. How many steps away depends on the code snippet author. | ||
If they used official docs, you’re one step away. | ||
If they used a Stack Overflow answer which used official docs, | ||
you’re two steps away and so on. It’s like playing telephone, | ||
but you don’t know how many people lie in between and how much noise they make. | ||
It’s, therefore, safer to not play this game and start at step 0. | ||
|
||
But who wants to open official documentation and read that wall of text. | ||
Well, people who want to get to the bottom of things. | ||
They’ll also go under the hood and debug source code of whatever library they’re using, | ||
trying really hard to figure out how things work. The outcome of such an approach is very | ||
few surprises when running the code because the code behaves how you think it should behave. | ||
When you’re reading source code of some amazing framework, | ||
in a way you’re hanging out with some pretty talented people. | ||
You’re touching their work. And you thought you had to be cool to hang out with cool people. | ||
|
||
Back to that copy/pasting thing. You don’t know who wrote that | ||
code and what their agenda is, but you can and should trust **yourself**, | ||
so go with that first, always. After a while, people will notice your | ||
confidence and quite possibly start calling you senior developer. |
25 changes: 25 additions & 0 deletions
25
_posts/2017-10-02-difference-between-debounce-and-throttle.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
layout: post | ||
lang: en | ||
title: Difference between debounce and throttle | ||
categories: [essays] | ||
hackernews: https://news.ycombinator.com/item?id=15382117 | ||
medium: https://medium.com/@hadalin/difference-between-debounce-and-throttle-9d44f4a6af8f | ||
canonical: https://medium.com/@hadalin/difference-between-debounce-and-throttle-9d44f4a6af8f | ||
redirect_from: | ||
- /blog/difference-between-debounce-and-throttle | ||
--- | ||
|
||
[Debounce](https://lodash.com/docs/4.17.11#debounce) is like hitting the snooze button on your alarm clock. You are trying to wake up, | ||
but you’re just not there yet. Debounce is you saying not yet, not yet, | ||
not yet—and this could go on forever. Theoretically you might never wake up. | ||
A real world example might be preventing a chart from being redrawn while the window | ||
is resized by some maniac who has nothing better to do than expand and shrink his | ||
browser incessantly for five minutes. | ||
Only when the activity stops for, say, two seconds will the chart be redrawn. | ||
|
||
With [throttling](https://lodash.com/docs/4.17.11#throttle), on the other hand, | ||
something _will_ happen every so often. | ||
Let’s say the maniac above decides to click a button that reloads the chart | ||
over and over again putting a strain on your backend. | ||
With throttle, the data would be fetched from the backend, but only every ten seconds. |
Oops, something went wrong.