Skip to content

Instantly share code, notes, and snippets.

@KaroseLiu
KaroseLiu / gist:7f87654330274351bbf4bfb12c61f57b
Created August 19, 2017 03:39
When your project is the front-end and back-end is separation, when you want to host your static file in the nginx or other http servers, you could use this Dockerfile to do it
FROM node:8.0.0-alpine as build-env
# your project name(my project name is planet)
WORKDIR /planet
# firstly copy your package.json to your docker and run npm install
COPY package.json .
RUN npm install
@KaroseLiu
KaroseLiu / gist:6666466924def97b9707226a1b0338c0
Last active August 18, 2017 10:05
High order component for add loading for component
import React from 'react'
import get from 'lodash/get'
import isBoolean from 'lodash/isBoolean'
import isEmpty from 'lodash/isEmpty'
import { Spin } from 'antd'
const NOT_MATCH_PROPERTY = 'not match any propertys'
export const withLoading = (WrappedComponent, opts) => {
const defaultOptions = {
@KaroseLiu
KaroseLiu / redis-autostart-osx.md
Created July 18, 2017 05:22 — forked from subfuzion/redis-autostart-osx.md
redis auto start OS X

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables