Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 80 12
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# pidfile: /var/run/redis.pid
@mfine2
mfine2 / lib.less
Created October 26, 2014 13:20
lib.less
.c0{color:#000;}.c3{color:#333;}.c4{color:#444;}.c6{color:#666;}.c9{color:#999;}.cc{color:#ccc;}.cf{color:#fff;}.red{color:red;}.green{color:green;}
@c0:#000;@c3:#333;@c4:#444;@c6:#666;@c9:#999;@cc:#ccc;@cf:#fff;@red:red;@green:green;
.ffa{font-family:Arial;}.ffs{font-family:'宋体';}.ffyh{font-family:'微软雅黑';}
.n{font-weight:normal;font-style:normal;}.b{font-weight:bold;}.i{font-style:italic;}//a-z
.tl{text-align:left;}.tc{text-align:center;}.tr{text-align:right;}.tj{text-align:justify;}
.vt{vertical-align:top;}.vm{vertical-align:middle;}.vb{vertical-align:bottom;}.vtb{vertical-align:text-bottom;}
.tdu{text-decoration:underline;}.tdn{text-decoration:none;}
.toe{text-overflow:ellipsis;}
.wsn{white-space:nowrap;}.wsp{white-space:pre;}.wbk{word-wrap:break-word;}
@mfine2
mfine2 / vim-config
Created January 7, 2014 03:39
vim-config
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
@mfine2
mfine2 / deploy.sh
Last active December 26, 2015 07:29
weibo dev kit deploy
if [ ! -n "$1" ] ; then
echo "please input svn username as the first parameter"
exit 0
fi
if [ ! -n "$2" ] ; then
echo "please input svn password as the second parameter"
exit 0
fi
echo "********** yum update **********"
git log #查看提交日志
git branch #查看分支
git branch develop #从当前分支切出development分支
git branch #查看分支
git checkout develop #切换到develop分支
git branch #查看分支
echo "how old are you, git" >> hello
git diff
git status
git add hello
@mfine2
mfine2 / git-config
Last active December 21, 2015 09:19
git config --global user.name "lixiao4"
git config --global user.email [email protected]
git config --global color.ui true
cd
mkdir git-demo-01
cd git-demo-01
git status #查看版本库和所有工作目录树的差异
git init # 初始化版本库
git status #查看初始化后的提示
echo "hello git" > hello #创建文件hello,内容为hello git
git add hello #将hello增加到暂存区
git diff #查看暂存区与工作目录树的区别
git status #查看
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
(function(GLOBAL) {
// Phantom Limb
// ------------
// http://viewinglens.com/phantom-limb
// https://github.com/brian-c/phantom-limb
// [email protected]
"use strict";
// Default configuration
var elem;
for ( var i = 0; elems[i]; i++ ) {
elem = elems[i];
// ...
}