Browse Source

add parts

master
heck 8 months ago
parent
commit
9d11dea487
5 changed files with 164 additions and 0 deletions
  1. +42
    -0
      bash_profile.d/00_base.sh
  2. +20
    -0
      bash_profile.d/convenience.sh
  3. +55
    -0
      bash_profile.d/git.sh
  4. +1
    -0
      bash_profile.d/java.sh
  5. +46
    -0
      bash_profile.d/pEp.sh

+ 42
- 0
bash_profile.d/00_base.sh View File

@ -0,0 +1,42 @@
#!/bin/bash
#export PATH=$PATH:/opt/local/bin:/opt/local/sbin
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PATH="$HOME/.cargo/bin:$PATH"
export LANG=en_US.UTF-8
TERM=xterm
EDITOR=vim
LESS='-RS -i -X'
HISTFILESIZE=
HISTSIZE=100000
alias sp='source $HOME/.bash_profile'
alias m='make'
alias mc='m clean'
alias mi='m install'
alias md='m develop'
# ls
if [ $(uname) == "Linux" ]; then {
alias l='ls -l --color=always --time-style=+%F%t%T'
alias ll='l -a'
alias lt='l -at'
alias ltr='l -art'
} fi
if [ $(uname) == "Darwin" ]; then {
alias l='ls -GlT'
alias ll='l -a'
alias lt='l -at'
alias ltr='l -art'
} fi
# grep
alias grep='grep --color=auto'

+ 20
- 0
bash_profile.d/convenience.sh View File

@ -0,0 +1,20 @@
#!/bin/bash
rmclassesrecursively() {
rm -vf $(find . | grep -E '\.class$')
}
rmdotoanddotdrecursively() {
rm -v $(find . | grep -E '\.o$|\.d$')
}
function realpath() {
python3 -c 'import sys, os; print(os.path.realpath(sys.argv[1]))' $1
}
# Print filenames matching grep $1
function fmatch() {
grep -ri $1 * | perl -pe 's/\:.*?\n/\n/g' | sort -u
}

+ 55
- 0
bash_profile.d/git.sh View File

@ -0,0 +1,55 @@
#!/bin/bash
# git
alias gf='git fetch --all --tags'
alias gp='git pull'
# git push
alias gpush='git push'
alias gpushf='git push --force'
alias gpusht='gpush; gpush --tags'
alias gpushtf='gpushf;gpushf --tags'
# --all / -u
alias gpau='gpush --all -u'
alias gpu='gpush -u'
alias gpauf='gpushf --all -u'
alias gpuf='gpushf -u'
# with tags
alias gpaut='gpush --all -u;gpusht'
alias gput='gpush -u;gpusht'
alias gpauft='gpushf --all -u;gpushtf'
alias gpuft='gpushf -u;gpushtf'
alias gs='git status --long'
alias gd='git diff'
alias gt='git tag'
alias gst='git for-each-ref --sort=creatordate --format "%(objectname) %(refname)" refs/tags'
alias gb='git branch'
alias gsb='git branch -vv --all'
alias gl='git log --graph --date=iso --topo-order --source --oneline'
alias gla='gl --all'
alias gll='git log --graph --date=iso --stat --topo-order --source'
alias glla='gll --all'
alias gm='git merge --no-ff'
alias grb='git rebase'
alias gco='git checkout'
alias gc='git commit'
alias gup='git pull --rebase --autostash -v'
alias gcp='git cherry-pick'
# stats
alias gstats='git shortlog -sne'
function gstatslines() {
echo -e "this usually takes a while.\nSo, go grab a coffee... or two... or three...";
git ls-files | while read f; do {
git blame -wMCC --line-porcelain $f | grep -I '^author ';
} done | sort -f | uniq -ic | sort -n --reverse
}
function gstats_libpEpAdapter_heck() {
echo "libpEpAdapter: corrected lines of code for author heck, because he commited the sqlite3 amalgamation..."
echo "$(gstatslines | grep 'author heck' | cut -f1 -d' ') - $(cat src/sqlite3.c src/internal/sqlite3.h | wc -l)" | bc
}
alias gstatsall='gstats;gstatslines'

+ 1
- 0
bash_profile.d/java.sh View File

@ -0,0 +1 @@
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home

+ 46
- 0
bash_profile.d/pEp.sh View File

@ -0,0 +1,46 @@
#!/bin/bash
# Delete symlinks in the pEpPythonAdapter (to allow "project search")
function pEpPythonAdapterRmSymlinks() {
for i in $(find . -type l | grep -i lib); do { rm -v $i; }; done
}
# pEp Fresh Repo Clones
export PEP_LOCAL_CONF_DIR=$HOME/src/adapter/conf/
function clone_pEpEngine() {
git clone https://gitea.pep.foundation/pEp.foundation/pEpEngine.git .
cp $PEP_LOCAL_CONF_DIR/local.conf.pEpEngine local.conf
cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpEngine .idea
}
function clone_pEpEngineHeck() {
git clone https://gitea.pep.foundation/heck/pEpEngine .
cp $PEP_LOCAL_CONF_DIR/local.conf.pEpEngine local.conf
cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpEngine .idea
}
function clone_pEpPythonAdapter() {
git clone https://gitea.pep.foundation/pEp.foundation/pEpPythonAdapter.git .
cp $PEP_LOCAL_CONF_DIR/local.conf.pEpPythonAdapter local.conf
cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpPythonAdapter .idea
}
function clone_pEpJNIAdapter() {
git clone https://gitea.pep.foundation/pEp.foundation/pEpJNIAdapter.git .
cp $PEP_LOCAL_CONF_DIR/local.conf.pEpJNIAdapter local.conf
cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpJNIAdapter .idea
cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.pEpJNIAdapter .idea
}
function clone_libpEpAdapter() {
git clone https://gitea.pep.foundation/pEp.foundation/libpEpAdapter.git .
cp $PEP_LOCAL_CONF_DIR/local.conf.libpEpAdapter local.conf
cp -r $PEP_LOCAL_CONF_DIR/intellij/.idea.libpEpAdapter .idea
}
function clone_devWiki() {
git clone ssh://wiki/var/lib/gitit/wikidata .
}
alias test_pEpPythonAdapter='python3 -c "import pEp;"'

Loading…
Cancel
Save