Skip to content

Instantly share code, notes, and snippets.

View huguangju's full-sized avatar
🎯
Focusing

Carson huguangju

🎯
Focusing
View GitHub Profile
@huguangju
huguangju / checkFileAndCreate.js
Last active May 25, 2016 02:45
Check if a file no exist in NodeJS, create it
var fs = require('fs');
module.exports = function checkFileAndCreate(cb) {
try {
fs.accessSync(file, fs.F_OK);
cb(null);
} catch (err) {
if(err.code === 'ENOENT') {
fs.writeFileSync(file, '');
cb(null);
@huguangju
huguangju / isEmptyObject.md
Last active January 19, 2017 08:02
Is an Object Empty?

在JavaScript中检测对象是否为空?

方式一

isEmptyObject(obj) {
  Object.keys(obj).length === 0;
}
@huguangju
huguangju / pyenv.md
Last active January 22, 2017 03:11
为Mac设置Python多版本开发环境
@huguangju
huguangju / CSS3ColumnLayout.md
Created March 12, 2017 08:23
圣杯布局和双飞翼布局等3栏布局

圣杯布局

<div class="container">
    <div class="main"></div>
	<div class="sub"></div>
	<div class="extra"></div>
</div>
@huguangju
huguangju / 安装node-sass时报错.md
Last active March 26, 2017 02:56
npm install node-sass failed
...

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/local/opt/pyenv/shims/python2
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /usr/local/opt/pyenv/shims/python2 -c import platform; print(platform.python_version());
gyp ERR! stack pyenv: python2: command not found
gyp ERR! stack

垂直居中

.dad {
    position: relative;
}
.son {
    position: absolute;
 margin: auto;
@huguangju
huguangju / SCSS.md
Created July 19, 2017 04:28 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@huguangju
huguangju / success.js
Created November 27, 2017 11:44
.babel.json
{
"{\"filename\":\"/Users/huguangju/Programming/github/react/ant-design-pro/src/theme.js\",\"env\":{\"development\":{\"plugins\":[]}},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],null],[[],{\"loose\":false,\"spec\":false}],[[],null],[[],null],[[],{\"spec\":false}],[[],null],[[],{\"loose\":false}],[[],null],[[],null],[[],null],[[],{\"loose\":false}],[[],{\"loose\":false}],[[],null],[[],null],[[],null],[[],{\"loose\":false}],[[],null],[[],{\"loose\":false}],[[],null],[[],null],[[],{\"loose\":false}],[[],{\"async\":false,\"asyncGenerators\":false}]],\"ignore\":[],\"code\":true,\"metadata\":true,\"ast\":true,\"comments\":true,\"compact\":\"auto\",\"minified\":false,\"sourceRoot\":\"/Users/huguangju/Programming/github/react/ant-design-pro/src\",\"babelrc\":false,\"sourceType\":\"modul