Skip to content

Instantly share code, notes, and snippets.

@rcmdnk
rcmdnk / a_to_b.mayu
Last active December 14, 2015 21:29
Setting file for [yamy](http://sourceforge.jp/projects/yamy/) Just change `a` to `b`
include "104.mayu"
keymap Global
key a = b
@rcmdnk
rcmdnk / face_mark_PS1.sh
Last active December 15, 2015 03:59
Face mark for command prompt
PS1="\$(\
ret=\$?
rand=\$((RANDOM%36));\
if [ \$ret -eq 0 ];then\
if [ \$rand -lt 3 ];then
printf '\[\e[m\](^_^)\[\e[m\] \$ ';\
elif [ \$rand -lt 5 ];then\
printf '\[\e[m\](^_-)\[\e[m\] \$ ';\
elif [ \$rand -lt 6 ];then\
printf '\[\e[m\](.^.)\[\e[m\] \$ ';\
#!/bin/bash
select command in "Hello World" "calculate 1+1" exit;do
if [ "$command" = "exit" ];then
exit
elif [ "$command" = "Hello World" ];then
echo $command
elif [ "$command" = "calculate 1+1" ];then
echo $((1+1))
fi
done
@rcmdnk
rcmdnk / screen_prompt.sh
Last active December 15, 2015 06:29
Prompt settings for screen
if [[ "$TERM" =~ "screen" ]]; then
# "\\" doesn't work well, use \134 instead
# \ek ~ \e\134 : Screen's window title (`\t` in caption/hardstatus)
# \e]0; ~ \a : Screen's hardstatus, instead of terminal's title bar (`\h` in caption/hardstatus)
# If you want to change terminal's title bar, use
# \eP\e]0; ~ \a\e\134 (\eP ~ \e\134 will send the words out)
PS1="\[\ek\W\e\134\e]0;\w\a\]\$(\
ret=\$?
@rcmdnk
rcmdnk / data-table.css
Last active December 15, 2015 06:39
GitHub like table (for Octopress)
* + table {
border-style:solid;
border-width:1.5px;
border-color:#CCCCCC;
}
* + table th, * + table td {
border-style:solid;
border-width:1.5px;
border-color:#CCCCCC;
# .bash_logout
echo "(-_-)/~ bye!"
# Directory store file
export LASTDIRFILE=$HOME/.lastDir
# Number of store directories
export NLASTDIR=20
function sd { # Save dir {{{
# Set values
local ldf=${LASTDIRFILE:-$HOME/.lastDir}
local nld="${NLASTDIR:-20}"
function cd {
if [ $# = 0 ];then
command cd
elif [ "$1" = "-" ];then
local opwd=$OLDPWD
pushd . >/dev/null
command cd $opwd
elif [ -f "$1" ];then
pushd . >/dev/null
command cd $(dirname "$@")
@rcmdnk
rcmdnk / Rakefile.diff
Last active December 16, 2015 03:49
Rakefile for Octopress
diff --git a/Rakefile b/Rakefile
index 471b227..a092f76 100644
--- a/Rakefile
+++ b/Rakefile
@@ -23,8 +23,8 @@ deploy_dir = "_deploy" # deploy directory (for Github pages deployment)
stash_dir = "_stash" # directory to stash posts for speedy generation
posts_dir = "_posts" # directory for blog files
themes_dir = ".themes" # directory for blog files
-new_post_ext = "markdown" # default new post file extension when using the new_post task
-new_page_ext = "markdown" # default new page file extension when using the new_page task
@rcmdnk
rcmdnk / gcalcli.diff
Last active December 16, 2015 03:59
Change agenda's format of gcalcli (https://github.com/insanum/gcalcli, v3.1) to fix for narrow space
diff --git a/gcalcli b/gcalcli
index f5cc390..c39bc84 100755
--- a/gcalcli
+++ b/gcalcli
@@ -1074,7 +1074,7 @@ class gcalcli:
new_descr += wrapper.fill(line) + "\n"
return new_descr.rstrip()
- indent = 10 * ' '
+ indent = ''