Skip to content

Instantly share code, notes, and snippets.

View cjhgo's full-sized avatar
🎯
Focusing

cjhgo

🎯
Focusing
View GitHub Profile
@cjhgo
cjhgo / git乱码解决方案汇总.txt
Last active September 21, 2015 13:09 — forked from xkyii/git乱码解决方案汇总.txt
git乱码解决方案汇总
原帖地址: 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
import time
import functools
def split_list_into_sized_chunks(l,n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
def clock(func):
@cjhgo
cjhgo / tiddly_chkconfig_service_script.sh
Last active March 12, 2017 17:24
the script to add tiddly as a init service
#!/bin/bash
#
#chkconfig: 35 99 99
#description: tiddlywiki
#
#reference
# https://www.rosehosting.com/blog/install-and-run-tiddlywiki-on-a-centoos-6-vps-using-nginx/
. /etc/rc.d/init.d/functions
#!/bin/bash
## Sample Script 0.1
## Dependencies: notify-osd
# notify-send "Sample nautilus script" "You Selected $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | while read filename; do
subl "$filename"
done
# subl "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
# subl $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
#!/bin/bash
## Sample Script 0.1
## Dependencies: notify-osd
# notify-send "Sample nautilus script" "You Selected $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | while read filename; do
fullfile="$filename"
filename=$(basename "$fullfile")
extension="${filename##*.}"
foldername="${filename%.*}"
/*
g++ filename.cpp -std=c++11
./a.out
display MathPic.ppm
http://blog.csdn.net/xshbx/article/details/45245389
http://www.matrix67.com/blog/archives/6039
*/
#include <iostream>
#include <cmath>
@cjhgo
cjhgo / 0_reuse_code.js
Created April 6, 2017 16:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cjhgo
cjhgo / kvset.sh
Last active April 20, 2017 02:27
#!/bin/bash
#设置终端目录变量
#usage
#$`kvset nglog /var/log/nginx`
#$cd $nglog
#$pwd
#$/var/log/nginx
if [ $# -eq 0 ]
then
#echo "No arguments supplied"
@cjhgo
cjhgo / vtraceback.py
Created April 24, 2017 07:40 — forked from snower/vtraceback.py
view local variable traceback
# -*- coding: utf-8 -*-
# 14-9-20
# create by: snower
import linecache
import sys
import types
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
'format_exception_only', 'format_list', 'format_stack',
import functools
def log(func):
@functools.wraps(func)
def wrapper(*args):
print(u"request body: {}".format(args[0]))
response = func(*args)
print u"response body: {}".format(response)
return response