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
#!/bin/bash | |
# Info : install tools for ubuntu | |
# Author : elain | |
# CTime : 2011.08.01 | |
# update by HJ 2015.05.15 | |
# run under root or with sudo | |
#------------------------------------------- | |
#--------- 删除一些没用的软件 ------------ | |
#--------------------------------------force-yes -y------- |
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
import java.util.Random; | |
/** | |
* 此类提供一系列产生随机数的方法,以满足不同用例需要 | |
* from Internet | |
* @author crazymonkey | |
*/ | |
public final class NumberRandom { | |
// 随机数对象 | |
private static Random random; |
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
# upgrade all pip packages. need sudo permission. path of pip should be modified | |
pip freeze --local|grep -v '^-e' | cut -d = -f 1 | xargs sudo /usr/local/bin/pip install -U |
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
#!/usr/bin/env python | |
#-*-encoding:utf-8-*- | |
import chardet | |
import argparse | |
import os | |
parser = argparse.ArgumentParser() | |
parser.add_argument("dir", help="directory where all files will be converted") | |
parser.add_argument("-r", "--recursive", action="store_true", help="do convertion recursively") | |
parser.add_argument("-e", "--extension", help="only convert files with specific extension") |
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
# user defined inputrc | |
find_git_branch () { | |
local dir=. head | |
git_branch='' | |
until [ "$dir" -ef / ]; do | |
if [ -f "$dir/.git/HEAD" ]; then | |
head=$(< "$dir/.git/HEAD") | |
if [[ $head = ref:\ refs/heads/* ]]; then | |
git_branch=" (${head#*/*/})" |
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
set number | |
" set <F5> to compile and run c/cpp/java/python/shell | |
" map <f5> :call CompileRunGcc()<cr> | |
" func! CompileRunGcc() | |
" exec "w" | |
" exec "!gcc % -o %<" | |
" exec "! ./%<" | |
" endfunc | |
" set <F5> to run javac and java |
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
if [ -x /usr/bin/dircolors ]; then | |
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(d ircolors -b)" | |
alias ls='ls --color=auto' | |
#alias dir='dir --color=auto' | |
#alias vdir='vdir --color=auto' | |
alias grep='grep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias egrep='egrep --color=auto' | |
fi |
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 off | |
title 更改文件名大写为小写 | |
::放在目标文件夹下执行 | |
set dir=%~dp0&call:cdto | |
for /f "delims=" %%i in ('dir/s/b/ad') do set dir=%%i&call:cdto | |
pause | |
exit/b | |
:cdto | |
cd /d %dir% | |
for /f "delims=" %%i in ('dir/b/a-d/l') do ren "%%i" "%%i" |
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 execAt(targetdir): | |
""" | |
execute the decorated method at specified directory | |
""" | |
def wrapper(method): | |
import os | |
def func(*args, **kvargs): | |
old = os.getcwd() | |
os.chdir(os.path.abspath(targetdir)) | |
ret = method(*args, **kvargs) |
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
[user] | |
name = ${username} | |
email = ${email} | |
[filter "lfs"] | |
required = true | |
clean = git-lfs clean -- %f | |
smudge = git-lfs smudge -- %f | |
process = git-lfs filter-process | |
[alias] | |
co = checkout |
OlderNewer