Skip to content
Open

merge #1502

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
e7a871d
Update _config.yml
May 12, 2020
2d26729
Update _config.yml
May 12, 2020
9f0062b
Add files via upload
May 12, 2020
5f31baa
Update _config.yml
May 12, 2020
3ef1b65
Update aboutme.md
May 13, 2020
d2c5fbc
Update aboutme.md
May 13, 2020
15b52f8
Update aboutme.md
May 13, 2020
fe88cdf
Create projects.md
May 13, 2020
aec5eb7
Update projects.md
May 13, 2020
5603cbd
Update projects.md
May 13, 2020
172acb4
Update projects.md
May 13, 2020
ea246a5
Update projects.md
May 13, 2020
975bc9a
Add files via upload
May 13, 2020
1a2b896
Update index.html
May 13, 2020
7e83464
Update aboutme.md
May 13, 2020
35b2fe0
Update aboutme.md
May 13, 2020
713daef
Update aboutme.md
May 13, 2020
329f69a
Update _config.yml
May 13, 2020
7108fb8
Update _config.yml
May 13, 2020
c6404d5
Update projects.md
May 13, 2020
380ac43
Update projects.md
May 13, 2020
f685c48
Add files via upload
May 13, 2020
28498db
Update _config.yml
May 13, 2020
a2d1087
Update projects.md
May 13, 2020
78682d2
Update aboutme.md
May 13, 2020
d97a002
Update projects.md
May 16, 2020
ade7353
Update projects.md
May 16, 2020
7d61154
Delete 2020-02-26-flake-it-till-you-make-it.md
May 18, 2020
6f215d7
Update and rename 2020-02-28-test-markdown.md to 2020-05-18-Stay-Away…
May 18, 2020
bc78b4a
Update projects.md
May 18, 2020
92ab078
Update _config.yml
May 19, 2020
8ecf6fb
Update _config.yml
May 19, 2020
34f165b
Create 2020-05-19-Polymorphism.md
May 19, 2020
4c9afd8
Add files via upload
May 19, 2020
9e55d02
Delete 2020-05-18-Stay-Away-From-Commenting
May 19, 2020
c378e16
Update 2020-05-19-Polymorphism.md
May 19, 2020
df6939d
Create 05-18-2020-Stay-Away-Commenting
May 19, 2020
6722733
Rename 05-18-2020-Stay-Away-Commenting to 2020-05-18-Stay-Away-Commen…
May 19, 2020
cac85cd
Add files via upload
May 19, 2020
abfc073
Update 2020-05-19-Polymorphism.md
May 19, 2020
deb3089
Update aboutme.md
May 19, 2020
49f5b0d
Update 2020-05-19-Polymorphism.md
May 21, 2020
f0f5d05
Update _config.yml
May 23, 2020
af39f88
Update _config.yml
May 23, 2020
aaeca31
Create 2020-05-19-Mistake-On-Git.md
May 24, 2020
fd1ce78
Rename 2020-05-19-Mistake-On-Git.md to 2020-05-23-Mistake-On-Git.md
May 24, 2020
ad3efe3
Update 2020-05-23-Mistake-On-Git.md
May 24, 2020
3367af6
Update 2020-05-23-Mistake-On-Git.md
May 24, 2020
623b319
Update 2020-05-23-Mistake-On-Git.md
May 24, 2020
8c389d2
Update 2020-05-23-Mistake-On-Git.md
May 25, 2020
fd31e8c
Update 2020-05-23-Mistake-On-Git.md
May 25, 2020
38c382c
Create 2020-05-24-BenchMarking-Disk.md
May 25, 2020
6b436f4
Update 2020-05-24-BenchMarking-Disk.md
May 25, 2020
e132133
Update 2020-05-24-BenchMarking-Disk.md
May 25, 2020
96e49ce
Update projects.md
May 25, 2020
6862bb5
Update aboutme.md
Jun 1, 2020
c1ae7f6
Update aboutme.md
Jun 1, 2020
d3085b3
Update aboutme.md
Jun 1, 2020
5890772
Update projects.md
Jun 2, 2020
ef3c1c5
Update projects.md
Jun 2, 2020
18f8dd2
Update projects.md
Jun 2, 2020
d16f018
Update projects.md
Jun 2, 2020
78bd562
Update projects.md
Jun 2, 2020
1beaf2c
Update aboutme.md
Jun 10, 2020
945df2a
Update aboutme.md
Jun 10, 2020
ab8f94b
Update and rename 2020-05-24-BenchMarking-Disk.md to 2020-07-20-Techn…
Jul 21, 2020
96267f5
Update aboutme.md
Aug 23, 2020
f4e5eda
Update aboutme.md
Aug 23, 2020
bafb7f3
Update aboutme.md
Jun 7, 2021
9251677
Update _config.yml
Sep 16, 2021
d4583c9
Create 2022-09-14-Sort-List-with-fixed-order.md
Sep 15, 2022
2e52804
Delete projects.md
Sep 15, 2022
dc69aac
Update aboutme.md
Sep 15, 2022
8890ab5
Update index.html
Sep 15, 2022
33976a7
Update _config.yml
Sep 15, 2022
3152900
Update 2022-09-14-Sort-List-with-fixed-order.md
Sep 16, 2022
4769aec
Create 2023-01-06-Drop-Blocks-of-Strings
Jan 7, 2023
5c8ec78
Update and rename 2023-01-06-Drop-Blocks-of-Strings to 2023-06-01-asy…
Jun 2, 2023
50bab1a
Reflect jdk17 stream toList method
redwing92 Aug 23, 2023
0c2889d
Update aboutme.md
redwing92 Aug 23, 2023
7a60fa0
Create 2024-02-05-My-First-Zero-Day.md
redwing92 Feb 19, 2024
0020489
Update 2024-02-05-My-First-Zero-Day.md
redwing92 Feb 19, 2024
548e756
Update 2024-02-05-My-First-Zero-Day.md
redwing92 Feb 19, 2024
8e2d58c
Create 03-27-2024.md
redwing92 Mar 28, 2024
c25f3ed
Rename 03-27-2024.md to 2024-03-27-Gmail-Image-Proxy-Not-Cache-Svg.md
redwing92 Mar 28, 2024
e586751
Create 2024-11-03-How-to-customize-refresh-token-behavior-in-b2c-cust…
redwing92 Nov 3, 2024
38768ff
Update 2024-11-03-How-to-customize-refresh-token-behavior-in-b2c-cust…
redwing92 Nov 3, 2024
ca77bd1
Update 2024-11-03-How-to-customize-refresh-token-behavior-in-b2c-cust…
redwing92 Nov 3, 2024
d390276
Update aboutme.md
redwing92 Nov 3, 2024
b5730ab
Delete _posts/2020-07-20-Technical-Debt.md
redwing92 Nov 3, 2024
16d793f
Update and rename 2024-11-03-How-to-customize-refresh-token-behavior-…
redwing92 Nov 3, 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
39 changes: 17 additions & 22 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
# --- Basic options --- #

