This file contains hidden or 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
parse_git_branch() { | |
_branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/') | |
_branch="$_branch" | |
echo $_branch | |
} | |
export PS1="\[\033[38;5;42m\]\u@\h\[\033[00m\]:\[\033[38;5;39m\]\W\[\033[38;5;198m\]\$(parse_git_branch)\[\033[00m\]$ " | |
jk() { | |
JUNK_DIR=$HOME/.junk/ | |
JUNK_ARGS="$@" |
This file contains hidden or 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 hlsearch | |
set incsearch | |
set ic | |
set expandtab | |
set shiftwidth=4 | |
set tabstop=4 | |
set laststatus=2 | |
set statusline=%f | |
set autoindent | |
set tags=tags;/ |
This file contains hidden or 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
void dump_structure(void *ptr, unsigned long size) { | |
unsigned long addr; | |
// Top row of the table | |
printf("\nSize of the structure: %lu\n ", size); | |
for(int i = 0; i <= 0xf; i++) { | |
if(i == 8) printf(" "); | |
printf(" %x ", i); | |
} |
This file contains hidden or 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
uint8_t reverse_byte(uint8_t byte) { | |
byte = ((byte & 0x55) << 1) | ((byte & 0xAA) >> 1); | |
byte = ((byte & 0x33) << 2) | ((byte & 0xCC) >> 2); | |
byte = ((byte & 0x0F) << 4) | ((byte & 0xF0) >> 4); | |
return byte; | |
} |