Skip to content

Instantly share code, notes, and snippets.

@yun-cloud
yun-cloud / .tmux-statusline-colors.conf
Last active July 27, 2022 14:11
tmuxline.vim snapshot file (vim-airline with gruvbox theme)
# This tmux statusbar config was created by tmuxline.vim
# on Wed, 27 Jul 2022
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=colour246,bg=colour239"
set -g status-right-style "none"
set -g pane-active-border-style "fg=colour246"
set -g status-style "none,bg=colour237"
@yun-cloud
yun-cloud / instmix-into-csv.sh
Created March 14, 2019 09:14
extract instmix.out into a csv file
#!/bin/bash
SRCS=(I0.out I3.out R0.out R3.out)
RESULT=instmix.csv
dynamic_counts_range() {
SRC=$1
TARGET=$2
START=$(cat -n ${SRC} | grep dynamic-counts | awk '{print $1}')
END=$(cat -n ${SRC} | grep eof | awk '{print $1}')
RANGE=$((${END} - ${START} - 3))
@yun-cloud
yun-cloud / .vimrc
Last active May 15, 2018 11:04
.vimrc on compiler server
if empty(glob('~/.vim/autoload//plug.vim'))
silent !curl -fLo ~/.vim/autoload//plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
call plug#begin('~/.vim/plugged')
" Misc
Plug 'tpope/vim-sensible'
Plug 'jiangmiao/auto-pairs'
"Plug 'mhinz/vim-startify'
Plug 'tpope/vim-surround'
@yun-cloud
yun-cloud / vimrc_on_OS_server
Last active April 8, 2018 06:27
vimrc on OS server
if empty(glob('~/.vim/autoload//plug.vim'))
silent !curl -fLo ~/.vim/autoload//plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
call plug#begin('~/.vim/plugged')
" Misc
Plug 'jiangmiao/auto-pairs'
Plug 'mhinz/vim-startify'
Plug 'tpope/vim-surround'
@yun-cloud
yun-cloud / init.vim
Created January 26, 2018 11:56
nvimrc on windows with neovim-qt
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" dependency "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 1. neovim
" 2. python3
" 3. pip install neovim
" 4. devicons: nerd font
" 5. clang-format: clang
"
@yun-cloud
yun-cloud / init.vim
Last active January 26, 2018 13:12
neovim on megumin server: doing llvm
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" dependency "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 1. neovim
" 2. python3
" 3. pip install neovim
" 4. devicons: nerd font
" 5. clang-format: clang
"
@yun-cloud
yun-cloud / common-log-func.sh
Last active January 8, 2020 07:58
some common used function, to show the infomation.
BLACK="$(tput setaf 0; tput bold)"
RED="$(tput setaf 1; tput bold)"
GREEN="$(tput setaf 2; tput bold)"
YELLOW="$(tput setaf 3; tput bold)"
BLUE="$(tput setaf 4; tput bold)"
MAGENTA="$(tput setaf 5; tput bold)"
CYAN="$(tput setaf 6; tput bold)"
WHITE="$(tput setaf 7; tput bold)"
BOLD="$(tput bold)"
RESET="$(tput sgr0)"
@yun-cloud
yun-cloud / nachos-helper.sh
Last active January 27, 2018 07:58
help you rebuild nachos and test your HW. Remember to change the variable, _base, to your project directory using 'pwd' command.
#!/bin/bash
_script="$(readlink -f ${BASH_SOURCE[0]})"
_base="$(dirname $_script)"
log_dir="${_base}/log"
mkdir -p ${log_dir}
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
@yun-cloud
yun-cloud / hw7-2
Created April 25, 2017 11:46 — forked from anonymous/hw7-2
#include "function.h"
using namespace std;
Polynomial::Polynomial()
{
greatestPower=0;
coefficients[0]=0;
}
Polynomial::Polynomial(const int N, const int C[51])
{
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;
int max_path_weight(const vector<int>& tree, int index)
{