# Name of website
title: My website
title: Jake Heo

# Short description of your site
description: A virtual proof that I'm awesome
description: Information of Jake Heo

# Your name to show in the footer
author: Some Person
author: Jake Heo

# --- List of links in the navigation bar --- #

navbar-links:
About Me: "aboutme"
Resources:
- Beautiful Jekyll: "https://beautifuljekyll.com"
- Learn markdown: "https://www.markdowntutorial.com/"
Author's home: "https://deanattali.com"


# --- Logo --- #

# Image to show in the navigation bar - works best with a square image
# Remove this parameter if you don't want an image in the navbar
avatar: "/assets/img/avatar-icon.png"
# avatar: "/assets/img/profile.png"

# By default, the image is cut into a circle. You can disable this behaviour here.
round-avatar: true
Expand All @@ -31,20 +27,20 @@ round-avatar: true
# then specify the following parameter
#title-img: /path/to/image

cover-img: "/assets/img/profile.png"

# --- Footer options --- #

# Select the social network links that you want to show in the footer.
# Uncomment the links you want to show and add your information to each one.
# If you don't want to show a link to an RSS feed, set rss to "false".
social-network-links:
email: "[email protected]"
facebook: deanattali
github: daattali
twitter: daattali
rss: true
email: "[email protected]"
# facebook: deanattali
github: gyucheonheo
# rss: true
# reddit: yourname
# linkedin: daattali
linkedin: gyucheon-heo-07a007157
# xing: yourname
# stackoverflow: "3943160/daattali"
# snapchat: deanat78
Expand All @@ -62,13 +58,12 @@ social-network-links:

