loading
Loop with async and await in JavaScript

JavaScript Notes

2018.05.03

Loop with async and await in JavaScript

Well, just got some problems in JavaScript loop with http request inside. Take a short note showing how to deal with it which got ideas from the post JavaScript: async/await with forEach().

National Geographic 'Photo of the Day' Downloader with Shell script

Linux Notes

2018.04.22

National Geographic 'Photo of the Day' Downloader with Shell script

A shell script to automate the process of downloading National Geographic Photo of the Day. The script saves the image of Photo of the Day in the same directory where the script itself resides. You can use cron to make it automatically running everyday.

npm install, concerns for me

Tutorials / Web Notes

2018.04.14

npm install, concerns for me

While learning Node.js, install packages is a commonly operation. However, as a newbie, I might install the packages not in the right way. So taking this note to refresh my mind on npm installs.

Contact form for a static site without a backend

Tutorials

2018.03.24

Contact form for a static site without a backend

For a static site like those on GitHub Pages, everything is done in the frontend. The user just downloads a bunch of static files that execute in their browser. But for a "Contact" form, to deal with the submissions we typically need a backend service, either self hosted or a third a third-party service.

JS 本地数据存储之 cookie

JavaScript Notes / Web Notes

2018.03.09

JS 本地数据存储之 cookie

本来只是想简单看看 cookie、localStorage 和 sessionStorage 的,没想到一搜索扩展了很多知识,但是,中心主题还是集中在 web storage (localStorage, sessionStorage) 的认识上,以及怎么使用它们。不过,在此之前,先来简单认识一下 cookie 吧。

初识 ES6

JavaScript Notes

2018.03.08

初识 ES6

虽然 ES8 已经发布,但是以我的基础来说还是从 ES6 (ECMAScript 2015) 开始,此番就跟着 JavaScript by Example 这本书来学习,随手记点笔记,以期长点记性。

中文网页字体设置

Web Notes

2018.03.01

中文网页字体设置

由于中文字体通常体积较大,在 web 中使用中文字体确实需要一些技巧。我也一直在纠结使用什么样的字体能有更好的阅读体验,鼓捣过 Typekit 加载思源宋体,可难免会拖慢加载速度,有时还不能成功加载,只能换回系统内置字体。今天就好好研究下网页字体的使用,一劳永逸!

Get your anaconda ready after brew install

Tutorials

2018.01.27

Get your anaconda ready after brew install

Just add the anaconda into PATH after installing it with Homebrew. If no .bash_profile, you can append the "/usr/local/anaconda3/bin" to the paths file as well.

In-place swap, in C

C Notes / CS Basics

2017.12.14

In-place swap, in C

In-place swap is just a logic trick used to swap a content of two distinct variables without any temporary storage variable.