Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boostrap apply #2261

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
d8d479f
Update CNAME
quang-ng Mar 8, 2024
6884c88
Update _config.yml
quang-ng Mar 8, 2024
be3e9cd
Delete CNAME
quang-ng Mar 8, 2024
b37b908
Create First blog Test
quang-ng Mar 8, 2024
6c29cf5
Update and rename First blog Test to 2024-03-08-test
quang-ng Mar 8, 2024
d20a217
Rename 2024-03-08-test to 2024-03-08-test.md
quang-ng Mar 8, 2024
b374d64
Create CNAME
quang-ng Mar 8, 2024
22bed7d
Update 2024-03-08-test.md
quang-ng Mar 8, 2024
a78fd40
Delete CNAME
quang-ng Mar 8, 2024
74d88eb
Create CNAME
quang-ng Mar 8, 2024
83263fd
Delete CNAME
quang-ng Mar 8, 2024
f265a9f
Create CNAME
quang-ng Mar 8, 2024
5193df9
Update about.md
quang-ng Mar 8, 2024
220267b
Update post.html
quang-ng Mar 8, 2024
d893c8a
Update style.scss
quang-ng Mar 8, 2024
0933126
Rename 2024-03-08-test.md to 2024-03-08-python-decorator-func.md
quang-ng Mar 8, 2024
d3cab82
Update post.html
quang-ng Mar 8, 2024
71c0578
Create tags.html
quang-ng Mar 8, 2024
79961d2
Update 2024-03-08-python-decorator-func.md
quang-ng Mar 8, 2024
039ad15
Delete CNAME
quang-ng Mar 8, 2024
553a028
Create CNAME
quang-ng Mar 8, 2024
8ca7056
Update post.html
quang-ng Mar 9, 2024
997bbd8
Update post.html
quang-ng Mar 9, 2024
3fa57f3
Update CNAME
quang-ng Mar 9, 2024
d64c53d
Update CNAME
quang-ng Mar 9, 2024
f88a901
Delete CNAME
quang-ng Mar 9, 2024
6211d07
Update _config.yml
quang-ng Mar 9, 2024
d51fd2c
Create 2024-03-09-golang-concurrency.md
quang-ng Mar 9, 2024
85c655a
Update 2024-03-09-golang-concurrency.md
quang-ng Mar 9, 2024
5831d93
Update 2024-03-09-golang-concurrency.md
quang-ng Mar 9, 2024
52a13d0
Create 2024-03-09-goroutines
quang-ng Mar 9, 2024
e499e78
Rename 2024-03-09-goroutines to 2024-03-09-goroutines.md
quang-ng Mar 9, 2024
c7c3076
Update 2024-03-09-goroutines.md
quang-ng Mar 9, 2024
9e93954
Update 2024-03-09-goroutines.md
quang-ng Mar 9, 2024
add01ca
Update 2024-03-09-goroutines.md
quang-ng Mar 9, 2024
b57d029
Update 2024-03-09-goroutines.md
quang-ng Mar 9, 2024
d9d37ad
Update 2024-03-09-goroutines.md
quang-ng Mar 9, 2024
f7fdff3
Create 2024-03-10-channels.md
quang-ng Mar 9, 2024
40cfdba
Rename 2024-03-10-channels.md to 2024-03-09-channels.md
quang-ng Mar 9, 2024
14840d6
Update 2024-03-09-goroutines.md
quang-ng Mar 9, 2024
f263a1f
Update 2024-03-09-golang-concurrency.md
quang-ng Mar 9, 2024
726b8e0
Update and rename 2024-03-09-goroutines.md to 2024-03-02-goroutines.md
quang-ng Mar 9, 2024
6994dac
Update and rename 2024-03-09-golang-concurrency.md to 2024-03-01-gola…
quang-ng Mar 9, 2024
68cf885
Rename 2024-03-08-python-decorator-func.md to 2024-02-08-python-decor…
quang-ng Mar 9, 2024
150afc2
Rename 2024-03-09-channels.md to 2024-03-03-channels.md
quang-ng Mar 9, 2024
29e3f63
Update 2024-03-03-channels.md
quang-ng Mar 9, 2024
758b3ea
Update 2024-03-03-channels.md
quang-ng Mar 11, 2024
dab98b2
Update 2024-03-03-channels.md
quang-ng Mar 11, 2024
c6984e4
Update 2024-03-03-channels.md
quang-ng Mar 11, 2024
0829cf0
Update 2024-03-02-goroutines.md
quang-ng Mar 11, 2024
138ee1d
Update 2024-03-03-channels.md
quang-ng Mar 11, 2024
d4d8f00
Create 2024-03-04-buffered-channels-and-workder-pools.md
quang-ng Mar 11, 2024
39b20ab
Update 2024-03-04-buffered-channels-and-workder-pools.md
quang-ng Mar 11, 2024
e2db277
Update 2024-03-04-buffered-channels-and-workder-pools.md
quang-ng Mar 11, 2024
ec990ec
Update 2024-03-04-buffered-channels-and-workder-pools.md
quang-ng Mar 11, 2024
2f34fc4
Update 2024-03-04-buffered-channels-and-workder-pools.md
quang-ng Mar 12, 2024
cbf16f9
Create 2024-03-16-select.md
quang-ng Mar 16, 2024
102745e
Create 2024-03-17-mutex.md
quang-ng Mar 17, 2024
c66de48
Add images Cs5
quang-ng Mar 17, 2024
b18a188
Update 2024-03-17-mutex.md
quang-ng Mar 17, 2024
f78282a
Update 2024-03-17-mutex.md
quang-ng Mar 17, 2024
4c93459
update images
quang-ng Mar 17, 2024
c066d41
Update 2024-03-17-mutex.md
quang-ng Mar 17, 2024
bac2da2
Update 2024-03-17-mutex.md
quang-ng Mar 17, 2024
f22331e
Create tags.html
quang-ng Mar 18, 2024
c22cc34
Update 2024-03-01-golang-concurrency.md
quang-ng Mar 18, 2024
7cbe93f
Update 2024-03-01-golang-concurrency.md
quang-ng Mar 18, 2024
77d914e
Update 2024-03-01-golang-concurrency.md
quang-ng Mar 18, 2024
dc37f93
Update 2024-03-02-goroutines.md
quang-ng Mar 18, 2024
6de2c2e
Update 2024-03-03-channels.md
quang-ng Mar 18, 2024
35066da
Update 2024-03-04-buffered-channels-and-workder-pools.md
quang-ng Mar 18, 2024
bd71f35
Update 2024-03-16-select.md
quang-ng Mar 18, 2024
23c0290
Update 2024-03-17-mutex.md
quang-ng Mar 18, 2024
5911838
Create 2024-03-18-interface-1.md
quang-ng Mar 18, 2024
88f6185
Update 2024-03-18-interface-1.md
quang-ng Mar 18, 2024
4d8524d
Update 2024-03-18-interface-1.md
quang-ng Mar 18, 2024
4fb19f6
Create 2024-03-19-interface-2.md
quang-ng Mar 18, 2024
f79874d
Rename 2024-03-18-interface-1.md to 2024-01-01-interface-1.md
quang-ng Mar 18, 2024
e289d5a
Rename 2024-03-19-interface-2.md to 2024-01-02-interface-2.md
quang-ng Mar 18, 2024
edfb809
Create 2024-02-01-defer-and-error-handling-1.md
quang-ng Mar 19, 2024
bb38299
Create 2024-02-02-defer-and-error-handling-2.md
quang-ng Mar 21, 2024
0ea2356
Update data
quang-turing Mar 29, 2024
2b40b03
setup dev env
quang-turing Mar 29, 2024
5f8af12
Add some old post
quang-turing Apr 1, 2024
c37d6e3
Add boostrap
quang-turing Apr 1, 2024
c5e63a8
Apply new layout
quang-turing Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

