Skip to content

Instantly share code, notes, and snippets.

@dustincys
dustincys / screen.sh
Created February 22, 2014 07:12
my double screens' resolution configuration
xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
xrandr --addmode DVI-0 "1440x900_60.00"
xrandr --output DVI-0 --mode "1440x900_60.00"
xrandr --output DVI-1 --mode "1920x1080"
xrandr --output DVI-0 --right-of DVI-1
sudo apt-get install ruby1.9.1
sudo apt-get install ruby1.9.1-dev
sudo gem install jekyll
sudo apt-get install git
sudo gem install rdiscount
@dustincys
dustincys / qt-style.css
Created March 24, 2014 13:23
qt style for goldendict
MainWindow #searchPane #translateLine, MainWindow #searchPane #wordList
{
background: black;
color: gray;
}
MainWindow #translateLine, ScanPopup #translateLine, MainWindow #wordList, MainWindow #dictsPane #dictsList, MainWindow #historyPane #historyList
{
background: black;
color: gray;
}
@dustincys
dustincys / markup.py
Created May 16, 2015 04:56
rednotebook2
CHARSET_UTF8 = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
CSS = """\
<style type="text/css">
body {
font-family: %(font)s;
background: black;
color: gray;
}
<!-- Don't split last line between pages.
###########################################################################
# General options
# Default termtype. If the rcfile sets $TERM, that overrides this value.
#set -g default-terminal screen-256color
# Ring the bell if any background window rang a bell
set -g bell-action any
# Watch for activity in background windows
@dustincys
dustincys / letsrock.sh
Last active August 29, 2015 14:25
tmux script
#!/bin/sh
tmux -2 new-session -d -s back
tmux new-window -t back:1 -n 'proxy'
tmux send-keys "proxyAll.sh" C-m
tmux new-window -t back:2 -n 'radio'
tmux send-keys "radio.sh" C-m
tmux -2 new-session -d -s work
@dustincys
dustincys / capitalize
Created January 15, 2014 12:19
capitalize the tags in _post of jekyll blog
grep '^tags\s*:' ./ -rl | xargs sed -i -e 's/\(tags\s*:\)\(.*\)/\1\U\2/g'
@dustincys
dustincys / newpost.sh
Last active January 3, 2016 08:19
shell script of creat new jekyll blog file, automatically change the tags to lowercase
#!/bin/bash
vim `date +%Y-%m-%d-$@.md`;
sed -i -e 's/\(tags\s*:\)\(.*\)/\1\L\2/g' `date +%Y-%m-%d-$@.md`;
@dustincys
dustincys / markdown.snippets
Last active January 3, 2016 08:19
jekyll blog snippet of Ultisnip in vim
###########################################################################
# SNIPPETS for MARKDOWN #
###########################################################################
###########################
# Sections and Paragraphs #
###########################
snippet sec "Section" b
# ${1:Section Name} #
$0
@dustincys
dustincys / .vimrc
Last active January 3, 2016 13:39
.vimrc
" Set color of terminal
if has ('gui_running')
else
set term=builtin_xterm
set term=xterm-256color
endif
set t_Co=256
"set path of plugin
set runtimepath+=~/.vim/l9