/images/art2.png

Z-shell overview

Reference Very useful blog: http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#username-and-hostname http://zsh.sourceforge.net/Intro/intro_12.html#SEC12 Variable name usage %m Hostname %n Username %d Directory from / %~ Directory from ~ %t time (12) %T time (24) %d and %~ can add a number to specify how many previous path will show. Like %1~ Guide to zsh Here is the link to A User’s Guide to the Z-Shell single quotes & double quotes 1 2 RPROMPT="$(command)" # this will run command, then set RPROMPT to the result RPROMPT='$(command)' # this will set RPROMPT to run command each time it is printed Date man Date

Callback, Promise and Async/await in js

Js event loop | Call stack | task queue This website shows how js running with single thread to handle concurrency Synchronous & asynchronous Function run synchronously means code is running as same as your writing. But in real situation, some code may need time to running but you don’t want all code is block. Therefore, you may need some technique to let this part running asynchronously which means this part of code is block and the rest of code is not.

What is "this" in javascript

Author: Dmitri Pavlutin Reference: https://dmitripavlutin.com/gentle-explanation-of-this-in-javascript/ Concept Invocation of a function is executing the code that makes the body of a function, or simply calling the function. For example parseInt function invocation is parseInt('15'). Context of an invocation is the value of this within function body. For example the invocation of map.set('key', 'value') has the context map. Scope of a function is the set of variables, objects, functions accessible within a function body.

How to have a dynamic class name

In same case, you may want to have a different style depend on your state or a variable. Now we can have two ways to achieve that. classNames This is a javascript for conditionally joining classNames. Here is: Github Basically, you can combine any number of classNames. 1 2 const classNames = require('classNames'); classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }); // => 'foo bar baz quux' ES6 template literals You can just use template literals.

Why Can’t I Open My React App By Clicking Index.html?

The app should Run when you open up your index.html file The conclusion is add "homepage":".", in package.json. medium.com/@louis.raymond Still not work when you have client side router If you are routing client side, index.html may still not work. In this case, you may using BrowserRouter. Change it to HashRouter. Click: Different between them

Redis overview

Installation For mac 1 sudo brew install redis-server open redis server 1 redis-server test is work or not 1 redis-cli ping basic command 1 2 3 ECHO 'hello word QUIT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 SET foo 100 GET foo // 100 SET bar 'hello world' GET bar // hello world INCR foo // 101 DECR foo // 100 EXISTS foo // 1 EXISTS foo1 // 0 DEL bar EXISTS bar // 0 GET bar //(nir) FLUSHALL // all empty SET server:name someserver GET server:name // "someserver" SET server:port 8000 GET server:port SET greeting "Hello world" GET greeting EXPIRE greeting 50 // set expirations to 50 second TTL greeting SETEX greeting 30 "hello world" // set value and expiration PERSIST greeting // key will not expire TTL greeting // -1 MSET key1 "hello" key2 "world" APPEND key1 " world" RENAME key1 greeting LPUSH people "Brad" // 1 LPUSH people "Jen" // 2 LPUSH people "Tom" // 3 LRANGE people 0 -1 // return all // Tom Jen Brad LRANGE people 1 2 // Jen Brad RPUSH people "Harry" LRANGE people 0 -1 // Tom Jen Brad Harry LLEN people // 4 RPOP people // Harry LPOP people LINSERT people BEFORE "Brad" "TOM" LRANGE people 0 -1 // Jen Tom Brad SADD cars "Ford" SADD cars "Honda" SADD cars "BMW" SISMEMBER cars "Ford" // 1 SISMEMBER cars "Chevy" // 0 SMEMBER cars // Honda BMW Ford SCARD cars // 3 SMOVE cars mycars "Ford" SMEMBER cars // Honda BMW SMEMBER mycars // Ford SRAM cars "BMW" SMEMBER cars // Honda ZADD users 1980 "Brad" ZADD users 1975 "Jen" ZADD users 1990 "Mike" ZADD users 1990 "Kate" ZRANK users "Mike" // 3 ZRANK users "Jen" // 0 ZRANK users "Brad" // 1 ZRANGE users 0 -1 // Jen Brad Kate Mike ZINCRBY users 1 "Jen" // 1976 HSET user:brad name "Brad" HSET user:brad email "brad@gmail.

Some cool websites archive

Development setting up for Mac This guide covers the basics of setting up a development environment on a new Mac. https://sourabhbajaj.com/mac-setup/ shapeCatcher Draw a character and find the ASCII code http://shapecatcher.com/index.html draw.io Draw diagram online https://www.draw.io regular expression Good online tool to test and learn regular expression https://regexr.com 100 front end component design 100 react component design challenge https://www.florin-pop.com/blog/2019/09/100-days-100-projects/ bootswatch Several bootstrap scheme. https://bootswatch.com shields.io Get or create Readme badge