Skip to content

Instantly share code, notes, and snippets.

View magicianzrh's full-sized avatar

magicianzrh magicianzrh

  • Shanghai,Hangzhou
View GitHub Profile
@magicianzrh
magicianzrh / gist:acae5c9b691dc0187b85f86b39c5982f
Created October 31, 2018 09:59 — forked from trodrigues/gist:1023167
Checkout only certain branches with git-svn
If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do.
* Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk:
git svn clone -T trunk http://example.com/PROJECT
* If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T:
git svn clone -T branches/somefeature http://example.com/PROJECT
find . -name '*.cs' ! -name '*Editor*' -print0 | xargs -0 cat | grep -v '^$' | grep -v '^\s*\/\/.*$' |wc -l
find . -name '*.py' -print0 | xargs -0 cat | grep -v '^#' | wc -l
@magicianzrh
magicianzrh / install-macvim-with-lua.sh
Created October 9, 2015 03:43 — forked from lodestone/install-macvim-with-lua.sh
brew install macvim with lua
brew install macvim --with-cscope --with-lua --override-system-vim
@magicianzrh
magicianzrh / gist:8c041bc12accc3e213aa
Last active August 29, 2015 14:22
update all folder git
#!/bin/sh
#更新同目录文件夹中的git
ls -d */ | while read F;
do
echo ${F};
cd ${F};
git pull --rebase && git submodule update --init --recursive;
cd -;
done
@magicianzrh
magicianzrh / gist:c6814732a1dd4887411e
Last active August 29, 2015 14:22
svn revert all shell for mac
# svn全部回滚
function svn_revert_all {
svn st | grep "^M" | cut -b 9- | while read FILENAME;
do
FILENAME=`echo ${FILENAME} | sed 's/ /\\\ /g'`
svn revert ${FILENAME}
done
}
@magicianzrh
magicianzrh / gist:32c69ed3e8a6a3a17d02
Last active August 29, 2015 14:22
svn rm unversioned shell for mac
# 删除svn没有进入版本的文件
function svn_rm_unversioned {
svn st | grep "^?" | cut -b 9- | while read FILENAME;
do
FILENAME=`echo ${FILENAME} | sed 's/ /\\\ /g'`
rm -Rf ${FILENAME}
done
}
using System;
namespace CodeRunner
{
class MainClass
{
public static void Main (string[] args)
{
Console.WriteLine ("Hello World!");
}
@magicianzrh
magicianzrh / gist:25ec023661805af3d73d
Created April 9, 2015 04:05
xcode DVTPlugInCompatibilityUUID
#/bin/sh
#view xcode uuid
defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
package main
import (
"fmt"
"io"
"log"
"os"
)
var target_path string
/*
clear all empty folder or only contain .DS_Store Thunmbs.db
TODO:CHECK PARENT FOLDER
*/
package main
import (
"fmt"
"io/ioutil"
"log"