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
alias mpp "ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'" |
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
function catt | |
if test (count $argv) -gt 1 | |
for i in $argv | |
echo -e "\\033[0;31m"\<$i\> | |
echo -e ------------------------------------------------- "\\033[0;39m" | |
cat $i | |
echo | |
end | |
else | |
cat $argv |
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
(defun delete-line-or-region-or-buffer () | |
"Delete current line, or text selection. | |
When `universal-argument' is called first, delete whole buffer (respects `narrow-to-region')." | |
(interactive) | |
(if current-prefix-arg | |
(delete-region (point-min) (point-max)) | |
(progn (if (use-region-p) | |
(delete-region (region-beginning) (region-end)) | |
(progn | |
(if (current-line-empty-p) |
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
(bind-keys :map helm-swoop-map | |
("C-x e" . helm-swoop-edit) ;; since builtin C-c C-e is already used | |
;; | |
) |
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
;; (setq comment-style 'extra-line) | |
(add-hook 'c-mode-hook | |
(lambda () | |
(set (make-local-variable 'rebox-style-loop) '(241 243 111)) | |
(rebox-mode 1))) | |
(add-hook 'c++-mode-hook | |
(lambda () | |
(set (make-local-variable 'rebox-style-loop) '(21 23 111)) |
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
in `function d` | |
change(type character/number without pressing Enter) | |
read -l -p 'echo "Goto: "' choice | |
to | |
read -n 1 -l -p 'echo "Goto: "' choice | |
change(echo path without /home/users) | |
if string match -q -r '^\d+$' $choice |
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/bin/perl | |
if (@ARGV < 2) { | |
printf("Convert numbers among bin/oct/dec/hex\n"); | |
printf("\nUsage: b2 2/8/10/16 num num2 ... \n"); | |
exit; | |
} | |
for ($i=1; $i<@ARGV; $i++) { | |
if ($ARGV[0] == 2) { |
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
(defun delete-line-or-region-or-buffer () | |
"Delete current line, or text selection. | |
When `universal-argument' is called first, delete whole buffer (respects `narrow-to-region')." | |
(interactive) | |
(if current-prefix-arg | |
(delete-region (point-min) (point-max)) | |
(progn (if (use-region-p) | |
(delete-region (region-beginning) (region-end)) | |
(progn | |
(if (current-line-empty-p) |
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
(autoload 'multiple-cursors "multiple-cursors" t) | |
(defhydra multiple-cursors-hydra (:hint nil) | |
" | |
^Up^ ^Down^ ^Other^ | |
---------------------------------------------- | |
[_p_] Next [_n_] Next [_l_] Edit lines | |
[_P_] Skip [_N_] Skip [_a_] Mark all | |
[_M-p_] Unmark [_M-n_] Unmark [_r_] Mark by regexp | |
^ ^ ^ ^ [_q_] Quit | |
" |
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
{"newTab":true,"newTabSelected":true,"newTabPosition":"Next","trackGA":true,"searchEverywhere":true,"searchEverywhereGroups":false,"searchEngines":[{"name":"Youtube","url":"http://www.youtube.com/results?search_query=%s&aq=f","incognito":false,"plus":false,"group":null,"$$hashKey":"object:161"},{"name":"Wikipedia","url":"http://en.wikipedia.org/w/index.php?title=Special:Search&search=%s","incognito":false,"plus":false,"group":null},{"name":"Chrome Extensions","url":"https://chrome.google.com/webstore/search?q=%s","incognito":false,"$$hashKey":"object:162"},{"name":"Google Images","url":"http://www.google.com/search?num=10&hl=en&site=imghp&tbm=isch&source=hp&q=%s","incognito":false},{"name":"Wikipedia","url":"http://en.wikipedia.org/w/index.php?title=Special:Search&search=%s","incognito":false},{"name":"Stackoverflow","url":"http://stackoverflow.com/search?q=%s","incognito":false},{"name":"Baidu","url":"https://www.baidu.com/s?wd=%s","incognito":false},{"name":"Github","url":"https://github.com/search?q=%s&ref |