12 changes: 6 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#

# Name of your site (displayed in the header)
name: Your Name
name: Quang Nguyen

# Short bio or description (displayed in the header)
description: Web Developer from Somewhere
description: Software Engineer

# URL of your avatar or profile pic (you could use your GitHub profile pic)
avatar: https://raw.githubusercontent.com/barryclark/jekyll-now/master/images/jekyll-logo.png
Expand All @@ -18,15 +18,15 @@ avatar: https://raw.githubusercontent.com/barryclark/jekyll-now/master/images/je
# Includes an icon in the footer for each username you enter
footer-links:
dribbble:
email:
email: nguyenvanquang247@gmail.com
facebook:
flickr:
github: barryclark/jekyll-now
github: https://github.com/quang-ng
instagram:
linkedin:
linkedin: https://www.linkedin.com/in/quang-nv/
pinterest:
rss: # just type anything here for a working RSS icon
twitter: jekyllrb
twitter:
stackoverflow: # your stackoverflow profile, e.g. "users/50476/bart-kiers"
youtube: # channel/<your_long_string> or user/<user-name>
googleplus: # anything in your profile username that comes after plus.google.com/
Expand Down
54 changes: 52 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<link rel="alternate" type="application/rss+xml" title="{{ site.name }} - {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />

<!-- Created with Jekyll Now - http://github.com/barryclark/jekyll-now -->
<link rel="stylesheet" href="{{ "/assets/bootstrap.min.css" | relative_url }}">
<script src="{{ "/assets/jquery-3.3.1.slim.min.js" | relative_url }}"></script>
<script src="{{ "/assets/popper.min.js" | relative_url }}"></script>
<script src="{{ "/assets/bootstrap.min.js" | relative_url }}"></script>
</head>

