Get Random Number Using Liquid

Code Snippet / Tutorials

2019.11.01

Get Random Number Using Liquid

Generate random numbers in Liquid was once possible with built-in rand(), but it has been taken out because it's easy to replicate in JavaScript and doesn't benefits to server side caching. However, you can actually get a random number in Liquid through a simple trick: making use of both the date & modulo Liquid filters.

临时关闭 Mac SIP 修改自带词典字体

Tutorials

2019.03.16

临时关闭 Mac SIP 修改自带词典字体

最近用词典比较多,而 Mac 自带词典不得不说非常好用,还能自己编译、安装一些第三方的词典。稍有遗憾的是,自带词典的字体目前(Mojave)不能任意修改,需要临时关闭 SIP (System Integrity Protection, 系统完整性保护) 才能添加自定义 CSS。

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.

Upgrade Ruby to the lastest version on MacOS with Homebrew

Tutorials

2017.10.26

Upgrade Ruby to the lastest version on MacOS with Homebrew

Recently when installing some gems, it popped out errors that telling the Ruby version is lower than required... I have to upgrade the shipped Ruby, version 2.0.0p648 (2015-12-16 revision 53162), on my machine. There are a few methods dealing with this, but I found the easiest way is using Homebrew.

Ads by Google

TRENDING