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
| git config --global diff.tool vimdiff | |
| git config --global difftool.prompt false | |
| git config --global alias.vimdiff difftool | |
| # Usage: git vimdiff | |
| # git vimdiff --cached |
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
| pip download -r requirement.txt -d pip-packages |
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
| pip install --no-index --find-links file://`pwd`/pip-pkgs -r requirement.txt |
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
| # references: https://github.com/pyenv/pyenv/issues/333 | |
| # get pyenv | |
| git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
| # configure pyenv | |
| echo 'export PYENV_ROOT="$HOME/.pyenv"' >> $PROFILE | |
| echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> $PROFILE | |
| # install python |
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
| // ref: https://linux.die.net/man/3/wordexp | |
| #include <iostream> | |
| #include <string> | |
| #include <wordexp.h> | |
| using namespace std; | |
| std::string expandPath(const std::string &str) { | |
| wordexp_t p; | |
| char** w; | |
| wordexp(str.c_str(), &p, 0); |
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
| struct tty_ldisc { | |
| int magic; | |
| char *name; | |
| int num; | |
| int flags; /* * The following routines are called from above. */ | |
| int (*open)(struct tty_struct *); | |
| void (*close)(struct tty_struct *); | |
| void (*flush_buffer)(struct tty_struct *tty); | |
| ssize_t (*chars_in_buffer)(struct tty_struct *tty); | |
| ssize_t (*read)(struct tty_struct *tty, struct file *file, unsigned char *buf, |
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
| [global_config] | |
| scroll_tabbar = True | |
| title_font = Lucida Console Semi-Condensed 13 | |
| title_inactive_bg_color = "#000000" | |
| title_inactive_fg_color = "#714c4c" | |
| title_transmit_bg_color = "#000001" | |
| [keybindings] | |
| switch_to_tab_1 = <Alt>1 | |
| switch_to_tab_2 = <Alt>2 | |
| switch_to_tab_3 = <Alt>3 |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int init_global_var = 10; /* Initialized global variable */ | |
| int global_var; /* Uninitialized global variable */ | |
| static int init_static_var = 20; /* Initialized static variable in global scope */ | |
| static int static_var; /* Uninitialized static variable in global scope */ | |
| int main(int argc, char **argv, char **envp) |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int init_global_var = 10; /* Initialized global variable */ | |
| int global_var; /* Uninitialized global variable */ | |
| static int init_static_var = 20; /* Initialized static variable in global scope */ | |
| static int static_var; /* Uninitialized static variable in global scope */ | |
| int main(int argc, char **argv, char **envp) |
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
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <stdio.h> | |
| int main(int argc, char *argv[], char *envp[]) | |
| { | |
| // goal: emulate the behavior of `ls -l | grep prog > output 2> errfile` | |
| int outfd; | |
| int errfd; | |
| int pipefd[2]; |