<body>
Expand All @@ -27,15 +31,61 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
</div>

<nav>
<a href="{{ site.baseurl }}/">Blog</a>
<a href="{{ site.baseurl }}/">Home</a>
<a href="{{ site.baseurl }}/tags">Tags</a>
<a href="{{ site.baseurl }}/posts">Archive</a>
<a href="{{ site.baseurl }}/about">About</a>

</nav>
</header>
</div>
</div>

<div id="main" role="main" class="container">
{{ content }}
<div class="row">
<div class="col-2">
{% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign tags_list = site_tags | split:',' | sort %}

<!-- Start tag array header -->
<div class="tags-list">
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tags_list[item] | strip_newlines }}{% endcapture %}
<a href="/tags/#{{ this_word | slugify | downcase }}" class="post-tag"><span class="term">{{ this_word }}</span> <span class="count">({{ site.tags[this_word].size }})</span></a><br/>
{% endunless %}{% endfor %}
</div>
<!-- End tag array header -->
</div>
<div class="col-8">{{ content }}</div>
<div class="col-2">
{% for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}

{% if forloop.first %}
<article>

<ul>
{% endif %}
<li>
<span class="post-date">{{ post.date | date_to_string }}</span> <br/>
<a class="tag-post-title"href="{{ post.url | prepend: site.baseurl }}" title="{{ post.title | escape }}">{{ post.title | escape }}</a>
</li>
{% if forloop.last %}
</ul>
</article>
{% else %}
{% if this_year != next_year %}
</ul>
</article>
<article>
<ul>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>

</div>

<div class="wrapper-footer">
Expand Down
30 changes: 27 additions & 3 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,40 @@
layout: default
---

