a full stack enthusiast interested in Javascript / Typescript / Kotlin / Python / React / React Native / (Android & iOS) native / Cloud

0%

There are two ways to use React, the old createClass or the fancy ES6 extend way. We should go the ES6 way since it gives much more native JavaScript feeling rather than react feeling when you coding. But there are so much examples out there which follows the classic way. It is good to give a look to both of them side by side to provide a more clear understanding. Yes, you can apply ES6 syntax to createClass as well, but we won’t cover that here.

Read more »

If you use a static blog system as me or a static site. You may consider which deployment suits you better, sftp maybe a stable old-school way. Today let’s use git to complete this quest. No, not push-then-pull, you can actually push only :)
Furthermore, via this approach, you have a taste to the world of continuous deployment. :) Let’s do this.

Read more »

The last time, we have installed a linux system and have done some preparation to make it ready to use. Now we will install a Nginx on it, and then your private server will become a web server and you can broadcast your ideas to the whole internet :)

Still, I will use Ubuntu 16.4.1, but solutions here still adoptable to the other linux distro.

Read more »

Do you know JSLint? A tool which can help you write quality JavaScript code, it is developed by Douglas Crockford. Who is the father of JavaScript, he surely has sufficient background to judge. :) And JSLint is very strict, and you can call it rigid sometimes, but he always has the point. If you have used the tool before, you may have noticed some errors, one of them may look like this : “Don’t make functions within a loop”. OK, let’s fix it, wait, what?

Yes, it may sound absurd at first, let’s dive into to find out what the father wants to say xD

Read more »

when you have a linux server and a newly installed system, what’s first thing you will do? Just dive into and play with the bash, no, never, it is not a windows desktop system. It needs some configurations first. Today, let’s see how many basic steps do we need to take before we can actually use a fresh new linux system. Yes, I use ubuntu 16.04.1 in this tutorial, but it should adopted to other linux distros as well. You just need to change apt-get part to the other package management system, like Yum in Cent OS.

At the below steps, i will not only show the commands, but also explain the detail behind it, so you can know why we use it.

Let’s from the very beginning, let’s say you just bought it…

Read more »

JavaScript is a de facto dominance in the modern web development. And its dynamic nature makes it very easy to learn, and, and very easy to fail :) One of the most famous confusion out there is the concept of closure. And in fact, you really shouldn’t read the accepted answer on the stack overflow. Because it doesn’t explain well as many other posts on the internet. Through this post, I will explain closure in a very straightforward way and tell you why they are wrong. Let’s begin.

Read more »

Front end world has an incredible evolution speed. Especially for the tooling, new kids jump out everyday. Webpack is one of them and seems it will dominate for a while. You may hear its complexity and how it is going to replace your current toolchain. Today, let’s bundle webpack like it bundle scripts for us xD

Read more »

CSS has lots of layout skills to master. position, float, multi-column, flexbox. Sometimes you can use them as you like, but sometimes you should choose wisely according to the situation. Let’s take a look at the position property. To look over some interesting behaviors among the different values.

Read more »

In ES5, we can very easy bind a event to DOM using the native way: document.addEventListener() , or a jQuery way, $(element).bind() , $(element).click() or $(element).on() , use them according to different situations.

But in the ES6 or Typescript, you will face some pitfall if you don;t care the details. Suppose you have the following code:

Read more »

Pointer in C is a powerful weapon, it can let us feel that we can manipulate the memory directly (Literally, not that true since the barrier as virtual memory and page table, but we can consider it like this.) And we know that you can use & to refer a memory address of a variable, and use * to deference an address to retrieve the inside value. And the relations between pointer and array, you can blahblahblah for a whole day.

But the question may come across, when do we need to use pointers and why? For instance, why scanf() need a pointer typed parameter while printf() doesn’t? We can’t just memorize function names. Aha, this may become tricky since it needs some background knowledge on the memory model. But clam down, we are here to solve it. And the memory model you will learn is not only applied to C, it’s universal. Let’s start!

Read more »