Skip to content

Instantly share code, notes, and snippets.

@guitong
guitong / Ebbinghaus_curve_sample.md
Last active February 21, 2018 05:09
如何用艾宾浩斯遗忘曲线来背单词?
@guitong
guitong / remember-selectors-with-love-and-hate.md
Created March 10, 2018 09:44
How To Remember the order of Selectors: LOVE and HATE
@guitong
guitong / zsh-and-iterm-simple.md
Last active March 15, 2018 06:34
Zsh + iTerm2 简单配置

Step 1: 安装iTerm2

http://www.iterm2.com/ 下载,安装 easy..

打开iTerm2

Step 2: 安装Zsh

运行zsh --version,确认是否安装了Zsh

@guitong
guitong / install-jdk-8-for-osx.md
Last active February 7, 2022 08:50
JDK 8 Installation for OS X
@guitong
guitong / cross-env-readme-zh-cn.md
Created March 28, 2018 07:04
cross-env 简介 (README)

The problem

当你使用NODE_ENV=production设置环境变量的时候,大多数Windows命令提示行将会choke。(例外是Bash on Windows,使用原生bash)同样地,windows和POSIX环境命令使用环境变量的方式也不同。POSIX环境下,你使用:$ENV_VAR,而windows环境使用%ENV_VAR%

This solution

cross-env可以让你使用一个命令,所有环境通用。只要遵循POSIX系统风格即可。

Installation

@guitong
guitong / difference-between-focus-and-active.md
Created April 20, 2018 09:50
What is the difference between `:focus` and `:active`?

Q: What is the difference between :focus and :active?

A: :focus:active是两种不同的状态。

:focus表示当元素是被选择接收输入设备(keyboard)的输入时的状态。:active表示当前元素正在被用户激活时的状态。

让我们来举个例子。假设我们有一个``元素,起初它不会有任何状态。它只是存在。如果我们使用Tab键将焦点移至其上,此时它将进入:focus状态。如果是点击操作(或者点击Space),它将进入`:active`状态。

@guitong
guitong / git-docs-reset.md
Last active May 2, 2018 04:39
git reset 指南
@guitong
guitong / box-sizing.md
Created June 11, 2018 14:52
CSS: box-sizing

box-sizing

CSS的 box-sizing 属性定义了用户代理应该如何计算一个元素的总宽度和高度。

CSS Demo: https://codepen.io/guitong/pen/RJpMWV

在默认的 CSS 盒模型中,你分配给元素的宽度和高度仅应用于元素的_content box_。如果元素有边框(border)或者内边距(padding),则会将其添加到元素的宽度和高度,以获得元素在屏幕上渲染的框的大小。这意味着当你设置宽度和高度时,需要去调整它们的值来允许可能会添加的边框或内边距。

box-sizing属性可以被用来调整该表现:

@guitong
guitong / nth-child.md
Created June 12, 2018 07:36
CSS :nth-child

CSS 伪类 :nth-child()根据元素在一组同胞元素中的位置进行匹配。

/* Selects every fourth element among any group of siblings */
:nth-child(4n) {
    color: lime;
}

语法

@guitong
guitong / so-bem-block-naming-nesting.md
Last active April 28, 2020 14:18
BEM block, naming & nesting - StackOverflow