# Select which social network share links to show in posts
share-links-active:
twitter: true
facebook: true
# facebook: true
linkedin: true

# How to display the link to your website in the footer
# Remove this if you don't want a link in the footer
url-pretty: "MyWebsite.com"
url-pretty: "gyucheonheo.github.io"

# Create a "tags" index page and make tags on each post clickable
link-tags: true
Expand All @@ -80,14 +75,14 @@ excerpt_length: 50

# Personalize the colors in your website. Colour values can be any valid CSS colour

navbar-col: "#F5F5F5"
navbar-text-col: "#404040"
navbar-col: "#FFFFFF"
navbar-text-col: "#000000"
navbar-border-col: "#EAEAEA"
page-col: "#FFFFFF"
link-col: "#008AFF"
hover-col: "#0085A1"
footer-col: "#F5F5F5"
footer-text-col: "#777777"
footer-col: "#FFFFFF"
footer-text-col: "#FFFFFF"
footer-link-col: "#404040"

# Alternatively, the navbar, footer, and page background can be set to use background images
Expand Down
15 changes: 0 additions & 15 deletions _posts/2020-02-26-flake-it-till-you-make-it.md

This file was deleted.

78 changes: 0 additions & 78 deletions _posts/2020-02-28-test-markdown.md

This file was deleted.

7 changes: 7 additions & 0 deletions _posts/2020-05-18-Stay-Away-Commenting
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: post
title: Stay Away Commenting to Your Code
subtitle: Why do you need it?
tags: [clean code]
comments: true
---
16 changes: 16 additions & 0 deletions _posts/2020-05-19-Polymorphism.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: post
title: If..Else..Switch..Polyporphism?
subtitle: What is good about it?
tags: [clean code, OOP, Polymorphism]
comments: true
---

I recently saw a nerd meme in Facebook. It gives me so many thought with respect to polymorphism.
![polymorphism](/assets/img/polymorphism.png)

Can you see polymorhpism on the second code? So what could be advantages by doing so?




68 changes: 68 additions & 0 deletions _posts/2020-05-23-Mistake-On-Git.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
layout: post
title: Did you mess up with git commit? No Worry!
subtitle: Let's go back to where it works
tags: [git]
comments: true
---

Everytime I learn about `git`, I frequently was likely to focus on adding/updating files. Because of that, I went through silly and stupid procedure or left those stupid whenever I did make mistakes.

It is NOW time for us to learn smart ways to revert it!

### Scenario 1; Wrong Commit Message? No Problem!
It it really common that you forget adding more files or put a bad message to a commit that you just made.
What would you do in this case? Are you going to leave it as it is or do you want to fix that?
I hope that you want to do the latter. Here are steps you need to follow to do so.

``` bash
(master)[you@machine]$>git commit --amend -m "<new message>"
```

{: .box-warning}
**Warning:** This commint will create a new commit number.

### Scenario 2; Made commit to a wrong branch? No Problem!
Imagine that you made a below commit to `master` branch. However, you figured out that this commit was supposed to belong to `foo` branch.

``` bash
(master)[you@machine]$>git add test.c
(master)[you@machine]$>git commit -m "Completed new foo feature"
```
Ouch! you noticed the branch name is `master` instead of `foo`. Don't worry. It will cover.

``` bash
(master)[you@machine]$>git branch
```
The above command will show you two branches; `master` and `foo`. Okay. `foo` is our final destination. In addition, we need a commit number that we want move to `foo`.

``` bash
(master)[you@machine]$>git log
```

The above command will show you a bunch of commit log and copy/paste the commit number.

``` bash
(master)[you@machine]$>git checkout foo
```

It enables you to switch your current branch to `foo`.

``` bash
(foo)[you@machine]$>git cherry-pick <the commit number>
```

Okay. Here we go. `foo` branch, now, has that commit.

But! we should fix our `master` branch as well.

``` bash
(foo)[you@machine]$>git checkout master
```

``` bash
(master)[you@machine]$>git reset --<soft or mix or hard> <the commit number>
```
* `soft` : `soft` will reset the commit, but changes will remain in working stage.
* `mix` : `mix` is the default. `mix` will reset the commit, but changes will remain in working directory.
* `hard` : `hard` will reset the commit, but changes will NOT remain anywhere.
65 changes: 65 additions & 0 deletions _posts/2022-09-14-Sort-List-with-fixed-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
layout: post
title: Sort List with fixed start items
subtitle:
tags: [java, stream, sort]
comments: true
---

