Skip to content

Instantly share code, notes, and snippets.

View monkeym4ster's full-sized avatar
🎯
Focusing

M4ster monkeym4ster

🎯
Focusing
View GitHub Profile
原帖地址: http://topic.csdn.net/u/20110113/19/b0d5d506-4307-428b-a61d-7974aa66a2da.html
首先要说明的是:这里介绍的方法都是大部分是本人“悟”出来的,所以网上难有流传!
好方法不能自己私藏,否则就白忙乎这几天了,分享给有需要的朋友们。如果有转载,敬请注明来自*CSDN老邓*作品。
呵呵,给自己打广告,实在是无耻之极,权当无聊之时打字之用。
欢迎流传,为最优秀的分布式版本管理系统Git做宣传!!
步骤:
1. 下载:http://loaden.googlecode.com/files/gitconfig.7z
2. 解压到:<MsysGit安装目录>/cmd/,例如:D:\Program Files\Git\cmd
#!/usr/bin/env python
# encoding: utf-8
import os
import urllib2
BASE_DIR = os.getcwd()
def read_file(path):
@monkeym4ster
monkeym4ster / gist:9dbb2c945e145ff21465
Created July 14, 2015 03:57
京东部分前端校验
//http://i.jd.com/js/userInfo.js
//获取购物行为
$.ajax({
type: "GET",
url : "/user/userinfo/getUserCredit.action",
timeout: 3000,
success: function (result) {
$("#userCredit").addClass("rank-sh rank-sh0"+result);
}
});
@monkeym4ster
monkeym4ster / ubuntu1404.sh
Created November 5, 2015 10:23 — forked from shenqihui/ubuntu1404.sh
ubuntu 1404 init sh
# aliyun apt source
# sudo sh -c 'echo "deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted \n\
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted \n\
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted \n\
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted \n\
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty universe \n\
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty universe \n\
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe \n\
# deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe \n\
# deb http://cn.archive.ubuntu.com/ubuntu/ trusty multiverse \n\
@monkeym4ster
monkeym4ster / .vimrc
Created November 10, 2015 03:28 — forked from shenqihui/.vimrc
vimrc
set nocompatible " Don't be compatible with vi
let mapleader="," " change the leader to be a comma vs slash
command! W :w
cmap W! w !sudo tee % >/dev/null
map <silent> <leader>V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
@monkeym4ster
monkeym4ster / gist:9764648907701a9dedd1
Created November 24, 2015 04:45 — forked from evildmp/gist:3094281
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@monkeym4ster
monkeym4ster / crawler.coffee
Created January 15, 2016 03:54
Simple html and javascript files crawler
request = require('request')
cheerio = require('cheerio')
async = require('async')
URL = process.argv[2] or 'http://127.0.0.1:3000/'
crawler = (url) ->
console.log 'crawler', url
request url, (err, res, body) ->
if err
@monkeym4ster
monkeym4ster / docker_cheat_sheet.md
Last active March 4, 2016 07:38
Docker Cheat Sheet

删除镜像

删除所有镜像

docker rmi $(docker images -q)

删除所有未打 tag 的镜像

docker rmi $(docker images | awk '/^/ { print $3 }')
@monkeym4ster
monkeym4ster / ip.js
Created March 18, 2016 07:04
JavaScript IP to long
var ip;
ip = {};
ip.toLong = function toInt(ip){
var ipl=0;
ip.split('.').forEach(function( octet ) {
ipl<<=8;
ipl+=parseInt(octet);
});
@monkeym4ster
monkeym4ster / readfile.coffee
Created March 21, 2016 07:50
Read File Stream Line-by-Line
readline = require('readline')
fs = require('fs')
rl = readline.createInterface(
input: fs.createReadStream('sample.txt')
)
rl.on 'line', (line) ->
console.log 'Line from file:', line
return