Skip to content

Instantly share code, notes, and snippets.

c02y

Block or report user

Report or block c02y

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@c02y
c02y / gist:3c672c049335097fb751463971139293
Last active Oct 10, 2019
manjaro unable to resize inside virtualbox
View gist:3c672c049335097fb751463971139293
https://unix.stackexchange.com/a/536056/22322
To get Auto-Resize Guest Display working you have to use 'VBoxVGA'
Stop VM if installed and running
Choose in VM Setting: Display > Screen > Graphics Controller > 'VBoxVGA'
Save
Start VM with Manjaro - Screen goes black.
hit CTRL+ALT+F2 to enter tty2
logon
@c02y
c02y / init.el
Last active Apr 29, 2019
change the last line of C-w and C-x w to fix the problem when using for multiple blank lines(it will tab in only one blank line)
View init.el
replace last line of C-w and C-x w to
(when (not (current-line-empty-p)) (indent-for-tab-command)))))
;; use different bullet for a sub-list
(setq org-list-demote-modify-bullet
'(("-" . "+") ("+" . "*") ("*" . "-") ("1." . "+") ("1)" . "+")
("a." . "-") ("a)" . "-") ("A." . "-") ("A)" . "-")))
;; Comment this line out, since it will cause the sub-list indentation problem,
@c02y
c02y / emm
Created Apr 29, 2019
fix the typo in emm -a
View emm
cmd="-e '(execute-kbd-macro (kbd \"C-c a a c\"))'"
@c02y
c02y / config.fish
Created Apr 29, 2019
one zips file to handle zip file
View config.fish
function zips -d 'zip to list(l)/extract(x)/create(c)'
set -l options 'l' 'L' 'c' 'x' 'X'
argparse -n zips $options -- $argv
or return
for a in $argv
if set -q _flag_l # list
unzip -l $a
else if set -q _flag_L # list Chinese characters
zips.py -l $a
@c02y
c02y / .condarc
Last active Apr 26, 2019
~/.condarc
View .condarc
channels:
- https://mirrors.cloud.tencent.com/anaconda/cloud/conda-forge/
- https://mirrors.cloud.tencent.com/anaconda/cloud/menpo/
- https://mirrors.cloud.tencent.com/anaconda/cloud/pytorch/
- https://mirrors.cloud.tencent.com/anaconda/cloud/bioconda/
- https://mirrors.cloud.tencent.com/anaconda/pkgs/main/
- https://mirrors.cloud.tencent.com/anaconda/pkgs/free/
- ripl-org
- lebedov
- conda-forge
@c02y
c02y / vimrc
Last active Apr 24, 2019
new vim plugin
View vimrc
" python-mode
Plugin 'klen/python-mode'
"default is python2
"let g:pymode_python = 'python3'
let g:pymode_options_colorcolumn = 0
Plugin 'wellle/targets.vim'
@c02y
c02y / gif
Last active Apr 26, 2019
gif recorder and converter
View gif
#!/bin/bash
print_usage()
{
cat <<EOF
$(basename $0) -- gif recorder and converter
Usage: $(basename $0) [-h] [-r] [-w] [-c] [time] [file]
-h to print this usage
-r to record a region
@c02y
c02y / config.fish
Last active Apr 26, 2019
clean abbrs/functions in config.fish
View config.fish
# replace tk and tka functions with one single function:
function tk -d 'tmux kill-session all(default)/single(id)/multiple(id1 id2)/except(-e)/list(-l) sessions'
if test (ps -ef | grep -v grep | grep -i tmux | wc -l ) = 0
echo "No tmux server is running!!!"
return
end
set -l options 'e' 'l'
argparse -n tk $options -- $argv
or return
@c02y
c02y / init.el
Last active Apr 26, 2019
org-agenda
View init.el
(setq org-todo-keywords
;; !/@ meaning: https://orgmode.org/manual/Tracking-TODO-state-changes.html
'((sequence "TODO(t!)" "STARTED(s!)" "NEXT(n!)" "WAITING(w!)" "|" "DONE(d!)" "CANCELED(c@)")
;; multiple sets for one file
;; (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)""|" "FIXED(f)")
;; (sequence "|" "CANCELED(c)")
))
# put this before txt README
@c02y
c02y / init.el
Last active Apr 16, 2019
comment out the STDOUT part
View init.el
;; ;; omit the result to STDOUT after return when using emacs/emacsclient -e "expression"
;; (when (not (display-graphic-p))
;; (define-advice server-eval-and-print (:filter-args (args) no-print)
;; (list (car args) nil)))
(setq org-agenda-custom-commands
'(("c" "Simple agenda view"
((tags "PRIORITY=\"A\""
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "High-priority unfinished tasks:")))
You can’t perform that action at this time.