Recently, I needed to write a piece of code snippet to convert a list of strings into a list of strings that should start with 2 items.
I started it with being dumb.

Let's say that your list should start with "Chicago" followed by "Illinois" and you don't care a rest of them once you meet "Chicago" followed by "Illinois".
Additionally, a given list may or may not have "Chicago" or "Illinois".

The first code that I pumped out smells a lot.
1. Too many if-else : I'm lucky to have only 2 items requirement. What if it should starts with 10 items? Its complexity will grow exponentially. Error-prone.
2. I repeat myself
3. In general, it is vomit-causing code. I hate it.

``` java
List<String> newList = new ArrayList<>();
List<String> lst = List.of("San Fransisco", "California", "St Louis", "Missouri", "Washington", "Seattle", "Chicago", "Wisconsin", "Illinois");

if (lst.contains("Chicago") && lst.contains("Illinois")) {
for (String s : lst) {
if (s.equals("Chicago")) newList.add(0, s);
else if (s.equals("Illinois")) newList.add(1, s);
else newList.add(s);
}
} else if (lst.contains("Chicago") && !lst.contains("Illinois")) {
for (String s : lst) {
if (s.equals("Chicago")) newList.add(0, s);
else newList.add(s);
}
} else if (!lst.contains("Chicago") && lst.contains("Illinois")) {
for (String s : lst) {
if (s.equals("Illinois")) newList.add(0, s);
else newList.add(s);
}
} else {
for (String s : lst) {
newList.add(s);
}
}

newList.forEach(System.out::println);
```

As a result of spending a few hours playing the code, I ended up sorting it based on fixed items.
It's pretty intuitive and there is nothing that I have to explain as extra.
Neat and simple.

``` java
Map<String, Integer> fixedItems = Map.of("Chicago", 0, "Illinois", 1);
List<String> lst = List.of("San Fransisco", "California", "St Louis", "Missouri", "Washington", "Seattle", "Chicago", "Wisconsin", "Illinois");

List<String> newList = lst.stream()
.distinct()
.sorted(Comparator.comparing( s -> {
int i = fixedItems.getOrDefault(s, -1);
return i >= 0 ? i : fixedItems.size();
}))
.toList();
```
Although the number of fixed items increase, this code will be able to handle it in scale without any changes except for `fixedItems`.
47 changes: 47 additions & 0 deletions _posts/2023-06-01-asymmetric-encryption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: post
title: How securely shares your secret with others?
subtitle:
tags: [encryption, decryption, openssl]
comments: false
---

Do you plan to share your secret, such as apikey, application secret, password, to your colleagues? But you don't want them to be stored in a persistant storage such as a messenger's database.
Then, let's follow it

Let's make up a situation.
Alice asks me to renew an apikey because Alices needs one more for a new application domain.
She told me "Send it to me through Slack!".
However, Slack stores our conversation and it'd be security breach candidate while scanning!
You and Alice and follows this.
1. Alice generates her private key
``` bash
$>openssl genpkey -algorithm RSA -out private_key.pem
```

2. Alice extracts her public key out of her private key
``` bash
$>openssl rsa -pubout -in private_key.pem -out public_key.pem
```

3. Alice shares her *public* key

4. You encrypts a file that includes a secret
``` bash
$>openssl rsautl -encrypt -pubin -inkey public_key.pem -in plaintext.txt -out encrypted.bin
```

5. You share an output file `encrypted.bin` to Alice

6. Alice descrypts the file `encrypted.bin` using her *private* key
``` bash
$>openssl rsautl -decrypt -inkey private_key.pem -in encrypted.bin -out decrypted.txt
```

Asymmetric encryption is a powerful tool that can be used to protect sensitive information. It is often used in conjunction with other security measures, such as passwords and authentication tokens, to create a more secure system.

Here are some additional benefits of using asymmetric encryption:

Confidentiality: Asymmetric encryption can be used to protect sensitive information from unauthorized access.
Integrity: Asymmetric encryption can be used to ensure that the contents of a message have not been tampered with.
Non-repudiation: Asymmetric encryption can be used to prove that a message was sent by a specific person.
Loading