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
#include <iostream> | |
using namespace std; | |
template<typename itemType> | |
class RangeBasedLooper { | |
itemType *beginItem; | |
int count; | |
public: | |
RangeBasedLooper(itemType *initialItem, int size_) : beginItem(initialItem), count(size_){} |
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
#pragma once | |
#include <mutex> | |
#include <map> | |
#include <functional> | |
#include <chrono> | |
template<class keyType, class dataType> | |
class ConcurrentMap { | |
std::map<keyType, dataType> dataMap; |
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
listen_for_process() { | |
__keyword=$1; (while :; do __arg=$(pgrep -d',' -f $__keyword); if [ -z "$__arg" ]; then top -u 65536 -n 1; else top -c -n 1 -p $__arg; fi; sleep 1; done;) | |
} | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="[\[$(tput sgr0)\]\[\033[38;5;10m\]\d\[$(tput sgr0)\]\[\033[38;5;15m\]] [\[$(tput sgr0)\]\[\033[38;5;10m\]\t\[$(tput sgr0)\]\[\033[38;5;15m\]] - [\[$(tput sgr0)\]\[\033[38;5;10m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]] - [\[$(tput bold)\]\u\[$(tput sgr0)\]] \$(parse_git_branch) :\n\\$ \[$(tput sgr0)\]" | |
parse_git_branch() { |
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
import os | |
import re | |
def line_similarity_level(line1, line2): | |
matchlinecnt = 0 | |
for idx in range(len(line1)): | |
idx = idx + 1 | |
char1 = ' ' | |
char2 = ' ' | |
try: |
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
#!/bin/bash | |
sudo apt-get install git cmake build-essential vim python3-dev | |
# amix vim configs | |
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime | |
sh ~/.vim_runtime/install_awesome_vimrc.sh | |
# youCompleteMe | |
cd ~/.vim_runtime/ |
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
# /usr/share/lightdm/lightdm.conf.d/01_debian.conf | |
[Seat:*] | |
greeter-session=lightdm-greeter | |
greeter-hide-users=false | |
autologin-session=true | |
autologin-user=<username> | |
autologin-user-timeout=1 | |
session-wrapper=/etc/X11/Xsession |
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
#include "opencv2/opencv.hpp" | |
#include "opencv2/xfeatures2d.hpp" | |
#include <istream> | |
#include <string> | |
#include <stdint.h> | |
using namespace std; | |
using namespace cv; | |
/* |
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
set number | |
set showcmd | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set showmatch | |
let mapleader="," " leader is comma | |
inoremap jk <esc> | |
colorscheme torte | |
set incsearch " search as characters are entered |
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
#!/bin/bash | |
echo "processing file `pwd`/cscope_create_db.sh" | |
curdir=`pwd` | |
project_dir="asdasdasd" | |
cscope_dir="${project_dir}/cscope" | |
cscope_file="${cscope_dir}/cscope.files" | |
NEW_CSCOPE_DB="asdasdasdcscope/cscope.out" |
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
#!/bin/bash | |
cur_dir=`pwd` | |
project_dir=$1 | |
cscope_dir=${project_dir}/cscope | |
rm -rf ${cscope_dir} | |
mkdir -p ${cscope_dir} | |
find ${project_dir}/ -type f \( \ | |
-name *.c \ |
NewerOlder