Skip to content

Instantly share code, notes, and snippets.

View rudaoshi's full-sized avatar

孙明明 rudaoshi

  • KnowledgeFrontier
View GitHub Profile
@rudaoshi
rudaoshi / osx
Created April 18, 2015 06:59
virtualenvwrapper config
export WORKON_HOME=~/Experiemnt/envs
export PROJECT_HOME=~/Experiment/projects
source /usr/local/bin/virtualenvwrapper.sh
@rudaoshi
rudaoshi / install-vagrant-vbguest.sh
Last active December 20, 2015 13:08 — forked from lotreal/install-vagrant-vbguest.sh
解决中国局域网中 vagrant plugin install vagrant-vbguest 出错的问题
#!/usr/bin/env bash
GEMS=$(cat <<EOF
childprocess-0.5.8.gem
ffi-1.9.10.gem
little-plugger-1.1.4.gem
micromachine-1.1.0.gem
multi_json-1.11.1.gem
net-ssh-2.9.2.gem
rest-client-1.6.9.gem
@rudaoshi
rudaoshi / elements.json
Created July 4, 2016 13:40 — forked from MarchLiu/elements.json
Euclid's Elements relations. Each json item for each element.
{"name":"C.N.1","description":"Things which are equal to the same thing are also equal to one another.","references":[]}
{"name":"C.N.2","description":"If equals be added to equals, the wholes are equal.","references":[]}
{"name":"C.N.3","description":"If equals be subtracted from equals, the remainders are equal.","references":[]}
{"name":"C.N.4","description":"Things which coincide with one another are equal to one another.","references":[]}
{"name":"C.N.5","description":"The whole is greater than the part.","references":[]}
{"name":"Def.1.1","description":"A point is that which has no part.","references":[]}
{"name":"Def.1.10","description":"When a straight line set up on a straight line makes the adjacent angles equal to one another, each of the equal angles is right, and the straight line standing on the other is called a perpendicular to that on which it stands.","references":[]}
{"name":"Def.1.11","description":"An obtuse angle is an angle greater than a right angle.","references":[]}
{"name":"Def.1.12
@rudaoshi
rudaoshi / StanfordCoreNLPServerMultiLang.java
Created July 10, 2016 11:21
Stanford Core NLP Server 模式的多语言版本。
package edu.stanford.nlp.pipeline;
import com.sun.net.httpserver.*;
import edu.stanford.nlp.io.IOUtils;
import edu.stanford.nlp.io.RuntimeIOException;
import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.ling.IndexedWord;
import edu.stanford.nlp.ling.tokensregex.SequenceMatchResult;
import edu.stanford.nlp.ling.tokensregex.TokenSequenceMatcher;
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"
export WORKON_HOME=$HOME/Projects/.envs
export PROJECT_HOME=$HOME/Projects/
@rudaoshi
rudaoshi / install_mujoco_apple_m1.sh
Created January 31, 2022 03:12
Install Mujoco_py on Apple M1
# this works for Mujoco.2.1.1 and mujoco_py 2.1
# install mujoco app into Applications
# since the newst mujoco_py version does not officially support Mujoco2.1.1, we need some hack to make it work as follows:
ln -sf /Applications/MuJoCo.app/Contents/Frameworks/MuJoCo.framework/Versions/Current/Headers/ $HOME/.mujoco/mujoco210/include
mkdir -p $HOME/.mujoco/mujoco210/bin
ln -sf /Applications/MuJoCo.app/Contents/Frameworks/MuJoCo.framework/Versions/Current/libmujoco.2.1.1.dylib $HOME/.mujoco/mujoco210/bin/libmujoco210.dylib
@rudaoshi
rudaoshi / virutal_module.py
Created January 31, 2022 09:38
define a virtual module
import types
class VirtualModule(types.ModuleType):
def __init__(self, module_name, sub_modules):
super().__init__(module_name)
try:
import sys
sys.modules[module_name] = self
self._module_name = module_name
@rudaoshi
rudaoshi / .zshrc
Created March 19, 2022 03:16
use brew in both arm64 and x64
alias arm_brew="eval '$(/opt/homebrew/bin/brew shellenv)'"
alias intel_brew="eval '$(/usr/local/bin/brew shellenv)'"
@rudaoshi
rudaoshi / gist:bffe02d658b57aa89dc4407622aa0aa1
Created March 19, 2022 03:19
conda configuration for project management
conda config --add envs_dirs ~/Projects/.envs
conda config --set env_prompt '({name})'