This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* gulp | |
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-minify-css gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
*/ | |
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(name, definition) { | |
if (typeof module != 'undefined') module.exports = definition(); | |
else if (typeof define == 'function' && typeof define.amd == 'object') define(definition); | |
else this[name] = definition(); | |
}('mod', function() { | |
//This is the code you would normally have inside define() or add to module.exports | |
return { | |
sayHi: function(name) { | |
console.log('Hi ' + name + '!'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.bookmark{ | |
background: #b00; | |
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b00), color-stop(100%,#900)); | |
background-image: -webkit-linear-gradient(top, #b00 0%, #900 100%); | |
background-image: -moz-linear-gradient(top, #b00 0%, #900 100%); | |
background-image: -o-linear-gradient(top, #b00 0%, #900 100%); | |
background-image: -ms-linear-gradient(top, #b00 0%, #b00 100%); | |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b00', endColorstr='#900',GradientType=0 ); | |
background-image: linear-gradient(top, #b00 0%, #900 100%); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def raw_string(s): | |
if isinstance(s, str): | |
s = s.encode('string-escape') | |
elif isinstance(s, unicode): | |
s = s.encode('unicode-escape') | |
return s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 14px ~ 16px Best font settings */ | |
font-family:Lucida Sans Unicode, Hiragino Sans GB, WenQuanYi Micro Hei, Verdana, Aril, sans-serif; | |
/* 12px ~ 13px Best font settings */ | |
font-family:Lucida Sans Unicode, Verdana, Aril, sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.clearfix:before, | |
.clearfix:after { | |
content: " "; /* 1 */ | |
display: table; /* 2 */ | |
} | |
.clearfix:after { | |
clear: both; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for property, value in vars(theObject).iteritems(): | |
print property, ": ", value | |
// or | |
import inspect | |
for attr, value in inspect.getmembers(obj): | |
print attr, value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_as_daemon(stdin = '/dev/null',stdout='/dev/null', stderr = '/dev/null'): | |
''' | |
@brief 以daemon的方式运行程序 | |
@details 以daemon的方式运行程序 | |
@param stdin (string) 重定向标准输入 | |
@param stdout (string) 重定向标准输出 | |
@param stderr (string) 重定向错误输出 | |
''' | |
try: |
NewerOlder