Skip to content

Instantly share code, notes, and snippets.


jerry lau Jerry-Lau

View GitHub Profile
Jerry-Lau / test
Created May 29, 2015
Gist is awesome and super convenient!
View test
Github Gist is so convenient!
I love this and would like to share with everyone else.
Jerry-Lau / Gruntfile.js
Created Sep 8, 2015
Grunt file for compiling sass
View Gruntfile.js
'use strict';
* Node Module
module.exports = function(grunt) {
// Task configuration
* Get package meta data
Jerry-Lau / gulpfile.js
Created Oct 13, 2015
A personal gulp configuration file
View gulpfile.js
// require modules
var fs = require('fs');
var path = require('path');
var merge = require('merge-stream');
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var concat = require('gulp-concat'); // 合并js
var uglify = require("gulp-uglify");
Jerry-Lau /
Created Nov 11, 2015 — forked from agnoster/
My ZSH Theme


A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

View oh-my-zsh settings
"Badge Text" : "",
"Working Directory" : "\/Users\/jerryrobot",
"Prompt Before Closing 2" : false,
"Selected Text Color" : {
"Green Component" : 0.5648583769798279,
"Red Component" : 0.5059919357299805,
"Blue Component" : 0.5636365413665771
"Rows" : 40,
Jerry-Lau / rc meaning
Created Nov 11, 2015
What does rc mean as a file name?
View rc meaning
The ‘rc’ suffix goes back to Unix's grandparent, CTSS.
It had a command-script feature called "runcom". Early
Unixes used ‘rc’ for the name of the operating system's
boot script, as a tribute to CTSS runcom.
Jerry-Lau / centos6.5_nginx
Created Nov 23, 2015 — forked from ifels/centos6.5_nginx
centos 6.5 nginx安装与配置
View centos6.5_nginx
cd /etc/yum.repos.d/
vim nginx.repo
name=nginx repo
Jerry-Lau / correct use "em" with "rem" without "px"
Last active Mar 7, 2016
correct use "em" with "rem" without "px"
View correct use "em" with "rem" without "px"
:root {
font-size: 16px;
// Or you can use html
// html {
// font-size: 16px;
// }
Jerry-Lau / package.json
Created Mar 16, 2016
npm scripts as a build tool
View package.json
"scripts": {
"clean": "rm -f resources/css/style.css",
"autoprefixer": "postcss -u autoprefixer -r resources/css/style.css",
"scss": "node-sass --output-style compressed --source-map true resources/sass/PPP.scss resources/css/style.css",
"serve": "browser-sync start --proxy '' --files 'resources/css/*.css, resources/images/*'",
"build:css": "npm run scss && npm run autoprefixer",
"build": "npm run build:css",
"watch:css": "onchange 'resources/sass/*.scss' -- npm run build:css",
"start": "npm-run-all -p serve watch:css",
Jerry-Lau /
Last active Apr 8, 2016
Mastering CSS Margin Collapsing

Mastering margin collapsing


Top and bottom margins of blocks are sometimes collapsed into a single margin whose size is the largest of the margins combined into it, a behavior known as margin collapsing.

Margin collapsing occurs in three basic cases:

  • Adjacent siblings
  • Parent and first/last child If there is no border, padding, inline content, or clearance to separate the margin-top of a block from the margin-top of its first child block, or no border, padding, inline content, height, min-height or max-height to separate the margin-bottom of a block from the margin-bottom of its last child, then those margins collapse. The collapsed margin ends up outside the parent.
You can’t perform that action at this time.