Skip to content

Commit c712b59

Browse files
committed
social icons fixed, repository links added, and singleton post improved
1 parent b33153d commit c712b59

File tree

8 files changed

+41
-9
lines changed

8 files changed

+41
-9
lines changed

_data/strings.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ share: "Udostępnij:"
1515
share-on: Udostępnij przez
1616

1717
post-read: czytania
18+
post-repository: "Repozytorium (listingi i przykłady):"
19+
post-repository-see: "Zobacz repozytorium"
1820

1921
show-all-posts: Pokaż wszystko
2022
show-less-posts: Pokaż mniej

_includes/footer.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
{% if site.social-links-enable | default: true %}
55
<nav class="social">
66
{% if site.github %}
7-
<a class="social__link" target="_blank" rel="noopener noreferrer" href="https://github.com/{{ site.data.social.github }}">
7+
<a class="social__link" target="_blank" rel="noopener noreferrer" href="https://github.com/{{ site.github }}">
88
<i class='fa fa-github fa-2x'></i>
99
</a>
1010
{% endif %}
1111

1212
{% if site.twitter %}
13-
<a class="social__link" target="_blank" rel="noopener noreferrer" href="https://www.twitter.com/{{ site.data.social.twitter }}">
13+
<a class="social__link" target="_blank" rel="noopener noreferrer" href="https://www.twitter.com/{{ site.twitter }}">
1414
<i class='fa fa-twitter fa-2x'></i>
1515
</a>
1616
{% endif %}
1717

1818
{% if site.facebook %}
19-
<a class="social__link" target="_blank" rel="noopener noreferrer" href="https://www.facebook.com/{{ site.data.social.facebook }}">
19+
<a class="social__link" target="_blank" rel="noopener noreferrer" href="https://www.facebook.com/{{ site.facebook }}">
2020
<i class='fa fa-facebook fa-2x'></i>
2121
</a>
2222
{% endif %}

_includes/post-repository.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div class="share-bar">
2+
3+
<h4>{{ site.data.strings.post-repository | default: "Repository (listings and examples):" }}</h4>
4+
5+
<div class="share-buttons">
6+
<a href="https://www.github.com/android-code/{{ page.github }}"
7+
title="{{ site.data.strings.post-repository-see | default: "See repository" }}">
8+
<i class="fa fa-github-square fa-2x share-button"></i>
9+
</a>
10+
</div>
11+
12+
</div>

_layouts/post.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
<article class="post-content" itemprop="articleBody">
2626
{{ content }}
2727

28+
{% if page.github %}
29+
{% include post-repository.html %}
30+
{% endif %}
31+
2832
{% if site.post-share-enable %}
2933
{% include post-share-buttons.html %}
3034
{% endif %}

_posts/wzorce_projektowe/2018-04-29-Singleton.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: "Singleton"
44
date: 2018-04-29
55
categories: ["Wzorce projektowe"]
66
image: singleton
7+
github: Singleton
78
---
89

910
## Zastosowanie
@@ -20,7 +21,7 @@ Istnieje wiele implementacji tego wzorca. Jedna z najprostszych opiera się na i
2021

2122
![Singleton diagram](/assets/img/diagrams/singleton.svg){: .center-image }
2223

23-
Poniższy listing przedstawia najprostszą implementacje Singleton. Rodzin ona jednak problemy w środowisku wielowątkowym.
24+
Poniższy listing przedstawia najprostszą implementacje `Singleton`. Rodzin ona jednak problemy w środowisku wielowątkowym.
2425

2526
{% highlight java %}
2627
public class Singleton {
@@ -39,7 +40,7 @@ public class Singleton {
3940
}
4041
{% endhighlight %}
4142

42-
Aby Singleton mógł zostać użyty w wielowątkowych aplikacjach należy skorzystać z podwójnego sprawdzania i blokowania.
43+
Aby `Singleton` mógł zostać użyty w wielowątkowych aplikacjach należy skorzystać z podwójnego sprawdzania i blokowania.
4344

4445
{% highlight java %}
4546
public class DoubleCheckSingleton {
@@ -60,7 +61,7 @@ public class DoubleCheckSingleton {
6061
}
6162
{% endhighlight %}
6263

63-
Optymalnym rozwiąaniem jest Singleton Holder, który zapewnia leniwe tworzenie instancji oraz nie wymaga synchronizacji.
64+
Optymalnym rozwiązaniem jest `Singleton Holder`, który zapewnia leniwe tworzenie instancji oraz nie wymaga synchronizacji.
6465

6566
{% highlight java %}
6667
public class SingletonHolder {
@@ -79,9 +80,8 @@ public class SingletonHolder {
7980
{% endhighlight %}
8081

8182
## Przykład
82-
SharedPreferences umożliwia przechowywanie ustawień aplikacji. Dostęp do odczytu i zapisu zapewnia instancja klasy, a operacje te są od niej niezależne. Zatem prawdopodobnie nie ma potrzeby przechowywania w pamięciu wielu instancji SharedPreferences. Dostęp do ustawień aplikacji może być wykorzystywany w wielu miejscach dlatego zastosowanie wzorca Singleton wydaje się być uzasadnione. SharedPreferences w sposób niejawny korzystają z wzorca Singleton. Poniższy listing przedstawia jego jawną implementacje.
83+
Aplikacja ma za zadanie przechowywać oraz wyświetlać dane użytkownika. Dostęp do danych powinien być możliwy z różnych miejsc aplikacji. Do realizacji można wykorzystać `SharedPreferences`, który umożliwia przechowywanie ustawień aplikacji. Dostęp do odczytu i zapisu zapewnia instancja klasy, a operacje te są od niej niezależne. Zatem prawdopodobnie nie ma potrzeby przechowywania w pamięciu wielu instancji `SharedPreferences`. Dostęp do ustawień aplikacji może być wykorzystywany w wielu miejscach dlatego zastosowanie wzorca `Singleton` wydaje się być uzasadnione. `SharedPreferences` w sposób niejawny korzysta ze wzorca `Singleton`. Poniższy listing przedstawia jego jawną implementacje.
8384

84-
###
8585
{% highlight java %}
8686
public class SharedPref {
8787

assets/css/parts/post-share.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,10 @@
4747
}
4848
.fa-envelope-square:hover {
4949
background-color: #444444;
50+
}
51+
.fa-github-square {
52+
color: #333;
53+
}
54+
.fa-github-square:hover {
55+
background-color: #333;
5056
}

assets/css/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/style_unminify.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,4 +1522,12 @@ ul.show-more-wrap {
15221522

15231523
.fa-envelope-square:hover {
15241524
background-color: #444444;
1525+
}
1526+
1527+
.fa-github-square {
1528+
color: #333;
1529+
}
1530+
1531+
.fa-github-square:hover {
1532+
background-color: #333;
15251533
}

0 commit comments

Comments
 (0)