I have a side project using dokku, it works well. But then I want to dump the production data to local in order to test some cases. I thought it should be as simple as dump and restore, but I was wrong. It took me a while, I think write it down might help someone…
How to auto delete Mongodb records after certain time with Mongoose
I have a requirement where I need to remove some records from a collection. Let’s see how to do that in Mongoose. I use Mongoose: 5.4.9 and MongoDB v4.0.3.
How to setup your own PaaS with Dokku + Node + React + Mongodb + Nginx
Setup environment could be tedious, but Dokku just makes it tremendously easy. Even more, you can have your own CD setup under 5 mins with everything. Let’s see how we can get up and running for this app: A Node back-end with a create-react-app powered front end, and we will use MongoDB.
How to create your own Dockerfile for a rapid Dokku deployment
Dokku is good, and I wrote a blog for whole setup of Dokku + Node + React + MongoDB. This blog, we will address the issue where if you use the default buildpack for building, it will download Node and NPM everytime, which will make it very long in some circumstance, in this blog, we will Dockerfile to replace it, make…
How to add official Google sign-in to your React application
The hard part of this is, the official Google sign-in is using a script tag in your HTML and initialize it using the traditional in-browser vanilla JavaScript, which is not happening in React. And make it a little bit harder to make the two works together.
How to do generic type transferring with jsx in TypeScript
So I just encountered a problem where I want to make a better type checking in a props of a React component. It’s about one prop takes an array of certain type X, and in another prop: callback, this type X needs to be the parameter of the callback. Let’s see how to do that in TypeScript.
8 features you can add after using create-react-app without ejecting
I love create-react-app, it really makes my life easier. But still I can see there are things that I need to do after bootstrapping a new project with CRA. I will share them to you. And yes, no ejecting. And I create a GitHub repo and added all of them for you.
How to make nested level using mobx-state-tree
I’ve heard mobx-state-tree for a while. Today I looked into it, and found it’s pretty lovely. Kind of the fat model pattern. Where it could make the code much more cleaner and far more less boilerplate compare to redux. Today, let’s see how to make nested level in mobx-state-tree.
How to pass css class as prop using styled component
Styled components will be good if you use it from start, but things could be tricky in terms of mixing it up with other libraries or even your own code. Today, I will show you how to use styled components to generate css class and pass it to the 3rd party lib or your own…
Scroll a not in view component into the view using React
Sometimes, we have a long list, and then we want to locate the list to one of the items that got a change but not currently been shown in the viewport, let’s see how to do that in React.