<!-- <style>
ul.blog-pager {margin-left: 0;}.blog-pager li {list-style: none;}li.previous {float: left;}li.next {float: right;}.pager li a{text-transform:uppercase;font-size:14px;font-weight:bold;letter-spacing:1px;padding:10px 5px;background:#FFF;border: 1px solid #ddd;border-radius:0;color:#404040;}.pager li a:hover,.pager li a:focus{color:#FFF;text-decoration:none;background:#0085a1;border:1px solid #0085a1;}
</style> -->

<article class="post">
<h1>{{ page.title }}</h1>

<br/>
<div class="date">
Written on {{ page.date | date: "%B %e, %Y" }}
</div>
<br/>
<div class="entry">
{{ content }}
</div>

<div class="date">
Written on {{ page.date | date: "%B %e, %Y" }}
</div>

<nav aria-label="Page navigation example">
<ul class="pagination">
{% if page.previous.url %}
<li class="page-item">
<a class="page-link" href="{{ page.previous.url | prepend: site.baseurl | replace: '//', '/' }}" data-toggle="tooltip" data-placement="top" title="{{page.previous.title}}">&larr; Previous Post</a>
</a>
</li>
{% endif %}
{% if page.next.url %}
<li class="page-item">
<a class="page-link" href="{{ page.next.url | prepend: site.baseurl | replace: '//', '/' }}" data-toggle="tooltip" data-placement="top" title="{{page.next.title}}">Next Post &rarr;</a>
</a>
</li>
{% endif %}
</ul>
</nav>


{% include disqus.html %}
</article>
34 changes: 34 additions & 0 deletions _layouts/tags.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
layout: archive
title: Tags
permalink: /tags/
description: "Posts listed by Tags"
author_profile: false
comments: false
---

{% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign tags_list = site_tags | split:',' | sort %}

<!-- Start tag array header -->
<div class="tags-list">
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tags_list[item] | strip_newlines }}{% endcapture %}
<a href="#{{ this_word | slugify | downcase }}" class="post-tag"><span class="term">{{ this_word }}</span> <span class="count">({{ site.tags[this_word].size }})</span></a>
{% endunless %}{% endfor %}
</div>
<!-- End tag array header -->
<hr/>
<!-- Start tag list -->
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tags_list[item] | strip_newlines }}{% endcapture %}
<article>
<h2 id="{{ this_word | slugify | downcase }}">{{ this_word }}</h2>
<ul>
{% for post in site.tags[this_word] %}{% if post.title != null %}
<li><span class="post-date">{{ post.date | date_to_string }}</span><a class="tag-post-title" href="{{ post.url | prepend: site.baseurl }}" title="{{ post.title | escape }}">{{ post.title | escape }}</a> </li>
{% endif %}{% endfor %}
</ul>
</article><!-- /.hentry -->
{% endunless %}{% endfor %}
<!-- End tag list -->
37 changes: 37 additions & 0 deletions _posts/2023-02-08-python-decorator-func.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
layout: post
title: Giới thiệu về Python Decorator Function
tags: [python]
---


Trong Python, Decorator là một tính năng mạnh mẽ cho phép bạn thay đổi hoặc mở rộng hành vi của một hàm mà không cần thay đổi mã nguồn gốc của hàm đó. Decorator giúp tách biệt việc xử lý logic và chức năng bổ sung, đồng thời cung cấp một cách linh hoạt để mở rộng chức năng của một hàm.

Một decorator function là một hàm bao bọc một hàm khác và thực hiện các thay đổi hoặc chức năng bổ sung trước, sau hoặc xung quanh hàm gốc. Điều này cho phép bạn thêm các chức năng bổ sung như logging, caching, xác thực, đo lường thời gian và nhiều hơn nữa vào một hàm mà không cần phải sửa đổi mã nguồn của hàm đó.

Ví dụ dưới đây minh họa cách sử dụng decorator function trong Python:

```python
def uppercase_decorator(func):
def wrapper(text):
result = func(text.upper())
return result
return wrapper

@uppercase_decorator
def greet(name):
return f"Hello, {name}!"

greeting = greet("John")
print(greeting)
```
Trong ví dụ trên, chúng ta đã định nghĩa một decorator function có tên là uppercase_decorator. Nó nhận một hàm func làm đối số và trả về một hàm wrapper mới. wrapper là nơi chúng ta thực hiện các thay đổi hoặc chức năng bổ sung trước và sau khi hàm gốc func được gọi.

Bằng cách sử dụng decorator function @uppercase_decorator trước hàm greet, chúng ta đã bọc hàm greet trong decorator. Khi chúng ta gọi greet("John"), decorator sẽ thực thi và chuyển đổi tên thành chữ hoa trước khi gọi hàm gốc. Sau đó, decorator nhận kết quả trả về từ hàm gốc và trả về kết quả đã được xử lý.

Kết quả đầu ra sẽ là:

```shell
Hello, JOHN!
```
Như vậy, decorator function uppercase_decorator đã thay đổi hành vi của hàm greet bằng cách làm cho tên được chuyển đổi thành chữ hoa trước khi in ra kết quả chào mừng.
Loading