Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
573 additions
and
446 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#! /usr/bin/env python2 | ||
SOURCE_DIR = "$HOME/git/scale-product/" | ||
|
||
# import glob | ||
# import os.path | ||
|
||
# for filename in glob.iglob(os.path.join(SOURCE_DIR, '/**/*.c'), recursive=True): | ||
# print(filename) | ||
|
||
import sys | ||
import os.path | ||
|
||
# sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) | ||
sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 200) | ||
|
||
translation_map = {} | ||
|
||
for fname in sys.argv: | ||
basename = os.path.basename(fname) | ||
translation_map[basename] = fname | ||
|
||
for line in sys.stdin: | ||
for key in translation_map.keys(): | ||
if key in line: | ||
line = line.replace(key, translation_map[key]) | ||
print line, | ||
sys.stdout.flush() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /bin/bash | ||
|
||
sc_build_root="$HOME/.scalerc" | ||
. $sc_build_root | ||
scmake $@ # | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | ||
# cat $HOME/Scripts/lastbuild | sed -r "s/^\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#! /bin/bash | ||
|
||
sc_build_root="$HOME/.scalerc" | ||
|
||
# translates buildvm paths to local paths. Correct _most_ of the time, but | ||
# occasionally fooled. | ||
#tee /tmp/lastbuild; | ||
|
||
# I'm gonna try just symlinking /local/scale-product and see how that goes | ||
# function convertToPwd { | ||
# local THEPWD="$HOME/git/scale-product" | ||
# { cat <(cd "$THEPWD" && find "." | egrep '(cpp|h)$') \ | ||
# <(echo SWITCHOVER); | ||
# tee /dev/null; | ||
# } | tee /tmp/lastbuild | gawk ' | ||
# BEGIN { sw=0; FS="/"; } | ||
# /SWITCHOVER/ {sw=1; FS=":"; printf("switchover\n");} | ||
# sw == 0 { m[$NF] = $0; } | ||
|
||
# sw == 1 { printed = 0 } | ||
# /:[0-9]+:/ && sw == 1 { | ||
|
||
# tmp=$0; | ||
# if (match($1, /\/([^\/]+)$/, r) != 0) $1 = r[1]; | ||
|
||
# for (i in m) { | ||
# if ($0 ~ i) { | ||
# sub(i, m[i], tmp); | ||
# print tmp; | ||
# printed = 1; | ||
# } | ||
# } | ||
# } | ||
# sw == 1 && printed == 0 { | ||
# print $0; | ||
# } | ||
# ' | ||
# } | ||
|
||
function convertToPwd { | ||
local THEPWD="$HOME/git/scale-product" | ||
{ cat <(cd "$THEPWD" && find "$THEPWD" | egrep '(cpp|h)$') \ | ||
<(echo SWITCHOVER); | ||
tee /dev/null; | ||
} | tee /tmp/lastbuild | gawk ' | ||
BEGIN { sw=0; FS="/"; } | ||
/SWITCHOVER/ {sw=1; FS=":"; printf("switchover\n");} | ||
sw == 0 { m[$NF] = $0; } | ||
sw == 1 { printed = 0 } | ||
/:[0-9]+:/ && sw == 1 { | ||
tmp=$0; | ||
if (match($1, /\/([^\/]+)$/, r) != 0) $1 = r[1]; | ||
gsub(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]/, "", $1) | ||
if ($1 in m) { | ||
# print $tmp | ||
# print $1 | ||
# print m[$1] | ||
rgx="^[^:]*"$1 | ||
sub(rgx, m[$1], tmp); | ||
print tmp; | ||
} else { | ||
print $0; | ||
} | ||
printed = 1; | ||
} | ||
sw == 1 && printed == 0 { | ||
print $0; | ||
} | ||
' | ||
} | ||
|
||
|
||
cd ~/git/scale-product | ||
LAST_FILE="" | ||
echo $(git ls-files --exclude-standard --others --modified) | ||
for file in $(git ls-files --exclude-standard --others --modified); do | ||
if [ "x$LAST_FILE" = "x" ]; then | ||
LAST_FILE=$(dirname $file) | ||
else | ||
echo $LAST_FILE | ||
echo $file | ||
LAST_FILE=$(printf "%s\n%s\n" "$LAST_FILE" "$file" | sed -e 'N;s/^\(.*\).*\n\1.*$/\1/') | ||
fi | ||
done | ||
|
||
echo $LAST_FILE | ||
FILES=$(rg --color=never -g "*.h" -g "*.cpp" --files ~/git/scale-product) | ||
|
||
if [ ! -f $LAST_FILE ]; then | ||
if [ ! -d $LAST_FILE ]; then | ||
LAST_FILE=$(dirname $LAST_FILE) | ||
fi | ||
cd $LAST_FILE | ||
fi | ||
if [ -f $sc_build_root ]; then | ||
# $HOME/Scripts/fscmake $@ | $HOME/Scripts/fenagle_filenames.py $FILES | ||
$HOME/Scripts/fscmake $@ | convertToPwd | ||
fi | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# echo "Sourcing .bash_profile" | ||
# .bash_profile | ||
|
||
# . "$HOME/.profile" | ||
|
||
if [ -n "$BASH_VERSION" ] && [ -f $HOME/.bashrc ];then | ||
source $HOME/.bashrc | ||
# Get the aliases and functions | ||
if [ -f ~/.bashrc ]; then | ||
. ~/.bashrc | ||
fi | ||
|
||
# echo "Attaching screen" | ||
# screen -dRR | ||
# User specific environment and startup programs | ||
|
||
PATH=$PATH:$HOME/.local/bin:$HOME/bin | ||
|
||
export PATH |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,24 @@ | ||
# ~/.bashrc: executed by bash(1) for non-login shells. | ||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | ||
# for examples | ||
# .bashrc | ||
|
||
# echo "Sourcing .bashrc" | ||
|
||
# If not running interactively, don't do anything | ||
[ -z "$PS1" ] && return | ||
|
||
# don't put duplicate lines in the history. See bash(1) for more options | ||
# ... or force ignoredups and ignorespace | ||
export HISTCONTROL=ignoreboth:erasedups | ||
|
||
# append to the history file, don't overwrite it | ||
shopt -s histappend | ||
set completion-ignore-case on | ||
|
||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | ||
HISTFILESIZE=10000 | ||
|
||
# check the window size after each command and, if necessary, | ||
# update the values of LINES and COLUMNS. | ||
shopt -s checkwinsize | ||
|
||
# make less more friendly for non-text input files, see lesspipe(1) | ||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" | ||
|
||
# set variable identifying the chroot you work in (used in the prompt below) | ||
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then | ||
debian_chroot=$(cat /etc/debian_chroot) | ||
fi | ||
|
||
# set a fancy prompt (non-color, unless we know we "want" color) | ||
case "$TERM" in | ||
xterm-color) color_prompt=yes;; | ||
esac | ||
|
||
# uncomment for a colored prompt, if the terminal has the capability; turned | ||
# off by default to not distract the user: the focus in a terminal window | ||
# should be on the output of commands, not on the prompt | ||
#force_color_prompt=yes | ||
|
||
if [ -n "$force_color_prompt" ]; then | ||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | ||
# We have color support; assume it's compliant with Ecma-48 | ||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such | ||
# a case would tend to support setf rather than setaf.) | ||
color_prompt=yes | ||
else | ||
color_prompt= | ||
fi | ||
fi | ||
|
||
# if [ "$color_prompt" = yes ]; then | ||
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | ||
# else | ||
# PS1='\W >>' | ||
# fi | ||
unset color_prompt force_color_prompt | ||
|
||
# If this is an xterm set the title to user@host:dir | ||
# case "$TERM" in | ||
# xterm*|rxvt*) | ||
# echo "3" | ||
# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" | ||
# ;; | ||
# *) | ||
# ;; | ||
# esac | ||
|
||
# enable programmable completion features (you don't need to enable | ||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile | ||
# sources /etc/bash.bashrc). | ||
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then | ||
. /etc/bash_completion | ||
if [ -f $HOME/.shellrc ]; then | ||
. $HOME/.shellrc | ||
fi | ||
|
||
# Source global definitions | ||
if [ -f /etc/bashrc ]; then | ||
. /etc/bashrc | ||
. /etc/bashrc | ||
fi | ||
PROMPT_COMMAND="" | ||
|
||
[ -f ~/.fzf.bash ] && source ~/.fzf.bash | ||
|
||
if [ -f ~/.aliasrc ]; then | ||
. ~/.aliasrc | ||
if [ -f `which powerline-daemon` ]; then | ||
powerline-daemon -q | ||
POWERLINE_BASH_CONTINUATION=1 | ||
POWERLINE_BASH_SELECT=1 | ||
. /usr/share/powerline/bash/powerline.sh | ||
fi | ||
|
||
__fzf_editor__() { | ||
local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ | ||
-o -type f -print \ | ||
-o -type d -print \ | ||
-o -type l -print 2> /dev/null | cut -b3-"}" | ||
eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" fzf -m "$@" | while read -r item; do | ||
printf '%q %q' "$VISUAL" "$item" | ||
done | ||
} | ||
# Uncomment the following line if you don't like systemctl's auto-paging feature: | ||
# export SYSTEMD_PAGER= | ||
|
||
# CTRL-P - open selected file with configured editor | ||
if [[ ! -o vi ]]; then | ||
bind '"\C-p": " \C-e\C-u`__fzf_editor__`\e\C-e\er\C-m"' | ||
else | ||
bind '"\C-p": "\C-x\C-addi`__fzf_editor__`\C-x\C-e\C-x\C-r\C-m"' | ||
bind -m vi-command '"\C-p": "ddi`__fzf_editor__`\C-x\C-e\C-x\C-r\C-m"' | ||
fi | ||
# User specific aliases and functions | ||
|
||
. "$HOME/.scalerc" | ||
[ -f ~/.fzf.bash ] && source ~/.fzf.bash |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,3 +50,4 @@ core.* | |
*.executed | ||
*.make.txt | ||
tags | ||
update_buildvm.sh |
Oops, something went wrong.