Skip to content
Paras Gupta

Jan 8 - Daily Programming Diary

Diary, Programming2 min read

10:30

Gonna study more about redux today and start implementing in Raahee component by component. The persistent state on reload is a way better approach to offer a better user experience that caching everything in the local storage by hand.

12:20

While playing around integrating redux in the Raahee app, I thought about integrating redux component by component. The most important things to be kept in the redux store are:

  • Blogs
  • Events
  • Community Posts

All of these can be persisted across reloads. While fetching blogs on /blog page, the ones fetched at home page can be used as the initial blogs posts.

Searched for Dangerous Dave and played 3 levels! Fun! 🔥

13:10

Gonna rice my Arch now.

14:40

Back here! Although I tried working with xmonad, I have realized that I've been dependent on i3 so much that the new key bindings will some time to get used to, time which I don't have. Starting today's Leetcode Challenge

Done! Today was easy.

check-if-two-string-arrays-are-equivalent.cpp
1bool arrayStringsAreEqual(vector<string> &word1, vector<string> &word2)
2{
3 string a = "", b = "";
4 for (int i = 0; i < word1.size(); i++)
5 {
6 a += word1[i];
7 }
8 for (int i = 0; i < word2.size(); i++)
9 {
10 b += word2[i];
11 }
12 return a == b;
13}

Writing in Go...

check-if-two-string-arrays-are-equivalent.go
1func arrayStringsAreEqual(word1 []string, word2 []string) bool {
2 var a, b string = "", ""
3 for _, e := range word1 {
4 a += e
5 }
6 for _, e := range word2 {
7 b += e
8 }
9 return a == b
10}
17:00-ish

So I installed "Oh My Zsh" and it seems pretty good to be honest. The plugins for git, just wow! It lets me type alias for git commands, lemme give some examples (always wanted to add a table here).

aliascommand
gaagit add --all
gco <branch>git checkout <branch>
gcamgit commit -am

Work in Progress feature

CommandDescription
gwipCreates a commit in the branch to switch to another branch
gunwipUncommits the gwip
work_in_progressEchoes a warning if the current branch is a WIP

The complete list of functionality is here.

I also discovered another command line utility called hub. According to their website, hub is an extension to command-line git that helps you do everyday GitHub tasks without ever leaving the terminal. It can be used to open PRs, check open issues and PRs, and basically use GitHub from the terminal. Tell me that's not cool and I'll punch you. 😛

Screenshot of the new shell! Haaye ❤️💞

zsh screenshot

Image has unnecessary top and bottom margin. Tried fixing but I'm just tired, and it's already 21:20

22:00

Just attended the Raahee App Beta launch, great work by the team. I wish the website was this good.

Just did the Crio Sherlock Challenge. Was provided with a long file with user logs and had to find user related data from it. Used the grep and awk commands to accomplish the task. Questions:

  1. Find out how many different (unique) IPs Anushka used, to access Flipkart site from the following log?
  2. She mentioned to the customer support team that she uses only a windows laptop and her Android phone to access Flipkart site. Can you find out how many accesses were made to her account from an iPad?

Solutions:

Don't want the search engine to index this stuff, so I think it's better to just hide it from the crawler.

EOD Checklist

  • Go
  • Leetcode January Challenge
  • Raahee
  • This blog
© 2022 by Paras Gupta. All rights reserved.
Theme by LekoArts