Skip to content

Instantly share code, notes, and snippets.

View redguardtoo's full-sized avatar
⛸️
Focusing

Chen Bin redguardtoo

⛸️
Focusing
View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwmjzGrIlozQ7Uekc+LyfmlMxNcFyA/qXpygydglcax/klFOwrMPoYbOgaooLCv5qUKl7FjfA5poKYcARPqGzlBPM61TGW8tmWTmBb5WkUNi1FpBCd76OQ1fnKP4a4Fnl27CMYgl3UBa0B2vXlfDTHb+TTI+b3EEwHBeVUjWreeN1YEBmnR/i9FR+OGCpMu87jIrJt8OBddwiEvZEVhtvncqyHZ9AsGw2r9X+EDR88GqpkZwHG18gjax01NDQPJcwIKhLCJ3CcB7IVTdghOvG/jMtizmHyDvDelV9H8Oydn6RJ4Z/DStUQPXqgSlJNv55K4OEFw0MuaZFA9ItoRko8w== chenbin.sh@gmail.com
@redguardtoo
redguardtoo / .gitconfig
Last active April 30, 2024 04:50
my git setup
[apply]
whitespace = nowarn
[user]
name = Chen Bin
email = cb@myemail.com
[core]
# @see http://comments.gmane.org/gmane.comp.version-control.git/166098
filemode = true
ignorecase = false
autocrlf = false
@redguardtoo
redguardtoo / .ctags.sample
Last active March 21, 2024 16:55
my ~/.ctags. Please note this is configuration for Exuberant Ctags. If you use Universal Ctags, you need run `ctags --options="$HOME/.ctags" -e -R` in shell at least once and fix all the warnings.
--c++-kinds=+p
--fields=+iaS
--extra=+q
--exclude=*/.hg/*
--exclude=.hg/*
--exclude=*/.cvs/*
--exclude=.cvs/*
--exclude=*/.svn/*
--exclude=.svn/*
--exclude=*/.git/*
@redguardtoo
redguardtoo / MyConfig.pm
Last active August 29, 2015 14:06
my cpan setup (use australia NSW http mirror site)
$CPAN::Config = {
'applypatch' => q[],
'auto_commit' => q[0],
'build_cache' => q[100],
'build_dir' => q[/root/.cpan/build],
'build_dir_reuse' => q[0],
'build_requires_install_policy' => q[yes],
'bzip2' => q[/bin/bzip2],
'cache_metadata' => q[1],
@redguardtoo
redguardtoo / cygwin.bat
Last active September 5, 2022 06:22
cygwin.bat
@echo off
REM shamelessly copied from git://github.com/justsoso8/dotfile.git
REM mintty installed which supports chinese
REM =======================================
@echo off
rem find cygwin roo directory one by one
rem disk c -> disk d -> disk e
:CYGWIN_C
if not exist c:\cygwin64 goto CYGWIN_D
@redguardtoo
redguardtoo / proj2ram
Last active May 17, 2022 18:12
script to copy project to tmpfs
#!/bin/sh
if [ -z "$1" ];then
echo "Usage:"
echo " proj2ram proj-name"
echo " proj2ram restore proj-name"
exit 1
fi
! rxvt-unicode-256color recommended
! @see http://websemantics.co.uk/resources/font_size_conversion_chart/
! 16px media; 18px large; 24px x-large ...
URxvt.font:xft:WenQuanYi Zen Hei Mono:pixelsize=20:antialias=True
URxvt.boldFont:xft:WenQuanYi Zen Hei Mono:pixelsize=20:antialias=True
URxvt.inputMethod: fcitx
URxvt.preeditType: OnTheSpot,None
URxvt*termName: rxvt
@redguardtoo
redguardtoo / install-emacs.sh
Last active June 23, 2022 03:50
Install emacs-nox on Linux
#!/bin/sh
[ -z "$EMACS_VERSION" ] && echo "Usage: EMACS_VERSION=25.1 install-emacs.sh or EMACS_VERSION=snapshot install-emacs.sh" && exit 1
[ -z "$EMACS_URL" ] && EMACS_URL="http://mirror.aarnet.edu.au/pub/gnu/emacs/"
# I've assign 12G memory to /tmp as ramdisk
[ -z "$EMACS_TMP" ] && EMACS_TMP="/tmp"
if [ "$EMACS_VERSION" != "snapshot" ]; then
echo "curl $EMACS_URL/emacs-$EMACS_VERSION.tar.gz"
curl $EMACS_URL/emacs-$EMACS_VERSION.tar.gz | tar xvz -C $EMACS_TMP
fi
@redguardtoo
redguardtoo / .emacs
Last active May 9, 2024 14:09
minimum emacs setup for Emacs plugin testing
;; A minimum .emacs to test Emacs plugins
(show-paren-mode 1)
(eval-when-compile (require 'cl))
;; test elisps download from internet here
(setq test-elisp-dir "~/test-elisp/")
(unless (file-exists-p (expand-file-name test-elisp-dir))
(make-directory (expand-file-name test-elisp-dir)))
(setq load-path
@redguardtoo
redguardtoo / sort-pyim-hanzi-order.el
Created June 14, 2019 12:18
sort chinese characters
(require 'cl-lib)
(defun my-read-file (file)
(with-temp-buffer
(insert-file-contents (file-truename file))
(buffer-string)))
;; (message "content=%s" (my-read-file))
(defun my-format-dictionary ()
(interactive)
(let* ((h (make-hash-table :size 1000))